@cloud-app-dev/vidc 1.0.46 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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;
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
+ }
@@ -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;
@@ -40,7 +40,8 @@ function TreeMode(_a) {
40
40
  treeNodeProps = _a.treeNodeProps,
41
41
  onDefailtSelect = _a.onDefailtSelect,
42
42
  mode = _a.mode,
43
- props = __rest(_a, ["title", "className", "renderHeader", "inputPlaceholder", "treeNodeProps", "onDefailtSelect", "mode"]);
43
+ showIcon = _a.showIcon,
44
+ props = __rest(_a, ["title", "className", "renderHeader", "inputPlaceholder", "treeNodeProps", "onDefailtSelect", "mode", "showIcon"]);
44
45
 
45
46
  var _useState = useState({
46
47
  keyword: undefined,
@@ -168,6 +169,7 @@ function TreeMode(_a) {
168
169
  }), renderHeader && renderHeader(), list.length > 0 && /*#__PURE__*/React.createElement(_Tree, Object.assign({}, props, {
169
170
  treeData: treeData,
170
171
  key: state.focusKey,
172
+ showIcon: showIcon,
171
173
  onExpand: function onExpand(keys) {
172
174
  return setState(function (old) {
173
175
  return Object.assign(Object.assign({}, old), {
@@ -185,7 +187,7 @@ function TreeMode(_a) {
185
187
  },
186
188
  icon: function icon(node) {
187
189
  return /*#__PURE__*/React.createElement(_IconFont, {
188
- type: "".concat(treeData.length > 0 && node.id === treeData[0].id ? 'icon-S_Bar_Home' : mode === 'Place' && node.level > 4 ? 'icon-S_Place_Place' : 'icon-S_Photo_ListTree')
190
+ type: "".concat(treeData.length === 1 && node.id === treeData[0].id ? 'icon-S_Bar_Home' : mode === 'Place' ? node.level > 4 ? 'icon-S_Place_Place' : 'icon-S_Bar_Add' : 'icon-S_Photo_ListTree')
189
191
  });
190
192
  }
191
193
  })));
@@ -194,6 +196,7 @@ function TreeMode(_a) {
194
196
  TreeMode.defaultProps = {
195
197
  mode: 'Bz',
196
198
  className: '',
197
- treeNodeProps: {}
199
+ treeNodeProps: {},
200
+ showIcon: true
198
201
  };
199
202
  export default TreeMode;
@@ -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,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
 
@@ -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, {
@@ -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, {
@@ -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: '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
  }
@@ -260,7 +262,9 @@ function WorkerFlow(_ref, ref) {
260
262
  }, [config]);
261
263
 
262
264
  _useChangeEffect(function () {
263
- onChange && onChange(getConfig());
265
+ if (onChange) {
266
+ onChange(getConfig());
267
+ }
264
268
  }, [config]);
265
269
 
266
270
  useImperativeHandle(ref, function () {
@@ -276,7 +280,8 @@ function WorkerFlow(_ref, ref) {
276
280
  onInsertNode: onInsertNode,
277
281
  onDeleteNode: onDeleteNode,
278
282
  onSelectNode: onSelectNode,
279
- readOnly: readOnly
283
+ readOnly: readOnly,
284
+ errorIds: errorIds
280
285
  }
281
286
  }, /*#__PURE__*/React.createElement("div", {
282
287
  className: "worker-flow-container"
@@ -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;
@@ -169,7 +169,6 @@ export function getUserFormKeys(data) {
169
169
 
170
170
  var fn = function fn(node) {
171
171
  if (node.bpmnType == 'sequenceFlow') {
172
- console.log(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.47",
6
6
  "scripts": {
7
7
  "start": "dumi dev",
8
8
  "docs:build": "dumi build",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@cloud-app-dev/utils": "^2.0.1",
41
- "@cloud-app-dev/basic-components": "^1.0.56",
41
+ "@cloud-app-dev/basic-components": "^1.0.58",
42
42
  "@types/chroma-js": "^2.1.3",
43
43
  "@types/lodash": "^4.14.172",
44
44
  "@umijs/test": "^3.0.5",