|
@@ -12,7 +12,7 @@ import './shape'
|
|
|
|
|
|
export default class FlowGraph {
|
|
export default class FlowGraph {
|
|
public static graph: Graph
|
|
public static graph: Graph
|
|
- private static stencil: Addon.Stencil
|
|
|
|
|
|
+ public static stencil: Addon.Stencil
|
|
|
|
|
|
/**
|
|
/**
|
|
* 初始化方法
|
|
* 初始化方法
|
|
@@ -172,8 +172,7 @@ export default class FlowGraph {
|
|
return this.graph
|
|
return this.graph
|
|
}
|
|
}
|
|
this.initStencil()
|
|
this.initStencil()
|
|
- this.initShape()
|
|
|
|
- // this.initGraphShape()
|
|
|
|
|
|
+ // this.initShape()
|
|
this.initEvent()
|
|
this.initEvent()
|
|
return this.graph
|
|
return this.graph
|
|
}
|
|
}
|
|
@@ -231,7 +230,7 @@ export default class FlowGraph {
|
|
stencilContainer?.appendChild(this.stencil.container)
|
|
stencilContainer?.appendChild(this.stencil.container)
|
|
}
|
|
}
|
|
// 初始化具体每个根节点下不同类型节点
|
|
// 初始化具体每个根节点下不同类型节点
|
|
- private static initShape() {
|
|
|
|
|
|
+ public static initShape() {
|
|
const { graph } = this
|
|
const { graph } = this
|
|
// 基础节点
|
|
// 基础节点
|
|
const r1 = graph.createNode({
|
|
const r1 = graph.createNode({
|
|
@@ -314,35 +313,26 @@ export default class FlowGraph {
|
|
})
|
|
})
|
|
|
|
|
|
// 子流程节点
|
|
// 子流程节点
|
|
- const s1 = graph.createNode({
|
|
|
|
- shape: 'sub-flow-rect',
|
|
|
|
- attrs: {
|
|
|
|
- title: {
|
|
|
|
- text: 'XX子流程'
|
|
|
|
- },
|
|
|
|
- text: {
|
|
|
|
- text: '测试xx流程'
|
|
|
|
- },
|
|
|
|
- lip: {
|
|
|
|
- transform: 'scale(0.01)'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- const s2 = graph.createNode({
|
|
|
|
- shape: 'sub-flow-rect'
|
|
|
|
- })
|
|
|
|
- const s3 = graph.createNode({
|
|
|
|
- shape: 'sub-flow-rect'
|
|
|
|
- })
|
|
|
|
- const s4 = graph.createNode({
|
|
|
|
- shape: 'sub-flow-rect'
|
|
|
|
- })
|
|
|
|
- const s5 = graph.createNode({
|
|
|
|
- shape: 'sub-flow-rect'
|
|
|
|
- })
|
|
|
|
- const L1 = graph.createNode({
|
|
|
|
- shape: 'logic-flow-path'
|
|
|
|
- })
|
|
|
|
|
|
+ // const s1 = graph.createNode({
|
|
|
|
+ // shape: 'sub-flow-rect',
|
|
|
|
+ // attrs: {
|
|
|
|
+ // title: {
|
|
|
|
+ // text: 'XX子流程'
|
|
|
|
+ // },
|
|
|
|
+ // text: {
|
|
|
|
+ // text: '测试xx流程'
|
|
|
|
+ // },
|
|
|
|
+ // lip: {
|
|
|
|
+ // transform: 'scale(0.01)'
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // const s2 = graph.createNode({
|
|
|
|
+ // shape: 'sub-flow-rect'
|
|
|
|
+ // })
|
|
|
|
+ // const L1 = graph.createNode({
|
|
|
|
+ // shape: 'logic-flow-path'
|
|
|
|
+ // })
|
|
|
|
|
|
// 组合节点
|
|
// 组合节点
|
|
const c1 = graph.createNode({
|
|
const c1 = graph.createNode({
|
|
@@ -368,8 +358,8 @@ export default class FlowGraph {
|
|
})
|
|
})
|
|
|
|
|
|
this.stencil.load([r1, r2, r3, r4], 'basic')
|
|
this.stencil.load([r1, r2, r3, r4], 'basic')
|
|
- this.stencil.load([s1, s2, s3, s4, s5], 's-pro')
|
|
|
|
- this.stencil.load([L1], 'logic')
|
|
|
|
|
|
+ // this.stencil.load([s1, s2], 's-pro')
|
|
|
|
+ // this.stencil.load([L1], 'logic')
|
|
this.stencil.load([c1, c2, c3], 'combination')
|
|
this.stencil.load([c1, c2, c3], 'combination')
|
|
this.stencil.load([g1], 'group')
|
|
this.stencil.load([g1], 'group')
|
|
}
|
|
}
|