gbflowengine 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +271 -271
- package/dist/gbflowengine.css +1 -1
- package/dist/gbflowengine.js +8232 -6913
- package/dist/gbflowengine.js.map +1 -1
- package/dist/gbflowengine.umd.cjs +2 -2
- package/dist/gbflowengine.umd.cjs.map +1 -1
- package/package.json +85 -84
- package/src/center/DefinitionInspect.vue +291 -291
- package/src/center/FlowCenter.vue +33 -33
- package/src/center/index.js +29 -29
- package/src/center/storage.js +748 -748
- package/src/core/flow/condition.js +160 -160
- package/src/core/flow/customNode.js +385 -385
- package/src/core/flow/defaults.js +124 -124
- package/src/core/flow/flowConstant.js +265 -265
- package/src/core/flow/flowNodeUtils.js +29 -29
- package/src/core/flow/index.js +47 -47
- package/src/core/flow/node.js +44 -44
- package/src/core/flow/nodeFactory.js +58 -58
- package/src/core/flow/prediction.js +325 -325
- package/src/core/flow/schema.js +864 -864
- package/src/definition/FlowDefinitionDesigner.vue +338 -338
- package/src/definition/index.js +9 -9
- package/src/index.js +39 -39
- package/src/storage.js +200 -200
- package/src/testing/FlowTestPanel.vue +2502 -2502
- package/src/testing/UserConfigDrawer.vue +376 -376
- package/src/testing/diagram/FlowProgressDiagram.vue +318 -318
- package/src/testing/diagramModel.js +517 -517
- package/src/testing/index.js +23 -23
- package/src/testing/mock.js +246 -246
- package/src/testing/oaExecutors.js +51 -51
- package/src/testing/oaSeed.js +467 -467
- package/src/testing/sample.js +412 -412
- package/src/testing/seed.js +122 -122
- package/src/utils/format.js +27 -27
- package/src/visual/FlowCanvas.vue +440 -440
- package/src/visual/NodeProgressDetail.vue +43 -43
- package/src/visual/NodeStatusBadge.vue +17 -17
- package/src/visual/NodeWrap.vue +46 -46
- package/src/visual/ScWorkflow.vue +49 -49
- package/src/visual/SelectDialog.vue +459 -459
- package/src/visual/conditionHelpers.js +116 -116
- package/src/visual/index.js +6 -6
- package/src/visual/nodes/AddNode.vue +222 -222
- package/src/visual/nodes/ApproverNode.vue +347 -347
- package/src/visual/nodes/BranchNode.vue +441 -441
- package/src/visual/nodes/CustomNode.vue +339 -339
- package/src/visual/nodes/EndNode.vue +21 -21
- package/src/visual/nodes/PassNode.vue +100 -100
- package/src/visual/nodes/PromoterNode.vue +134 -134
- package/src/visual/nodes/RejectNode.vue +100 -100
- package/src/visual/nodes/SendNode.vue +151 -151
- package/src/visual/styles.scss +879 -879
- package/src/visual/useScNodeStatus.js +18 -18
- package/src/workbench/OaWorkbench.vue +1341 -1341
- package/src/workbench/components/ApprovalWorkspace.vue +2090 -2090
- package/src/workbench/components/CategoryIcon.vue +74 -74
- package/src/workbench/components/NotificationIcon.vue +73 -73
- package/src/workbench/components/ProcessSteps.vue +557 -557
- package/src/workbench/components/ResubmitDialog.vue +227 -227
- package/src/workbench/components/SidebarNav.vue +138 -138
- package/src/workbench/components/StartFlowDialog.vue +1058 -1058
- package/src/workbench/components/UserAvatar.vue +68 -68
- package/src/workbench/model.js +1080 -1080
- package/src/workbench/pages/DesignPage.vue +798 -798
- package/src/workbench/pages/HomePage.vue +1050 -1050
- package/src/workbench/pages/MonitorPage.vue +1029 -1029
- package/src/workbench/pages/NotificationsPage.vue +554 -554
- package/src/workbench/pages/RequestsPage.vue +644 -644
- package/src/workbench/pages/TaskCenterPage.vue +1155 -1155
- package/src/workbench/pages/TemplatesPage.vue +680 -680
- package/src/workbench/styles.scss +555 -555
- package/types/center.d.ts +5 -5
- package/types/core.d.ts +479 -479
- package/types/definition.d.ts +4 -4
- package/types/index.d.ts +34 -34
- package/types/testing.d.ts +20 -20
- package/types/visual.d.ts +20 -20
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FlowNodeType,
|
|
3
|
-
ApproverType,
|
|
4
|
-
SignMode,
|
|
5
|
-
RejectStrategy,
|
|
6
|
-
NodeTypeLabel
|
|
7
|
-
} from './flowConstant.js'
|
|
8
|
-
import { createCustomNodeConfig } from './customNode.js'
|
|
9
|
-
|
|
10
|
-
export const STRUCTURAL_NODE_TYPES = [
|
|
11
|
-
FlowNodeType.START,
|
|
12
|
-
FlowNodeType.BRANCH,
|
|
13
|
-
FlowNodeType.CONDITION,
|
|
14
|
-
FlowNodeType.PARALLEL,
|
|
15
|
-
FlowNodeType.PARALLEL_BRANCH,
|
|
16
|
-
FlowNodeType.INCLUSIVE,
|
|
17
|
-
FlowNodeType.INCLUSIVE_BRANCH
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
export const TERMINAL_NODE_TYPES = [
|
|
21
|
-
FlowNodeType.END,
|
|
22
|
-
FlowNodeType.PASS,
|
|
23
|
-
FlowNodeType.REJECT
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
export const BRANCH_NODE_TYPES = [
|
|
27
|
-
FlowNodeType.BRANCH,
|
|
28
|
-
FlowNodeType.PARALLEL,
|
|
29
|
-
FlowNodeType.INCLUSIVE
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
export function isStructuralNode(node) {
|
|
33
|
-
return !!node && STRUCTURAL_NODE_TYPES.includes(node.type)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function isTerminalNode(node) {
|
|
37
|
-
return !!node && TERMINAL_NODE_TYPES.includes(node.type)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function isBranchNode(node) {
|
|
41
|
-
return !!node && BRANCH_NODE_TYPES.includes(node.type)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function getNodeTypeLabel(type) {
|
|
45
|
-
return NodeTypeLabel[type] || type || '未知节点'
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Returns the complete default property set for a node type.
|
|
50
|
-
* Values follow the persisted shape used by yudi-flow-ruoyi so imported
|
|
51
|
-
* definitions stay wire-compatible with the original backend.
|
|
52
|
-
*/
|
|
53
|
-
export function createNodeDefaults(type) {
|
|
54
|
-
switch (type) {
|
|
55
|
-
case FlowNodeType.START:
|
|
56
|
-
return { nodeName: '发起人', childNode: null }
|
|
57
|
-
case FlowNodeType.APPROVE:
|
|
58
|
-
return {
|
|
59
|
-
nodeName: '审批人',
|
|
60
|
-
userList: [],
|
|
61
|
-
roleList: [],
|
|
62
|
-
userNickNames: {},
|
|
63
|
-
deptNameMap: {},
|
|
64
|
-
roleNameMap: {},
|
|
65
|
-
signMode: SignMode.AND,
|
|
66
|
-
approverType: ApproverType.USER,
|
|
67
|
-
superiorLevel: 1,
|
|
68
|
-
allowTransfer: true,
|
|
69
|
-
rejectStrategy: RejectStrategy.TERMINATE,
|
|
70
|
-
rejectTargetNodeId: null,
|
|
71
|
-
rejectRetryLimit: 0,
|
|
72
|
-
termAuto: false,
|
|
73
|
-
term: 0,
|
|
74
|
-
termMode: 0,
|
|
75
|
-
childNode: null
|
|
76
|
-
}
|
|
77
|
-
case FlowNodeType.CC:
|
|
78
|
-
return {
|
|
79
|
-
nodeName: '抄送人',
|
|
80
|
-
userList: [],
|
|
81
|
-
userNickNames: {},
|
|
82
|
-
deptNameMap: {},
|
|
83
|
-
allowInitiatorAddUsers: true,
|
|
84
|
-
childNode: null
|
|
85
|
-
}
|
|
86
|
-
case FlowNodeType.CUSTOM:
|
|
87
|
-
return {
|
|
88
|
-
nodeName: '自定义节点',
|
|
89
|
-
custom: createCustomNodeConfig(),
|
|
90
|
-
childNode: null
|
|
91
|
-
}
|
|
92
|
-
case FlowNodeType.BRANCH:
|
|
93
|
-
return { nodeName: '条件分支', branchList: [], childNode: null }
|
|
94
|
-
case FlowNodeType.CONDITION:
|
|
95
|
-
return {
|
|
96
|
-
nodeName: '条件',
|
|
97
|
-
conditions: [],
|
|
98
|
-
isDefaultCondition: false,
|
|
99
|
-
childNode: null
|
|
100
|
-
}
|
|
101
|
-
case FlowNodeType.PARALLEL:
|
|
102
|
-
return { nodeName: '并行分支', branchList: [], childNode: null }
|
|
103
|
-
case FlowNodeType.PARALLEL_BRANCH:
|
|
104
|
-
return { nodeName: '分支', branchIndex: 0, childNode: null }
|
|
105
|
-
case FlowNodeType.INCLUSIVE:
|
|
106
|
-
return { nodeName: '包容分支', branchList: [], childNode: null }
|
|
107
|
-
case FlowNodeType.INCLUSIVE_BRANCH:
|
|
108
|
-
return {
|
|
109
|
-
nodeName: '包容条件',
|
|
110
|
-
branchIndex: 0,
|
|
111
|
-
conditions: [],
|
|
112
|
-
isDefaultBranch: false,
|
|
113
|
-
childNode: null
|
|
114
|
-
}
|
|
115
|
-
case FlowNodeType.PASS:
|
|
116
|
-
return { nodeName: '直接通过', childNode: null }
|
|
117
|
-
case FlowNodeType.REJECT:
|
|
118
|
-
return { nodeName: '直接拒绝', childNode: null }
|
|
119
|
-
case FlowNodeType.END:
|
|
120
|
-
return { nodeName: '流程结束', childNode: null }
|
|
121
|
-
default:
|
|
122
|
-
return { nodeName: getNodeTypeLabel(type), childNode: null }
|
|
123
|
-
}
|
|
124
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
FlowNodeType,
|
|
3
|
+
ApproverType,
|
|
4
|
+
SignMode,
|
|
5
|
+
RejectStrategy,
|
|
6
|
+
NodeTypeLabel
|
|
7
|
+
} from './flowConstant.js'
|
|
8
|
+
import { createCustomNodeConfig } from './customNode.js'
|
|
9
|
+
|
|
10
|
+
export const STRUCTURAL_NODE_TYPES = [
|
|
11
|
+
FlowNodeType.START,
|
|
12
|
+
FlowNodeType.BRANCH,
|
|
13
|
+
FlowNodeType.CONDITION,
|
|
14
|
+
FlowNodeType.PARALLEL,
|
|
15
|
+
FlowNodeType.PARALLEL_BRANCH,
|
|
16
|
+
FlowNodeType.INCLUSIVE,
|
|
17
|
+
FlowNodeType.INCLUSIVE_BRANCH
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
export const TERMINAL_NODE_TYPES = [
|
|
21
|
+
FlowNodeType.END,
|
|
22
|
+
FlowNodeType.PASS,
|
|
23
|
+
FlowNodeType.REJECT
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
export const BRANCH_NODE_TYPES = [
|
|
27
|
+
FlowNodeType.BRANCH,
|
|
28
|
+
FlowNodeType.PARALLEL,
|
|
29
|
+
FlowNodeType.INCLUSIVE
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
export function isStructuralNode(node) {
|
|
33
|
+
return !!node && STRUCTURAL_NODE_TYPES.includes(node.type)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function isTerminalNode(node) {
|
|
37
|
+
return !!node && TERMINAL_NODE_TYPES.includes(node.type)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function isBranchNode(node) {
|
|
41
|
+
return !!node && BRANCH_NODE_TYPES.includes(node.type)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function getNodeTypeLabel(type) {
|
|
45
|
+
return NodeTypeLabel[type] || type || '未知节点'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the complete default property set for a node type.
|
|
50
|
+
* Values follow the persisted shape used by yudi-flow-ruoyi so imported
|
|
51
|
+
* definitions stay wire-compatible with the original backend.
|
|
52
|
+
*/
|
|
53
|
+
export function createNodeDefaults(type) {
|
|
54
|
+
switch (type) {
|
|
55
|
+
case FlowNodeType.START:
|
|
56
|
+
return { nodeName: '发起人', childNode: null }
|
|
57
|
+
case FlowNodeType.APPROVE:
|
|
58
|
+
return {
|
|
59
|
+
nodeName: '审批人',
|
|
60
|
+
userList: [],
|
|
61
|
+
roleList: [],
|
|
62
|
+
userNickNames: {},
|
|
63
|
+
deptNameMap: {},
|
|
64
|
+
roleNameMap: {},
|
|
65
|
+
signMode: SignMode.AND,
|
|
66
|
+
approverType: ApproverType.USER,
|
|
67
|
+
superiorLevel: 1,
|
|
68
|
+
allowTransfer: true,
|
|
69
|
+
rejectStrategy: RejectStrategy.TERMINATE,
|
|
70
|
+
rejectTargetNodeId: null,
|
|
71
|
+
rejectRetryLimit: 0,
|
|
72
|
+
termAuto: false,
|
|
73
|
+
term: 0,
|
|
74
|
+
termMode: 0,
|
|
75
|
+
childNode: null
|
|
76
|
+
}
|
|
77
|
+
case FlowNodeType.CC:
|
|
78
|
+
return {
|
|
79
|
+
nodeName: '抄送人',
|
|
80
|
+
userList: [],
|
|
81
|
+
userNickNames: {},
|
|
82
|
+
deptNameMap: {},
|
|
83
|
+
allowInitiatorAddUsers: true,
|
|
84
|
+
childNode: null
|
|
85
|
+
}
|
|
86
|
+
case FlowNodeType.CUSTOM:
|
|
87
|
+
return {
|
|
88
|
+
nodeName: '自定义节点',
|
|
89
|
+
custom: createCustomNodeConfig(),
|
|
90
|
+
childNode: null
|
|
91
|
+
}
|
|
92
|
+
case FlowNodeType.BRANCH:
|
|
93
|
+
return { nodeName: '条件分支', branchList: [], childNode: null }
|
|
94
|
+
case FlowNodeType.CONDITION:
|
|
95
|
+
return {
|
|
96
|
+
nodeName: '条件',
|
|
97
|
+
conditions: [],
|
|
98
|
+
isDefaultCondition: false,
|
|
99
|
+
childNode: null
|
|
100
|
+
}
|
|
101
|
+
case FlowNodeType.PARALLEL:
|
|
102
|
+
return { nodeName: '并行分支', branchList: [], childNode: null }
|
|
103
|
+
case FlowNodeType.PARALLEL_BRANCH:
|
|
104
|
+
return { nodeName: '分支', branchIndex: 0, childNode: null }
|
|
105
|
+
case FlowNodeType.INCLUSIVE:
|
|
106
|
+
return { nodeName: '包容分支', branchList: [], childNode: null }
|
|
107
|
+
case FlowNodeType.INCLUSIVE_BRANCH:
|
|
108
|
+
return {
|
|
109
|
+
nodeName: '包容条件',
|
|
110
|
+
branchIndex: 0,
|
|
111
|
+
conditions: [],
|
|
112
|
+
isDefaultBranch: false,
|
|
113
|
+
childNode: null
|
|
114
|
+
}
|
|
115
|
+
case FlowNodeType.PASS:
|
|
116
|
+
return { nodeName: '直接通过', childNode: null }
|
|
117
|
+
case FlowNodeType.REJECT:
|
|
118
|
+
return { nodeName: '直接拒绝', childNode: null }
|
|
119
|
+
case FlowNodeType.END:
|
|
120
|
+
return { nodeName: '流程结束', childNode: null }
|
|
121
|
+
default:
|
|
122
|
+
return { nodeName: getNodeTypeLabel(type), childNode: null }
|
|
123
|
+
}
|
|
124
|
+
}
|