Browse Source

重复提交限制

gangyj 2 năm trước cách đây
mục cha
commit
983d65dede
1 tập tin đã thay đổi với 26 bổ sung15 xóa
  1. 26 15
      src/views/exctab/excelmodel/excelmodel.vue

+ 26 - 15
src/views/exctab/excelmodel/excelmodel.vue

@@ -351,6 +351,7 @@
           type="info"
           style="margin-left: 50px;"
           size="mini"
+          :loading="saveExcelLoad"
           @click="saveExcel()"
         >确定</el-button>
       </div>
@@ -450,6 +451,8 @@ export default {
       exceltypeData: [],//清表类型枚举
       wbsmodel: [],//wbs模板名称枚举
       //#endregion
+
+      saveExcelLoad:false,
     }
   },
   methods: {
@@ -830,22 +833,30 @@ export default {
               }
             })
           }
-          if (this.excelForm.parentId && !this.excelForm.id) {
-            await this.Excelmodify({
-              nodeName: this.excelForm.nodeName,
-              tabType: this.excelForm.tabType,
-              parentId: this.excelForm.parentId,
-              linkDataInfo: linkDataInfo
-            })
-          } else {
-            await this.Excelmodify({
-              nodeName: this.excelForm.nodeName,
-              tabType: this.excelForm.tabType,
-              id: this.excelForm.id,
-              linkDataInfo: linkDataInfo
-            })
+
+          this.saveExcelLoad = true;
+          try {
+            if (this.excelForm.parentId && !this.excelForm.id) {
+              await this.Excelmodify({
+                nodeName: this.excelForm.nodeName,
+                tabType: this.excelForm.tabType,
+                parentId: this.excelForm.parentId,
+                linkDataInfo: linkDataInfo
+              })
+            } else {
+              await this.Excelmodify({
+                nodeName: this.excelForm.nodeName,
+                tabType: this.excelForm.tabType,
+                id: this.excelForm.id,
+                linkDataInfo: linkDataInfo
+              })
+            }
+            this.dialogTap = false
+          } catch (error) {
+            console.log(error)
           }
-          this.dialogTap = false
+
+          this.saveExcelLoad = false;
         }
       });
     },