| | |
| | | </div> |
| | | <div class="vfe-chart-panel" v-if="type !== 'detail'"> |
| | | <div class="vfe-chart-panel-detail"> |
| | | <editor-detail-panel :rowData="rowData" ref="EditorDetailPanel" /> |
| | | <editor-detail-panel :rowData="rowData" ref="EditorDetailPanel" :existNodes="existNodes"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | tooltipShow: true, |
| | | tooltipData: [], |
| | | existNodes: [] |
| | | }; |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | // onAfterChange(e) { |
| | | // const model = e.model |
| | | // console.log(JSON.parse(JSON.stringify(e))); |
| | | // if (!model.change) { |
| | | // model.id = model.label |
| | | // model.change = true |
| | | // } else { |
| | | // return |
| | | // } |
| | | // const { nodes } = this.$refs.flowChart.propsAPI.save() |
| | | // if (Array.isArray(nodes) && nodes.length > 0) { |
| | | |
| | | // } else { |
| | | // this.$refs.flowChart.propsAPI.add("node", model); |
| | | // } |
| | | // throw '禁止原生新增方法' |
| | | // }, |
| | | onAfterChange(e) { |
| | | console.log(e); |
| | | try { |
| | | if (e.action === "add" && e.model.type === "node") { |
| | | if (!e.model.change) { |
| | |
| | | this.$message.error("不能添加已存在的节点!"); |
| | | } |
| | | } |
| | | const { nodes } = this.$refs.flowChart.propsAPI.save() |
| | | this.existNodes = nodes || [] |
| | | console.log(this.$refs.flowChart.propsAPI.save()); |
| | | }, |
| | | _downloadImage(data, filename = "flowchart.png") { |
| | | const a = document.createElement("a"); |