Kaynağa Gözat

同步查询

duy 1 gün önce
ebeveyn
işleme
6275fb2fbe

+ 8 - 0
src/api/manager/wbsformelement.js

@@ -80,3 +80,11 @@ export const importWbsElement = (formData) => {
     data: formData
   })
 }
+//同步查询功能
+export const querySyncRecord = (data) => {
+  return request({
+    url: '/api/blade-manager/synchronousRecord/querySyncRecord',
+    method: 'get',
+    params:data
+  })
+}

+ 83 - 48
src/views/manager/projectinfo/tree.vue

@@ -2502,44 +2502,53 @@
       <el-dialog
           title="同步队列"
           :visible.sync="syncListDialog"
-          width="30%"
+          width="50%"
           append-to-body
           :close-on-click-modal="false"
           @close="closeSyncListTag"
           custom-class="sync-queue-dialog"
         >
           <!-- 有同步任务时显示 -->
-          <div v-if="syncListData && syncListData.length > 0" class="sync-list">
+          <div v-if="syncListDataNew && syncListDataNew.length > 0" class="sync-list">
             <div 
-              v-for="(item, index) in syncListData" 
+              v-for="(item, index) in syncListDataNew" 
               :key="index" 
               class="sync-item"
             >
               <!-- 同步方信息和状态 -->
               <div class="sync-header">
-                <span class="sync-party">{{ item.party }}</span>
-                <span class="sync-status">{{ item.status }}</span>
+                <span class="sync-party">{{ item.nodeName }}</span>
+                <span class="sync-status">{{ item.rangeName }}</span>
               </div>
               
               <!-- 进度条 -->
               <div class="progress-container">
-                <el-progress 
-                  :percentage="item.progress" 
-                  stroke-width="6"
-                  stroke-linecap="round"
-                ></el-progress>
-                <span class="progress-text">{{ item.progress }}%</span>
+      
+                <div class="progress-text">
+                  <div>同步进度</div>
+                  <div class="progress-num">100%</div>
+                </div>
+                  <div>
+                    <el-progress 
+                    :percentage="70"
+                    :show-text="false"
+                    color="#2550A2"
+                    stroke-width="20"
+                    stroke-linecap="round"
+                  ></el-progress>
+                  </div>
+     
               </div>
               
               <!-- 统计数据 -->
               <div class="sync-stats">
                 <div class="stat-item">
                   <span class="stat-label">已同步</span>
-                  <span class="stat-value synced">{{ item.synced }}</span>
+                  <span class="stat-value synced">{{ item.nodeNumEnd }}</span>
                 </div>
                 <div class="stat-item">
                   <span class="stat-label">剩余</span>
-                  <span class="stat-value remaining">{{ item.remaining }}</span>
+                  <span class="stat-value remaining">{{ item.nodeNumEnd }}</span>
                 </div>
               </div>
             </div>
@@ -2557,8 +2566,10 @@
           <div slot="footer" class="dialog-footer">
             <el-button 
               type="primary" 
-              @click="syncListDialog = false"
+            @click="closeSyncListTag"
               class="confirm-btn"
+              round
+
             >
               好的,我已知晓
             </el-button>
