| | |
| | | id: '', |
| | | graph: null, |
| | | globalGridAttr: { |
| | | voteSum: '', |
| | | voteNum: '', |
| | | repairMttcr: '', |
| | | repairMttcrOther: '', |
| | | repairDistribType: '', |
| | |
| | | grid: { |
| | | visible: true, |
| | | }, |
| | | onToolItemCreated({tool}) { |
| | | const handle = tool |
| | | const options = handle.options |
| | | if (options && options.index % 2 === 1) { |
| | | tool.setAttrs({fill: 'red'}) |
| | | } |
| | | }, |
| | | autoResize: true, |
| | | history: true, |
| | | history: { |
| | | enabled: true, |
| | | ignoreAdd: true, |
| | | ignoreRemove: true, |
| | | ignoreChange: true, |
| | | }, |
| | | // panning: { |
| | | // enabled: true, |
| | | // }, |
| | |
| | | } |
| | | } |
| | | }], |
| | | tools: { |
| | | name: 'vertices', |
| | | args: { |
| | | attrs: { fill: '#666' }, |
| | | }, |
| | | }, |
| | | zIndex: 0, |
| | | }) |
| | | }, |
| | |
| | | data: { |
| | | dataId: '', |
| | | nodeType: item.nodeType, |
| | | nodeTypeExt: '' |
| | | nodeTypeExt: '', |
| | | voteNum:'' |
| | | }, |
| | | attrs: { |
| | | text: { |
| | |
| | | width: 60, |
| | | height: 60, |
| | | data: { |
| | | isRepair: false, |
| | | isRepair: item.isRepair, |
| | | dataId: item.dataId, |
| | | nodeType: item.nodeType, |
| | | nodeTypeExt: item.nodeTypeExt, |
| | |
| | | repairMttcrOther: item.repairMttcrOther, |
| | | taskMtbcf: item.taskMtbcf, |
| | | taskMtbcfOther: item.taskMtbcfOther, |
| | | voteSum: '', |
| | | imgHeight: item.imgHeight, |
| | | imgWidth: item.imgWidth |
| | | imgWidth: item.imgWidth, |
| | | voteNum:'', |
| | | }, |
| | | attrs: { |
| | | text: { |
| | |
| | | this.showPorts(ports, false) |
| | | }) |
| | | |
| | | this.graph.on('edge:mouseenter', ({cell, view}) => { |
| | | this.graph.on('edge:mouseenter', ({cell}) => { |
| | | // alert(123) |
| | | cell.addTools([ |
| | | { |
| | | name: 'source-arrowhead', |
| | | }, |
| | | { |
| | | name: 'target-arrowhead', |
| | | args: { |
| | | attrs: { |
| | | fill: 'red', |
| | | }, |
| | | }, |
| | | }, |
| | | ]) |
| | | cell.addTools( |
| | | [ |
| | | { |
| | | name: 'segments', |
| | | args: {snapRadius: 20, attrs: {fill: '#444'}} |
| | | } |
| | | ] |
| | | ['vertices', 'segments'] |
| | | ) |
| | | }) |
| | | |