Browse Source

提交做防抖

ye 8 months ago
parent
commit
0c944b5b64
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/views/pages/domainName/addDomainName/index.vue

+ 5 - 3
src/views/pages/domainName/addDomainName/index.vue

@@ -203,6 +203,7 @@
 
 <script>
 import { sortByUp } from "../../../../components/performance/common/js/method";
+import _ from "lodash";
 import {
   findOrganization,
   insertDnmDomainInformationAndCost,
@@ -306,7 +307,7 @@ export default {
         }
       );
     },
-    publishForm() {
+    publishForm: _.debounce(function () {
       if (this.flag == 0) {
         console.log("提交");
         // 保存主表单的逻辑
@@ -329,6 +330,7 @@ export default {
           }
         });
       }
+
       if (this.flag == 1) {
         console.log("修改");
         // 保存主表单的逻辑
@@ -353,9 +355,9 @@ export default {
       } else {
         this.$message.error("系统异常");
       }
-    },
+    }, 500),
     saveForm() {
-      // 保存主表单的逻辑
+      // 保存主表单的逻辑  做防抖
       this.$refs["domainForm"].validate((valid) => {
         if (valid) {
           // 提交主表单和费用信息的数据