This commit is contained in:
孟帅
2024-07-21 22:21:02 +08:00
parent 7d8330f72f
commit a37d088360
440 changed files with 6303 additions and 3339 deletions

View File

@@ -45,6 +45,7 @@
const emit = defineEmits(['reloadTable']);
const message = useMessage();
const settingStore = useProjectSettingStore();
@{ if eq .options.DictOps.Has true }const dict = useDictStore();@{end}
const loading = ref(false);
const showModal = ref(false);
const formValue = ref<State>(newState(null));
@@ -54,6 +55,34 @@
return adaModalWidth(840);
});
// 提交表单
function confirmForm(e) {
e.preventDefault();
formRef.value.validate((errors) => {
if (!errors) {
formBtnLoading.value = true;
Edit(formValue.value)
.then((_res) => {
message.success('操作成功');
closeForm();
emit('reloadTable');
})
.finally(() => {
formBtnLoading.value = false;
});
} else {
message.error('请填写完整信息');
}
});
}
// 关闭表单
function closeForm() {
showModal.value = false;
loading.value = false;
}
// 打开模态框
function openModal(state: State) {
showModal.value = true;
@{ if eq .options.Step.IsTreeTable true }
@@ -86,31 +115,6 @@
});
}
function confirmForm(e) {
e.preventDefault();
formBtnLoading.value = true;
formRef.value.validate((errors) => {
if (!errors) {
Edit(formValue.value).then((_res) => {
message.success('操作成功');
setTimeout(() => {
closeForm();
emit('reloadTable');
});
});
} else {
message.error('请填写完整信息');
}
formBtnLoading.value = false;
loading.value = false;
});
}
function closeForm() {
showModal.value = false;
loading.value = false;
}
defineExpose({
openModal,
});