jinlin
2024-10-09 c73915bda3963a67322e366c1883e9615a25535a
web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -22,7 +22,7 @@
            </el-input>
          </zt-form-item>
          <zt-form-item >
            <zt-button @click="getDiagram()">查看时序图</zt-button>
            <zt-button @click="getDiagram(null)">查看时序图</zt-button>
          </zt-form-item>
        </el-form>
        <div>
@@ -518,37 +518,7 @@
        console.log(res.data)
        this.simulatList = res.data
      },
      async onTreeSelected(data) {
        this.graph.unfreeze()
        if (!this.dataForm.taskModelId) {
          this.$alert("请先选择具体任务")
          return
        }
        if (!this.dataForm.id) {
          this.$alert("请先选择具体仿真记录")
          return
        }
        let params = {
          productId: data.id,
          taskId: this.dataForm.taskModelId,
          fzId: this.dataForm.id
        }
        let res = await this.$http.get('/taskReliability/SimulatAssess/getStatus', {params: params})
        if (res.data !== null) {
          this.diagramJson = JSON.parse(res.data)
          console.log(this.diagramJson, 'this.Diagram json')
          this.graph.fromJSON(this.diagramJson)
          this.graph.positionContent('left')
          //this.graph.zoomToFit()
          this.graph.freeze()
        } else {
          this.graph.fromJSON(this.emptyJson)
          //this.graph.centerContent()
          //this.graph.zoomToFit()
          this.graph.freeze()
        }
        console.log(res.data)
      },
      // 获取信息
      onProductSelected(data) {
        this.isSelect = true
@@ -578,10 +548,13 @@
        this.dataForm.samplPeriod = result.data.samplPeriod
        this.dataForm.simulatFrequency = result.data.simulatFrequency
      },
      async getDiagram() {
      async onTreeSelected(data) {
        this.getDiagram(data.id)
      },
      async getDiagram(productId) {
        this.graph.unfreeze()
        let params = {
          productId: this.dataForm.productId,
          productId: productId ? productId : this.dataForm.productId,
          taskId: this.dataForm.taskModelId,
          fzId: this.dataForm.id,
          smallWidth:1000,
@@ -593,12 +566,12 @@
          console.log(this.diagramJson, 'this.Diagram json')
          this.graph.fromJSON(this.diagramJson)
          this.graph.centerContent()
          this.graph.zoomToFit()
          //this.graph.zoomToFit()
          this.graph.freeze()
        } else {
          this.graph.fromJSON(this.emptyJson)
          this.graph.centerContent()
          this.graph.zoomToFit()
          //this.graph.zoomToFit()
          this.graph.freeze()
        }
        console.log(res.data)
@@ -612,9 +585,11 @@
    border: 1px solid #dfe3e8;
    width: 100% !important;
  }
  #timeDiagram .x6-cell.x6-node {
    cursor: inherit;
  }
  .x6-graph-scroller.x6-graph-scroller-pannable {
    width: 100% !important;
  }