haoxuan
2023-08-28 4436c040d89980c8624f88cd4876c808806c414f
src/views/visualization.vue
@@ -531,6 +531,9 @@
      countDownHour:0,
      countDownMinute:0,
      Arr:[],
        // 记录定时器状态
        procInfoTimer:null,
       cutdownTimer: null
    };
  },
  mounted() {
@@ -695,9 +698,11 @@
              }
            });
            this.getProgressInfo();
            setInterval(() => {
              this.getProgressInfo();
            }, 6000);
            if (!this.procInfoTimer) {
                this.procInfoTimer = setInterval(() => {
                  this.getProgressInfo();
                }, 6000);
            }
          }
          console.log(this.procedureList, "===1111procedureList");
          // setTimeout(() => {
@@ -708,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);
          }
        }
      });
    },
@@ -729,13 +737,8 @@
      if (Object.keys(this.taskData).length > 0 && this.taskData.Procedure.ID) {
        this.$refs.control.islook = true;
      } else {
        this.$confirm( "当前设备没有工序!", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {})
          .catch(() => {});
        this.$message.error("当前设备没有工序!");
      }
    },
    // 右侧完成
@@ -749,13 +752,7 @@
          }
        });
      } else {
        this.$confirm( "当前设备没有工序!", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {})
          .catch(() => {});
        this.$message.error("当前设备没有工序!");
      }
    },
    getRandomNumber(min, max) {