| | |
| | | }, |
| | | async saveDiagram() { |
| | | console.log(JSON.stringify(this.graph.toJSON()), 'graph.toJSON()') |
| | | const nodes = this.graph.getNodes() |
| | | let nodeArr2 = [] |
| | | // 检查除当前节点之外的所有节点的包围框是否相交 |
| | | for (const node of nodes) { |
| | | console.log(node, 'saveDiagram node') |
| | | if (node.getData().nodeType == 'node' && node.getData().dataId) { |
| | | nodeArr2.push(node.getData().dataId) |
| | | } |
| | | } |
| | | this.dataForm.nodeArr = nodeArr2 |
| | | // 获取所有子节点 |
| | | this.getNodeArr() |
| | | this.dataForm.content = JSON.stringify(this.graph.toJSON()) |
| | | this.dataForm.urlPref = window.SITE_CONFIG['apiURL'] |
| | | console.log(this.dataForm, 'dataFrom') |
| | |
| | | } |
| | | }) |
| | | }, |
| | | async analyzeDiagram() { |
| | | console.log(JSON.stringify(this.graph.toJSON()), 'graph.toJSON()') |
| | | getNodeArr(){ |
| | | const nodes = this.graph.getNodes() |
| | | let nodeArr2 = [] |
| | | // 检查除当前节点之外的所有节点的包围框是否相交 |
| | | for (const node of nodes) { |
| | | console.log(node, 'saveDiagram node') |
| | | if (node.getData().nodeType == 'node' && node.getData().dataId) { |
| | | nodeArr2.push(node.getData().dataId) |
| | | } |
| | | } |
| | | this.dataForm.nodeArr = nodeArr2 |
| | | }, |
| | | async analyzeDiagram() { |
| | | console.log(JSON.stringify(this.graph.toJSON()), 'graph.toJSON()') |
| | | // 检查除当前节点之外的所有节点的包围框是否相交 |
| | | // 获取所有子节点 |
| | | this.getNodeArr() |
| | | const nodes = this.graph.getNodes() |
| | | for (const node of nodes) { |
| | | if(node.getData().nodeType === 'dashedBox'){ |
| | | this.$message({message: '该模型中存在虚框,无法保存', type: 'warning'}) |
| | |
| | | return false; // 取消添加节点操作 |
| | | } |
| | | } |
| | | if (node.getData().nodeType === 'node' && node.getData().dataId) { |
| | | nodeArr2.push(node.getData().dataId) |
| | | } |
| | | } |
| | | this.dataForm.nodeArr = nodeArr2 |
| | | this.dataForm.content = JSON.stringify(this.graph.toJSON()) |
| | | this.dataForm.urlPref = window.SITE_CONFIG['apiURL'] |
| | | await this.$http['post'](`/taskReliability/ModelLine/analyze`, this.dataForm).then(async res => { |