ソースを参照

刷新按钮修改

duy 2 ヶ月 前
コミット
c4175e5f54
1 ファイル変更71 行追加14 行削除
  1. 71 14
      src/views/manager/projectinfo/tree.vue

+ 71 - 14
src/views/manager/projectinfo/tree.vue

@@ -1919,6 +1919,7 @@
           <el-scrollbar style="height: 100%;">
                 <div v-loading="treeLoad">
                   <el-tree
+                
                     class="filter-tree"
                     lazy
                     :load="loadNode"
@@ -2034,7 +2035,8 @@
       <el-button type="primary" @click="syncListDialog=false">好的,我已知晓</el-button>
       </div>
       <div  class="mt-14">
-      <el-link type="primary" @click="refreshData" v-loading="refreshLoading">刷新数据</el-link>
+      <el-link type="primary" @click="refreshData" v-loading="refreshLoading" v-if="!isAdd">刷新数据</el-link>
+      <el-link type="primary" @click="refreshData1" v-loading="refreshLoading1" v-else>刷新数据</el-link>
      </div>
     </div>
       
@@ -2556,7 +2558,9 @@ export default {
       syncListData:{
         nodeNum:'',//同步节点数量
         nodeNumEnd:''//已同步数量
-      }
+      },
+      isAdd:'',
+      refreshLoading1:false,
       
     };
   },
@@ -4205,6 +4209,7 @@ export default {
     },
 
   async  syncNodeTableHandle(data) {
+    this.isAdd=''
      console.log('后管数据同步',data);
      this.curTreeData=data
      this.isShowLeft=false
@@ -4217,7 +4222,12 @@ export default {
    
       
      this.proSyncTag=true
-    
+     if(this.$refs.syncProTree){
+        this.$refs.syncProTree.setCheckedKeys([])
+       }
+        if(this.$refs.proTable){
+          this.$refs.proTable.clearSelection()
+        }
      this.isShowTable=true
      this.getTypeOptions()
     this.getRangeOptions()
@@ -4822,11 +4832,17 @@ export default {
     },
    async proSyncbtn(){
       console.log('项目数据同步');
-    
+    this.isAdd=''
       this.getTypeOptions()
       this.getRangeOptions()
       this.getCheckIdList()
       this.proSyncTag=true
+      if(this.$refs.syncProTree){
+        this.$refs.syncProTree.setCheckedKeys([])
+       }
+        if(this.$refs.proTable){
+          this.$refs.proTable.clearSelection()
+        }
       this.isShowLeft=true
       this.isShowTable=false
     },
@@ -4925,6 +4941,7 @@ export default {
      },
      
     closeProSyncTag(){
+      this.proSyncTag=false
       this.syncForm={
         range:'',
         rangeName:'',
@@ -4937,14 +4954,10 @@ export default {
         nodeId:'',
         formIds:''};
       
-       if(this.$refs.syncProTree){
-        this.$refs.syncProTree.setCheckedKeys([])
-       }
-        if(this.$refs.proTable){
-          this.$refs.proTable.clearSelection()
-        }
+     
         this.preTableData=[]
-        this.proSyncTag=false
+        this.isShowLeft=false
+      
      
     },
    async saveProTag(){
@@ -4972,6 +4985,12 @@ export default {
           
         }
       }
+      console.log(this.syncForm.range,'this.syncForm.range=');
+      
+      if(this.syncForm.range===''){
+        this.$message.warning('请选择同步范围')
+        return
+      }
       this.saveProTagLoading=true
 
       addSync({
@@ -4991,7 +5010,13 @@ export default {
        
         this.syncListData.nodeNum=res.data.data.nodeNum
         this.syncListData.nodeNumEnd=res.data.nodeNumEnd
-       
+          if(this.isShowLeft){
+            this.isAdd=res.data.data.nodeId
+          }else{
+            this.isAdd=''
+          }
+console.log( this.isAdd,' this.isAdd');
+
         this.syncListDialog=true
         this.closeProSyncTag()
        
@@ -5084,7 +5109,7 @@ export default {
                     this.$message.success(res.data.msg)
                     this.syncTableDialog=false
                     this.$refs.proTable1.clearSelection()
-                    
+                   
                     }else{
                       this.$message.error(res.data.msg)
                     }
@@ -5122,6 +5147,37 @@ export default {
      this.syncListDialog=true
      this.refreshLoading=false
       
+    },
+    refreshData1(){
+      console.log('shuax');
+      this.refreshLoading1=true
+      getNodeStatus({ id:this.isAdd}).then((res) => {
+        this.refreshLoading1=false
+      if(res.data.code==200){
+                  if(res.data.data){
+                  
+                    this.syncListData.nodeNum=res.data.data.nodeNum
+                    this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
+                  
+                  }else{
+                  
+                    this.syncListData={
+                      nodeNum:'',//同步节点数量
+                      nodeNumEnd:''//已同步数量
+                    }
+                    
+                  }
+                  
+                  }else{
+                   
+                    this.syncListData={
+                      nodeNum:'',//同步节点数量
+                      nodeNumEnd:''//已同步数量
+                    }
+                    this.$message.error(res.data.msg)
+                  }
+      });
+      
     },
     getNodeStatusData(){
      
@@ -5129,7 +5185,8 @@ export default {
       if(this.isShowLeft){
         ids=this.$refs.syncProTree.getCheckedKeys()
         ids=ids.join(',')
-      }else{
+      }
+      else{
         ids=this.curTreeData.primaryKeyId
       }