|
@@ -2539,19 +2539,20 @@
|
|
|
|
|
|
<div class="progress-text">
|
|
|
<div class="progress-text-btn">
|
|
|
- <div>同步进度</div>
|
|
|
+ <div style="font-weight: bold;">同步进度</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
- <el-button type="text" icon="el-icon-refresh" style="color:orange"></el-button>
|
|
|
- <el-button type="text" icon="el-icon-delete" style="color:red"></el-button>
|
|
|
+ <el-button type="text" icon="el-icon-refresh" style="color:orange" @click="refreshSyncList(item.id)" :loading="refreshListLoad"></el-button>
|
|
|
+ <el-button type="text" icon="el-icon-delete" style="color:red" @click="delSyncItem(item.id)" :loading="delSyncLoad"></el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div>
|
|
|
+ <div style="padding-right: 10px;padding-left: 10px;">
|
|
|
<el-progress
|
|
|
+ text-inside
|
|
|
class="custom-progress"
|
|
|
:percentage="item.progress"
|
|
|
text-color="#2550A2"
|
|
@@ -2791,7 +2792,9 @@ import {
|
|
|
updateBatchElements,
|
|
|
getTemplate,
|
|
|
importWbsElement,
|
|
|
- querySyncRecord
|
|
|
+ querySyncRecord,
|
|
|
+ reFlush,
|
|
|
+ deleteRecord
|
|
|
} from "@/api/manager/wbsformelement";
|
|
|
import {
|
|
|
|
|
@@ -3248,8 +3251,10 @@ export default {
|
|
|
|
|
|
},
|
|
|
tableListByType:[],
|
|
|
- tableListByTypeLoad:false
|
|
|
-
|
|
|
+ tableListByTypeLoad:false,
|
|
|
+ refreshListLoad:false,
|
|
|
+ delSyncLoad:false,
|
|
|
+ syncListTimer: null // 用于存储定时器ID
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -6263,6 +6268,10 @@ async saveLinkTab() {
|
|
|
|
|
|
|
|
|
this.syncListDialog=true
|
|
|
+ // 启动定时器,每5秒请求一次
|
|
|
+ this.syncListTimer = setInterval(() => {
|
|
|
+ this.getSyncListDataNew();
|
|
|
+ }, 5000);
|
|
|
this.getSyncListDataNew ()
|
|
|
this.closeProSyncTag()
|
|
|
|
|
@@ -6280,6 +6289,11 @@ async saveLinkTab() {
|
|
|
},
|
|
|
closeSyncListTag(){
|
|
|
this.syncListDialog=false;
|
|
|
+ // 清除定时器,停止请求
|
|
|
+ if (this.syncListTimer) {
|
|
|
+ clearInterval(this.syncListTimer);
|
|
|
+ this.syncListTimer = null;
|
|
|
+ }
|
|
|
this.updateNodeTable()
|
|
|
},
|
|
|
handleCheckAllChange(val) {
|
|
@@ -6509,15 +6523,28 @@ async saveLinkTab() {
|
|
|
|
|
|
|
|
|
this.syncListDialog=true
|
|
|
+ this.syncListTimer = setInterval(() => {
|
|
|
+ this.getSyncListDataNew();
|
|
|
+ }, 5000);
|
|
|
this.getSyncListDataNew ()
|
|
|
}else{
|
|
|
|
|
|
|
|
|
this.syncListDialog=false
|
|
|
+ // 清除定时器,停止请求
|
|
|
+ if (this.syncListTimer) {
|
|
|
+ clearInterval(this.syncListTimer);
|
|
|
+ this.syncListTimer = null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
this.syncListDialog=false
|
|
|
+ // 清除定时器,停止请求
|
|
|
+ if (this.syncListTimer) {
|
|
|
+ clearInterval(this.syncListTimer);
|
|
|
+ this.syncListTimer = null;
|
|
|
+ }
|
|
|
|
|
|
this.$message.error(res.data.msg)
|
|
|
}
|
|
@@ -6560,6 +6587,9 @@ async saveLinkTab() {
|
|
|
SyncbtnProGress(){
|
|
|
this.syncListDialog=true
|
|
|
this.getSyncListDataNew()
|
|
|
+ this.syncListTimer = setInterval(() => {
|
|
|
+ this.getSyncListDataNew();
|
|
|
+ }, 5000);
|
|
|
|
|
|
},
|
|
|
getSyncListDataNew(){
|
|
@@ -6578,6 +6608,46 @@ async saveLinkTab() {
|
|
|
this.syncListDataNew=[]
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ //刷新
|
|
|
+ refreshSyncList(id){
|
|
|
+ this.refreshListLoad=true
|
|
|
+ reFlush({ id}).then((res) => {
|
|
|
+
|
|
|
+ if(res.data.code==200){
|
|
|
+ this.$message.success(res.data.msg)
|
|
|
+ this.getSyncListDataNew()
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ this.refreshListLoad=false
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ delSyncItem(id){
|
|
|
+ this.delSyncLoad=true
|
|
|
+
|
|
|
+ this.$confirm("是否删除该条数据" , {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: "删除",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ }).then(() => {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ deleteRecord({ id}).then((res) => {
|
|
|
+
|
|
|
+ if(res.data.code==200){
|
|
|
+ this.$message.success(res.data.msg)
|
|
|
+ this.getSyncListDataNew()
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ this.delSyncLoad=false
|
|
|
+ })
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
watch: {
|