@cloud-app-dev/vidc 1.0.46 → 1.0.50

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.
Files changed (42) hide show
  1. package/.umirc.ts +1 -1
  2. package/README.md +4 -0
  3. package/es/Api/index.d.ts +1 -1
  4. package/es/Api/index.js +7 -1
  5. package/es/AppLayout/Header/ModifyPassword/index.js +1 -1
  6. package/es/AppLayout/Header/ModifyUserAvatar/index.css +4 -0
  7. package/es/AppLayout/Header/ModifyUserAvatar/index.js +2 -3
  8. package/es/AutoExit/index.d.ts +1 -1
  9. package/es/List/index.css +6 -0
  10. package/es/OrgTree/index.js +1 -2
  11. package/es/OrgUserTree/index.js +1 -2
  12. package/es/PlaceTree/index.js +1 -2
  13. package/es/RefDrawer/index.d.ts +2 -2
  14. package/es/RefModal/index.d.ts +2 -2
  15. package/es/TreeMode/index.css +7 -0
  16. package/es/TreeMode/index.d.ts +2 -1
  17. package/es/TreeMode/index.js +7 -5
  18. package/es/UserSelect/demo.js +4 -3
  19. package/es/UserSelect/index.d.ts +4 -0
  20. package/es/UserSelect/index.js +15 -3
  21. package/es/WorkerFlow/Demo.js +5 -1
  22. package/es/WorkerFlow/Form/Condition.js +8 -8
  23. package/es/WorkerFlow/Form/GroupSelect.js +18 -3
  24. package/es/WorkerFlow/Form/LevelGroupSelect.js +33 -11
  25. package/es/WorkerFlow/Form/UserAndGroupSelect.js +22 -4
  26. package/es/WorkerFlow/Form/UserSelect.js +18 -3
  27. package/es/WorkerFlow/Form/UserSet.js +1 -6
  28. package/es/WorkerFlow/Form/utils.d.ts +1 -0
  29. package/es/WorkerFlow/Form/utils.js +21 -0
  30. package/es/WorkerFlow/Nodes/Approver.js +4 -2
  31. package/es/WorkerFlow/Nodes/Condition.js +15 -9
  32. package/es/WorkerFlow/Nodes/Constants.js +1 -1
  33. package/es/WorkerFlow/Nodes/Handle.js +4 -2
  34. package/es/WorkerFlow/Nodes/Notifier.js +4 -2
  35. package/es/WorkerFlow/Nodes/TitleElement.js +14 -7
  36. package/es/WorkerFlow/Nodes/Wrap.js +8 -2
  37. package/es/WorkerFlow/index.css +6 -2
  38. package/es/WorkerFlow/index.d.ts +1 -0
  39. package/es/WorkerFlow/index.js +16 -8
  40. package/es/WorkerFlow/interface.d.ts +1 -0
  41. package/es/WorkerFlow/utils.js +1 -2
  42. 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.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTYzODA3ODM3NjE0NSwidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjM3ODE5MTc2MTQ1fQ.x9o6vi8T5YW7P05AkeQh1Sse8sp6tGs7zxUWgB_rxtk';
5
+ 'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTYzODY4NzgyNzEwNywidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjM4NDI4NjI3MTA3fQ.eEvUc9_eGBdUi2QCMDNjOYgTzTKwiLX-7DEQ_O9kjhs';
6
6
 
