| | |
| | | }, |
| | | mounted() { |
| | | this.getProductList() |
| | | this.init() |
| | | |
| | | }, |
| | | components: { |
| | | ProductModelTree, |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // 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 |
| | |
| | | }, |
| | | // anchor: 'center', |
| | | connectionPoint: 'anchor', |
| | | allowBlank: false, |
| | | snap: { |
| | | radius: 20, |
| | | }, |
| | |
| | | text: '' |
| | | } |
| | | }, |
| | | // position: { |
| | | // distance: 0.5, |
| | | // angle: 180, |
| | | // options: { |
| | | // keepGradient: true, |
| | | // ensureLegibility: true |
| | | // } |
| | | // } |
| | | }], |
| | | zIndex: 0, |
| | | }) |
| | |
| | | stroke: '#5F95FF', |
| | | fill: '#EFF4FF', |
| | | }, |
| | | // title:{ |
| | | // text:'', |
| | | // refX: 40, |
| | | // refY: 38, |
| | | // fontSize: 20, |
| | | // fill: '#262626', |
| | | // 'text-anchor': 'start', |
| | | // }, |
| | | text: { |
| | | // refX: 40, |
| | | // refY: 20, |
| | | fontSize: 20, |
| | | fill: '#262626', |
| | | // 'text-anchor': 'start', |
| | | }, |
| | | }, |
| | | // markup: [ |
| | | // { |
| | | // tagName: 'polygon', |
| | | // selector: 'body', |
| | | // }, |
| | | // { |
| | | // tagName: 'text', |
| | | // selector: 'title', |
| | | // }, |
| | | // { |
| | | // tagName: 'text', |
| | | // selector: 'text', |
| | | // }, |
| | | // ], |
| | | ports: { |
| | | ...this.ports |
| | | // items: [ |
| | |
| | | }) |
| | | |
| | | this.graph.on('blank:click', ({cell}) => { |
| | | // this.reset() |
| | | // this.type.value = "grid" |
| | | this.type = 'grid' |
| | | // this.id = cell.id |
| | | }) |
| | | |
| | | this.graph.on('cell:click', ({cell}) => { |
| | |
| | | // 单击node节点 |
| | | this.graph.on('node:click', ({node}) => { |
| | | // this.reset() |
| | | if (node.getData().dataId) { |
| | | this.dialogVisible2 = true |
| | | let param = { |
| | | id: node.getData().dataId, |
| | | modelName: node.attr('label/textWrap/text'), |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.rbdEditImg.init(param) |
| | | }) |
| | | } |
| | | node.attr('line/stroke', '#5F95FF') |
| | | node.prop('labels/0', { |
| | | attrs: { |
| | | body: { |
| | | stroke: '#5F95FF', |
| | | }, |
| | | }, |
| | | }) |
| | | }) |
| | | // 控制连接桩显示/隐藏 |
| | | this.graph.on('node:delete', ({view, e}) => { |
| | |
| | | this.dataForm.simulatFrequency = result.data.simulatFrequency |
| | | }, |
| | | async getDiagram() { |
| | | this.init() |
| | | let params = { |
| | | productId: this.dataForm.productId, |
| | | taskId: this.dataForm.taskModelId, |