@cloud-app-dev/vidc 1.0.38 → 1.0.42
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/es/AppLayout/AppHeader/index.d.ts +18 -0
- package/es/AppLayout/AppHeader/index.js +5 -6
- package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.d.ts +1 -0
- package/es/AppLayout/AppHorizontalMenu/SubGroup.d.ts +9 -0
- package/es/AppLayout/AppHorizontalMenu/index.d.ts +13 -0
- package/es/AppLayout/AppHorizontalMenu/index.js +6 -13
- package/es/AppLayout/AppInlineMenu/SubGroup.d.ts +9 -0
- package/es/AppLayout/AppInlineMenu/SubGroup.js +29 -70
- package/es/AppLayout/AppInlineMenu/index.d.ts +12 -0
- package/es/AppLayout/AppInlineMenu/index.js +10 -15
- package/es/AppLayout/AppLogo/index.d.ts +13 -0
- package/es/AppLayout/AppLogo/index.js +9 -10
- package/es/AppLayout/AppTools/index.d.ts +7 -9
- package/es/AppLayout/FunctionPreview/index.d.ts +22 -0
- package/es/AppLayout/FunctionPreview/index.js +33 -39
- package/es/AppLayout/Header/ListenceRoute.d.ts +5 -0
- package/es/AppLayout/Header/ListenceRoute.js +1 -1
- package/es/AppLayout/Header/ModifyPassword/index.d.ts +6 -0
- package/es/AppLayout/Header/ModifyPassword/index.js +72 -38
- package/es/AppLayout/Header/ModifyUserAvatar/index.d.ts +10 -0
- package/es/AppLayout/Header/ModifyUserAvatar/index.js +4 -10
- package/es/AppLayout/Header/NotifyAlarm.js +1 -2
- package/es/AppLayout/Header/Tools.d.ts +11 -0
- package/es/AppLayout/Header/Tools.js +2 -3
- package/es/AppLayout/Header/ToolsItem.d.ts +1 -0
- package/es/AppLayout/Header/ToolsItem.js +7 -14
- package/es/AppLayout/Header/UserAction.d.ts +10 -0
- package/es/AppLayout/Header/UserAction.js +28 -34
- package/es/AppLayout/Header/index.d.ts +9 -0
- package/es/AppLayout/Header/index.js +10 -22
- package/es/AppLayout/index.d.ts +10 -12
- package/es/AppLayout/index.js +2 -1
- package/es/AppLayout/utils.d.ts +4 -0
- package/es/AppLayout/utils.js +9 -35
- package/es/OrgUserTree/index.d.ts +6 -0
- package/es/OrgUserTree/index.js +4 -0
- package/es/PlaceTree/index.js +2 -1
- package/es/TreeMode/index.d.ts +1 -0
- package/es/TreeMode/index.js +10 -1
- package/es/WorkerFlow/Demo.js +2 -32
- package/es/WorkerFlow/Form/Approver.d.ts +3 -2
- package/es/WorkerFlow/Form/Approver.js +14 -3
- package/es/WorkerFlow/Form/Handle.d.ts +3 -2
- package/es/WorkerFlow/Form/Handle.js +13 -3
- package/es/WorkerFlow/Nodes/Add.js +16 -5
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +3 -4
- package/es/WorkerFlow/Nodes/AddOptionList.js +6 -6
- package/es/WorkerFlow/Nodes/Approver.js +1 -1
- package/es/WorkerFlow/Nodes/Condition.js +1 -1
- package/es/WorkerFlow/Nodes/Handle.js +1 -1
- package/es/WorkerFlow/Nodes/Notifier.js +1 -1
- package/es/WorkerFlow/Tools.d.ts +1 -1
- package/es/WorkerFlow/Tools.js +3 -2
- package/es/WorkerFlow/XML/utils.d.ts +1 -0
- package/es/WorkerFlow/XML/utils.js +30 -0
- package/es/WorkerFlow/index.js +9 -2
- package/es/WorkerFlow/interface.d.ts +3 -1
- package/es/WorkerFlow/utils.d.ts +2 -0
- package/es/WorkerFlow/utils.js +52 -14
- package/package.json +3 -3
- package/scripts/entry.js +1 -1
package/es/TreeMode/index.js
CHANGED
|
@@ -68,6 +68,10 @@ function TreeMode(_a) {
|
|
|
68
68
|
var treeData = useMemo(function () {
|
|
69
69
|
return mode === 'Place' ? treeHelper.computPlaceTree(list) : treeHelper.computTreeList(list);
|
|
70
70
|
}, [list, mode]);
|
|
71
|
+
/**
|
|
72
|
+
* @description 实现关键字展开节点
|
|
73
|
+
*/
|
|
74
|
+
|
|
71
75
|
useEffect(function () {
|
|
72
76
|
var _a, _b;
|
|
73
77
|
|
|
@@ -137,6 +141,10 @@ function TreeMode(_a) {
|
|
|
137
141
|
var treeName = useMemo(function () {
|
|
138
142
|
return mode === 'Place' ? 'areaName' : mode === 'Org' ? 'organizationName' : 'groupName';
|
|
139
143
|
}, [mode]);
|
|
144
|
+
/**
|
|
145
|
+
* @description 触发默认选中节点事件
|
|
146
|
+
*/
|
|
147
|
+
|
|
140
148
|
useEffect(function () {
|
|
141
149
|
var id = treeData[0] ? treeData[0][treeKey] : undefined;
|
|
142
150
|
|
|
@@ -185,6 +193,7 @@ function TreeMode(_a) {
|
|
|
185
193
|
|
|
186
194
|
TreeMode.defaultProps = {
|
|
187
195
|
mode: 'Bz',
|
|
188
|
-
className: ''
|
|
196
|
+
className: '',
|
|
197
|
+
treeNodeProps: {}
|
|
189
198
|
};
|
|
190
199
|
export default TreeMode;
|
package/es/WorkerFlow/Demo.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
import "antd/lib/drawer/style";
|
|
2
|
-
import _Drawer from "antd/lib/drawer";
|
|
3
1
|
import "antd/lib/config-provider/style";
|
|
4
2
|
import _ConfigProvider from "antd/lib/config-provider";
|
|
5
|
-
|
|
6
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
-
|
|
8
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
|
|
10
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
-
|
|
12
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13
|
-
|
|
14
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
15
|
-
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
|
|
18
|
-
import React, { useState } from 'react';
|
|
3
|
+
import React from 'react';
|
|
19
4
|
import WorkerFlow from './index';
|
|
20
5
|
var form = [{
|
|
21
6
|
label: '处理意见',
|
|
@@ -51,31 +36,16 @@ var form = [{
|
|
|
51
36
|
}];
|
|
52
37
|
|
|
53
38
|
var App = function App() {
|
|
54
|
-
var _useState = useState({
|
|
55
|
-
visible: false
|
|
56
|
-
}),
|
|
57
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
-
state = _useState2[0],
|
|
59
|
-
setState = _useState2[1];
|
|
60
|
-
|
|
61
39
|
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
62
40
|
prefixCls: "cloudapp"
|
|
63
41
|
}, /*#__PURE__*/React.createElement("div", {
|
|
64
42
|
style: {
|
|
65
43
|
height: 800
|
|
66
44
|
}
|
|
67
|
-
}, /*#__PURE__*/React.createElement(
|
|
68
|
-
onClick: function onClick(old) {
|
|
69
|
-
return setState({
|
|
70
|
-
visible: true
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}, "111"), /*#__PURE__*/React.createElement(WorkerFlow, {
|
|
45
|
+
}, /*#__PURE__*/React.createElement(WorkerFlow, {
|
|
74
46
|
form: form,
|
|
75
47
|
onChange: console.log,
|
|
76
48
|
hasTools: true
|
|
77
|
-
}), /*#__PURE__*/React.createElement(_Drawer, {
|
|
78
|
-
visible: state.visible
|
|
79
49
|
})));
|
|
80
50
|
};
|
|
81
51
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NodeItem, WorkerFlowFormType } from '../interface';
|
|
2
2
|
interface IApproverFormProps {
|
|
3
3
|
form: WorkerFlowFormType[];
|
|
4
|
-
item
|
|
4
|
+
item: NodeItem;
|
|
5
5
|
onChange: (data: any) => void;
|
|
6
|
+
config: NodeItem;
|
|
6
7
|
}
|
|
7
|
-
declare function ApproverForm({ form, item, onChange }: IApproverFormProps): JSX.Element;
|
|
8
|
+
declare function ApproverForm({ form, item, onChange, config }: IApproverFormProps): JSX.Element;
|
|
8
9
|
export default ApproverForm;
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import UserSet from './UserSet';
|
|
3
3
|
import FormAuth from './FormAuth';
|
|
4
|
+
import { getParentNodeById } from '../XML/utils';
|
|
4
5
|
|
|
5
6
|
function ApproverForm(_ref) {
|
|
6
7
|
var form = _ref.form,
|
|
7
8
|
item = _ref.item,
|
|
8
|
-
onChange = _ref.onChange
|
|
9
|
+
onChange = _ref.onChange,
|
|
10
|
+
config = _ref.config;
|
|
11
|
+
var parentNodeType = useMemo(function () {
|
|
12
|
+
var _a;
|
|
13
|
+
|
|
14
|
+
return (_a = getParentNodeById(config, item.id)) === null || _a === void 0 ? void 0 : _a.bpmnType;
|
|
15
|
+
}, [config, item.id]);
|
|
16
|
+
var includeUserTypes = useMemo(function () {
|
|
17
|
+
return parentNodeType === 'startEvent' || parentNodeType === 'sequenceFlow' ? [1, 3, 4, 5] : [1, 2, 3, 4, 5];
|
|
18
|
+
}, []);
|
|
9
19
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UserSet, {
|
|
10
20
|
chargeLevel: item.chargeLevel,
|
|
11
21
|
userType: item.userType,
|
|
12
22
|
emptyUsers: item.emptyUserList,
|
|
13
23
|
nodeUserList: item.nodeUserList,
|
|
14
24
|
usersHandType: item.usersHandType,
|
|
15
|
-
onChange: onChange
|
|
25
|
+
onChange: onChange,
|
|
26
|
+
includeUserTypes: includeUserTypes
|
|
16
27
|
}), /*#__PURE__*/React.createElement(FormAuth, {
|
|
17
28
|
form: form,
|
|
18
29
|
onChange: onChange
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NodeItem, WorkerFlowFormType } from '../interface';
|
|
2
2
|
interface IHandleFormProps {
|
|
3
3
|
form: WorkerFlowFormType[];
|
|
4
|
-
item
|
|
4
|
+
item: NodeItem;
|
|
5
5
|
onChange: (data: any) => void;
|
|
6
|
+
config: NodeItem;
|
|
6
7
|
}
|
|
7
|
-
declare function HandleForm({ form, item, onChange }: IHandleFormProps): JSX.Element;
|
|
8
|
+
declare function HandleForm({ form, item, onChange, config }: IHandleFormProps): JSX.Element;
|
|
8
9
|
export default HandleForm;
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import UserSet from './UserSet';
|
|
3
3
|
import FormAuth from './FormAuth';
|
|
4
|
+
import { getParentNodeById } from '../XML/utils';
|
|
4
5
|
|
|
5
6
|
function HandleForm(_ref) {
|
|
6
7
|
var form = _ref.form,
|
|
7
8
|
item = _ref.item,
|
|
8
|
-
onChange = _ref.onChange
|
|
9
|
+
onChange = _ref.onChange,
|
|
10
|
+
config = _ref.config;
|
|
11
|
+
var parentNodeType = useMemo(function () {
|
|
12
|
+
var _a;
|
|
13
|
+
|
|
14
|
+
return (_a = getParentNodeById(config, item.id)) === null || _a === void 0 ? void 0 : _a.bpmnType;
|
|
15
|
+
}, [config, item.id]);
|
|
16
|
+
var includeUserTypes = useMemo(function () {
|
|
17
|
+
return parentNodeType === 'startEvent' || parentNodeType === 'sequenceFlow' ? [1, 3] : [1, 2, 3];
|
|
18
|
+
}, []);
|
|
9
19
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UserSet, {
|
|
10
20
|
chargeLevel: item.chargeLevel,
|
|
11
21
|
userType: item.userType,
|
|
12
22
|
nodeUserList: item.nodeUserList,
|
|
13
23
|
emptyUsers: item.emptyUserList,
|
|
14
24
|
onChange: onChange,
|
|
15
|
-
includeUserTypes:
|
|
25
|
+
includeUserTypes: includeUserTypes,
|
|
16
26
|
usersHandType: item.usersHandType
|
|
17
27
|
}), /*#__PURE__*/React.createElement(FormAuth, {
|
|
18
28
|
form: form,
|
|
@@ -19,9 +19,6 @@ import QueueAnim from 'rc-queue-anim';
|
|
|
19
19
|
|
|
20
20
|
function AddNode(_ref) {
|
|
21
21
|
var node = _ref.node;
|
|
22
|
-
|
|
23
|
-
var _a;
|
|
24
|
-
|
|
25
22
|
var boxRef = useRef(null);
|
|
26
23
|
|
|
27
24
|
var _useState = useState(false),
|
|
@@ -58,6 +55,21 @@ function AddNode(_ref) {
|
|
|
58
55
|
document.body.removeEventListener('click', fn, false);
|
|
59
56
|
};
|
|
60
57
|
}, [showPop]);
|
|
58
|
+
|
|
59
|
+
var types = function () {
|
|
60
|
+
var _a;
|
|
61
|
+
|
|
62
|
+
if (node.type === 0 || node.bpmnType === 'sequenceFlow') {
|
|
63
|
+
return [1, 3];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (((_a = node.childNode) === null || _a === void 0 ? void 0 : _a.type) === 9) {
|
|
67
|
+
return [1, 2, 3];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return [1, 2, 3, 4];
|
|
71
|
+
}();
|
|
72
|
+
|
|
61
73
|
return /*#__PURE__*/React.createElement("div", {
|
|
62
74
|
className: "add-node-btn-box",
|
|
63
75
|
ref: boxRef
|
|
@@ -68,8 +80,7 @@ function AddNode(_ref) {
|
|
|
68
80
|
key: "add-popover"
|
|
69
81
|
}, /*#__PURE__*/React.createElement(AddNodeList, {
|
|
70
82
|
onOptionClick: onOptionClick,
|
|
71
|
-
|
|
72
|
-
childType: (_a = node.childNode) === null || _a === void 0 ? void 0 : _a.type
|
|
83
|
+
types: types
|
|
73
84
|
})) : /*#__PURE__*/React.createElement(React.Fragment, {
|
|
74
85
|
key: "cancel-popover"
|
|
75
86
|
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("button", {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { NodeType } from '../interface';
|
|
1
|
+
import { AddNodeType, NodeType } from '../interface';
|
|
2
2
|
interface IAddNodeListProps {
|
|
3
3
|
onOptionClick: (type: NodeType) => void;
|
|
4
|
-
|
|
5
|
-
childType: NodeType;
|
|
4
|
+
types: AddNodeType[];
|
|
6
5
|
}
|
|
7
|
-
declare function AddNodeList({ onOptionClick,
|
|
6
|
+
declare function AddNodeList({ onOptionClick, types }: IAddNodeListProps): JSX.Element;
|
|
8
7
|
export default AddNodeList;
|
|
@@ -4,11 +4,11 @@ import { OptionNames, OptionTypes } from './Constants';
|
|
|
4
4
|
|
|
5
5
|
function AddNodeList(_ref) {
|
|
6
6
|
var onOptionClick = _ref.onOptionClick,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
_ref$types = _ref.types,
|
|
8
|
+
types = _ref$types === void 0 ? [1, 2, 3, 4] : _ref$types;
|
|
9
9
|
return /*#__PURE__*/React.createElement("div", {
|
|
10
10
|
className: "add-node-popover-body"
|
|
11
|
-
}, /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
11
|
+
}, types.includes(1) && /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
12
12
|
icon: "icon-yewu",
|
|
13
13
|
type: "approver",
|
|
14
14
|
onClick: function onClick() {
|
|
@@ -16,7 +16,7 @@ function AddNodeList(_ref) {
|
|
|
16
16
|
},
|
|
17
17
|
color: OptionNames[OptionTypes.APPROVER].color,
|
|
18
18
|
name: OptionNames[OptionTypes.APPROVER].name
|
|
19
|
-
}),
|
|
19
|
+
}), types.includes(2) && /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
20
20
|
icon: "icon-biaoqian",
|
|
21
21
|
type: "notifier",
|
|
22
22
|
onClick: function onClick() {
|
|
@@ -24,7 +24,7 @@ function AddNodeList(_ref) {
|
|
|
24
24
|
},
|
|
25
25
|
color: OptionNames[OptionTypes.NOTIFIER].color,
|
|
26
26
|
name: OptionNames[OptionTypes.NOTIFIER].name
|
|
27
|
-
}), /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
27
|
+
}), types.includes(3) && /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
28
28
|
icon: "icon-yewu",
|
|
29
29
|
type: "handle",
|
|
30
30
|
onClick: function onClick() {
|
|
@@ -32,7 +32,7 @@ function AddNodeList(_ref) {
|
|
|
32
32
|
},
|
|
33
33
|
color: OptionNames[OptionTypes.HANDLE].color,
|
|
34
34
|
name: OptionNames[OptionTypes.HANDLE].name
|
|
35
|
-
}),
|
|
35
|
+
}), types.includes(4) && /*#__PURE__*/React.createElement(AddNodeOption, {
|
|
36
36
|
icon: "icon-ListTree",
|
|
37
37
|
type: "condition",
|
|
38
38
|
onClick: function onClick() {
|
|
@@ -115,7 +115,7 @@ function ConditionNode(_ref3) {
|
|
|
115
115
|
owner: item.owner,
|
|
116
116
|
first: index === 0,
|
|
117
117
|
onBranchClick: function onBranchClick() {
|
|
118
|
-
return onSelectNode(node, index);
|
|
118
|
+
return onSelectNode(node, parentNode, index);
|
|
119
119
|
},
|
|
120
120
|
delBranch: function delBranch() {
|
|
121
121
|
return branches.length === 2 ? onDeleteNode(parentNode, node) : onDeleteNode(parentNode, node, NodeTypes.BRANCH, index);
|
package/es/WorkerFlow/Tools.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ interface IZoomLayoutProps {
|
|
|
4
4
|
hasTools?: boolean;
|
|
5
5
|
exportBpmnFile?: () => any;
|
|
6
6
|
}
|
|
7
|
-
declare function ZoomLayout({ children, exportBpmnFile }: IZoomLayoutProps): JSX.Element;
|
|
7
|
+
declare function ZoomLayout({ children, exportBpmnFile, hasTools }: IZoomLayoutProps): JSX.Element;
|
|
8
8
|
export default ZoomLayout;
|
package/es/WorkerFlow/Tools.js
CHANGED
|
@@ -20,7 +20,8 @@ var ZOOM = {
|
|
|
20
20
|
|
|
21
21
|
function ZoomLayout(_ref) {
|
|
22
22
|
var children = _ref.children,
|
|
23
|
-
exportBpmnFile = _ref.exportBpmnFile
|
|
23
|
+
exportBpmnFile = _ref.exportBpmnFile,
|
|
24
|
+
hasTools = _ref.hasTools;
|
|
24
25
|
|
|
25
26
|
// 放大比例, 按百分制给 100 为 100%
|
|
26
27
|
var _useState = useState(100),
|
|
@@ -60,7 +61,7 @@ function ZoomLayout(_ref) {
|
|
|
60
61
|
onClick: function onClick() {
|
|
61
62
|
return zoomSize(ZOOM.UP);
|
|
62
63
|
}
|
|
63
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
})), hasTools && /*#__PURE__*/React.createElement("div", {
|
|
64
65
|
className: "tools"
|
|
65
66
|
}, /*#__PURE__*/React.createElement("button", {
|
|
66
67
|
onClick: exportBpmnFile
|
|
@@ -2,4 +2,5 @@ import { NodeItem } from '../interface';
|
|
|
2
2
|
export declare function createId(type: string): string;
|
|
3
3
|
export declare function getEndEventId(data: NodeItem): string;
|
|
4
4
|
export declare function getNodeById(data: NodeItem, id: string): NodeItem;
|
|
5
|
+
export declare function getParentNodeById(data: NodeItem, id: string): NodeItem;
|
|
5
6
|
export declare function transformArray(data: NodeItem): NodeItem[];
|
|
@@ -45,6 +45,36 @@ export function getNodeById(data, id) {
|
|
|
45
45
|
runGetNode(data);
|
|
46
46
|
return nodeItem;
|
|
47
47
|
}
|
|
48
|
+
export function getParentNodeById(data, id) {
|
|
49
|
+
var nodeItem;
|
|
50
|
+
|
|
51
|
+
var runGetNode = function runGetNode(node) {
|
|
52
|
+
if (!node || !!nodeItem) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (!node.childNode) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (node.childNode.id === id) {
|
|
61
|
+
nodeItem = node;
|
|
62
|
+
} else {
|
|
63
|
+
if (node.conditionNodes && node.conditionNodes.length > 0) {
|
|
64
|
+
node.conditionNodes.forEach(function (item) {
|
|
65
|
+
runGetNode(item);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (node.childNode) {
|
|
70
|
+
runGetNode(node.childNode);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
runGetNode(data);
|
|
76
|
+
return nodeItem;
|
|
77
|
+
}
|
|
48
78
|
export function transformArray(data) {
|
|
49
79
|
var arr = [];
|
|
50
80
|
|
package/es/WorkerFlow/index.js
CHANGED
|
@@ -166,7 +166,7 @@ function WorkerFlow(_ref, ref) {
|
|
|
166
166
|
} // 获取节点
|
|
167
167
|
|
|
168
168
|
|
|
169
|
-
function onSelectNode(node, index) {
|
|
169
|
+
function onSelectNode(node, parentNode, index) {
|
|
170
170
|
if (readOnly) {
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
@@ -209,13 +209,20 @@ function WorkerFlow(_ref, ref) {
|
|
|
209
209
|
return v.id !== node.conditionNodes[index].id ? v.conditionList : [];
|
|
210
210
|
})).flat() : [];
|
|
211
211
|
var nodeItem = node.type === 4 ? node.conditionNodes[index] : node;
|
|
212
|
+
var from = nodeItem.form ? form.map(function (v) {
|
|
213
|
+
return nodeItem.form.find(function (v2) {
|
|
214
|
+
return v2.name === v.name;
|
|
215
|
+
}) || v;
|
|
216
|
+
}) : form;
|
|
212
217
|
drawer.open({
|
|
213
218
|
title: nodeName,
|
|
214
219
|
width: 640,
|
|
215
220
|
content: /*#__PURE__*/React.createElement(FormContent, {
|
|
216
221
|
useConditionFields: useConditionFields,
|
|
217
|
-
form:
|
|
222
|
+
form: from,
|
|
218
223
|
item: nodeItem,
|
|
224
|
+
config: config,
|
|
225
|
+
parentNode: parentNode,
|
|
219
226
|
onChange: onChange,
|
|
220
227
|
index: index
|
|
221
228
|
}),
|
|
@@ -51,7 +51,7 @@ export interface WorkerFlowContext {
|
|
|
51
51
|
form: WorkerFlowFormType[];
|
|
52
52
|
onInsertNode: (type: NodeType, node: NodeItem) => void;
|
|
53
53
|
onDeleteNode: (parentNode: NodeItem, node: NodeItem, type?: NodeType, index?: number) => void;
|
|
54
|
-
onSelectNode: (node: NodeItem, index?: number) => void;
|
|
54
|
+
onSelectNode: (node: NodeItem, parentNode: NodeItem, index?: number) => void;
|
|
55
55
|
updateNode: () => void;
|
|
56
56
|
readOnly?: boolean;
|
|
57
57
|
}
|
|
@@ -87,3 +87,5 @@ export type SubmitData = {
|
|
|
87
87
|
useFormKeys: string[];
|
|
88
88
|
taskList: SubmitFlowItemType[];
|
|
89
89
|
};
|
|
90
|
+
|
|
91
|
+
export type AddNodeType = 1 | 2 | 3 | 4; //1审核人,2抄送人,3办理人,4条件分支
|
package/es/WorkerFlow/utils.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { NodeItem, SubmitFlowItemType } from './interface';
|
|
2
2
|
export declare function getJAVATaskData(data: NodeItem): SubmitFlowItemType[];
|
|
3
|
+
export declare function getNextTaskId(node: NodeItem): string | undefined;
|
|
4
|
+
export declare function getNextNode(node: NodeItem): NodeItem | undefined;
|
|
3
5
|
export declare function filterNoticeNode(data: NodeItem): NodeItem;
|
|
4
6
|
export declare function getUserFormKeys(data: NodeItem): string[];
|
package/es/WorkerFlow/utils.js
CHANGED
|
@@ -11,11 +11,12 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
11
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
12
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
|
+
import { getNodeById } from './XML/utils';
|
|
14
15
|
export function getJAVATaskData(data) {
|
|
15
16
|
var arr = [];
|
|
16
17
|
|
|
17
|
-
var fn = function fn(node) {
|
|
18
|
-
var _a, _b, _c, _d
|
|
18
|
+
var fn = function fn(node, _nextNode) {
|
|
19
|
+
var _a, _b, _c, _d;
|
|
19
20
|
|
|
20
21
|
if (node.bpmnType === 'userTask') {
|
|
21
22
|
var item = {
|
|
@@ -51,12 +52,17 @@ export function getJAVATaskData(data) {
|
|
|
51
52
|
item.multiVariableName = "assigneeList_".concat(node.id);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
if (((_b = node.childNode) === null || _b === void 0 ? void 0 : _b.bpmnType) === 'userTask'
|
|
55
|
-
item.nextTaskId = node.childNode
|
|
55
|
+
if (((_b = node.childNode) === null || _b === void 0 ? void 0 : _b.bpmnType) === 'userTask') {
|
|
56
|
+
item.nextTaskId = getNextTaskId(node.childNode);
|
|
57
|
+
} // 连接条件nextTaskId
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if (!node.childNode) {
|
|
61
|
+
item.nextTaskId = _nextNode === null || _nextNode === void 0 ? void 0 : _nextNode.id;
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
if (node.form) {
|
|
59
|
-
item.formAuthority = JSON.stringify((
|
|
65
|
+
item.formAuthority = JSON.stringify((_c = node.form) === null || _c === void 0 ? void 0 : _c.map(function (v) {
|
|
60
66
|
return {
|
|
61
67
|
formAuth: v.auth,
|
|
62
68
|
formVariableName: v.name
|
|
@@ -64,27 +70,26 @@ export function getJAVATaskData(data) {
|
|
|
64
70
|
}));
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
if (((
|
|
73
|
+
if (((_d = node.childNode) === null || _d === void 0 ? void 0 : _d.type) === 2) {
|
|
68
74
|
item.copyUserIds = node.childNode.nodeUserList.map(function (v) {
|
|
69
75
|
return v.value;
|
|
70
76
|
});
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
arr.push(item);
|
|
74
|
-
}
|
|
80
|
+
} // 检查最后一个nextTaskId
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
var nextNode = getNextNode(node.childNode);
|
|
75
84
|
|
|
76
85
|
if (node.conditionNodes) {
|
|
77
86
|
node.conditionNodes.forEach(function (item) {
|
|
78
|
-
fn(item);
|
|
87
|
+
fn(item, nextNode);
|
|
79
88
|
});
|
|
80
89
|
}
|
|
81
90
|
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
fn(node.childNode.childNode);
|
|
85
|
-
} else {
|
|
86
|
-
fn(node.childNode);
|
|
87
|
-
}
|
|
91
|
+
if (nextNode) {
|
|
92
|
+
fn(nextNode, _nextNode);
|
|
88
93
|
}
|
|
89
94
|
};
|
|
90
95
|
|
|
@@ -92,10 +97,43 @@ export function getJAVATaskData(data) {
|
|
|
92
97
|
|
|
93
98
|
if (arr[0]) {
|
|
94
99
|
arr[0].taskFirstBlank = 1;
|
|
100
|
+
} // 修正最后一个节点的nextid
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
var lastNextId = arr[arr.length - 1].nextTaskId;
|
|
104
|
+
|
|
105
|
+
if (lastNextId) {
|
|
106
|
+
var lastNode = getNodeById(data, lastNextId);
|
|
107
|
+
|
|
108
|
+
if (lastNode.type === 2 || lastNode.bpmnType === 'endEvent') {
|
|
109
|
+
arr[arr.length - 1].nextTaskId = undefined;
|
|
110
|
+
}
|
|
95
111
|
}
|
|
96
112
|
|
|
97
113
|
return arr;
|
|
98
114
|
}
|
|
115
|
+
export function getNextTaskId(node) {
|
|
116
|
+
if (!node) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (node.type !== 2) {
|
|
121
|
+
return node.id;
|
|
122
|
+
} else {
|
|
123
|
+
return getNextTaskId(node.childNode);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export function getNextNode(node) {
|
|
127
|
+
if (!node) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (node.type !== 2) {
|
|
132
|
+
return node;
|
|
133
|
+
} else {
|
|
134
|
+
return getNextNode(node.childNode);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
99
137
|
export function filterNoticeNode(data) {
|
|
100
138
|
var newData = _.cloneDeep(data);
|
|
101
139
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@cloud-app-dev/vidc",
|
|
4
4
|
"description": "Video Image Data Componennts",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.42",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "dumi dev",
|
|
8
8
|
"docs:build": "dumi build",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
]
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@cloud-app-dev/utils": "^1.0.2",
|
|
34
33
|
"chroma-js": "^2.1.2",
|
|
35
34
|
"jsencrypt": "^3.2.1",
|
|
36
35
|
"lodash": "^4.17.21",
|
|
@@ -38,7 +37,8 @@
|
|
|
38
37
|
"rc-queue-anim": "^2.0.0"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"@cloud-app-dev/
|
|
40
|
+
"@cloud-app-dev/utils": "^2.0.1",
|
|
41
|
+
"@cloud-app-dev/basic-components": "^1.0.54",
|
|
42
42
|
"@types/chroma-js": "^2.1.3",
|
|
43
43
|
"@types/lodash": "^4.14.172",
|
|
44
44
|
"@umijs/test": "^3.0.5",
|
package/scripts/entry.js
CHANGED