diff --git a/src/views/pages/autoexec/detail/job-detail.vue b/src/views/pages/autoexec/detail/job-detail.vue index 81219a922934654c2b03a9768b3ba5829c84f541..468ebc189b63ec8d5bf358e4cc23a433d0413d3f 100644 --- a/src/views/pages/autoexec/detail/job-detail.vue +++ b/src/views/pages/autoexec/detail/job-detail.vue @@ -272,7 +272,8 @@ export default { }, versionId: null, hasOperationVersionAndProductManagerAuth: false, - jobNameWidth: 0 + jobNameWidth: 0, + refreshTimes: 3 //作业完成后刷新次数 }; }, beforeCreate() {}, @@ -455,11 +456,11 @@ export default { } }); if (phaseIdList.length > 0) { - //refreshPhaseList存在定时器 - // this.timmer = setTimeout(() => { - this.refreshPhaseList(phaseIdList); - // }, 5000); + this.refreshTimes = 3; } + this.timmer = setTimeout(() => { + this.refreshPhaseList(phaseIdList); + }, 5000); } }) .finally(() => { @@ -474,7 +475,7 @@ export default { }, refreshPhaseList(phaseIdList) { this.clearTimmer(); - if (phaseIdList && phaseIdList.length > 0) { + if (!this.$utils.isEmpty(phaseIdList) || this.refreshTimes > 0) { this.$api.autoexec.job.getPhaseList({ jobId: this.jobParam.jobId, phaseIdList: phaseIdList }).then(res => { if (res.Return['phaseList'] && res.Return['phaseList'].length > 0) { res.Return['phaseList'].forEach(phase => { @@ -496,7 +497,10 @@ export default { if (this.jobData && this.jobData.extraInfo) { this.$set(this.jobData, 'extraInfo', res.Return['extraInfo']); } - if (phaseIdList.length > 0) { + if (this.$utils.isEmpty(phaseIdList)) { + this.refreshTimes--; + } + if (phaseIdList.length > 0 || this.refreshTimes > 0) { this.timmer = setTimeout(() => { this.refreshPhaseList(phaseIdList); }, 5000); diff --git a/src/views/pages/autoexec/detail/jobDetail/phase/node-list.vue b/src/views/pages/autoexec/detail/jobDetail/phase/node-list.vue index e7cb1b4da1e9682294c95768c3ff21ab820c51e7..415087ba8402837469f3cf4514202adeec7a1265 100644 --- a/src/views/pages/autoexec/detail/jobDetail/phase/node-list.vue +++ b/src/views/pages/autoexec/detail/jobDetail/phase/node-list.vue @@ -353,7 +353,8 @@ export default { fn: _this.resetNode } }, - nodeTitle: null + nodeTitle: null, + refreshTimes: 3 //完成后刷新次数 }; }, beforeCreate() {}, @@ -505,7 +506,7 @@ export default { clearTimeout(this.timmer); this.timmer = null; } - if (nodeIdList && nodeIdList.length > 0) { + if (!this.$utils.isEmpty(nodeIdList) || this.refreshTimes > 0) { this.$api.autoexec.job .searchPhaseNode({ nodeIdList: nodeIdList, @@ -529,7 +530,10 @@ export default { node['isDisabled'] = true; } }); - if (nodeIdList.length > 0) { + if (this.$utils.isEmpty(nodeIdList)) { + this.refreshTimes--; + } + if (nodeIdList.length > 0 || this.refreshTimes > 0) { this.timmer = setTimeout(() => { this.refreshNode(nodeIdList); }, 3000); @@ -563,10 +567,11 @@ export default { }); } if (nodeIdList.length > 0) { - this.timmer = setTimeout(() => { - this.refreshNode(nodeIdList); - }, 3000); + this.refreshTimes = 3; } + this.timmer = setTimeout(() => { + this.refreshNode(nodeIdList); + }, 3000); } if (this.nodeData && this.nodeData.tbodyList && this.nodeData.tbodyList.length > 0) { // 节点被删除,复选框禁用