import { ref, verification, requestSearch, requestAdd, requestDelete, requestEdit } from "@/utils/importUsed"; import { useApiInfo } from "../hook"; const { onSearch } = useApiInfo(); export default function setVersion() { // 设置版本号 const setVersionVisible = ref(false); const setVersionColumns = ref({}); function handleSetVersion(row) { setVersionVisible.value = true; // 表格数据赋值 setVersionColumns.value = row; } const closeFn = () => (setVersionVisible.value = false); /// 提交函数 const setVersionFormsubmit = async data => { requestAdd( { module: "kxsConfigServer", method: "apiInfosetVersion", params: data }, () => { closeFn(); onSearch(); } ); }; // 获取表单项数据函数 const setVersionOpenFunction = async () => { //通过表格数据获取参数 for (const key in setVersionFormData.value) { if (Object.prototype.hasOwnProperty.call(setVersionFormData.value, key)) { setVersionFormData.value[key].value = setVersionColumns[key] || ""; } } }; // 表单数据 const setVersionFormData = ref({ version: { label: "版本号", value: "", type: "number", disposition: {}, options: [], rules: [{ required: true, message: "请输入接口名称", trigger: "blur" }] } }); return { setVersionFormData, setVersionFormsubmit, setVersionVisible, handleSetVersion, setVersionOpenFunction }; }