@@ -2757,6 +2768,7 @@ import {
   updateBatchElements,
   getTemplate,
   importWbsElement,
+  querySyncRecord
 } from "@/api/manager/wbsformelement";
 import {
  
@@ -3194,6 +3206,7 @@ export default {
         nodeNum:'',//同步节点数量
         nodeNumEnd:''//已同步数量
       },
+      syncListDataNew:[],
       isAdd:'',
       refreshLoading1:false,
       codeDialog:false,
@@ -3586,10 +3599,11 @@ export default {
     updateNodeTable() {
 
       if(this.isNodeType){
-        this.tableListByTypeLoad=true
-        if(!this.curTreeData){
+           if(!this.curTreeData.id){
           return
         }
+        this.tableListByTypeLoad=true
+     
           getGroupNodeTables( 
            
             {
@@ -6226,6 +6240,7 @@ async saveLinkTab() {
 
 
         this.syncListDialog=true
+        this.getSyncListDataNew ()
         this.closeProSyncTag()
        
          
@@ -6469,24 +6484,18 @@ async saveLinkTab() {
         if(res.data.code==200){
                     if(res.data.data){
                     
-                      this.syncListData.nodeNum=res.data.data.nodeNum
-                      this.syncListData.nodeNumEnd=res.data.data.nodeNumEnd
+                  
                       this.syncListDialog=true
+                              this.getSyncListDataNew ()
                     }else{
                      
-                      this.syncListData={
-                        nodeNum:'',//同步节点数量
-                        nodeNumEnd:''//已同步数量
-                      }
+               
                       this.syncListDialog=false
                     }
                     
                     }else{
                       this.syncListDialog=false
-                      this.syncListData={
-                        nodeNum:'',//同步节点数量
-                        nodeNumEnd:''//已同步数量
-                      }
+                    
                       this.$message.error(res.data.msg)
                     }
         });
@@ -6527,8 +6536,26 @@ async saveLinkTab() {
     //同步进度按钮
    SyncbtnProGress(){
     this.syncListDialog=true
+    this.getSyncListDataNew()
 
    },
+   getSyncListDataNew(){
+        querySyncRecord({ projectId:this.projectid}).then((res) => {
+
+        if(res.data.code==200){
+                    if(res.data.data){
+                    
+                    this.syncListDataNew=res.data.data
+                    }else{
+                     
+                      this.syncListDataNew=[]
+                    }
+                    
+                    }else{
+                      this.syncListDataNew=[]
+                    }
+        });
+   }
   },
   watch: {
     "GLExcelFrom.search"(val) {
@@ -6877,6 +6904,8 @@ async saveLinkTab() {
 }
 
 .sync-list {
+  max-height:600px;
+  overflow-y: auto;
   .sync-item {
     padding: 15px 0;
     border-bottom: 1px dashed #eee;
@@ -6889,8 +6918,15 @@ async saveLinkTab() {
   .sync-header {
     display: flex;
     justify-content: space-between;
+    align-items: center;
     margin-bottom: 10px;
     font-size: 14px;
+    background-color: #F2F2F2;
+
+    height: 30px;
+    overflow-y: auto;
+    padding: 10px 10px;
+    border-radius: 10px;
     
     .sync-party {
       color: #333;
@@ -6908,11 +6944,14 @@ async saveLinkTab() {
     margin-bottom: 12px;
     
     .progress-text {
-      position: absolute;
-      right: 0;
-      top: -5px;
-      font-size: 12px;
-      color: #666;
+      display: flex;
+      justify-content: space-between;
+      padding: 5px;
+      .progress-num{
+        color:#2550A2;
+        font-weight: bold;
+      }
+
     }
   }
   
@@ -6924,25 +6963,32 @@ async saveLinkTab() {
     .stat-item {
       display: flex;
       flex-direction: column;
-      align-items: center;
+      /* text-align: left; */
+      /* align-items: center;
+      justify-content: flex-end; */
+    
       width: 45%;
-      padding: 8px 0;
+      padding: 10px 15px;
+
       border-radius: 4px;
       background-color: #f5f7fa;
       
       .stat-label {
         font-size: 12px;
         color: #999;
-        margin-bottom: 5px;
+     
+        
       }
       
       .stat-value {
-        font-size: 16px;
-        font-weight: 500;
+        font-size: 20px;
+        font-weight: 800;
       }
       
       .synced {
         color: #42b983; /* Element UI success color */
+        
+
       }
       
       .remaining {
@@ -6957,18 +7003,7 @@ async saveLinkTab() {
   flex-direction: column;
   align-items: center;
   justify-content: center;
-  padding: 30px 0;
-  
-  .no-data-icon {
-    font-size: 48px;
-    color: #c0c4cc;
-    margin-bottom: 15px;
-  }
-  
-  .no-data-text {
-    font-size: 14px;
-    color: #666;
-  }
+
 }
 
 .dialog-footer {