Sfoglia il codice sorgente

表单同步按钮加载状态

duy 2 anni fa
parent
commit
e1bbc646fa
1 ha cambiato i file con 11 aggiunte e 8 eliminazioni
  1. 11 8
      src/views/manager/projectinfo/tree.vue

+ 11 - 8
src/views/manager/projectinfo/tree.vue

@@ -415,11 +415,12 @@
                       @click="handleEditFormula(scope.$index, scope.row)"
                       >编辑元素公式.</el-link
                     >
-                    <el-link
+                    <el-button
                       class="mg-l-10"
-                      type="primary"
+                      type="text"
+                      :loading="handlesyncLoad"
                       @click="handlesync(scope.$index, scope.row)"
-                      >表单同步</el-link>
+                      >表单同步</el-button>
                     <el-link
                       class="mg-l-10"
                       type="danger"
@@ -2033,6 +2034,9 @@ export default {
         selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
           if (res.data.data.length) {
             this.formData = res.data.data;
+            this.formData.forEach((ele)=>{
+              ele.handlesyncLoad=false
+            })
           } else {
             this.formData = [];
           }
@@ -2202,14 +2206,13 @@ export default {
     },
     //表单同步
     handlesync(index, row){
-      console.log(row,'表单同步');
-      this.handlesyncLoad=true;
-    
-      syncCurrentFormInProject({pkeyId:row.pkeyId}).then((res)=>{
-         this.handlesyncLoad=false;
+        this.handlesyncLoad=true
+      syncCurrentFormInProject({pKeyId:row.pkeyId}).then((res)=>{
          if(res.data.code==200){
             this.$message.success('操作成功');
          }
+      }).finally(()=>{
+        this.handlesyncLoad=false
       })
     },
     //搜索 筛选