7
7
  export default defineConfig({
8
8
  title: '云应用-业务组件库',
package/README.md CHANGED
@@ -25,3 +25,7 @@ Build library via `father-build`,
25
25
  ```bash
26
26
  $ npm run build
27
27
  ```
28
+
29
+ ### Changlog
30
+
31
+ - 1.0.48 修复工作流 bug
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.log(_context.t0);
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;
@@ -19,3 +19,7 @@
19
19
  display: flex;
20
20
  align-items: flex-end;
21
21
  }
22
+ .lm-c-modify-user-avatar-box .lm-upload-content {
23
+ width: 100%;
24
+ height: 100%;
25
+ }
@@ -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(_CBox, {
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(_CBox, {
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"
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface IAutoExitProps {
3
- children: React.ReactNode;
3
+ children?: React.ReactNode;
4
4
  }
5
5
  declare function AutoExit({ children }: IAutoExitProps): JSX.Element;
6
6
  export default AutoExit;
package/es/List/index.css CHANGED
@@ -1,3 +1,9 @@
1
1
  .vidc-list-component {
2
2
  margin-left: -1px;
3
3
  }
4
+ .vidc-list-component .lm-c-base-list-layout .list-item .item-info .anticon {
5
+ color: var(--icon);
6
+ }
7
+ .vidc-list-component .lm-c-base-list-layout .list-item:hover .item-info .anticon {
8
+ color: inherit;
9
+ }
@@ -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(_CBox, {
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,
@@ -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(_CBox, {
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,
@@ -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(_CBox, {
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,
@@ -7,9 +7,9 @@ export interface IUseDrawerHookState {
7
7
  width?: number | string;
8
8
  className?: string;
9
9
  }
10
- export interface IDrawerMethodsProps {
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<IDrawerMethodsProps>>;
14
+ declare const _default: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<IRefDrawerMethodsProps>>;
15
15
  export default _default;
@@ -7,9 +7,9 @@ export interface IUseModalHookState {
7
7
  width?: number | string;
8
8
  className?: string;
9
9
  }
10
- export interface IModalMethodsProps {
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<IModalMethodsProps>>;
14
+ declare const _default: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<IRefModalMethodsProps>>;
15
15
  export default _default;
@@ -29,3 +29,10 @@
29
29
  display: inline-flex;
30
30
  justify-content: space-between;
31
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
+ }
@@ -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;
@@ -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
- props = __rest(_a, ["title", "className", "renderHeader", "inputPlaceholder", "treeNodeProps", "onDefailtSelect", "mode"]);
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(_CBox, {
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 > 0 && node.id === treeData[0].id ? 'icon-S_Bar_Home' : mode === 'Place' && node.level > 4 ? 'icon-S_Place_Place' : 'icon-S_Photo_ListTree')
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;
@@ -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 OrgTree from './index';
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(OrgTree, {
16
- selectUsers: []
15
+ }, /*#__PURE__*/React.createElement(UserSelect, {
16
+ selectUsers: [],
17
+ filterUserIds: ['101003000142']
17
18
  })));
18
19
  }
19
20
 
@@ -5,6 +5,10 @@ interface IUserSelectProps {
5
5
  selectUsers: UserInfo[];
6
6
  onChange?: (users: UserInfo[]) => void;
7
7
  className?: string;
8
+ /**
9
+ * @description 过滤不需要的用户
10
+ */
11
+ filterUserIds?: string[];
8
12
  /**
9
13
  * @description getUser其他参数
10
14
  */
@@ -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
 
@@ -2,6 +2,7 @@ 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,
@@ -45,8 +46,11 @@ var App = function App() {
45
46
  }
46
47
  }, /*#__PURE__*/React.createElement(WorkerFlow, {
47
48
  form: form,
49
+ data: data.data,
50
+ readOnly: false,
48
51
  onChange: console.log,
49
- hasTools: true
52
+ hasTools: true,
53
+ errorIds: ['UserTask_2222', 'SequenceFlow_6666']
50
54
  })));
51
55
  };
52
56
 
@@ -4,7 +4,6 @@ import "antd/lib/button/style";
4
4
  import _Button from "antd/lib/button";
5
5
  import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
6
6
  import _ContentBox from "@cloud-app-dev/basic-components/es/ContentBox";
7
- import _useChangeEffect from "@cloud-app-dev/basic-components/es/useChangeEffect";
8
7
 
9
8
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
9
 
@@ -18,20 +17,23 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
18
17
 
19
18
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
19
 
21
- import React, { useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
20
+ import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
22
21
  import RefModal from '../../RefModal';
23
22
 
24
23
  function ConditionForm(_ref) {
25
24
  var form = _ref.form,
26
25
  item = _ref.item,
27
26
  onChange = _ref.onChange,
28
- useConditionFields = _ref.useConditionFields;
27
+ _ref$useConditionFiel = _ref.useConditionFields,
28
+ useConditionFields = _ref$useConditionFiel === void 0 ? [] : _ref$useConditionFiel;
29
29
 
30
30
  var _a, _b;
31
31
 
32
+ console.log(item, useConditionFields);
33
+
32
34
  var _useState = useState({
33
- field: ((_a = item === null || item === void 0 ? void 0 : item.conditionList[0]) === null || _a === void 0 ? void 0 : _a.field) || '',
34
- value: ((_b = item === null || item === void 0 ? void 0 : item.conditionList[0]) === null || _b === void 0 ? void 0 : _b.value) || ''
35
+ field: (item === null || item === void 0 ? void 0 : item.conditionList) ? (_a = item.conditionList[0]) === null || _a === void 0 ? void 0 : _a.field : '',
36
+ 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
37
  }),
36
38
  _useState2 = _slicedToArray(_useState, 2),
37
39
  state = _useState2[0],
@@ -103,8 +105,7 @@ function ConditionForm(_ref) {
103
105
  };
104
106
  });
105
107
  }, []);
106
-
107
- _useChangeEffect(function () {
108
+ useEffect(function () {
108
109
  if (state.field !== undefined && state.value !== undefined && formItem) {
109
110
  var conditionList = [{
110
111
  field: state.field,
@@ -128,7 +129,6 @@ function ConditionForm(_ref) {
128
129
  });
129
130
  }
130
131
  }, [state.field, state.value, formItem, options]);
131
-
132
132
  return /*#__PURE__*/React.createElement(_ContentBox.InfoBox, {
133
133
  title: "\u8BBE\u7F6E\u6761\u4EF6",
134
134
  contentStyle: {
@@ -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
- }, /*#__PURE__*/React.createElement(_Button, {
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("div", {
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", {
@@ -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
- }, /*#__PURE__*/React.createElement("span", null, "\u6307\u5B9A\u5C97\u4F4D\uFF08\u540C\u65F6\u662F\u4E3B\u7BA1\uFF09", /*#__PURE__*/React.createElement(_IconFont, {
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("div", {
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
- }, /*#__PURE__*/React.createElement(_Select.Option, {
173
- value: 1
174
- }, "\u7B2C\u4E00\u7EA7\u4E3B\u7BA1"), /*#__PURE__*/React.createElement(_Select.Option, {
175
- value: 2
176
- }, "\u7B2C\u4E8C\u7EA7\u4E3B\u7BA1"), /*#__PURE__*/React.createElement(_Select.Option, {
177
- value: 3
178
- }, "\u7B2C\u4E09\u7EA7\u4E3B\u7BA1"))), /*#__PURE__*/React.createElement(RefModal, {
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 ? '添加人员' : '修改人员'), /*#__PURE__*/React.createElement("span", {
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")), /*#__PURE__*/React.createElement("div", {
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' ? state.userList.map(function (v) {
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
- }, /*#__PURE__*/React.createElement(_Button, {
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("div", {
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: userList,
176
+ userList: users,
182
177
  onChange: function onChange(users) {
183
178
  return _onChange3(_defineProperty({}, type, users));
184
179
  }
@@ -1,2 +1,3 @@
1
1
  import { NodeUserType } from '../interface';
2
2
  export declare function formatRenderGroup(list?: NodeUserType[]): [string, NodeUserType[]][];
3
+ export declare function ToUpperNumberString(n: string): string;
@@ -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; // TODO: 这里读取props数据
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
- return node.nodeName = val;
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
- return node.nodeName = val;
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
- return node.nodeName = val;
27
+ node.nodeName = val;
28
+ updateNode();
27
29
  }
28
30
  });
29
31
  return /*#__PURE__*/React.createElement(NodeWrap, {
@@ -13,7 +13,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
13
13
 
14
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
 
16
- import React, { useState, useEffect, useRef, useCallback } from 'react';
16
+ import React, { useState, useEffect, useRef, useCallback, useContext } from 'react';
17
+ import WFC from '../OperatorContext';
17
18
 
18
19
  function TitleElement(_ref) {
19
20
  var nodeName = _ref.nodeName,
@@ -22,6 +23,9 @@ function TitleElement(_ref) {
22
23
  icon = _ref.icon,
23
24
  delNode = _ref.delNode;
24
25
 
26
+ var _useContext = useContext(WFC),
27
+ readOnly = _useContext.readOnly;
28
+
25
29
  var _useState = useState(nodeName),
26
30
  _useState2 = _slicedToArray(_useState, 2),
27
31
  title = _useState2[0],
@@ -41,19 +45,19 @@ function TitleElement(_ref) {
41
45
  }
42
46
  }, [title, placeholder]);
43
47
  useEffect(function () {
44
- return editable && input.current.focus();
48
+ return !readOnly && editable && input.current.focus();
45
49
  }, [editable]);
46
50
 
47
51
  _useChangeEffect(function () {
48
- onTitleChange && onTitleChange(title);
49
- }, [title]);
52
+ !readOnly && !editable && onTitleChange && onTitleChange(title);
53
+ }, [title, editable]);
50
54
 
51
55
  return /*#__PURE__*/React.createElement(React.Fragment, null, icon && /*#__PURE__*/React.createElement(_IconFont, {
52
56
  type: icon,
53
57
  style: {
54
58
  paddingRight: 4
55
59
  }
56
- }), editable ? /*#__PURE__*/React.createElement("input", {
60
+ }), !readOnly && editable ? /*#__PURE__*/React.createElement("input", {
57
61
  ref: input,
58
62
  type: "text",
59
63
  className: "cloudapp-input editable-title-input",
@@ -70,8 +74,11 @@ function TitleElement(_ref) {
70
74
  className: "editable-title",
71
75
  onClick: function onClick() {
72
76
  return setEditable(true);
73
- }
74
- }, title), /*#__PURE__*/React.createElement(_IconFont, {
77
+ },
78
+ style: readOnly ? {
79
+ borderColor: 'transparent'
80
+ } : undefined
81
+ }, title), !readOnly && /*#__PURE__*/React.createElement(_IconFont, {
75
82
  className: "worker-flow-node-del",
76
83
  type: "icon-MarkNo",
77
84
  onClick: delNode,
@@ -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: 'node-wrap-box ' + (type === NodeTypes.START ? 'start-node' : ''),
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",
@@ -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(0, 0, 0, 0.1);
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(0, 0, 0, 0.1);
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
  }
@@ -4,6 +4,7 @@ import './index.less';
4
4
  interface IWorkFlowProps {
5
5
  data?: WorkerFlowRequest;
6
6
  form?: WorkerFlowFormType[];
7
+ errorIds?: string[];
7
8
  onChange?: (data: SubmitData) => void;
8
9
  readOnly?: boolean;
9
10
  hasTools?: boolean;
@@ -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\u8282\u70B9\"".concat(type === NodeTypes.BRANCH ? node.conditionNodes[index].nodeName : node.nodeName, "\"\uFF1F");
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 ? '直属主管' : data.nodeUserList.map(function (v) {
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 useConditionFields = node.type === 4 ? _toConsumableArray(node.conditionNodes.map(function (v) {
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
- onChange && onChange(getConfig());
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"
@@ -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;
@@ -168,8 +168,7 @@ export function getUserFormKeys(data) {
168
168
  var arr = [];
169
169
 
170
170
  var fn = function fn(node) {
171
- if (node.bpmnType == 'sequenceFlow') {
172
- console.log(node.conditionList);
171
+ if (node.bpmnType == 'sequenceFlow' && node.conditionList) {
173
172
  arr.push.apply(arr, _toConsumableArray(node.conditionList));
174
173
  }
175
174
 
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.46",
5
+ "version": "1.0.50",
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.1",
41
- "@cloud-app-dev/basic-components": "^1.0.56",
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",