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