@cloud-app-dev/vidc 1.0.44 → 1.0.48
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 +7 -1
- package/es/AppLayout/Header/ModifyPassword/index.js +1 -1
- package/es/AppLayout/Header/ModifyUserAvatar/index.css +4 -0
- package/es/AppLayout/Header/ModifyUserAvatar/index.js +2 -3
- package/es/AutoExit/index.d.ts +1 -1
- package/es/List/index.css +6 -0
- package/es/OrgTree/index.js +1 -2
- package/es/OrgUserTree/index.js +1 -2
- package/es/PlaceTree/index.js +1 -2
- package/es/RefDrawer/index.d.ts +2 -2
- package/es/RefModal/index.d.ts +2 -2
- 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 +7 -5
- package/es/UserSelect/demo.js +4 -3
- package/es/UserSelect/index.d.ts +4 -0
- package/es/UserSelect/index.js +15 -3
- package/es/WorkerFlow/Demo.js +5 -2
- package/es/WorkerFlow/Form/Approver.js +2 -2
- package/es/WorkerFlow/Form/Condition.js +5 -4
- 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/UserSet.js +1 -6
- 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 +16 -8
- package/es/WorkerFlow/interface.d.ts +2 -1
- package/es/WorkerFlow/utils.d.ts +1 -0
- package/es/WorkerFlow/utils.js +11 -3
- package/package.json +3 -3
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.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTYzODY4NzgyNzEwNywidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjM4NDI4NjI3MTA3fQ.eEvUc9_eGBdUi2QCMDNjOYgTzTKwiLX-7DEQ_O9kjhs';
|
|
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, params?: any): 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
|
@@ -50,6 +50,10 @@ var Api = /*#__PURE__*/function () {
|
|
|
50
50
|
key: "getUsers",
|
|
51
51
|
value: function getUsers(organizationId) {
|
|
52
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
|
+
|
|
53
57
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
54
58
|
var res;
|
|
55
59
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -73,7 +77,9 @@ var Api = /*#__PURE__*/function () {
|
|
|
73
77
|
|
|
74
78
|
case 2:
|
|
75
79
|
res = _context2.sent;
|
|
76
|
-
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
|
+
}));
|
|
77
83
|
|
|
78
84
|
case 4:
|
|
79
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;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
2
|
import _ImageView from "@cloud-app-dev/basic-components/es/ImageView";
|
|
3
|
-
import _CBox from "@cloud-app-dev/basic-components/es/CBox";
|
|
4
3
|
import _ContentBox from "@cloud-app-dev/basic-components/es/ContentBox";
|
|
5
4
|
import _Drawer from "@cloud-app-dev/basic-components/es/Drawer";
|
|
6
5
|
import "antd/lib/message/style";
|
|
@@ -82,11 +81,11 @@ function ModifyUserAvatar(_ref) {
|
|
|
82
81
|
className: "user-avatar-upload"
|
|
83
82
|
}, /*#__PURE__*/React.createElement(FormUpload, {
|
|
84
83
|
customUpload: uploadImg
|
|
85
|
-
}, userAvatarUrl ? /*#__PURE__*/React.createElement(
|
|
84
|
+
}, userAvatarUrl ? /*#__PURE__*/React.createElement("div", {
|
|
86
85
|
className: "lm-upload-content"
|
|
87
86
|
}, /*#__PURE__*/React.createElement(_ImageView, {
|
|
88
87
|
src: userAvatarUrl
|
|
89
|
-
})) : /*#__PURE__*/React.createElement(
|
|
88
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
90
89
|
className: "lm-upload-content lm-c-normol-box"
|
|
91
90
|
}, /*#__PURE__*/React.createElement(_IconFont, {
|
|
92
91
|
type: "icon-L_Bar_AddImg"
|
package/es/AutoExit/index.d.ts
CHANGED
package/es/List/index.css
CHANGED
package/es/OrgTree/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
import _CBox from "@cloud-app-dev/basic-components/es/CBox";
|
|
4
3
|
import _Tree from "@cloud-app-dev/basic-components/es/Tree";
|
|
5
4
|
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
6
5
|
import _Store from "@cloud-app-dev/basic-components/es/Store";
|
|
@@ -133,7 +132,7 @@ var OrgTree = /*#__PURE__*/function (_React$Component) {
|
|
|
133
132
|
props = _objectWithoutProperties(_this$props3, _excluded);
|
|
134
133
|
|
|
135
134
|
var expandedKeys = this.state.expandedKeys;
|
|
136
|
-
return /*#__PURE__*/React.createElement(
|
|
135
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
137
136
|
className: "lm-organization-tree ".concat(className)
|
|
138
137
|
}, title ? /*#__PURE__*/React.createElement(TreeTitle, {
|
|
139
138
|
title: title,
|
package/es/OrgUserTree/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
2
|
import _Tree from "@cloud-app-dev/basic-components/es/Tree";
|
|
3
|
-
import _CBox from "@cloud-app-dev/basic-components/es/CBox";
|
|
4
3
|
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
5
4
|
import _useHttp2 from "@cloud-app-dev/basic-components/es/useHttp";
|
|
6
5
|
|
|
@@ -87,7 +86,7 @@ function OrgUserTree(_a) {
|
|
|
87
86
|
onDefailtSelect(treeData[0].id);
|
|
88
87
|
}
|
|
89
88
|
}, [treeData]);
|
|
90
|
-
return /*#__PURE__*/React.createElement(
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
91
90
|
className: "bc-org-user-tree-layout ".concat(className)
|
|
92
91
|
}, title ? /*#__PURE__*/React.createElement(TreeTitle, {
|
|
93
92
|
title: title,
|
package/es/PlaceTree/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
2
|
import _Tree from "@cloud-app-dev/basic-components/es/Tree";
|
|
3
|
-
import _CBox from "@cloud-app-dev/basic-components/es/CBox";
|
|
4
3
|
import _Store from "@cloud-app-dev/basic-components/es/Store";
|
|
5
4
|
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
6
5
|
|
|
@@ -124,7 +123,7 @@ function PlaceTree(params) {
|
|
|
124
123
|
});
|
|
125
124
|
});
|
|
126
125
|
}, [keyword]);
|
|
127
|
-
return /*#__PURE__*/React.createElement(
|
|
126
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
128
127
|
className: "lm-c-place-tree ".concat(className)
|
|
129
128
|
}, /*#__PURE__*/React.createElement(TreeTitle, {
|
|
130
129
|
title: title,
|
package/es/RefDrawer/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export interface IUseDrawerHookState {
|
|
|
7
7
|
width?: number | string;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface IRefDrawerMethodsProps {
|
|
11
11
|
open: (options: IUseDrawerHookState) => void;
|
|
12
12
|
close: () => void;
|
|
13
13
|
}
|
|
14
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<
|
|
14
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<IRefDrawerMethodsProps>>;
|
|
15
15
|
export default _default;
|
package/es/RefModal/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export interface IUseModalHookState {
|
|
|
7
7
|
width?: number | string;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface IRefModalMethodsProps {
|
|
11
11
|
open: (options: IUseModalHookState) => void;
|
|
12
12
|
close: () => void;
|
|
13
13
|
}
|
|
14
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<
|
|
14
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<IRefModalMethodsProps>>;
|
|
15
15
|
export default _default;
|
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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
2
|
import _Tree from "@cloud-app-dev/basic-components/es/Tree";
|
|
3
|
-
import _CBox from "@cloud-app-dev/basic-components/es/CBox";
|
|
4
3
|
import _treeHelper from "@cloud-app-dev/utils/es/treeHelper";
|
|
5
4
|
import _useHttp2 from "@cloud-app-dev/basic-components/es/useHttp";
|
|
6
5
|
|
|
@@ -40,7 +39,8 @@ function TreeMode(_a) {
|
|
|
40
39
|
treeNodeProps = _a.treeNodeProps,
|
|
41
40
|
onDefailtSelect = _a.onDefailtSelect,
|
|
42
41
|
mode = _a.mode,
|
|
43
|
-
|
|
42
|
+
showIcon = _a.showIcon,
|
|
43
|
+
props = __rest(_a, ["title", "className", "renderHeader", "inputPlaceholder", "treeNodeProps", "onDefailtSelect", "mode", "showIcon"]);
|
|
44
44
|
|
|
45
45
|
var _useState = useState({
|
|
46
46
|
keyword: undefined,
|
|
@@ -152,7 +152,7 @@ function TreeMode(_a) {
|
|
|
152
152
|
onDefailtSelect(id);
|
|
153
153
|
}
|
|
154
154
|
}, [treeData, treeKey]);
|
|
155
|
-
return /*#__PURE__*/React.createElement(
|
|
155
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
156
156
|
className: "bc-type-tree-layout ".concat(className)
|
|
157
157
|
}, /*#__PURE__*/React.createElement(TreeTitle, {
|
|
158
158
|
title: title,
|
|
@@ -168,6 +168,7 @@ function TreeMode(_a) {
|
|
|
168
168
|
}), renderHeader && renderHeader(), list.length > 0 && /*#__PURE__*/React.createElement(_Tree, Object.assign({}, props, {
|
|
169
169
|
treeData: treeData,
|
|
170
170
|
key: state.focusKey,
|
|
171
|
+
showIcon: showIcon,
|
|
171
172
|
onExpand: function onExpand(keys) {
|
|
172
173
|
return setState(function (old) {
|
|
173
174
|
return Object.assign(Object.assign({}, old), {
|
|
@@ -185,7 +186,7 @@ function TreeMode(_a) {
|
|
|
185
186
|
},
|
|
186
187
|
icon: function icon(node) {
|
|
187
188
|
return /*#__PURE__*/React.createElement(_IconFont, {
|
|
188
|
-
type: "".concat(treeData.length
|
|
189
|
+
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
190
|
});
|
|
190
191
|
}
|
|
191
192
|
})));
|
|
@@ -194,6 +195,7 @@ function TreeMode(_a) {
|
|
|
194
195
|
TreeMode.defaultProps = {
|
|
195
196
|
mode: 'Bz',
|
|
196
197
|
className: '',
|
|
197
|
-
treeNodeProps: {}
|
|
198
|
+
treeNodeProps: {},
|
|
199
|
+
showIcon: true
|
|
198
200
|
};
|
|
199
201
|
export default TreeMode;
|
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
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";
|
|
@@ -34,6 +35,7 @@ function UserSelect(_ref, ref) {
|
|
|
34
35
|
onChange = _ref.onChange,
|
|
35
36
|
_ref$className = _ref.className,
|
|
36
37
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
38
|
+
filterUserIds = _ref.filterUserIds,
|
|
37
39
|
userParams = _ref.userParams;
|
|
38
40
|
|
|
39
41
|
var _useState = useState({
|
|
@@ -67,7 +69,7 @@ function UserSelect(_ref, ref) {
|
|
|
67
69
|
_ = _ref3[0],
|
|
68
70
|
id = _ref3[1];
|
|
69
71
|
|
|
70
|
-
return id ? api.getUsers(id, userParams) : Promise.resolve();
|
|
72
|
+
return id ? api.getUsers(id, userParams, filterUserIds) : Promise.resolve();
|
|
71
73
|
}),
|
|
72
74
|
_useHttp3$data = _useHttp3.data,
|
|
73
75
|
userList = _useHttp3$data === void 0 ? [] : _useHttp3$data;
|
|
@@ -159,7 +161,12 @@ function UserSelect(_ref, ref) {
|
|
|
159
161
|
});
|
|
160
162
|
});
|
|
161
163
|
},
|
|
162
|
-
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
|
+
}
|
|
163
170
|
}), /*#__PURE__*/React.createElement(List, {
|
|
164
171
|
list: renderList2,
|
|
165
172
|
itemKey: "id",
|
|
@@ -175,7 +182,12 @@ function UserSelect(_ref, ref) {
|
|
|
175
182
|
});
|
|
176
183
|
},
|
|
177
184
|
keywords: state.keyword2,
|
|
178
|
-
onChecked: onUserChecked2
|
|
185
|
+
onChecked: onUserChecked2,
|
|
186
|
+
whatIcon: function whatIcon() {
|
|
187
|
+
return /*#__PURE__*/React.createElement(_IconFont, {
|
|
188
|
+
type: "icon-S_AID_username"
|
|
189
|
+
});
|
|
190
|
+
}
|
|
179
191
|
}));
|
|
180
192
|
}
|
|
181
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,
|
|
@@ -25,13 +25,14 @@ function ConditionForm(_ref) {
|
|
|
25
25
|
var form = _ref.form,
|
|
26
26
|
item = _ref.item,
|
|
27
27
|
onChange = _ref.onChange,
|
|
28
|
-
|
|
28
|
+
_ref$useConditionFiel = _ref.useConditionFields,
|
|
29
|
+
useConditionFields = _ref$useConditionFiel === void 0 ? [] : _ref$useConditionFiel;
|
|
29
30
|
|
|
30
31
|
var _a, _b;
|
|
31
32
|
|
|
32
33
|
var _useState = useState({
|
|
33
|
-
field: (
|
|
34
|
-
value: ((_b = item === null || item === void 0 ? void 0 : item.conditionList[0]) === null || _b === void 0 ? void 0 : _b.value
|
|
34
|
+
field: (item === null || item === void 0 ? void 0 : item.conditionList) ? (_a = item.conditionList[0]) === null || _a === void 0 ? void 0 : _a.field : '',
|
|
35
|
+
value: (item === null || item === void 0 ? void 0 : item.conditionList) ? (_b = item === null || item === void 0 ? void 0 : item.conditionList[0]) === null || _b === void 0 ? void 0 : _b.value : ''
|
|
35
36
|
}),
|
|
36
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
38
|
state = _useState2[0],
|
|
@@ -57,7 +58,7 @@ function ConditionForm(_ref) {
|
|
|
57
58
|
var addCondition = useCallback(function () {
|
|
58
59
|
var modal = modalRef.current;
|
|
59
60
|
var allowForm = form.filter(function (v) {
|
|
60
|
-
return v.
|
|
61
|
+
return v.widgetType === 'SINGLE_SELECTION' && v.required;
|
|
61
62
|
});
|
|
62
63
|
|
|
63
64
|
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, {
|
|
@@ -170,15 +170,10 @@ function UserSelectType2(_ref3) {
|
|
|
170
170
|
_onChange3 = _ref3.onChange,
|
|
171
171
|
type = _ref3.type,
|
|
172
172
|
emptyUsers = _ref3.emptyUsers;
|
|
173
|
-
var userList = useMemo(function () {
|
|
174
|
-
return users.filter(function (v) {
|
|
175
|
-
return v.key === 'userId';
|
|
176
|
-
});
|
|
177
|
-
}, [users]);
|
|
178
173
|
return /*#__PURE__*/React.createElement("div", {
|
|
179
174
|
className: "user-select-type1"
|
|
180
175
|
}, /*#__PURE__*/React.createElement(UserAndGroupSelect, {
|
|
181
|
-
userList:
|
|
176
|
+
userList: users,
|
|
182
177
|
onChange: function onChange(users) {
|
|
183
178
|
return _onChange3(_defineProperty({}, type, users));
|
|
184
179
|
}
|
|
@@ -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
|
}
|
|
@@ -205,9 +207,12 @@ function WorkerFlow(_ref, ref) {
|
|
|
205
207
|
}).includes(node.type)) {
|
|
206
208
|
var nodeName = node.type === 4 ? node.conditionNodes[index].nodeName : node.nodeName;
|
|
207
209
|
var FormContent = FormMap[node.type];
|
|
208
|
-
var
|
|
210
|
+
var fiels = node.type === 4 ? _toConsumableArray(node.conditionNodes.map(function (v) {
|
|
209
211
|
return v.id !== node.conditionNodes[index].id ? v.conditionList : [];
|
|
210
212
|
})).flat() : [];
|
|
213
|
+
var useConditionFields = fiels.filter(function (v) {
|
|
214
|
+
return !!v;
|
|
215
|
+
});
|
|
211
216
|
var nodeItem = node.type === 4 ? node.conditionNodes[index] : node;
|
|
212
217
|
var from = nodeItem.form ? form.map(function (v) {
|
|
213
218
|
return nodeItem.form.find(function (v2) {
|
|
@@ -260,7 +265,9 @@ function WorkerFlow(_ref, ref) {
|
|
|
260
265
|
}, [config]);
|
|
261
266
|
|
|
262
267
|
_useChangeEffect(function () {
|
|
263
|
-
|
|
268
|
+
if (onChange) {
|
|
269
|
+
onChange(getConfig());
|
|
270
|
+
}
|
|
264
271
|
}, [config]);
|
|
265
272
|
|
|
266
273
|
useImperativeHandle(ref, function () {
|
|
@@ -276,7 +283,8 @@ function WorkerFlow(_ref, ref) {
|
|
|
276
283
|
onInsertNode: onInsertNode,
|
|
277
284
|
onDeleteNode: onDeleteNode,
|
|
278
285
|
onSelectNode: onSelectNode,
|
|
279
|
-
readOnly: readOnly
|
|
286
|
+
readOnly: readOnly,
|
|
287
|
+
errorIds: errorIds
|
|
280
288
|
}
|
|
281
289
|
}, /*#__PURE__*/React.createElement("div", {
|
|
282
290
|
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);
|
|
@@ -166,8 +168,7 @@ export function getUserFormKeys(data) {
|
|
|
166
168
|
var arr = [];
|
|
167
169
|
|
|
168
170
|
var fn = function fn(node) {
|
|
169
|
-
if (node.bpmnType == 'sequenceFlow') {
|
|
170
|
-
console.log(node.conditionList);
|
|
171
|
+
if (node.bpmnType == 'sequenceFlow' && 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.48",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "dumi dev",
|
|
8
8
|
"docs:build": "dumi build",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"rc-queue-anim": "^2.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@cloud-app-dev/utils": "^2.0.
|
|
41
|
-
"@cloud-app-dev/basic-components": "^1.0.
|
|
40
|
+
"@cloud-app-dev/utils": "^2.0.2",
|
|
41
|
+
"@cloud-app-dev/basic-components": "^1.0.62",
|
|
42
42
|
"@types/chroma-js": "^2.1.3",
|
|
43
43
|
"@types/lodash": "^4.14.172",
|
|
44
44
|
"@umijs/test": "^3.0.5",
|