|
@@ -12,6 +12,8 @@ const useSubmitForm = (getList) => {
|
|
|
const title = ref("");
|
|
|
// 表单的 loading 状态
|
|
|
const formLoading = ref(false);
|
|
|
+ // 提交表单loading
|
|
|
+ const submitLoading = ref(false);
|
|
|
const data = reactive({
|
|
|
// 表单数据
|
|
|
form: {
|
|
@@ -91,7 +93,9 @@ const useSubmitForm = (getList) => {
|
|
|
proxy.$modal.msgSuccess("修改成功");
|
|
|
open.value = false;
|
|
|
getList();
|
|
|
- });
|
|
|
+ }).finally(()=>{
|
|
|
+ submitLoading.value = false;
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
// 添加工具分类
|
|
@@ -104,16 +108,20 @@ const useSubmitForm = (getList) => {
|
|
|
toolAdd(params).then((res) => {
|
|
|
fileUpdate(res.data).then(() => {
|
|
|
proxy.$modal.msgSuccess("新增成功");
|
|
|
+ submitLoading.value = false;
|
|
|
open.value = false;
|
|
|
getList();
|
|
|
});
|
|
|
- });
|
|
|
+ }).finally(()=>{
|
|
|
+ submitLoading.value = false;
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
// 提交按钮
|
|
|
const submitForm = () => {
|
|
|
proxy.$refs["toolTypesRef"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ submitLoading.value = true;
|
|
|
if (form.value.id != undefined) {
|
|
|
updateToolType();
|
|
|
} else {
|
|
@@ -133,6 +141,7 @@ const useSubmitForm = (getList) => {
|
|
|
form,
|
|
|
rules,
|
|
|
formLoading,
|
|
|
+ submitLoading,
|
|
|
handleFormTypeChange,
|
|
|
reset,
|
|
|
submitForm,
|