From 5eeac2be08383953337d3789a8d442c21303bb54 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期一, 28 八月 2023 15:25:05 +0800 Subject: [PATCH] 周六的代码更新对比 合并 2023-8-28 --- src/views/visualization.vue | 56 +++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/views/visualization.vue b/src/views/visualization.vue index 066ebe2..25dbbbf 100644 --- a/src/views/visualization.vue +++ b/src/views/visualization.vue @@ -1,8 +1,8 @@ <template> <div class="home"> - <!-- v-if="Object.keys(taskData).length > 0 && taskData.Procedure.ID" --> - <template > + <!-- --> + <template v-if="Object.keys(taskData).length > 0 && taskData.Procedure.ID"> <div class="left"> <p class="title"> 鐢熶骇绠$悊鐪嬫澘 @@ -419,8 +419,8 @@ </div> </div> </template> - <!-- v-else --> - <template > + <!-- --> + <template v-else> <div class="home-img-box"> <div class="bg-title"> <img src="../../public/bg-title.png" /> @@ -531,6 +531,9 @@ countDownHour:0, countDownMinute:0, Arr:[], + // 璁板綍瀹氭椂鍣ㄧ姸鎬� + procInfoTimer:null, + cutdownTimer: null }; }, mounted() { @@ -658,6 +661,7 @@ }; getTaskInfo().then((res) => { if (res.code == 200) { + this.procedureList=[] this.taskData = res.data ? res.data : { @@ -694,9 +698,11 @@ } }); this.getProgressInfo(); - setInterval(() => { - this.getProgressInfo(); - }, 6000); + if (!this.procInfoTimer) { + this.procInfoTimer = setInterval(() => { + this.getProgressInfo(); + }, 6000); + } } console.log(this.procedureList, "===1111procedureList"); // setTimeout(() => { @@ -707,9 +713,12 @@ } if(res.code!=200||!this.taskData.Procedure.ID){ this.getcountdown(); - setInterval(() => { - this.getcountdown(); - }, 60000); + // 鎺у埗閲嶆柊璇锋眰getTaskInfo, 鍙紑鍚竴涓畾鏃跺櫒 + if (!this.cutdownTimer) { + this.cutdownTimer = setInterval(() => { + this.getcountdown(); + }, 60000); + } } }); }, @@ -728,7 +737,13 @@ if (Object.keys(this.taskData).length > 0 && this.taskData.Procedure.ID) { this.$refs.control.islook = true; } else { - this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�"); + this.$confirm( "褰撳墠璁惧娌℃湁宸ュ簭!", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => {}) + .catch(() => {}); } }, // 鍙充晶瀹屾垚 @@ -742,7 +757,13 @@ } }); } else { - this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�"); + this.$confirm( "褰撳墠璁惧娌℃湁宸ュ簭!", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => {}) + .catch(() => {}); } }, getRandomNumber(min, max) { @@ -831,11 +852,7 @@ font-size: 30px; font-weight: 700; } -.el-button--primary { - border: 0; - font-weight: 700 !important; - font-size: 16px !important; -} + .color_4efefa { color: #4efefa; } @@ -1348,4 +1365,9 @@ } } } +.el-button--primary { + border: 0; + font-weight: 700 !important; + font-size: 16px; +} </style> -- Gitblit v1.8.0