jinlin
2024-10-09 c73915bda3963a67322e366c1883e9615a25535a
修改
2个文件已修改
53 ■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/TimeDiagram.vue 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java
@@ -385,12 +385,12 @@
        for (int i = 0; i < smallStatusDtoList.size(); i++) {
            for (TimeDiagramStatusDto status : smallStatusDtoList.get(i)) {
                JSONObject lineJson = new JSONObject(templetsStrMap2.get(status.getStatus()));
                setlineXy(lineJson, status.getX1(), y, status.getX2(), y, "");
                setlineXy(lineJson, status.getX1(), y, status.getX2()+5, y, "");
                JsonUtils2.setJsonValueByPath(lineJson, "data/status".split("/"), status.getStatus());
                JsonUtils2.setJsonValueByPath(lineJson, "id".split("/"), UUIDUtil.generateId().toString());
                jsonArray2.add(lineJson);
            }
            y = y + 20;
            y = y + 10;
        }
        //图例
@@ -402,7 +402,7 @@
            JSONObject f = templetsMap.get(s);
            x1 = x1 + spaceWitdth;
            x2 = x2 + spaceWitdth;
            setlineXy(f, x1, y, x2, y, null);
            setlineXy(f, x1, y+10, x2, y+10, null);
            jsonArray2.add(f);
        }
        timeDiagramDto.setDiagramJson(jsonObject.toString());
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;
  }