| | |
| | | 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; |
| | | } |
| | | |
| | | //图例 |
| | |
| | | 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()); |
| | |
| | | </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> |
| | |
| | | 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 |
| | |
| | | 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, |
| | |
| | | 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) |
| | |
| | | border: 1px solid #dfe3e8; |
| | | width: 100% !important; |
| | | } |
| | | |
| | | #timeDiagram .x6-cell.x6-node { |
| | | cursor: inherit; |
| | | } |
| | | |
| | | .x6-graph-scroller.x6-graph-scroller-pannable { |
| | | width: 100% !important; |
| | | } |