| | |
| | | if (res.data !== null && res.data.content != null) { |
| | | this.dataForm = res.data |
| | | this.diagramJson = JSON.parse(this.dataForm.content) |
| | | // console.log(this.dataForm.content,'this.Diagram content') |
| | | console.log(this.diagramJson, 'this.Diagram json') |
| | | this.graph.fromJSON(this.diagramJson) |
| | | // this.graph.centerContent() |
| | | // this.graph.zoomToFit() |
| | | } else { |
| | | this.dataForm.id = null |
| | | // await this.$alert('该项目还未编制网络图', '提示', { |
| | | // confirmButtonText: '确定' |
| | | // }) |
| | | this.graph.fromJSON(this.emptyJson) |
| | | // this.graph.centerContent() |
| | | // this.graph.zoomToFit() |
| | | // this.graph.freeze() |
| | | } |
| | | }, |
| | | init() { |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // translating: { |
| | | // restrict(view) { |
| | | // const cell = view.cell |
| | | // if (cell.isNode()) { |
| | | // const parent = cell.getParent() |
| | | // if (parent) { |
| | | // return parent.getBBox() |
| | | // } |
| | | // } |
| | | // |
| | | // return null |
| | | // }, |
| | | // }, |
| | | onToolItemCreated({tool}) { |
| | | const handle = tool |
| | | const options = handle.options |
| | |
| | | text: '' |
| | | } |
| | | }, |
| | | // position: { |
| | | // distance: 0.5, |
| | | // angle: 180, |
| | | // options: { |
| | | // keepGradient: true, |
| | | // ensureLegibility: true |
| | | // } |
| | | // } |
| | | }], |
| | | zIndex: 0, |
| | | }) |