| | |
| | | { |
| | | name: 'group1', |
| | | title: '常用组件', |
| | | }, |
| | | { |
| | | name: 'group2', |
| | | title: '逻辑组件' |
| | | } |
| | | ], |
| | | }) |
| | |
| | | data: initNodeData, |
| | | }) |
| | | |
| | | const n3Data = JSON.parse(JSON.stringify(initNodeData)) |
| | | n3Data.isLogic = true;//逻辑判断 |
| | | const n3 = graph.createNode({ |
| | | const crnData = JSON.parse(JSON.stringify(initNodeData)) |
| | | crnData.type = "crn"; |
| | | const crnStencil = graph.createNode({ |
| | | shape: "rect", |
| | | width: 80, |
| | | height: 40, |
| | | label: "堆垛机组件", |
| | | attrs: commonGraphAttrs, |
| | | ports: commonGraphPorts, |
| | | data: crnData, |
| | | }) |
| | | |
| | | const shuttleData = JSON.parse(JSON.stringify(initNodeData)) |
| | | shuttleData.type = "shuttle"; |
| | | const shuttleStencil = graph.createNode({ |
| | | shape: "rect", |
| | | width: 80, |
| | | height: 40, |
| | | label: "四向车组件", |
| | | attrs: commonGraphAttrs, |
| | | ports: commonGraphPorts, |
| | | data: shuttleData, |
| | | }) |
| | | |
| | | const liftData = JSON.parse(JSON.stringify(initNodeData)) |
| | | liftData.type = "lift"; |
| | | const liftStencil = graph.createNode({ |
| | | shape: "rect", |
| | | width: 80, |
| | | height: 40, |
| | | label: "提升机组件", |
| | | attrs: commonGraphAttrs, |
| | | ports: commonGraphPorts, |
| | | data: liftData, |
| | | }) |
| | | |
| | | const devpData = JSON.parse(JSON.stringify(initNodeData)) |
| | | devpData.type = "devp"; |
| | | const devpStencil = graph.createNode({ |
| | | shape: "rect", |
| | | width: 80, |
| | | height: 40, |
| | | label: "输送线组件", |
| | | attrs: commonGraphAttrs, |
| | | ports: commonGraphPorts, |
| | | data: devpData, |
| | | }) |
| | | |
| | | const logicStencilData = JSON.parse(JSON.stringify(initNodeData)) |
| | | logicStencilData.isLogic = true;//逻辑判断 |
| | | const logicStencil = graph.createNode({ |
| | | shape: 'path', |
| | | width: 100, |
| | | height: 60, |
| | |
| | | attrs: commonGraphAttrs, |
| | | label: '逻辑判断', |
| | | ports: commonGraphPorts, |
| | | data: n3Data, |
| | | data: logicStencilData, |
| | | }) |
| | | |
| | | stencil.load([n1, n2, n3], 'group1') |
| | | stencil.load([n1, n2, crnStencil, shuttleStencil, liftStencil, devpStencil], 'group1') |
| | | stencil.load([logicStencil], 'group2') |
| | | } |
| | | |
| | | function initBind(graph) { |