xyc
2025-02-21 664db98c9e8595ce4dd636a27f480e3a08b81ff5
web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -143,14 +143,14 @@
    },
    created() {
      let scrollView = this.$refs['scrollView']
      window.addEventListener('scroll', this.handleScroll,true);
      window.addEventListener('scroll', this.handleScroll,{passive:false});
    },
    destroyed() {
      let scrollView = this.$refs['scrollView']
      window.removeEventListener('scroll', this.handleScroll,true);
      window.removeEventListener('scroll', this.handleScroll);
    },
    mounted() {
      this.getProductList()
      this.getProductList(Cookies.get('productId'))
      this.init()
      this.$refs.textDiagram.init()
      this.$refs.timeDiagramThumbnail.init()
@@ -169,6 +169,20 @@
        let top = this.graph.getScrollbarPosition().top
        this.$refs.textDiagram.setScroll(top)
        this.$refs.timeDiagramThumbnail.getNodePointX(left,this.bigWidth)
      },
      getPath(){
        if (Cookies.get('productId') != null){
          this.dataForm.id = Cookies.get('fzId')
          this.dataForm.productId = Cookies.get('productId')
          this.dataForm.taskModelId = Cookies.get('taskModelId')
          console.log(this.dataForm.id)
          this.getTaskList()
          this.$nextTick(() => {
            this.onProductSelected({id:this.dataForm.productId})
            this.onTaskSelected({id:Cookies.get('taskModelId')})
            this.onSimulatSelected({id:Cookies.get('fzId')})
          })
        }
      },
      init() {
        this.graph = new Graph({
@@ -363,10 +377,14 @@
          style.display = 'none'
        })
      },
      async getProductList() {
      async getProductList(productId) {
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        this.onProductSelected(this.productList[0])
        if(productId!=null){
          this.getPath()
        }else{
          this.onProductSelected(this.productList[0])
        }
      },
      async getTaskList() {
        let params = {