From bfe24379bb53ba77daa5dabab8198ade504d5a3f Mon Sep 17 00:00:00 2001 From: Feynman Date: Wed, 10 Jan 2024 19:11:35 +0800 Subject: [PATCH] refactor: prevents the button from being located when the task leads to the monitor --- apps/dfs/src/mixins/tour.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/dfs/src/mixins/tour.js b/apps/dfs/src/mixins/tour.js index 4927b66e26..d1b791aabd 100644 --- a/apps/dfs/src/mixins/tour.js +++ b/apps/dfs/src/mixins/tour.js @@ -598,13 +598,15 @@ export default { if (!this.$store.state.replicationConnectionDialog) { this.$nextTick(() => { // 判断任务的监控按钮是否渲染 - if (this.replicationTour.activeIndex === 3 && !document.getElementById(taskMonitorId)) { + let index = this.replicationTour.activeIndex + if (this.replicationTour.behavior === 'add-task') index = 3 + if (index === 3 && !document.querySelector(taskMonitorId)) { // 如果没有渲染,监听任务列表的加载时间 const unwatch = this.$watch('$store.state.taskLoadedTime', () => { this.$nextTick(() => { - if (document.getElementById(taskMonitorId)) { + if (document.querySelector(taskMonitorId)) { unwatch() - this.replicationDriverObj.drive(this.replicationTour.activeIndex || 0) + this.replicationDriverObj.drive(index) } }) })