@cloud-app-dev/vidc 1.0.12 → 1.0.16
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/.umirc.ts +18 -11
- package/es/AppLayout/AppHorizontalMenu/index.js +6 -2
- package/es/AppLayout/AppInlineMenu/index.js +9 -3
- package/es/InitialConfig/index.js +0 -1
- package/es/InitialRequest/index.js +4 -2
- package/es/InitialRequest/utils.js +120 -61
- package/es/OrgTree/index.js +6 -5
- package/es/WorkerFlow/Demo.d.ts +2 -0
- package/es/WorkerFlow/Demo.js +34 -0
- package/es/WorkerFlow/Form/Approver.d.ts +2 -0
- package/es/WorkerFlow/Form/Approver.js +7 -0
- package/es/WorkerFlow/Form/Condition.d.ts +2 -0
- package/es/WorkerFlow/Form/Condition.js +7 -0
- package/es/WorkerFlow/Form/FormAuth.d.ts +7 -0
- package/es/WorkerFlow/Form/FormAuth.js +116 -0
- package/es/WorkerFlow/Form/Handle.d.ts +8 -0
- package/es/WorkerFlow/Form/Handle.js +19 -0
- package/es/WorkerFlow/Form/UserSelect.d.ts +7 -0
- package/es/WorkerFlow/Form/UserSelect.js +253 -0
- package/es/WorkerFlow/Form/UserSet.d.ts +9 -0
- package/es/WorkerFlow/Form/UserSet.js +124 -0
- package/es/WorkerFlow/Form/UsersHandleType.d.ts +6 -0
- package/es/WorkerFlow/Form/UsersHandleType.js +30 -0
- package/es/WorkerFlow/Nodes/Add.d.ts +7 -0
- package/es/WorkerFlow/Nodes/Add.js +81 -0
- package/es/WorkerFlow/Nodes/AddOption.d.ts +9 -0
- package/es/WorkerFlow/Nodes/AddOption.js +23 -0
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +6 -0
- package/es/WorkerFlow/Nodes/AddOptionList.js +44 -0
- package/es/WorkerFlow/Nodes/Approver.d.ts +11 -0
- package/es/WorkerFlow/Nodes/Approver.js +53 -0
- package/es/WorkerFlow/Nodes/Condition.d.ts +9 -0
- package/es/WorkerFlow/Nodes/Condition.js +154 -0
- package/es/WorkerFlow/Nodes/Constants.d.ts +34 -0
- package/es/WorkerFlow/Nodes/Constants.js +110 -0
- package/es/WorkerFlow/Nodes/End.d.ts +6 -0
- package/es/WorkerFlow/Nodes/End.js +16 -0
- package/es/WorkerFlow/Nodes/Handle.d.ts +11 -0
- package/es/WorkerFlow/Nodes/Handle.js +53 -0
- package/es/WorkerFlow/Nodes/Node.d.ts +7 -0
- package/es/WorkerFlow/Nodes/Node.js +26 -0
- package/es/WorkerFlow/Nodes/Notifier.d.ts +11 -0
- package/es/WorkerFlow/Nodes/Notifier.js +58 -0
- package/es/WorkerFlow/Nodes/Render.d.ts +7 -0
- package/es/WorkerFlow/Nodes/Render.js +16 -0
- package/es/WorkerFlow/Nodes/Start.d.ts +11 -0
- package/es/WorkerFlow/Nodes/Start.js +26 -0
- package/es/WorkerFlow/Nodes/TitleElement.d.ts +9 -0
- package/es/WorkerFlow/Nodes/TitleElement.js +92 -0
- package/es/WorkerFlow/Nodes/Wrap.d.ts +13 -0
- package/es/WorkerFlow/Nodes/Wrap.js +29 -0
- package/es/WorkerFlow/OperatorContext.d.ts +4 -0
- package/es/WorkerFlow/OperatorContext.js +3 -0
- package/es/WorkerFlow/Tools.d.ts +8 -0
- package/es/WorkerFlow/Tools.js +80 -0
- package/es/WorkerFlow/XML/CanvasTag.d.ts +3 -0
- package/es/WorkerFlow/XML/CanvasTag.js +126 -0
- package/es/WorkerFlow/XML/EndEvent.d.ts +1 -0
- package/es/WorkerFlow/XML/EndEvent.js +14 -0
- package/es/WorkerFlow/XML/ExclusiveGateway.d.ts +8 -0
- package/es/WorkerFlow/XML/ExclusiveGateway.js +120 -0
- package/es/WorkerFlow/XML/Root.d.ts +1 -0
- package/es/WorkerFlow/XML/Root.js +5 -0
- package/es/WorkerFlow/XML/StartEvent.d.ts +5 -0
- package/es/WorkerFlow/XML/StartEvent.js +28 -0
- package/es/WorkerFlow/XML/UserTask.d.ts +5 -0
- package/es/WorkerFlow/XML/UserTask.js +45 -0
- package/es/WorkerFlow/XML/index.d.ts +3 -0
- package/es/WorkerFlow/XML/index.js +97 -0
- package/es/WorkerFlow/XML/utils.d.ts +4 -0
- package/es/WorkerFlow/XML/utils.js +47 -0
- package/es/WorkerFlow/api.d.ts +8 -0
- package/es/WorkerFlow/api.js +49 -0
- package/es/WorkerFlow/bpmn-mock.bpmn +103 -0
- package/es/WorkerFlow/data.json +83 -0
- package/es/WorkerFlow/index.css +728 -0
- package/es/WorkerFlow/index.d.ts +8 -0
- package/es/WorkerFlow/index.js +223 -0
- package/es/WorkerFlow/interface.d.ts +58 -0
- package/es/WorkerFlow/useDrawer.d.ts +14 -0
- package/es/WorkerFlow/useDrawer.js +77 -0
- package/es/WorkerFlow/useModal.d.ts +14 -0
- package/es/WorkerFlow/useModal.js +79 -0
- package/es/core.d.ts +16 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/package.json +7 -2
- package/tsconfig.json +1 -0
- package/es/InitialConfig/index.css +0 -0
- package/es/InitialRequest/index.css +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
function AddNodeOption(_ref) {
|
|
5
|
+
var type = _ref.type,
|
|
6
|
+
onClick = _ref.onClick,
|
|
7
|
+
name = _ref.name,
|
|
8
|
+
icon = _ref.icon,
|
|
9
|
+
color = _ref.color;
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: 'add-node-popover-item ' + type,
|
|
12
|
+
onClick: onClick
|
|
13
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
14
|
+
className: "item-wrapper"
|
|
15
|
+
}, /*#__PURE__*/React.createElement(_IconFont, {
|
|
16
|
+
type: icon,
|
|
17
|
+
style: {
|
|
18
|
+
color: color
|
|
19
|
+
}
|
|
20
|
+
})), /*#__PURE__*/React.createElement("span", null, name));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default AddNodeOption;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import AddNodeOption from './AddOption';
|
|
3
|
+
import { OptionNames, OptionTypes } from './Constants';
|
|
4
|
+
|
|
5
|
+
function AddNodeList(_ref) {
|
|
6
|
+
var onOptionClick = _ref.onOptionClick;
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: "add-node-popover-body"
|
|
9
|
+
}, /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
10
|
+
icon: "icon-yewu",
|
|
11
|
+
type: "approver",
|
|
12
|
+
onClick: function onClick() {
|
|
13
|
+
return onOptionClick(OptionTypes.APPROVER);
|
|
14
|
+
},
|
|
15
|
+
color: OptionNames[OptionTypes.APPROVER].color,
|
|
16
|
+
name: OptionNames[OptionTypes.APPROVER].name
|
|
17
|
+
}), /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
18
|
+
icon: "icon-biaoqian",
|
|
19
|
+
type: "notifier",
|
|
20
|
+
onClick: function onClick() {
|
|
21
|
+
return onOptionClick(OptionTypes.NOTIFIER);
|
|
22
|
+
},
|
|
23
|
+
color: OptionNames[OptionTypes.NOTIFIER].color,
|
|
24
|
+
name: OptionNames[OptionTypes.NOTIFIER].name
|
|
25
|
+
}), /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
26
|
+
icon: "icon-yewu",
|
|
27
|
+
type: "handle",
|
|
28
|
+
onClick: function onClick() {
|
|
29
|
+
return onOptionClick(OptionTypes.HANDLE);
|
|
30
|
+
},
|
|
31
|
+
color: OptionNames[OptionTypes.HANDLE].color,
|
|
32
|
+
name: OptionNames[OptionTypes.HANDLE].name
|
|
33
|
+
}), /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
34
|
+
icon: "icon-ListTree",
|
|
35
|
+
type: "condition",
|
|
36
|
+
onClick: function onClick() {
|
|
37
|
+
return onOptionClick(OptionTypes.CONDITION);
|
|
38
|
+
},
|
|
39
|
+
color: OptionNames[OptionTypes.CONDITION].color,
|
|
40
|
+
name: OptionNames[OptionTypes.CONDITION].name
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default AddNodeList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeItem } from '../interface';
|
|
2
|
+
interface IApproverNodeProps {
|
|
3
|
+
pRef: NodeItem;
|
|
4
|
+
objRef: NodeItem;
|
|
5
|
+
onContentClick: () => void;
|
|
6
|
+
nodeName: string;
|
|
7
|
+
owner?: string;
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
declare function ApproverNode(props: IApproverNodeProps): JSX.Element;
|
|
11
|
+
export default ApproverNode;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import NodeWrap from './Wrap';
|
|
4
|
+
import TitleElement from './TitleElement';
|
|
5
|
+
import WFC from '../OperatorContext';
|
|
6
|
+
|
|
7
|
+
function ApproverNode(props) {
|
|
8
|
+
var _useContext = useContext(WFC),
|
|
9
|
+
onDeleteNode = _useContext.onDeleteNode,
|
|
10
|
+
onSelectNode = _useContext.onSelectNode;
|
|
11
|
+
|
|
12
|
+
function delNode() {
|
|
13
|
+
onDeleteNode(props.pRef, props.objRef);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function onChange(val) {
|
|
17
|
+
// 数据设置不用去重新渲染
|
|
18
|
+
props.pRef.childNode.nodeName = val;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function onContentClick() {
|
|
22
|
+
onSelectNode(props.pRef, props.objRef);
|
|
23
|
+
props.onContentClick && props.onContentClick();
|
|
24
|
+
} // TODO: 这里读取props数据
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var TitleEl = /*#__PURE__*/React.createElement(TitleElement, {
|
|
28
|
+
icon: "icon-yewu",
|
|
29
|
+
delNode: delNode,
|
|
30
|
+
placeholder: props.nodeName,
|
|
31
|
+
nodeName: props.nodeName,
|
|
32
|
+
onTitleChange: onChange
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/React.createElement(NodeWrap, {
|
|
35
|
+
id: props.id,
|
|
36
|
+
titleStyle: {
|
|
37
|
+
backgroundColor: '#29CCCC'
|
|
38
|
+
},
|
|
39
|
+
onContentClick: onContentClick,
|
|
40
|
+
title: TitleEl,
|
|
41
|
+
objRef: props.objRef
|
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: "text"
|
|
44
|
+
}, props.owner ? /*#__PURE__*/React.createElement("span", {
|
|
45
|
+
title: props.owner
|
|
46
|
+
}, props.owner) : /*#__PURE__*/React.createElement("span", {
|
|
47
|
+
className: "placeholder"
|
|
48
|
+
}, "\u8BF7\u9009\u62E9\u5BA1\u6838\u4EBA"), /*#__PURE__*/React.createElement(_IconFont, {
|
|
49
|
+
type: "icon-S_Arrow_SmallRight"
|
|
50
|
+
})));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default ApproverNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NodeItem } from '../interface';
|
|
2
|
+
interface IConditionNodeProps {
|
|
3
|
+
conditionNodes: NodeItem[];
|
|
4
|
+
pRef: NodeItem;
|
|
5
|
+
objRef: NodeItem;
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
declare function ConditionNode({ conditionNodes: branches, objRef, pRef, id }: IConditionNodeProps): JSX.Element;
|
|
9
|
+
export default ConditionNode;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import AddNode from './Add';
|
|
4
|
+
import Render from './Render';
|
|
5
|
+
import { NodeTypes } from './Constants';
|
|
6
|
+
import WFC from '../OperatorContext';
|
|
7
|
+
|
|
8
|
+
function CoverLine(_ref) {
|
|
9
|
+
var _ref$first = _ref.first,
|
|
10
|
+
first = _ref$first === void 0 ? false : _ref$first,
|
|
11
|
+
_ref$last = _ref.last,
|
|
12
|
+
last = _ref$last === void 0 ? false : _ref$last;
|
|
13
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, first && /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "top-left-cover-line"
|
|
15
|
+
}), first && /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: "bottom-left-cover-line"
|
|
17
|
+
}), last && /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "top-right-cover-line"
|
|
19
|
+
}), last && /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "bottom-right-cover-line"
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function BranchNode(_ref2) {
|
|
25
|
+
var first = _ref2.first,
|
|
26
|
+
last = _ref2.last,
|
|
27
|
+
sortLeft = _ref2.sortLeft,
|
|
28
|
+
owner = _ref2.owner,
|
|
29
|
+
nodeName = _ref2.nodeName,
|
|
30
|
+
priorityLevel = _ref2.priorityLevel,
|
|
31
|
+
delBranch = _ref2.delBranch,
|
|
32
|
+
sortRight = _ref2.sortRight,
|
|
33
|
+
onBranchClick = _ref2.onBranchClick,
|
|
34
|
+
objRef = _ref2.objRef,
|
|
35
|
+
id = _ref2.id;
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: "condition-node"
|
|
38
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: "condition-node-box"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: "auto-judge",
|
|
42
|
+
id: id
|
|
43
|
+
}, !first && /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "sort-left",
|
|
45
|
+
onClick: sortLeft
|
|
46
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: "title-wrapper"
|
|
48
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
className: "editable-title"
|
|
50
|
+
}, nodeName), /*#__PURE__*/React.createElement("span", {
|
|
51
|
+
className: "priority-title"
|
|
52
|
+
}, "\u4F18\u5148\u7EA7", priorityLevel), /*#__PURE__*/React.createElement(_IconFont, {
|
|
53
|
+
className: "worker-flow-node-del",
|
|
54
|
+
type: "icon-MarkNo",
|
|
55
|
+
onClick: delBranch
|
|
56
|
+
})), !last && /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: "sort-right",
|
|
58
|
+
onClick: sortRight
|
|
59
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: "content",
|
|
61
|
+
onClick: function onClick() {
|
|
62
|
+
return onBranchClick(objRef);
|
|
63
|
+
}
|
|
64
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: "text"
|
|
66
|
+
}, owner ? /*#__PURE__*/React.createElement("span", {
|
|
67
|
+
title: owner
|
|
68
|
+
}, owner) : /*#__PURE__*/React.createElement("span", {
|
|
69
|
+
className: "placeholder"
|
|
70
|
+
}, "\u8BF7\u8BBE\u7F6E\u6761\u4EF6"), /*#__PURE__*/React.createElement(_IconFont, {
|
|
71
|
+
type: "icon-S_Arrow_SmallRight"
|
|
72
|
+
})))), /*#__PURE__*/React.createElement(AddNode, {
|
|
73
|
+
objRef: objRef
|
|
74
|
+
})));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function ConditionNode(_ref3) {
|
|
78
|
+
var _ref3$conditionNodes = _ref3.conditionNodes,
|
|
79
|
+
branches = _ref3$conditionNodes === void 0 ? [] : _ref3$conditionNodes,
|
|
80
|
+
objRef = _ref3.objRef,
|
|
81
|
+
pRef = _ref3.pRef,
|
|
82
|
+
id = _ref3.id;
|
|
83
|
+
|
|
84
|
+
var _useContext = useContext(WFC),
|
|
85
|
+
onAddNode = _useContext.onAddNode,
|
|
86
|
+
onDeleteNode = _useContext.onDeleteNode,
|
|
87
|
+
onSelectNode = _useContext.onSelectNode;
|
|
88
|
+
|
|
89
|
+
function addBranch() {
|
|
90
|
+
onAddNode(NodeTypes.BRANCH, pRef, objRef);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function _delBranch(i) {
|
|
94
|
+
if (branches.length === 2) {
|
|
95
|
+
onDeleteNode(pRef, objRef);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
console.log('delBranch(i)', i);
|
|
100
|
+
onDeleteNode(pRef, objRef, NodeTypes.BRANCH, i);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function sortLeft() {}
|
|
104
|
+
|
|
105
|
+
function sortRight() {}
|
|
106
|
+
|
|
107
|
+
function onBranchClick(objRef) {
|
|
108
|
+
onSelectNode(objRef, objRef);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (!Array.isArray(branches) || branches.length === 0) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: "branch-wrap"
|
|
117
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: "branch-box-wrap"
|
|
119
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
className: "branch-box"
|
|
121
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
122
|
+
className: "add-branch",
|
|
123
|
+
onClick: addBranch,
|
|
124
|
+
id: id
|
|
125
|
+
}, "\u6DFB\u52A0\u6761\u4EF6"), branches.map(function (item, index) {
|
|
126
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
127
|
+
className: "col-box",
|
|
128
|
+
key: index.toString()
|
|
129
|
+
}, /*#__PURE__*/React.createElement(BranchNode, Object.assign({}, item, {
|
|
130
|
+
nodeName: item.nodeName,
|
|
131
|
+
priorityLevel: item.priorityLevel,
|
|
132
|
+
owner: item.owner,
|
|
133
|
+
sortLeft: sortLeft,
|
|
134
|
+
sortRight: sortRight,
|
|
135
|
+
first: index === 0,
|
|
136
|
+
onBranchClick: onBranchClick,
|
|
137
|
+
delBranch: function delBranch() {
|
|
138
|
+
return _delBranch(index);
|
|
139
|
+
},
|
|
140
|
+
last: index === branches.length - 1,
|
|
141
|
+
objRef: item
|
|
142
|
+
})), item.childNode && /*#__PURE__*/React.createElement(Render, {
|
|
143
|
+
pRef: item,
|
|
144
|
+
config: item.childNode
|
|
145
|
+
}), /*#__PURE__*/React.createElement(CoverLine, {
|
|
146
|
+
first: index === 0,
|
|
147
|
+
last: index === branches.length - 1
|
|
148
|
+
}));
|
|
149
|
+
})), /*#__PURE__*/React.createElement(AddNode, {
|
|
150
|
+
objRef: objRef
|
|
151
|
+
})));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export default ConditionNode;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MutipleUserHandleType, NodeItem, NodeType, NodeTypeKey, UserSetType } from '../interface';
|
|
2
|
+
export declare const OptionTypes: {
|
|
3
|
+
[key in NodeTypeKey]: NodeType;
|
|
4
|
+
};
|
|
5
|
+
export declare const UserSetOptions: {
|
|
6
|
+
[key in UserSetType]: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: UserSetType;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const UserHandleTypeOptions: {
|
|
12
|
+
[key in MutipleUserHandleType]: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: MutipleUserHandleType;
|
|
15
|
+
desc: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const NodeTypes: {
|
|
19
|
+
START: number;
|
|
20
|
+
APPROVER: NodeType;
|
|
21
|
+
NOTIFIER: NodeType;
|
|
22
|
+
BRANCH: NodeType;
|
|
23
|
+
CONDITION: NodeType;
|
|
24
|
+
HANDLE: NodeType;
|
|
25
|
+
};
|
|
26
|
+
export declare const OptionNames: {
|
|
27
|
+
[key: number]: {
|
|
28
|
+
name: string;
|
|
29
|
+
color: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const NodeTemplates: {
|
|
33
|
+
[key: number]: () => NodeItem;
|
|
34
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
var _OptionNames, _NodeTemplates;
|
|
2
|
+
|
|
3
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
|
|
5
|
+
import { createId } from '../XML/utils'; // 添加节点类型
|
|
6
|
+
|
|
7
|
+
export var OptionTypes = {
|
|
8
|
+
APPROVER: 1,
|
|
9
|
+
NOTIFIER: 2,
|
|
10
|
+
BRANCH: 3,
|
|
11
|
+
CONDITION: 4,
|
|
12
|
+
HANDLE: 5
|
|
13
|
+
}; //人员类型
|
|
14
|
+
|
|
15
|
+
export var UserSetOptions = {
|
|
16
|
+
1: {
|
|
17
|
+
label: '指定人员',
|
|
18
|
+
value: 1
|
|
19
|
+
},
|
|
20
|
+
2: {
|
|
21
|
+
label: '自选人员',
|
|
22
|
+
value: 2
|
|
23
|
+
},
|
|
24
|
+
3: {
|
|
25
|
+
label: '岗位',
|
|
26
|
+
value: 3
|
|
27
|
+
},
|
|
28
|
+
4: {
|
|
29
|
+
label: '直属主管',
|
|
30
|
+
value: 4
|
|
31
|
+
},
|
|
32
|
+
5: {
|
|
33
|
+
label: '连续多级主管',
|
|
34
|
+
value: 5
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export var UserHandleTypeOptions = {
|
|
38
|
+
1: {
|
|
39
|
+
label: '会签',
|
|
40
|
+
value: 1,
|
|
41
|
+
desc: '须所有审批人同意'
|
|
42
|
+
},
|
|
43
|
+
2: {
|
|
44
|
+
label: '或签',
|
|
45
|
+
value: 2,
|
|
46
|
+
desc: '一名审批人同意或拒绝即可'
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export var NodeTypes = Object.assign(Object.assign({}, OptionTypes), {
|
|
50
|
+
START: 0
|
|
51
|
+
}); // 节点类型默认标题名
|
|
52
|
+
|
|
53
|
+
export var OptionNames = (_OptionNames = {}, _defineProperty(_OptionNames, OptionTypes.APPROVER, {
|
|
54
|
+
name: '审批人',
|
|
55
|
+
color: 'rgb(41, 204, 204)'
|
|
56
|
+
}), _defineProperty(_OptionNames, OptionTypes.NOTIFIER, {
|
|
57
|
+
name: '抄送人',
|
|
58
|
+
color: 'rgb(25, 140, 255)'
|
|
59
|
+
}), _defineProperty(_OptionNames, OptionTypes.CONDITION, {
|
|
60
|
+
name: '条件分支',
|
|
61
|
+
color: '#15bc83'
|
|
62
|
+
}), _defineProperty(_OptionNames, OptionTypes.HANDLE, {
|
|
63
|
+
name: '办理人',
|
|
64
|
+
color: 'rgb(255, 179, 25)'
|
|
65
|
+
}), _OptionNames); // 节点模板
|
|
66
|
+
|
|
67
|
+
export var NodeTemplates = (_NodeTemplates = {}, _defineProperty(_NodeTemplates, OptionTypes.APPROVER, function () {
|
|
68
|
+
return {
|
|
69
|
+
id: createId('UserTask'),
|
|
70
|
+
nodeName: '审核人',
|
|
71
|
+
type: OptionTypes.APPROVER,
|
|
72
|
+
nodeUserList: [],
|
|
73
|
+
bpmnType: 'userTask'
|
|
74
|
+
};
|
|
75
|
+
}), _defineProperty(_NodeTemplates, OptionTypes.HANDLE, function () {
|
|
76
|
+
return {
|
|
77
|
+
id: createId('UserTask'),
|
|
78
|
+
nodeName: '办理人',
|
|
79
|
+
type: OptionTypes.HANDLE,
|
|
80
|
+
nodeUserList: [],
|
|
81
|
+
bpmnType: 'userTask'
|
|
82
|
+
};
|
|
83
|
+
}), _defineProperty(_NodeTemplates, OptionTypes.NOTIFIER, function () {
|
|
84
|
+
return {
|
|
85
|
+
id: createId('UserTask'),
|
|
86
|
+
nodeName: '抄送人',
|
|
87
|
+
type: OptionTypes.NOTIFIER,
|
|
88
|
+
nodeUserList: [],
|
|
89
|
+
bpmnType: 'userTask'
|
|
90
|
+
};
|
|
91
|
+
}), _defineProperty(_NodeTemplates, OptionTypes.CONDITION, function () {
|
|
92
|
+
return {
|
|
93
|
+
id: createId('ExclusiveGateway'),
|
|
94
|
+
nodeName: '路由',
|
|
95
|
+
type: OptionTypes.CONDITION,
|
|
96
|
+
childNode: null,
|
|
97
|
+
conditionNodes: [],
|
|
98
|
+
bpmnType: 'exclusiveGateway'
|
|
99
|
+
};
|
|
100
|
+
}), _defineProperty(_NodeTemplates, OptionTypes.BRANCH, function () {
|
|
101
|
+
return {
|
|
102
|
+
id: createId('SequenceFlow'),
|
|
103
|
+
nodeName: '条件',
|
|
104
|
+
type: OptionTypes.BRANCH,
|
|
105
|
+
conditionList: [],
|
|
106
|
+
nodeUserList: [],
|
|
107
|
+
childNode: null,
|
|
108
|
+
bpmnType: 'sequenceFlow'
|
|
109
|
+
};
|
|
110
|
+
}), _NodeTemplates);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
function EndNode(_ref) {
|
|
4
|
+
var id = _ref.id,
|
|
5
|
+
nodeName = _ref.nodeName;
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "end-node"
|
|
8
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "end-node-circle",
|
|
10
|
+
id: id
|
|
11
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "end-node-text"
|
|
13
|
+
}, nodeName));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default EndNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeItem } from '../interface';
|
|
2
|
+
interface IHandleNodeProps {
|
|
3
|
+
pRef: NodeItem;
|
|
4
|
+
objRef: NodeItem;
|
|
5
|
+
onContentClick: () => void;
|
|
6
|
+
nodeName: string;
|
|
7
|
+
owner?: string;
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
declare function HandleNode(props: IHandleNodeProps): JSX.Element;
|
|
11
|
+
export default HandleNode;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import NodeWrap from './Wrap';
|
|
4
|
+
import TitleElement from './TitleElement';
|
|
5
|
+
import WFC from '../OperatorContext';
|
|
6
|
+
|
|
7
|
+
function HandleNode(props) {
|
|
8
|
+
var _useContext = useContext(WFC),
|
|
9
|
+
onDeleteNode = _useContext.onDeleteNode,
|
|
10
|
+
onSelectNode = _useContext.onSelectNode;
|
|
11
|
+
|
|
12
|
+
function delNode() {
|
|
13
|
+
onDeleteNode(props.pRef, props.objRef);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function onChange(val) {
|
|
17
|
+
// 数据设置不用去重新渲染
|
|
18
|
+
props.pRef.childNode.nodeName = val;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function onContentClick() {
|
|
22
|
+
onSelectNode(props.pRef, props.objRef);
|
|
23
|
+
props.onContentClick && props.onContentClick();
|
|
24
|
+
} // TODO: 这里读取props数据
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var TitleEl = /*#__PURE__*/React.createElement(TitleElement, {
|
|
28
|
+
icon: "icon-yewu",
|
|
29
|
+
delNode: delNode,
|
|
30
|
+
placeholder: props.nodeName,
|
|
31
|
+
nodeName: props.nodeName,
|
|
32
|
+
onTitleChange: onChange
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/React.createElement(NodeWrap, {
|
|
35
|
+
id: props.id,
|
|
36
|
+
titleStyle: {
|
|
37
|
+
backgroundColor: '#FFB319'
|
|
38
|
+
},
|
|
39
|
+
onContentClick: onContentClick,
|
|
40
|
+
title: TitleEl,
|
|
41
|
+
objRef: props.objRef
|
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: "text"
|
|
44
|
+
}, props.owner ? /*#__PURE__*/React.createElement("span", {
|
|
45
|
+
title: props.owner
|
|
46
|
+
}, props.owner) : /*#__PURE__*/React.createElement("span", {
|
|
47
|
+
className: "placeholder"
|
|
48
|
+
}, "\u8BF7\u9009\u62E9\u529E\u7406\u4EBA"), /*#__PURE__*/React.createElement(_IconFont, {
|
|
49
|
+
type: "icon-S_Arrow_SmallRight"
|
|
50
|
+
})));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default HandleNode;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import StartNode from './Start';
|
|
3
|
+
import ApproverNode from './Approver';
|
|
4
|
+
import NotifierNode from './Notifier';
|
|
5
|
+
import ConditionNode from './Condition';
|
|
6
|
+
import HandleNode from './Handle';
|
|
7
|
+
var NodeMaps = {
|
|
8
|
+
0: StartNode,
|
|
9
|
+
1: ApproverNode,
|
|
10
|
+
2: NotifierNode,
|
|
11
|
+
4: ConditionNode,
|
|
12
|
+
5: HandleNode
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function MatchNode(_ref) {
|
|
16
|
+
var config = _ref.config,
|
|
17
|
+
pRef = _ref.pRef;
|
|
18
|
+
var Node = NodeMaps[config.type] || null;
|
|
19
|
+
return Node && /*#__PURE__*/React.createElement(Node, Object.assign({}, config, {
|
|
20
|
+
objRef: config,
|
|
21
|
+
pRef: pRef,
|
|
22
|
+
key: config.id
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default MatchNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeItem } from '../interface';
|
|
2
|
+
interface INotifierNodeProps {
|
|
3
|
+
pRef: NodeItem;
|
|
4
|
+
objRef: NodeItem;
|
|
5
|
+
onContentClick?: () => void;
|
|
6
|
+
nodeName: string;
|
|
7
|
+
owner?: string;
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
declare function NotifierNode({ pRef, objRef, onContentClick, nodeName, owner, id }: INotifierNodeProps): JSX.Element;
|
|
11
|
+
export default NotifierNode;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import NodeWrap from './Wrap';
|
|
4
|
+
import TitleElement from './TitleElement';
|
|
5
|
+
import WFC from '../OperatorContext';
|
|
6
|
+
|
|
7
|
+
function NotifierNode(_ref) {
|
|
8
|
+
var pRef = _ref.pRef,
|
|
9
|
+
objRef = _ref.objRef,
|
|
10
|
+
onContentClick = _ref.onContentClick,
|
|
11
|
+
nodeName = _ref.nodeName,
|
|
12
|
+
owner = _ref.owner,
|
|
13
|
+
id = _ref.id;
|
|
14
|
+
|
|
15
|
+
var _useContext = useContext(WFC),
|
|
16
|
+
onDeleteNode = _useContext.onDeleteNode,
|
|
17
|
+
onSelectNode = _useContext.onSelectNode;
|
|
18
|
+
|
|
19
|
+
function delNode() {
|
|
20
|
+
onDeleteNode(pRef, objRef);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function onChange(val) {
|
|
24
|
+
pRef.childNode.nodeName = val;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function onContentClickAction() {
|
|
28
|
+
onSelectNode(pRef, objRef);
|
|
29
|
+
onContentClick && onContentClick();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var TitleEl = /*#__PURE__*/React.createElement(TitleElement, {
|
|
33
|
+
icon: "icon-biaoqian",
|
|
34
|
+
delNode: delNode,
|
|
35
|
+
placeholder: nodeName,
|
|
36
|
+
nodeName: nodeName,
|
|
37
|
+
onTitleChange: onChange
|
|
38
|
+
});
|
|
39
|
+
return /*#__PURE__*/React.createElement(NodeWrap, {
|
|
40
|
+
id: id,
|
|
41
|
+
titleStyle: {
|
|
42
|
+
backgroundColor: '#198CFF'
|
|
43
|
+
},
|
|
44
|
+
onContentClick: onContentClickAction,
|
|
45
|
+
title: TitleEl,
|
|
46
|
+
objRef: objRef
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: "text"
|
|
49
|
+
}, owner ? /*#__PURE__*/React.createElement("span", {
|
|
50
|
+
title: owner
|
|
51
|
+
}, owner) : /*#__PURE__*/React.createElement("span", {
|
|
52
|
+
className: "placeholder"
|
|
53
|
+
}, "\u8BF7\u9009\u62E9\u6284\u9001\u4EBA"), /*#__PURE__*/React.createElement(_IconFont, {
|
|
54
|
+
type: "icon-S_Arrow_SmallRight"
|
|
55
|
+
})));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default NotifierNode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import MatchNode from './Node';
|
|
3
|
+
|
|
4
|
+
function Render(_ref) {
|
|
5
|
+
var config = _ref.config,
|
|
6
|
+
pRef = _ref.pRef;
|
|
7
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MatchNode, {
|
|
8
|
+
pRef: pRef,
|
|
9
|
+
config: config
|
|
10
|
+
}), config.childNode && /*#__PURE__*/React.createElement(Render, {
|
|
11
|
+
pRef: config,
|
|
12
|
+
config: config.childNode
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default Render;
|