songshankun
2023-10-08 c71cbfb359c5b50db75d98435c6641620fbdd313
src/views/visualization.vue
@@ -787,7 +787,11 @@
      this.getDate3();
      this.getDate2();
    }, 5000);
    this.getTaskInfo();
    let channelType = this.getChannelTypeFromUrl()
    channelType = channelType ?? 1
    this.activeName = channelType
    this.getTaskInfo(channelType);
    this.getTaskCountStatistics()
  },
  beforeDestroy() {
@@ -803,7 +807,6 @@
    // }
  },
  methods: {
    getModelList(){
      this.resResult=null
      for (let i in this.TasksCopy){
@@ -822,10 +825,10 @@
                    this.isUpdateIcon=true;
                    break;
                  }
                }
                }
              }
            }
            this.resResult=res;
            this.resResult=res;
          })
        }
      }
@@ -839,7 +842,6 @@
        }
      }
      this.$message.error('当前工序无编号,无法查看工序!')
    },
    getProcessModelList(){
      this.getModelList()
@@ -873,6 +875,7 @@
    },
    cutClick(val) {
      this.activeName = val;
      this.updateChannelTypeToUrl(val)
      if(this.activeName==2){
        this.Tasks=this.TasksCopy.slice(0,2)
        if(this.Tasks.length<2){
@@ -915,9 +918,6 @@
        }
      });
    },
    getDateObj(date, fmt) {
      if (/(y+)/.test(fmt)) {
        fmt = fmt.replace(
@@ -1161,6 +1161,27 @@
        }
      })
    },
    /**
     * 向URL中设置当前通道展示类型
     * @param {number} type 通道展示类型
     */
    updateChannelTypeToUrl(type){
      const activeName = this.getChannelTypeFromUrl();
      if (activeName === type){
        return
      }
      let path = this.$router.history.current.path
      this.$router.push({path, query: {activeName:  `${type ?? 1}`}})
    },
    /**
     * 从URL获取当前通道展示类型
     * @return {number}
     */
    getChannelTypeFromUrl(){
      let activeName = new URLSearchParams(location.search).get('activeName')
      activeName = activeName ? +activeName : undefined
      return activeName
    },
    getProgressInfo() {
      this.resprocInfoTimer=null
      for (let i in this.TasksCopy){