@cloud-app-dev/vidc 1.0.41 → 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/utils.d.ts +4 -0
- package/es/AppLayout/utils.js +9 -35
- 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.js +14 -1
- package/package.json +2 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function updateFunctionCount(name: string): Promise<void>;
|
|
2
|
+
export declare function getFunctionCount(): Promise<any[]>;
|
|
3
|
+
export declare function clearFunctionCount(): Promise<void>;
|
|
4
|
+
export declare function deleteFunctionItemCount(name: string): Promise<void>;
|
package/es/AppLayout/utils.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
|
-
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
5
2
|
import { LM_DB, SocketEmitter } from '@cloud-app-dev/utils';
|
|
6
3
|
import { orderBy } from 'lodash';
|
|
7
4
|
var db = new LM_DB('functionCount');
|
|
8
|
-
export function updateFunctionCount(
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function _updateFunctionCount() {
|
|
13
|
-
_updateFunctionCount = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(name) {
|
|
5
|
+
export function updateFunctionCount(name) {
|
|
6
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
14
7
|
var item, expireTime;
|
|
15
8
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
9
|
while (1) {
|
|
@@ -50,7 +43,7 @@ function _updateFunctionCount() {
|
|
|
50
43
|
});
|
|
51
44
|
|
|
52
45
|
case 11:
|
|
53
|
-
SocketEmitter.emit('updateFunctionCount');
|
|
46
|
+
SocketEmitter.emit('updateFunctionCount', null);
|
|
54
47
|
|
|
55
48
|
case 12:
|
|
56
49
|
case "end":
|
|
@@ -59,22 +52,16 @@ function _updateFunctionCount() {
|
|
|
59
52
|
}
|
|
60
53
|
}, _callee);
|
|
61
54
|
}));
|
|
62
|
-
return _updateFunctionCount.apply(this, arguments);
|
|
63
55
|
}
|
|
64
|
-
|
|
65
56
|
export function getFunctionCount() {
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _getFunctionCount() {
|
|
70
|
-
_getFunctionCount = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
57
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
71
58
|
var list;
|
|
72
59
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
73
60
|
while (1) {
|
|
74
61
|
switch (_context2.prev = _context2.next) {
|
|
75
62
|
case 0:
|
|
76
63
|
_context2.next = 2;
|
|
77
|
-
return db.query(
|
|
64
|
+
return db.query();
|
|
78
65
|
|
|
79
66
|
case 2:
|
|
80
67
|
list = _context2.sent;
|
|
@@ -87,15 +74,9 @@ function _getFunctionCount() {
|
|
|
87
74
|
}
|
|
88
75
|
}, _callee2);
|
|
89
76
|
}));
|
|
90
|
-
return _getFunctionCount.apply(this, arguments);
|
|
91
77
|
}
|
|
92
|
-
|
|
93
78
|
export function clearFunctionCount() {
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function _clearFunctionCount() {
|
|
98
|
-
_clearFunctionCount = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
79
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
99
80
|
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
100
81
|
while (1) {
|
|
101
82
|
switch (_context3.prev = _context3.next) {
|
|
@@ -110,15 +91,9 @@ function _clearFunctionCount() {
|
|
|
110
91
|
}
|
|
111
92
|
}, _callee3);
|
|
112
93
|
}));
|
|
113
|
-
return _clearFunctionCount.apply(this, arguments);
|
|
114
94
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return _deleteFunctionItemCount.apply(this, arguments);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function _deleteFunctionItemCount() {
|
|
121
|
-
_deleteFunctionItemCount = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(name) {
|
|
95
|
+
export function deleteFunctionItemCount(name) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
122
97
|
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
123
98
|
while (1) {
|
|
124
99
|
switch (_context4.prev = _context4.next) {
|
|
@@ -133,5 +108,4 @@ function _deleteFunctionItemCount() {
|
|
|
133
108
|
}
|
|
134
109
|
}, _callee4);
|
|
135
110
|
}));
|
|
136
|
-
return _deleteFunctionItemCount.apply(this, arguments);
|
|
137
111
|
}
|
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.js
CHANGED
|
@@ -11,6 +11,7 @@ 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
|
|
|
@@ -76,7 +77,8 @@ export function getJAVATaskData(data) {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
arr.push(item);
|
|
79
|
-
}
|
|
80
|
+
} // 检查最后一个nextTaskId
|
|
81
|
+
|
|
80
82
|
|
|
81
83
|
var nextNode = getNextNode(node.childNode);
|
|
82
84
|
|
|
@@ -95,6 +97,17 @@ export function getJAVATaskData(data) {
|
|
|
95
97
|
|
|
96
98
|
if (arr[0]) {
|
|
97
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
|
+
}
|
|
98
111
|
}
|
|
99
112
|
|
|
100
113
|
return arr;
|
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,6 +37,7 @@
|
|
|
38
37
|
"rc-queue-anim": "^2.0.0"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
40
|
+
"@cloud-app-dev/utils": "^2.0.1",
|
|
41
41
|
"@cloud-app-dev/basic-components": "^1.0.54",
|
|
42
42
|
"@types/chroma-js": "^2.1.3",
|
|
43
43
|
"@types/lodash": "^4.14.172",
|