@cloud-app-dev/vidc 1.0.43 → 1.0.47
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 +1 -1
- package/es/Api/index.d.ts +1 -1
- package/es/Api/index.js +10 -3
- package/es/AppLayout/Header/ModifyPassword/index.js +1 -1
- package/es/List/index.css +6 -0
- package/es/TreeMode/demo.js +3 -1
- package/es/TreeMode/index.css +7 -5
- package/es/TreeMode/index.d.ts +2 -1
- package/es/TreeMode/index.js +6 -3
- package/es/TreeTitle/index.css +1 -0
- package/es/UserSelect/demo.js +4 -3
- package/es/UserSelect/index.d.ts +8 -0
- package/es/UserSelect/index.js +32 -9
- package/es/WorkerFlow/Demo.js +5 -2
- package/es/WorkerFlow/Form/Approver.js +2 -2
- package/es/WorkerFlow/Form/Condition.js +1 -1
- package/es/WorkerFlow/Form/GroupSelect.js +18 -3
- package/es/WorkerFlow/Form/Handle.js +2 -2
- package/es/WorkerFlow/Form/LevelGroupSelect.js +33 -11
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +22 -4
- package/es/WorkerFlow/Form/UserSelect.js +18 -3
- package/es/WorkerFlow/Form/utils.d.ts +1 -0
- package/es/WorkerFlow/Form/utils.js +21 -0
- package/es/WorkerFlow/Nodes/Approver.js +4 -2
- package/es/WorkerFlow/Nodes/Condition.js +15 -9
- package/es/WorkerFlow/Nodes/Constants.js +1 -1
- package/es/WorkerFlow/Nodes/Handle.js +4 -2
- package/es/WorkerFlow/Nodes/Notifier.js +4 -2
- package/es/WorkerFlow/Nodes/TitleElement.js +2 -2
- package/es/WorkerFlow/Nodes/Wrap.js +8 -2
- package/es/WorkerFlow/index.css +6 -2
- package/es/WorkerFlow/index.d.ts +1 -0
- package/es/WorkerFlow/index.js +12 -7
- package/es/WorkerFlow/interface.d.ts +2 -1
- package/es/WorkerFlow/utils.d.ts +1 -0
- package/es/WorkerFlow/utils.js +10 -2
- package/package.json +2 -2
package/.umirc.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { defineConfig } from 'dumi';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
4
|
const token =
|
|
5
|
-
'eyJhbGciOiJIUzI1NiJ9.
|
|
5
|
+
'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTYzODA3ODM3NjE0NSwidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjM3ODE5MTc2MTQ1fQ.x9o6vi8T5YW7P05AkeQh1Sse8sp6tGs7zxUWgB_rxtk';
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
title: '云应用-业务组件库',
|
package/es/Api/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { UserInfo } from '@cloud-app-dev/basic-components/es/Store/app';
|
|
|
3
3
|
import { BzTreeItemType, PostItemType } from '../core';
|
|
4
4
|
declare class Api {
|
|
5
5
|
getOrgs(): Promise<OrgItemType[]>;
|
|
6
|
-
getUsers(organizationId: string): Promise<UserInfo[]>;
|
|
6
|
+
getUsers(organizationId: string, params?: any, filterUserIds?: string[]): Promise<UserInfo[]>;
|
|
7
7
|
getPosts(orgId: string): Promise<PostItemType[]>;
|
|
8
8
|
getDeviceBzTree(): Promise<BzTreeItemType[]>;
|
|
9
9
|
getCustomDeviceGroup(): Promise<BzTreeItemType[]>;
|
package/es/Api/index.js
CHANGED
|
@@ -49,6 +49,11 @@ var Api = /*#__PURE__*/function () {
|
|
|
49
49
|
}, {
|
|
50
50
|
key: "getUsers",
|
|
51
51
|
value: function getUsers(organizationId) {
|
|
52
|
+
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
53
|
+
var filterUserIds = arguments.length > 2 ? arguments[2] : undefined;
|
|
54
|
+
|
|
55
|
+
var _a, _b;
|
|
56
|
+
|
|
52
57
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
53
58
|
var res;
|
|
54
59
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -61,18 +66,20 @@ var Api = /*#__PURE__*/function () {
|
|
|
61
66
|
method: 'post',
|
|
62
67
|
requestId: 'queryUsers',
|
|
63
68
|
headers: getHeader(),
|
|
64
|
-
data: {
|
|
69
|
+
data: Object.assign({
|
|
65
70
|
containSubOrganization: 1,
|
|
66
71
|
limit: 10000,
|
|
67
72
|
offset: 0,
|
|
68
73
|
organizationId: organizationId,
|
|
69
74
|
validState: ['104406']
|
|
70
|
-
}
|
|
75
|
+
}, params)
|
|
71
76
|
});
|
|
72
77
|
|
|
73
78
|
case 2:
|
|
74
79
|
res = _context2.sent;
|
|
75
|
-
return _context2.abrupt("return", res.data.list)
|
|
80
|
+
return _context2.abrupt("return", !filterUserIds ? (_a = res.data) === null || _a === void 0 ? void 0 : _a.list : (((_b = res.data) === null || _b === void 0 ? void 0 : _b.list) || []).filter(function (v) {
|
|
81
|
+
return !filterUserIds.includes(v.id);
|
|
82
|
+
}));
|
|
76
83
|
|
|
77
84
|
case 4:
|
|
78
85
|
case "end":
|
|
@@ -88,7 +88,7 @@ function ModifyPassword(_ref) {
|
|
|
88
88
|
case 14:
|
|
89
89
|
_context.prev = 14;
|
|
90
90
|
_context.t0 = _context["catch"](1);
|
|
91
|
-
console.
|
|
91
|
+
console.error(_context.t0);
|
|
92
92
|
|
|
93
93
|
try {
|
|
94
94
|
msg = (_a = _context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.data) === null || _a === void 0 ? void 0 : _a.message;
|
package/es/List/index.css
CHANGED
package/es/TreeMode/demo.js
CHANGED
|
@@ -20,7 +20,9 @@ function App() {
|
|
|
20
20
|
mode: "Custom"
|
|
21
21
|
}), /*#__PURE__*/React.createElement(BsTree, {
|
|
22
22
|
title: "\u884C\u653F\u533A\u5212",
|
|
23
|
-
mode: "Place"
|
|
23
|
+
mode: "Place",
|
|
24
|
+
checkable: true,
|
|
25
|
+
checkStrictly: true
|
|
24
26
|
}), /*#__PURE__*/React.createElement(BsTree, {
|
|
25
27
|
title: "\u7EC4\u7EC7\u673A\u6784",
|
|
26
28
|
mode: "Org"
|
package/es/TreeMode/index.css
CHANGED
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
flex: 1;
|
|
14
14
|
overflow: auto;
|
|
15
15
|
}
|
|
16
|
-
.bc-type-tree-layout .lm-base-tree-component .cloudapp-tree-treenode span.cloudapp-tree-node-content-wrapper:hover:after,
|
|
17
|
-
.bc-type-tree-layout .lm-base-tree-component .cloudapp-tree-treenode span.cloudapp-tree-node-content-wrapper.cloudapp-tree-node-selected:after {
|
|
18
|
-
left: 10px;
|
|
19
|
-
width: calc(100% - 10px);
|
|
20
|
-
}
|
|
21
16
|
.bc-type-tree-layout .cloudapp-tree {
|
|
22
17
|
height: 100%;
|
|
23
18
|
overflow: auto;
|
|
@@ -34,3 +29,10 @@
|
|
|
34
29
|
display: inline-flex;
|
|
35
30
|
justify-content: space-between;
|
|
36
31
|
}
|
|
32
|
+
.bc-type-tree-layout .cloudapp-tree-title > span .anticon {
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
color: var(--icon);
|
|
35
|
+
padding-right: 6px;
|
|
36
|
+
position: relative;
|
|
37
|
+
top: 1px;
|
|
38
|
+
}
|
package/es/TreeMode/index.d.ts
CHANGED
|
@@ -11,12 +11,13 @@ interface IBsTreeProps extends BaseTreeProps {
|
|
|
11
11
|
onDefailtSelect?: (id?: string) => void;
|
|
12
12
|
mode?: 'Bz' | 'Custom' | 'Place' | 'Org';
|
|
13
13
|
}
|
|
14
|
-
declare function TreeMode({ title, className, renderHeader, inputPlaceholder, treeNodeProps, onDefailtSelect, mode, ...props }: IBsTreeProps): JSX.Element;
|
|
14
|
+
declare function TreeMode({ title, className, renderHeader, inputPlaceholder, treeNodeProps, onDefailtSelect, mode, showIcon, ...props }: IBsTreeProps): JSX.Element;
|
|
15
15
|
declare namespace TreeMode {
|
|
16
16
|
var defaultProps: {
|
|
17
17
|
mode: string;
|
|
18
18
|
className: string;
|
|
19
19
|
treeNodeProps: {};
|
|
20
|
+
showIcon: boolean;
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
export default TreeMode;
|
package/es/TreeMode/index.js
CHANGED
|
@@ -40,7 +40,8 @@ function TreeMode(_a) {
|
|
|
40
40
|
treeNodeProps = _a.treeNodeProps,
|
|
41
41
|
onDefailtSelect = _a.onDefailtSelect,
|
|
42
42
|
mode = _a.mode,
|
|
43
|
-
|
|
43
|
+
showIcon = _a.showIcon,
|
|
44
|
+
props = __rest(_a, ["title", "className", "renderHeader", "inputPlaceholder", "treeNodeProps", "onDefailtSelect", "mode", "showIcon"]);
|
|
44
45
|
|
|
45
46
|
var _useState = useState({
|
|
46
47
|
keyword: undefined,
|
|
@@ -168,6 +169,7 @@ function TreeMode(_a) {
|
|
|
168
169
|
}), renderHeader && renderHeader(), list.length > 0 && /*#__PURE__*/React.createElement(_Tree, Object.assign({}, props, {
|
|
169
170
|
treeData: treeData,
|
|
170
171
|
key: state.focusKey,
|
|
172
|
+
showIcon: showIcon,
|
|
171
173
|
onExpand: function onExpand(keys) {
|
|
172
174
|
return setState(function (old) {
|
|
173
175
|
return Object.assign(Object.assign({}, old), {
|
|
@@ -185,7 +187,7 @@ function TreeMode(_a) {
|
|
|
185
187
|
},
|
|
186
188
|
icon: function icon(node) {
|
|
187
189
|
return /*#__PURE__*/React.createElement(_IconFont, {
|
|
188
|
-
type: "".concat(treeData.length
|
|
190
|
+
type: "".concat(treeData.length === 1 && node.id === treeData[0].id ? 'icon-S_Bar_Home' : mode === 'Place' ? node.level > 4 ? 'icon-S_Place_Place' : 'icon-S_Bar_Add' : 'icon-S_Photo_ListTree')
|
|
189
191
|
});
|
|
190
192
|
}
|
|
191
193
|
})));
|
|
@@ -194,6 +196,7 @@ function TreeMode(_a) {
|
|
|
194
196
|
TreeMode.defaultProps = {
|
|
195
197
|
mode: 'Bz',
|
|
196
198
|
className: '',
|
|
197
|
-
treeNodeProps: {}
|
|
199
|
+
treeNodeProps: {},
|
|
200
|
+
showIcon: true
|
|
198
201
|
};
|
|
199
202
|
export default TreeMode;
|
package/es/TreeTitle/index.css
CHANGED
package/es/UserSelect/demo.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "antd/lib/config-provider/style";
|
|
2
2
|
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import UserSelect from './index';
|
|
5
5
|
|
|
6
6
|
function App() {
|
|
7
7
|
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
@@ -12,8 +12,9 @@ function App() {
|
|
|
12
12
|
width: 1000,
|
|
13
13
|
height: 600
|
|
14
14
|
}
|
|
15
|
-
}, /*#__PURE__*/React.createElement(
|
|
16
|
-
selectUsers: []
|
|
15
|
+
}, /*#__PURE__*/React.createElement(UserSelect, {
|
|
16
|
+
selectUsers: [],
|
|
17
|
+
filterUserIds: ['101003000142']
|
|
17
18
|
})));
|
|
18
19
|
}
|
|
19
20
|
|
package/es/UserSelect/index.d.ts
CHANGED
|
@@ -5,6 +5,14 @@ interface IUserSelectProps {
|
|
|
5
5
|
selectUsers: UserInfo[];
|
|
6
6
|
onChange?: (users: UserInfo[]) => void;
|
|
7
7
|
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description 过滤不需要的用户
|
|
10
|
+
*/
|
|
11
|
+
filterUserIds?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* @description getUser其他参数
|
|
14
|
+
*/
|
|
15
|
+
userParams?: any;
|
|
8
16
|
}
|
|
9
17
|
declare const _default: React.ForwardRefExoticComponent<IUserSelectProps & React.RefAttributes<any>>;
|
|
10
18
|
export default _default;
|
package/es/UserSelect/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
1
2
|
import _useChangeEffect from "@cloud-app-dev/basic-components/es/useChangeEffect";
|
|
2
3
|
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
3
4
|
import _useHttp2 from "@cloud-app-dev/basic-components/es/useHttp";
|
|
@@ -33,7 +34,9 @@ function UserSelect(_ref, ref) {
|
|
|
33
34
|
var selectUsers = _ref.selectUsers,
|
|
34
35
|
onChange = _ref.onChange,
|
|
35
36
|
_ref$className = _ref.className,
|
|
36
|
-
className = _ref$className === void 0 ? '' : _ref$className
|
|
37
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
38
|
+
filterUserIds = _ref.filterUserIds,
|
|
39
|
+
userParams = _ref.userParams;
|
|
37
40
|
|
|
38
41
|
var _useState = useState({
|
|
39
42
|
keyword1: '',
|
|
@@ -61,12 +64,12 @@ function UserSelect(_ref, ref) {
|
|
|
61
64
|
return state.orgId ? state.orgId : treeData[0] ? treeData[0].id : undefined;
|
|
62
65
|
}, [treeData, state.orgId]);
|
|
63
66
|
|
|
64
|
-
var _useHttp3 = _useHttp2(['QueryUserList', selectId], function (_ref2) {
|
|
67
|
+
var _useHttp3 = _useHttp2(['QueryUserList', selectId, userParams], function (_ref2) {
|
|
65
68
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
66
69
|
_ = _ref3[0],
|
|
67
70
|
id = _ref3[1];
|
|
68
71
|
|
|
69
|
-
return id ? api.getUsers(id) : Promise.resolve();
|
|
72
|
+
return id ? api.getUsers(id, userParams, filterUserIds) : Promise.resolve();
|
|
70
73
|
}),
|
|
71
74
|
_useHttp3$data = _useHttp3.data,
|
|
72
75
|
userList = _useHttp3$data === void 0 ? [] : _useHttp3$data;
|
|
@@ -118,6 +121,16 @@ function UserSelect(_ref, ref) {
|
|
|
118
121
|
}));
|
|
119
122
|
}, [state.selectUsers, state.selectIds]);
|
|
120
123
|
|
|
124
|
+
var renderList1 = useMemo(function () {
|
|
125
|
+
return userList.filter(function (v) {
|
|
126
|
+
return !state.keyword1 || v.realName.includes(state.keyword1);
|
|
127
|
+
});
|
|
128
|
+
}, [userList, state.keyword1]);
|
|
129
|
+
var renderList2 = useMemo(function () {
|
|
130
|
+
return state.selectUsers.filter(function (v) {
|
|
131
|
+
return !state.keyword2 || v.realName.includes(state.keyword2);
|
|
132
|
+
});
|
|
133
|
+
}, [state.selectUsers, state.keyword2]);
|
|
121
134
|
return /*#__PURE__*/React.createElement("div", {
|
|
122
135
|
className: "user-select-modal-content ".concat(className)
|
|
123
136
|
}, /*#__PURE__*/React.createElement(TreeMode, {
|
|
@@ -134,13 +147,13 @@ function UserSelect(_ref, ref) {
|
|
|
134
147
|
selectedKeys: [selectId]
|
|
135
148
|
}), /*#__PURE__*/React.createElement(List, {
|
|
136
149
|
onChecked: onUserChecked1,
|
|
137
|
-
list:
|
|
150
|
+
list: renderList1,
|
|
138
151
|
key: userList.length,
|
|
139
152
|
checkedKeys: list1CheckedKeys,
|
|
140
153
|
itemKey: "id",
|
|
141
154
|
itemNameKey: "realName",
|
|
142
155
|
className: "user-source-list",
|
|
143
|
-
title: "\u4EBA\u5458",
|
|
156
|
+
title: "\u4EBA\u5458\u5217\u8868",
|
|
144
157
|
onKeywordChange: function onKeywordChange(v) {
|
|
145
158
|
return setState(function (old) {
|
|
146
159
|
return Object.assign(Object.assign({}, old), {
|
|
@@ -148,14 +161,19 @@ function UserSelect(_ref, ref) {
|
|
|
148
161
|
});
|
|
149
162
|
});
|
|
150
163
|
},
|
|
151
|
-
keywords: state.keyword1
|
|
164
|
+
keywords: state.keyword1,
|
|
165
|
+
whatIcon: function whatIcon() {
|
|
166
|
+
return /*#__PURE__*/React.createElement(_IconFont, {
|
|
167
|
+
type: "icon-S_AID_username"
|
|
168
|
+
});
|
|
169
|
+
}
|
|
152
170
|
}), /*#__PURE__*/React.createElement(List, {
|
|
153
|
-
list:
|
|
171
|
+
list: renderList2,
|
|
154
172
|
itemKey: "id",
|
|
155
173
|
itemNameKey: "realName",
|
|
156
174
|
checkedKeys: state.selectIds,
|
|
157
175
|
className: "user-select-list",
|
|
158
|
-
title: "\u5DF2\
|
|
176
|
+
title: "\u5DF2\u9009\u62E9\u4EBA\u5458",
|
|
159
177
|
onKeywordChange: function onKeywordChange(v) {
|
|
160
178
|
return setState(function (old) {
|
|
161
179
|
return Object.assign(Object.assign({}, old), {
|
|
@@ -164,7 +182,12 @@ function UserSelect(_ref, ref) {
|
|
|
164
182
|
});
|
|
165
183
|
},
|
|
166
184
|
keywords: state.keyword2,
|
|
167
|
-
onChecked: onUserChecked2
|
|
185
|
+
onChecked: onUserChecked2,
|
|
186
|
+
whatIcon: function whatIcon() {
|
|
187
|
+
return /*#__PURE__*/React.createElement(_IconFont, {
|
|
188
|
+
type: "icon-S_AID_username"
|
|
189
|
+
});
|
|
190
|
+
}
|
|
168
191
|
}));
|
|
169
192
|
}
|
|
170
193
|
|
package/es/WorkerFlow/Demo.js
CHANGED
|
@@ -2,11 +2,12 @@ import "antd/lib/config-provider/style";
|
|
|
2
2
|
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import WorkerFlow from './index';
|
|
5
|
+
import data from './data.json';
|
|
5
6
|
var form = [{
|
|
6
7
|
label: '处理意见',
|
|
7
8
|
auth: 1,
|
|
8
9
|
name: 'yijian',
|
|
9
|
-
|
|
10
|
+
widgetType: 'SINGLE_SELECTION',
|
|
10
11
|
required: true,
|
|
11
12
|
options: [{
|
|
12
13
|
label: '有效',
|
|
@@ -45,8 +46,10 @@ var App = function App() {
|
|
|
45
46
|
}
|
|
46
47
|
}, /*#__PURE__*/React.createElement(WorkerFlow, {
|
|
47
48
|
form: form,
|
|
49
|
+
data: data.data,
|
|
48
50
|
onChange: console.log,
|
|
49
|
-
hasTools: true
|
|
51
|
+
hasTools: true,
|
|
52
|
+
errorIds: ['UserTask_2222', 'SequenceFlow_6666']
|
|
50
53
|
})));
|
|
51
54
|
};
|
|
52
55
|
|
|
@@ -14,8 +14,8 @@ function ApproverForm(_ref) {
|
|
|
14
14
|
return (_a = getParentNodeById(config, item.id)) === null || _a === void 0 ? void 0 : _a.bpmnType;
|
|
15
15
|
}, [config, item.id]);
|
|
16
16
|
var includeUserTypes = useMemo(function () {
|
|
17
|
-
return parentNodeType === 'startEvent'
|
|
18
|
-
}, []);
|
|
17
|
+
return parentNodeType === 'startEvent' ? [1, 3] : parentNodeType === 'sequenceFlow' ? [1, 3, 4, 5] : [1, 2, 3, 4, 5];
|
|
18
|
+
}, [parentNodeType]);
|
|
19
19
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UserSet, {
|
|
20
20
|
chargeLevel: item.chargeLevel,
|
|
21
21
|
userType: item.userType,
|
|
@@ -57,7 +57,7 @@ function ConditionForm(_ref) {
|
|
|
57
57
|
var addCondition = useCallback(function () {
|
|
58
58
|
var modal = modalRef.current;
|
|
59
59
|
var allowForm = form.filter(function (v) {
|
|
60
|
-
return v.
|
|
60
|
+
return v.widgetType === 'SINGLE_SELECTION' && v.required;
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
var onOk = function onOk() {
|
|
@@ -108,8 +108,11 @@ function GroupSelect(_ref) {
|
|
|
108
108
|
return /*#__PURE__*/React.createElement("div", {
|
|
109
109
|
className: "user-select-component group-select-component"
|
|
110
110
|
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
-
className: "user-select-tools"
|
|
112
|
-
|
|
111
|
+
className: "user-select-tools",
|
|
112
|
+
style: {
|
|
113
|
+
justifyContent: 'space-between'
|
|
114
|
+
}
|
|
115
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
|
|
113
116
|
icon: /*#__PURE__*/React.createElement(_IconFont, {
|
|
114
117
|
type: "icon-S_Edit_Draw"
|
|
115
118
|
}),
|
|
@@ -117,7 +120,19 @@ function GroupSelect(_ref) {
|
|
|
117
120
|
onClick: userModify
|
|
118
121
|
}, state.userList.length === 0 ? '选择岗位' : '修改岗位'), /*#__PURE__*/React.createElement("span", {
|
|
119
122
|
className: "placeholder"
|
|
120
|
-
}, "\u4E0D\u80FD\u8D85\u8FC720\u4EBA")), /*#__PURE__*/React.createElement("
|
|
123
|
+
}, "\u4E0D\u80FD\u8D85\u8FC720\u4EBA")), state.userList.length > 1 && /*#__PURE__*/React.createElement("span", {
|
|
124
|
+
style: {
|
|
125
|
+
cursor: 'pointer',
|
|
126
|
+
color: 'var(--primary)'
|
|
127
|
+
},
|
|
128
|
+
onClick: function onClick() {
|
|
129
|
+
return setState(function (old) {
|
|
130
|
+
return Object.assign(Object.assign({}, old), {
|
|
131
|
+
userList: []
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}, "\u6E05\u7A7A")), /*#__PURE__*/React.createElement("div", {
|
|
121
136
|
className: "user-list-wrapper"
|
|
122
137
|
}, renderList.map(function (v) {
|
|
123
138
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -14,8 +14,8 @@ function HandleForm(_ref) {
|
|
|
14
14
|
return (_a = getParentNodeById(config, item.id)) === null || _a === void 0 ? void 0 : _a.bpmnType;
|
|
15
15
|
}, [config, item.id]);
|
|
16
16
|
var includeUserTypes = useMemo(function () {
|
|
17
|
-
return parentNodeType === 'startEvent'
|
|
18
|
-
}, []);
|
|
17
|
+
return parentNodeType === 'startEvent' ? [1, 3] : parentNodeType === 'sequenceFlow' ? [1, 3, 4, 5] : [1, 2, 3, 4, 5];
|
|
18
|
+
}, [parentNodeType]);
|
|
19
19
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UserSet, {
|
|
20
20
|
chargeLevel: item.chargeLevel,
|
|
21
21
|
userType: item.userType,
|
|
@@ -25,8 +25,11 @@ import React, { useCallback, useMemo, useRef, useState, useEffect } from 'react'
|
|
|
25
25
|
import _ from 'lodash';
|
|
26
26
|
import chroma from 'chroma-js';
|
|
27
27
|
import GroupSelectModalContent from './GroupSelectModalContent';
|
|
28
|
-
import { formatRenderGroup } from './utils';
|
|
28
|
+
import { formatRenderGroup, ToUpperNumberString } from './utils';
|
|
29
29
|
import RefModal from '../../RefModal';
|
|
30
|
+
var levelDict = Array.from(new Array(30)).map(function (_, i) {
|
|
31
|
+
return i + 1;
|
|
32
|
+
});
|
|
30
33
|
|
|
31
34
|
function LevelGroupSelect(_ref) {
|
|
32
35
|
var _this = this;
|
|
@@ -115,8 +118,15 @@ function LevelGroupSelect(_ref) {
|
|
|
115
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
116
119
|
className: "user-select-component group-select-component level-group-select-component"
|
|
117
120
|
}, /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: "user-select-tools"
|
|
119
|
-
|
|
121
|
+
className: "user-select-tools",
|
|
122
|
+
style: {
|
|
123
|
+
justifyContent: 'space-between'
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
126
|
+
style: {
|
|
127
|
+
paddingRight: 10
|
|
128
|
+
}
|
|
129
|
+
}, "\u6307\u5B9A\u5C97\u4F4D\uFF08\u540C\u65F6\u662F\u4E3B\u7BA1\uFF09", /*#__PURE__*/React.createElement(_IconFont, {
|
|
120
130
|
type: "icon-Warning"
|
|
121
131
|
})), /*#__PURE__*/React.createElement(_Button, {
|
|
122
132
|
icon: /*#__PURE__*/React.createElement(_IconFont, {
|
|
@@ -124,7 +134,19 @@ function LevelGroupSelect(_ref) {
|
|
|
124
134
|
}),
|
|
125
135
|
type: "primary",
|
|
126
136
|
onClick: userModify
|
|
127
|
-
}, state.userList.length === 0 ? '选择岗位' : '修改岗位')), /*#__PURE__*/React.createElement("
|
|
137
|
+
}, state.userList.length === 0 ? '选择岗位' : '修改岗位')), state.userList.length > 1 && /*#__PURE__*/React.createElement("span", {
|
|
138
|
+
style: {
|
|
139
|
+
cursor: 'pointer',
|
|
140
|
+
color: 'var(--primary)'
|
|
141
|
+
},
|
|
142
|
+
onClick: function onClick() {
|
|
143
|
+
return setState(function (old) {
|
|
144
|
+
return Object.assign(Object.assign({}, old), {
|
|
145
|
+
userList: []
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}, "\u6E05\u7A7A")), /*#__PURE__*/React.createElement("div", {
|
|
128
150
|
className: "user-list-wrapper"
|
|
129
151
|
}, renderList.map(function (v) {
|
|
130
152
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -169,13 +191,13 @@ function LevelGroupSelect(_ref) {
|
|
|
169
191
|
});
|
|
170
192
|
});
|
|
171
193
|
}
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
value:
|
|
178
|
-
}, "\
|
|
194
|
+
}, levelDict.map(function (v) {
|
|
195
|
+
return /*#__PURE__*/React.createElement(_Select.Option, {
|
|
196
|
+
value: v
|
|
197
|
+
}, "\u7B2C", ToUpperNumberString("".concat(v)), "\u7EA7\u4E3B\u7BA1");
|
|
198
|
+
}), /*#__PURE__*/React.createElement(_Select.Option, {
|
|
199
|
+
value: 99
|
|
200
|
+
}, "\u6700\u9AD8\u5C42\u7EA7\u4E3B\u7BA1"))), /*#__PURE__*/React.createElement(RefModal, {
|
|
179
201
|
ref: modalRef
|
|
180
202
|
}));
|
|
181
203
|
}
|
|
@@ -128,7 +128,7 @@ function UserAndGroupSelect(_ref) {
|
|
|
128
128
|
className: "select-title"
|
|
129
129
|
}, "\u9009\u62E9\u8303\u56F4"), /*#__PURE__*/React.createElement("div", {
|
|
130
130
|
className: "user-select-tools"
|
|
131
|
-
}, /*#__PURE__*/React.createElement(_Select, {
|
|
131
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Select, {
|
|
132
132
|
value: state.type,
|
|
133
133
|
style: {
|
|
134
134
|
width: 100,
|
|
@@ -145,11 +145,29 @@ function UserAndGroupSelect(_ref) {
|
|
|
145
145
|
}),
|
|
146
146
|
type: "primary",
|
|
147
147
|
onClick: userModify
|
|
148
|
-
}, state.userList.length === 0 ? '
|
|
148
|
+
}, state.userList.length === 0 ? '添加' : '修改', state.type === 'groupId' ? '岗位' : '人员')), /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
style: {
|
|
150
|
+
display: 'flex',
|
|
151
|
+
justifyContent: 'space-between',
|
|
152
|
+
flex: 1
|
|
153
|
+
}
|
|
154
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
149
155
|
className: "placeholder"
|
|
150
|
-
}, "\u4E0D\u80FD\u8D85\u8FC720\u4E2A")
|
|
156
|
+
}, "\u4E0D\u80FD\u8D85\u8FC720\u4E2A"), state.userList.length > 1 && /*#__PURE__*/React.createElement("span", {
|
|
157
|
+
style: {
|
|
158
|
+
cursor: 'pointer',
|
|
159
|
+
color: 'var(--primary)'
|
|
160
|
+
},
|
|
161
|
+
onClick: function onClick() {
|
|
162
|
+
return setState(function (old) {
|
|
163
|
+
return Object.assign(Object.assign({}, old), {
|
|
164
|
+
userList: []
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}, "\u6E05\u7A7A"))), /*#__PURE__*/React.createElement("div", {
|
|
151
169
|
className: "user-list-wrapper"
|
|
152
|
-
}, state.type === 'userId' ?
|
|
170
|
+
}, state.type === 'userId' ? renderList.map(function (v) {
|
|
153
171
|
return /*#__PURE__*/React.createElement(_Tag, {
|
|
154
172
|
closable: true,
|
|
155
173
|
key: v.value,
|
|
@@ -104,8 +104,11 @@ function UserSelect(_ref) {
|
|
|
104
104
|
return /*#__PURE__*/React.createElement("div", {
|
|
105
105
|
className: "user-select-component"
|
|
106
106
|
}, /*#__PURE__*/React.createElement("div", {
|
|
107
|
-
className: "user-select-tools"
|
|
108
|
-
|
|
107
|
+
className: "user-select-tools",
|
|
108
|
+
style: {
|
|
109
|
+
justifyContent: 'space-between'
|
|
110
|
+
}
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
|
|
109
112
|
icon: /*#__PURE__*/React.createElement(_IconFont, {
|
|
110
113
|
type: "icon-S_Edit_Draw"
|
|
111
114
|
}),
|
|
@@ -113,7 +116,19 @@ function UserSelect(_ref) {
|
|
|
113
116
|
onClick: userModify
|
|
114
117
|
}, state.userList.length === 0 ? '添加人员' : '修改人员'), /*#__PURE__*/React.createElement("span", {
|
|
115
118
|
className: "placeholder"
|
|
116
|
-
}, "\u4E0D\u80FD\u8D85\u8FC720\u4EBA")), /*#__PURE__*/React.createElement("
|
|
119
|
+
}, "\u4E0D\u80FD\u8D85\u8FC720\u4EBA")), state.userList.length > 1 && /*#__PURE__*/React.createElement("span", {
|
|
120
|
+
style: {
|
|
121
|
+
cursor: 'pointer',
|
|
122
|
+
color: 'var(--primary)'
|
|
123
|
+
},
|
|
124
|
+
onClick: function onClick() {
|
|
125
|
+
return setState(function (old) {
|
|
126
|
+
return Object.assign(Object.assign({}, old), {
|
|
127
|
+
userList: []
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}, "\u6E05\u7A7A")), /*#__PURE__*/React.createElement("div", {
|
|
117
132
|
className: "user-list-wrapper"
|
|
118
133
|
}, state.userList.map(function (v) {
|
|
119
134
|
return /*#__PURE__*/React.createElement(_Tag, {
|
|
@@ -23,4 +23,25 @@ export function formatRenderGroup() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
return arr;
|
|
26
|
+
}
|
|
27
|
+
var upperNumbers = '十一二三四五六七八九';
|
|
28
|
+
export function ToUpperNumberString(n) {
|
|
29
|
+
var arr = (n + '').split('');
|
|
30
|
+
var strs = arr.map(function (v) {
|
|
31
|
+
return upperNumbers.charAt(+v);
|
|
32
|
+
}).join('');
|
|
33
|
+
|
|
34
|
+
if (strs === '一十') {
|
|
35
|
+
return '十';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (strs.length === 2 && strs.charAt(0) === '一') {
|
|
39
|
+
return strs.replace('一', '十');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (strs.length === 2 && strs.charAt(0) !== '一' && !strs.includes('十')) {
|
|
43
|
+
return strs.charAt(0) + '十' + strs.charAt(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return strs;
|
|
26
47
|
}
|
|
@@ -13,7 +13,8 @@ function ApproverNode(_ref) {
|
|
|
13
13
|
|
|
14
14
|
var _useContext = useContext(WFC),
|
|
15
15
|
onDeleteNode = _useContext.onDeleteNode,
|
|
16
|
-
onSelectNode = _useContext.onSelectNode
|
|
16
|
+
onSelectNode = _useContext.onSelectNode,
|
|
17
|
+
updateNode = _useContext.updateNode; // TODO: 这里读取props数据
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
var TitleEl = /*#__PURE__*/React.createElement(TitleElement, {
|
|
@@ -24,7 +25,8 @@ function ApproverNode(_ref) {
|
|
|
24
25
|
placeholder: nodeName,
|
|
25
26
|
nodeName: nodeName,
|
|
26
27
|
onTitleChange: function onTitleChange(val) {
|
|
27
|
-
|
|
28
|
+
node.nodeName = val;
|
|
29
|
+
updateNode();
|
|
28
30
|
}
|
|
29
31
|
});
|
|
30
32
|
return /*#__PURE__*/React.createElement(NodeWrap, {
|
|
@@ -27,10 +27,11 @@ function BranchNode(_ref2) {
|
|
|
27
27
|
last = _ref2.last,
|
|
28
28
|
sortLeft = _ref2.sortLeft,
|
|
29
29
|
owner = _ref2.owner,
|
|
30
|
-
nodeName = _ref2.nodeName,
|
|
31
30
|
delBranch = _ref2.delBranch,
|
|
32
31
|
sortRight = _ref2.sortRight,
|
|
33
32
|
onBranchClick = _ref2.onBranchClick,
|
|
33
|
+
updateNode = _ref2.updateNode,
|
|
34
|
+
errorIds = _ref2.errorIds,
|
|
34
35
|
node = _ref2.node,
|
|
35
36
|
id = _ref2.id;
|
|
36
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -38,7 +39,7 @@ function BranchNode(_ref2) {
|
|
|
38
39
|
}, /*#__PURE__*/React.createElement("div", {
|
|
39
40
|
className: "condition-node-box"
|
|
40
41
|
}, /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: "auto-judge",
|
|
42
|
+
className: "auto-judge ".concat(node.error || errorIds.includes(id) ? 'error' : ''),
|
|
42
43
|
id: id
|
|
43
44
|
}, !first && /*#__PURE__*/React.createElement("div", {
|
|
44
45
|
className: "sort-left",
|
|
@@ -47,11 +48,12 @@ function BranchNode(_ref2) {
|
|
|
47
48
|
className: "title-wrapper"
|
|
48
49
|
}, /*#__PURE__*/React.createElement(TitleElement, {
|
|
49
50
|
placeholder: "\u8BF7\u8F93\u5165\u6761\u4EF6\u540D\u79F0",
|
|
50
|
-
onTitleChange: function onTitleChange(v) {
|
|
51
|
-
return node.nodeName = v;
|
|
52
|
-
},
|
|
53
51
|
delNode: delBranch,
|
|
54
|
-
nodeName: node.nodeName
|
|
52
|
+
nodeName: node.nodeName,
|
|
53
|
+
onTitleChange: function onTitleChange(v) {
|
|
54
|
+
node.nodeName = v;
|
|
55
|
+
updateNode();
|
|
56
|
+
}
|
|
55
57
|
})), !last && /*#__PURE__*/React.createElement("div", {
|
|
56
58
|
className: "sort-right",
|
|
57
59
|
onClick: sortRight
|
|
@@ -84,7 +86,10 @@ function ConditionNode(_ref3) {
|
|
|
84
86
|
onInsertNode = _useContext.onInsertNode,
|
|
85
87
|
onDeleteNode = _useContext.onDeleteNode,
|
|
86
88
|
onSelectNode = _useContext.onSelectNode,
|
|
87
|
-
readOnly = _useContext.readOnly
|
|
89
|
+
readOnly = _useContext.readOnly,
|
|
90
|
+
updateNode = _useContext.updateNode,
|
|
91
|
+
_useContext$errorIds = _useContext.errorIds,
|
|
92
|
+
errorIds = _useContext$errorIds === void 0 ? [] : _useContext$errorIds;
|
|
88
93
|
|
|
89
94
|
if (!Array.isArray(branches) || branches.length === 0) {
|
|
90
95
|
return null;
|
|
@@ -107,10 +112,10 @@ function ConditionNode(_ref3) {
|
|
|
107
112
|
className: "col-box",
|
|
108
113
|
key: index.toString()
|
|
109
114
|
}, /*#__PURE__*/React.createElement(BranchNode, Object.assign({}, item, {
|
|
110
|
-
nodeName: item.nodeName,
|
|
111
115
|
priorityLevel: item.priorityLevel,
|
|
112
116
|
owner: item.owner,
|
|
113
117
|
first: index === 0,
|
|
118
|
+
updateNode: updateNode,
|
|
114
119
|
onBranchClick: function onBranchClick() {
|
|
115
120
|
return onSelectNode(node, parentNode, index);
|
|
116
121
|
},
|
|
@@ -118,7 +123,8 @@ function ConditionNode(_ref3) {
|
|
|
118
123
|
return branches.length === 2 ? onDeleteNode(parentNode, node) : onDeleteNode(parentNode, node, NodeTypes.BRANCH, index);
|
|
119
124
|
},
|
|
120
125
|
last: index === branches.length - 1,
|
|
121
|
-
node: item
|
|
126
|
+
node: item,
|
|
127
|
+
errorIds: errorIds
|
|
122
128
|
})), item.childNode && /*#__PURE__*/React.createElement(Render, {
|
|
123
129
|
parentNode: item,
|
|
124
130
|
config: item.childNode
|
|
@@ -91,7 +91,7 @@ export var NodeTemplates = (_NodeTemplates = {}, _defineProperty(_NodeTemplates,
|
|
|
91
91
|
}), _defineProperty(_NodeTemplates, OptionTypes.CONDITION, function () {
|
|
92
92
|
return {
|
|
93
93
|
id: createId('ExclusiveGateway'),
|
|
94
|
-
nodeName: '
|
|
94
|
+
nodeName: '条件分支',
|
|
95
95
|
type: OptionTypes.CONDITION,
|
|
96
96
|
childNode: null,
|
|
97
97
|
conditionNodes: [],
|
|
@@ -13,7 +13,8 @@ function HandleNode(_ref) {
|
|
|
13
13
|
|
|
14
14
|
var _useContext = useContext(WFC),
|
|
15
15
|
onDeleteNode = _useContext.onDeleteNode,
|
|
16
|
-
onSelectNode = _useContext.onSelectNode
|
|
16
|
+
onSelectNode = _useContext.onSelectNode,
|
|
17
|
+
updateNode = _useContext.updateNode;
|
|
17
18
|
|
|
18
19
|
var TitleEl = /*#__PURE__*/React.createElement(TitleElement, {
|
|
19
20
|
icon: "icon-yewu",
|
|
@@ -23,7 +24,8 @@ function HandleNode(_ref) {
|
|
|
23
24
|
placeholder: nodeName,
|
|
24
25
|
nodeName: nodeName,
|
|
25
26
|
onTitleChange: function onTitleChange(val) {
|
|
26
|
-
|
|
27
|
+
node.nodeName = val;
|
|
28
|
+
updateNode();
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
31
|
return /*#__PURE__*/React.createElement(NodeWrap, {
|
|
@@ -13,7 +13,8 @@ function NotifierNode(_ref) {
|
|
|
13
13
|
|
|
14
14
|
var _useContext = useContext(WFC),
|
|
15
15
|
onDeleteNode = _useContext.onDeleteNode,
|
|
16
|
-
onSelectNode = _useContext.onSelectNode
|
|
16
|
+
onSelectNode = _useContext.onSelectNode,
|
|
17
|
+
updateNode = _useContext.updateNode;
|
|
17
18
|
|
|
18
19
|
var TitleEl = /*#__PURE__*/React.createElement(TitleElement, {
|
|
19
20
|
icon: "icon-biaoqian",
|
|
@@ -23,7 +24,8 @@ function NotifierNode(_ref) {
|
|
|
23
24
|
placeholder: nodeName,
|
|
24
25
|
nodeName: nodeName,
|
|
25
26
|
onTitleChange: function onTitleChange(val) {
|
|
26
|
-
|
|
27
|
+
node.nodeName = val;
|
|
28
|
+
updateNode();
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
31
|
return /*#__PURE__*/React.createElement(NodeWrap, {
|
|
@@ -45,8 +45,8 @@ function TitleElement(_ref) {
|
|
|
45
45
|
}, [editable]);
|
|
46
46
|
|
|
47
47
|
_useChangeEffect(function () {
|
|
48
|
-
onTitleChange && onTitleChange(title);
|
|
49
|
-
}, [title]);
|
|
48
|
+
!editable && onTitleChange && onTitleChange(title);
|
|
49
|
+
}, [title, editable]);
|
|
50
50
|
|
|
51
51
|
return /*#__PURE__*/React.createElement(React.Fragment, null, icon && /*#__PURE__*/React.createElement(_IconFont, {
|
|
52
52
|
type: icon,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
2
|
import { NodeTypes } from './Constants';
|
|
3
3
|
import AddNode from './Add';
|
|
4
|
+
import WFC from '../OperatorContext';
|
|
4
5
|
|
|
5
6
|
function NodeWrap(_ref) {
|
|
6
7
|
var type = _ref.type,
|
|
@@ -10,10 +11,15 @@ function NodeWrap(_ref) {
|
|
|
10
11
|
children = _ref.children,
|
|
11
12
|
titleStyle = _ref.titleStyle,
|
|
12
13
|
id = _ref.id;
|
|
14
|
+
|
|
15
|
+
var _useContext = useContext(WFC),
|
|
16
|
+
_useContext$errorIds = _useContext.errorIds,
|
|
17
|
+
errorIds = _useContext$errorIds === void 0 ? [] : _useContext$errorIds;
|
|
18
|
+
|
|
13
19
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
14
20
|
className: "node-wrap"
|
|
15
21
|
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className:
|
|
22
|
+
className: "node-wrap-box ".concat(type === NodeTypes.START ? 'start-node' : '', " ").concat(node.error || errorIds.includes(node.id) ? 'error' : ''),
|
|
17
23
|
id: id
|
|
18
24
|
}, /*#__PURE__*/React.createElement("div", {
|
|
19
25
|
className: "title",
|
package/es/WorkerFlow/index.css
CHANGED
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
}
|
|
235
235
|
.worker-flow-design .auto-judge.error:after {
|
|
236
236
|
border: 1px solid #f25643;
|
|
237
|
-
box-shadow: 0 2px 5px 0 rgba(
|
|
237
|
+
box-shadow: 0 2px 5px 0 rgba(238, 55, 55, 0.5);
|
|
238
238
|
}
|
|
239
239
|
.worker-flow-design .auto-judge .title-wrapper {
|
|
240
240
|
font-size: 12px;
|
|
@@ -488,7 +488,7 @@
|
|
|
488
488
|
}
|
|
489
489
|
.node-wrap-box.error:after {
|
|
490
490
|
border: 1px solid #f25643;
|
|
491
|
-
box-shadow: 0 2px 5px 0 rgba(
|
|
491
|
+
box-shadow: 0 2px 5px 0 rgba(238, 55, 55, 0.5);
|
|
492
492
|
}
|
|
493
493
|
.node-wrap-box .title {
|
|
494
494
|
position: relative;
|
|
@@ -677,6 +677,10 @@
|
|
|
677
677
|
.user-list-wrapper {
|
|
678
678
|
padding: 10px 0;
|
|
679
679
|
}
|
|
680
|
+
.user-select-tools {
|
|
681
|
+
display: flex;
|
|
682
|
+
align-items: center;
|
|
683
|
+
}
|
|
680
684
|
.user-select-tools .cloudapp-btn {
|
|
681
685
|
margin-right: 20px;
|
|
682
686
|
}
|
package/es/WorkerFlow/index.d.ts
CHANGED
package/es/WorkerFlow/index.js
CHANGED
|
@@ -53,7 +53,8 @@ function WorkerFlow(_ref, ref) {
|
|
|
53
53
|
form = _ref$form === void 0 ? [] : _ref$form,
|
|
54
54
|
onChange = _ref.onChange,
|
|
55
55
|
readOnly = _ref.readOnly,
|
|
56
|
-
hasTools = _ref.hasTools
|
|
56
|
+
hasTools = _ref.hasTools,
|
|
57
|
+
errorIds = _ref.errorIds;
|
|
57
58
|
|
|
58
59
|
var _useState = useState(cloneDeep((_data === null || _data === void 0 ? void 0 : _data.nodeConfig) || cloneDeep(TemplateConfig1))),
|
|
59
60
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -123,7 +124,7 @@ function WorkerFlow(_ref, ref) {
|
|
|
123
124
|
return;
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
var title = "\u662F\u5426\u5220\u9664\
|
|
127
|
+
var title = "\u662F\u5426\u5220\u9664\"".concat(type === NodeTypes.BRANCH ? node.conditionNodes[index].nodeName : node.nodeName, "\"\u8282\u70B9\uFF1F");
|
|
127
128
|
var options = {
|
|
128
129
|
title: title,
|
|
129
130
|
okText: '确定',
|
|
@@ -185,13 +186,14 @@ function WorkerFlow(_ref, ref) {
|
|
|
185
186
|
node.conditionNodes[index].expression = data.expression;
|
|
186
187
|
node.conditionNodes[index].owner = data.owner;
|
|
187
188
|
} else {
|
|
189
|
+
var userArr = data.nodeUserList.map(function (v) {
|
|
190
|
+
return v.name;
|
|
191
|
+
});
|
|
188
192
|
node.nodeUserList = data.nodeUserList || [];
|
|
189
193
|
node.form = data.form || [];
|
|
190
194
|
node.userType = data.userType;
|
|
191
195
|
node.usersHandType = data.usersHandType;
|
|
192
|
-
node.owner = data.userType === 4 ? '直属主管' :
|
|
193
|
-
return v.name;
|
|
194
|
-
}).join(',');
|
|
196
|
+
node.owner = data.userType === 4 ? '直属主管' : userArr.join(',');
|
|
195
197
|
node.emptyUserList = data.emptyUserList;
|
|
196
198
|
node.chargeLevel = data.chargeLevel;
|
|
197
199
|
}
|
|
@@ -260,7 +262,9 @@ function WorkerFlow(_ref, ref) {
|
|
|
260
262
|
}, [config]);
|
|
261
263
|
|
|
262
264
|
_useChangeEffect(function () {
|
|
263
|
-
|
|
265
|
+
if (onChange) {
|
|
266
|
+
onChange(getConfig());
|
|
267
|
+
}
|
|
264
268
|
}, [config]);
|
|
265
269
|
|
|
266
270
|
useImperativeHandle(ref, function () {
|
|
@@ -276,7 +280,8 @@ function WorkerFlow(_ref, ref) {
|
|
|
276
280
|
onInsertNode: onInsertNode,
|
|
277
281
|
onDeleteNode: onDeleteNode,
|
|
278
282
|
onSelectNode: onSelectNode,
|
|
279
|
-
readOnly: readOnly
|
|
283
|
+
readOnly: readOnly,
|
|
284
|
+
errorIds: errorIds
|
|
280
285
|
}
|
|
281
286
|
}, /*#__PURE__*/React.createElement("div", {
|
|
282
287
|
className: "worker-flow-container"
|
|
@@ -15,7 +15,7 @@ export type NodeUserType = {
|
|
|
15
15
|
export type WorkerFlowFormType = {
|
|
16
16
|
name: string;
|
|
17
17
|
label: string;
|
|
18
|
-
|
|
18
|
+
widgetType: 'SINGLE_TEXT' | 'MULTIPLE_TEXT' | 'SINGLE_SELECTION' | 'MULTIPLE_SELECTION' | 'IMAGE';
|
|
19
19
|
type: string;
|
|
20
20
|
value: string;
|
|
21
21
|
auth?: FormAuthType;
|
|
@@ -49,6 +49,7 @@ export type NodeItem = {
|
|
|
49
49
|
|
|
50
50
|
export interface WorkerFlowContext {
|
|
51
51
|
config: NodeItem;
|
|
52
|
+
errorIds?: string[];
|
|
52
53
|
form: WorkerFlowFormType[];
|
|
53
54
|
onInsertNode: (type: NodeType, node: NodeItem) => void;
|
|
54
55
|
onDeleteNode: (parentNode: NodeItem, node: NodeItem, type?: NodeType, index?: number) => void;
|
package/es/WorkerFlow/utils.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export declare function getNextTaskId(node: NodeItem): string | undefined;
|
|
|
4
4
|
export declare function getNextNode(node: NodeItem): NodeItem | undefined;
|
|
5
5
|
export declare function filterNoticeNode(data: NodeItem): NodeItem;
|
|
6
6
|
export declare function getUserFormKeys(data: NodeItem): ConditionItemType[];
|
|
7
|
+
export declare function getFirstUserTask(data: NodeItem): NodeItem | undefined;
|
package/es/WorkerFlow/utils.js
CHANGED
|
@@ -13,6 +13,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
import { getNodeById } from './XML/utils';
|
|
15
15
|
export function getJAVATaskData(data) {
|
|
16
|
+
var _a;
|
|
17
|
+
|
|
16
18
|
var arr = [];
|
|
17
19
|
|
|
18
20
|
var fn = function fn(node, _nextNode) {
|
|
@@ -100,7 +102,7 @@ export function getJAVATaskData(data) {
|
|
|
100
102
|
} // 修正最后一个节点的nextid
|
|
101
103
|
|
|
102
104
|
|
|
103
|
-
var lastNextId = arr[arr.length - 1].nextTaskId;
|
|
105
|
+
var lastNextId = (_a = arr[arr.length - 1]) === null || _a === void 0 ? void 0 : _a.nextTaskId;
|
|
104
106
|
|
|
105
107
|
if (lastNextId) {
|
|
106
108
|
var lastNode = getNodeById(data, lastNextId);
|
|
@@ -167,7 +169,6 @@ export function getUserFormKeys(data) {
|
|
|
167
169
|
|
|
168
170
|
var fn = function fn(node) {
|
|
169
171
|
if (node.bpmnType == 'sequenceFlow') {
|
|
170
|
-
console.log(node.conditionList);
|
|
171
172
|
arr.push.apply(arr, _toConsumableArray(node.conditionList));
|
|
172
173
|
}
|
|
173
174
|
|
|
@@ -186,4 +187,11 @@ export function getUserFormKeys(data) {
|
|
|
186
187
|
return arr.filter(function (v) {
|
|
187
188
|
return !!v;
|
|
188
189
|
});
|
|
190
|
+
}
|
|
191
|
+
export function getFirstUserTask(data) {
|
|
192
|
+
if (data.bpmnType === 'startEvent') {
|
|
193
|
+
return data.childNode;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return undefined;
|
|
189
197
|
}
|
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.47",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "dumi dev",
|
|
8
8
|
"docs:build": "dumi build",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@cloud-app-dev/utils": "^2.0.1",
|
|
41
|
-
"@cloud-app-dev/basic-components": "^1.0.
|
|
41
|
+
"@cloud-app-dev/basic-components": "^1.0.58",
|
|
42
42
|
"@types/chroma-js": "^2.1.3",
|
|
43
43
|
"@types/lodash": "^4.14.172",
|
|
44
44
|
"@umijs/test": "^3.0.5",
|