@cloud-app-dev/vidc 1.0.35 → 1.0.39

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 (49) hide show
  1. package/.umirc.ts +1 -1
  2. package/es/Api/index.d.ts +4 -1
  3. package/es/Api/index.js +90 -0
  4. package/es/AppLayout/index.d.ts +2 -2
  5. package/es/DeviceList/index.d.ts +2 -2
  6. package/es/DeviceList/index.js +5 -3
  7. package/es/DeviceSelect/demo.d.ts +2 -0
  8. package/es/DeviceSelect/demo.js +22 -0
  9. package/es/DeviceSelect/index.css +6 -0
  10. package/es/DeviceSelect/index.d.ts +7 -0
  11. package/es/DeviceSelect/index.js +222 -0
  12. package/es/DynamicDeviceList/CheckExt.d.ts +8 -0
  13. package/es/DynamicDeviceList/CheckExt.js +36 -0
  14. package/es/DynamicDeviceList/Demo.js +1 -5
  15. package/es/DynamicDeviceList/index.css +20 -0
  16. package/es/DynamicDeviceList/index.d.ts +7 -4
  17. package/es/DynamicDeviceList/index.js +100 -49
  18. package/es/DynamicDeviceList/utils.d.ts +1 -2
  19. package/es/OrgTree/index.js +5 -5
  20. package/es/OrgUserTree/index.d.ts +1 -1
  21. package/es/OrgUserTree/index.js +10 -10
  22. package/es/PlaceTree/demo.d.ts +2 -0
  23. package/es/PlaceTree/demo.js +20 -0
  24. package/es/PlaceTree/index.css +1 -0
  25. package/es/PlaceTree/index.d.ts +2 -2
  26. package/es/PlaceTree/index.js +27 -22
  27. package/es/TreeMode/demo.d.ts +2 -0
  28. package/es/TreeMode/demo.js +30 -0
  29. package/es/TreeMode/index.css +36 -0
  30. package/es/TreeMode/index.d.ts +21 -0
  31. package/es/TreeMode/index.js +190 -0
  32. package/es/TreeTitle/index.d.ts +2 -1
  33. package/es/TreeTitle/index.js +4 -2
  34. package/es/WorkerFlow/Form/GroupList.d.ts +1 -1
  35. package/es/WorkerFlow/Form/GroupList.js +3 -1
  36. package/es/WorkerFlow/Form/GroupSelectModalContent.js +11 -10
  37. package/es/WorkerFlow/Form/Notifier.js +2 -1
  38. package/es/WorkerFlow/Form/UserSelectModalContent.js +4 -3
  39. package/es/WorkerFlow/Form/UserSet.js +5 -2
  40. package/es/WorkerFlow/index.js +13 -6
  41. package/es/WorkerFlow/utils.d.ts +2 -0
  42. package/es/WorkerFlow/utils.js +35 -6
  43. package/es/core.d.ts +91 -0
  44. package/es/index.d.ts +2 -0
  45. package/es/index.js +2 -0
  46. package/es/utils.d.ts +6 -0
  47. package/es/utils.js +30 -1
  48. package/package.json +2 -2
  49. package/es/DynamicDeviceList/interface.d.ts +0 -75
@@ -0,0 +1,190 @@
1
+ import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
2
+ import _Tree from "@cloud-app-dev/basic-components/es/Tree";
3
+ import _CBox from "@cloud-app-dev/basic-components/es/CBox";
4
+ import _useHttp2 from "@cloud-app-dev/basic-components/es/useHttp";
5
+
6
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
7
+
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+
10
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
+
12
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
+
14
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
+
16
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+
18
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
+
20
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21
+
22
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
23
+
24
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
25
+
26
+ import { __rest } from "tslib";
27
+ import React, { useEffect, useMemo, useState } from 'react';
28
+ import api from '../Api';
29
+ import TreeTitle from '../TreeTitle';
30
+ import { treeHelper } from '@cloud-app-dev/utils';
31
+ import { getParentListById, getPlaceCodesWithParent } from '../utils';
32
+ import "./index.css";
33
+ var defaultList = [];
34
+
35
+ function TreeMode(_a) {
36
+ var title = _a.title,
37
+ className = _a.className,
38
+ renderHeader = _a.renderHeader,
39
+ inputPlaceholder = _a.inputPlaceholder,
40
+ treeNodeProps = _a.treeNodeProps,
41
+ onDefailtSelect = _a.onDefailtSelect,
42
+ mode = _a.mode,
43
+ props = __rest(_a, ["title", "className", "renderHeader", "inputPlaceholder", "treeNodeProps", "onDefailtSelect", "mode"]);
44
+
45
+ var _useState = useState({
46
+ keyword: undefined,
47
+ expandedKeys: undefined,
48
+ focusKey: Date.now()
49
+ }),
50
+ _useState2 = _slicedToArray(_useState, 2),
51
+ state = _useState2[0],
52
+ setState = _useState2[1];
53
+ /**
54
+ * @description 根据mode获取树的数据
55
+ */
56
+
57
+
58
+ var _useHttp = _useHttp2(['TreeMode', mode], function (_ref) {
59
+ var _ref2 = _slicedToArray(_ref, 2),
60
+ _ = _ref2[0],
61
+ mode = _ref2[1];
62
+
63
+ return mode === 'Bz' ? api.getDeviceBzTree() : mode === 'Custom' ? api.getCustomDeviceGroup() : mode === 'Org' ? api.getOrgs() : api.getPlacesByHasDevice();
64
+ }),
65
+ _useHttp$data = _useHttp.data,
66
+ list = _useHttp$data === void 0 ? defaultList : _useHttp$data;
67
+
68
+ var treeData = useMemo(function () {
69
+ return mode === 'Place' ? treeHelper.computPlaceTree(list) : treeHelper.computTreeList(list);
70
+ }, [list, mode]);
71
+ useEffect(function () {
72
+ var _a, _b;
73
+
74
+ var keys = [];
75
+ var defaultKeys = mode === 'Place' ? [] : ((_a = treeData[0]) === null || _a === void 0 ? void 0 : _a.id) ? [(_b = treeData[0]) === null || _b === void 0 ? void 0 : _b.id] : [];
76
+
77
+ if (!state.keyword) {
78
+ setState(function (old) {
79
+ return Object.assign(Object.assign({}, old), {
80
+ expandedKeys: defaultKeys,
81
+ focusKey: Date.now()
82
+ });
83
+ });
84
+ return null;
85
+ }
86
+
87
+ switch (mode) {
88
+ case 'Place':
89
+ var places = list.filter(function (v) {
90
+ return v.areaName.includes(state.keyword);
91
+ });
92
+ places.forEach(function (v) {
93
+ var codes = getPlaceCodesWithParent(v.areaCode, list);
94
+ keys = [].concat(keys, codes);
95
+ });
96
+ break;
97
+
98
+ case 'Bz':
99
+ case 'Custom':
100
+ var trees = list.filter(function (v) {
101
+ return v.groupName.includes(state.keyword);
102
+ });
103
+ trees.forEach(function (v) {
104
+ var ids = getParentListById(v.id, list).map(function (v) {
105
+ return v.id;
106
+ });
107
+ keys = [].concat(keys, ids);
108
+ });
109
+
110
+ case 'Org':
111
+ var orgs = list.filter(function (v) {
112
+ return v.organizationName.includes(state.keyword);
113
+ });
114
+ orgs.forEach(function (v) {
115
+ var ids = getParentListById(v.id, list).map(function (v) {
116
+ return v.id;
117
+ });
118
+ keys = [].concat(keys, ids);
119
+ });
120
+ break;
121
+ }
122
+
123
+ var expandedKeys = _toConsumableArray(new Set(_toConsumableArray(keys)));
124
+
125
+ setState(function (old) {
126
+ var _a;
127
+
128
+ return Object.assign(Object.assign({}, old), {
129
+ expandedKeys: expandedKeys.length > 0 ? expandedKeys : [(_a = treeData[0]) === null || _a === void 0 ? void 0 : _a.id],
130
+ focusKey: Date.now()
131
+ });
132
+ });
133
+ }, [state.keyword, list, treeData, mode]);
134
+ var treeKey = useMemo(function () {
135
+ return mode === 'Place' ? 'areaCode' : 'id';
136
+ }, [mode]);
137
+ var treeName = useMemo(function () {
138
+ return mode === 'Place' ? 'areaName' : mode === 'Org' ? 'organizationName' : 'groupName';
139
+ }, [mode]);
140
+ useEffect(function () {
141
+ var id = treeData[0] ? treeData[0][treeKey] : undefined;
142
+
143
+ if (id && onDefailtSelect) {
144
+ onDefailtSelect(id);
145
+ }
146
+ }, [treeData, treeKey]);
147
+ return /*#__PURE__*/React.createElement(_CBox, {
148
+ className: "bc-type-tree-layout ".concat(className)
149
+ }, /*#__PURE__*/React.createElement(TreeTitle, {
150
+ title: title,
151
+ value: state.keyword,
152
+ inputPlaceholder: inputPlaceholder,
153
+ onChange: function onChange(val) {
154
+ return setState(function (old) {
155
+ return Object.assign(Object.assign({}, old), {
156
+ keyword: val
157
+ });
158
+ });
159
+ }
160
+ }), renderHeader && renderHeader(), list.length > 0 && /*#__PURE__*/React.createElement(_Tree, Object.assign({}, props, {
161
+ treeData: treeData,
162
+ key: state.focusKey,
163
+ onExpand: function onExpand(keys) {
164
+ return setState(function (old) {
165
+ return Object.assign(Object.assign({}, old), {
166
+ expandedKeys: keys
167
+ });
168
+ });
169
+ },
170
+ expandedKeys: state.expandedKeys,
171
+ defaultExpandedKeys: treeData[0] ? [treeData[0].id] : undefined,
172
+ treeNodeProps: {
173
+ keyword: state.keyword,
174
+ suffix: treeNodeProps === null || treeNodeProps === void 0 ? void 0 : treeNodeProps.suffix,
175
+ nameKey: treeName,
176
+ key: treeKey
177
+ },
178
+ icon: function icon(node) {
179
+ return /*#__PURE__*/React.createElement(_IconFont, {
180
+ 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')
181
+ });
182
+ }
183
+ })));
184
+ }
185
+
186
+ TreeMode.defaultProps = {
187
+ mode: 'Bz',
188
+ className: ''
189
+ };
190
+ export default TreeMode;
@@ -6,6 +6,7 @@ interface ITreeTitleProps {
6
6
  onChange?: (val: string) => void;
7
7
  hasInput?: boolean;
8
8
  titleExt?: React.ReactNode;
9
+ value?: string;
9
10
  }
10
- export default function TreeTitle({ title, inputPlaceholder, onChange, hasInput, titleExt }: ITreeTitleProps): JSX.Element;
11
+ export default function TreeTitle({ title, inputPlaceholder, onChange, hasInput, titleExt, value }: ITreeTitleProps): JSX.Element;
11
12
  export {};
@@ -7,7 +7,8 @@ export default function TreeTitle(_ref) {
7
7
  onChange = _ref.onChange,
8
8
  _ref$hasInput = _ref.hasInput,
9
9
  hasInput = _ref$hasInput === void 0 ? true : _ref$hasInput,
10
- titleExt = _ref.titleExt;
10
+ titleExt = _ref.titleExt,
11
+ value = _ref.value;
11
12
 
12
13
  if (!title) {
13
14
  return null;
@@ -20,6 +21,7 @@ export default function TreeTitle(_ref) {
20
21
  }, title), hasInput && /*#__PURE__*/React.createElement(_Input, {
21
22
  className: "input-keword",
22
23
  placeholder: inputPlaceholder,
23
- onChange: onChange
24
+ onChange: onChange,
25
+ value: value
24
26
  }), titleExt);
25
27
  }
@@ -6,5 +6,5 @@ interface IGroupListProps {
6
6
  keywords?: string;
7
7
  onChecked: (ids: string[]) => void;
8
8
  }
9
- declare function GroupList({ list, onKeywordChange, onChecked }: IGroupListProps): JSX.Element;
9
+ declare function GroupList({ list, onKeywordChange, onChecked, checkedKeys }: IGroupListProps): JSX.Element;
10
10
  export default GroupList;
@@ -6,7 +6,8 @@ import TreeTitle from '../../TreeTitle';
6
6
  function GroupList(_ref) {
7
7
  var list = _ref.list,
8
8
  onKeywordChange = _ref.onKeywordChange,
9
- onChecked = _ref.onChecked;
9
+ onChecked = _ref.onChecked,
10
+ checkedKeys = _ref.checkedKeys;
10
11
  return /*#__PURE__*/React.createElement("div", {
11
12
  className: "lm-c-check-list-wrapper vidc-list-component post-group-list"
12
13
  }, /*#__PURE__*/React.createElement(TreeTitle, {
@@ -17,6 +18,7 @@ function GroupList(_ref) {
17
18
  }), /*#__PURE__*/React.createElement("div", {
18
19
  className: "lm-c-base-list-layout"
19
20
  }, /*#__PURE__*/React.createElement(_Checkbox.Group, {
21
+ value: checkedKeys,
20
22
  onChange: function onChange(v) {
21
23
  return onChecked(v);
22
24
  }
@@ -22,7 +22,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
22
 
23
23
  import React, { useCallback, useMemo, useState, useImperativeHandle } from 'react';
24
24
  import api from '../../Api';
25
- import OrgTree from '../../OrgTree';
25
+ import TreeMode from '../../TreeMode';
26
26
  import List from '../../List';
27
27
  import { uniq, intersectionWith } from 'lodash';
28
28
  import { treeHelper } from '@cloud-app-dev/utils';
@@ -66,10 +66,10 @@ function GroupSelectModalContent(_ref, ref) {
66
66
  return id ? api.getPosts(id) : Promise.resolve();
67
67
  }),
68
68
  _useHttp3$data = _useHttp3.data,
69
- userList = _useHttp3$data === void 0 ? [] : _useHttp3$data;
69
+ groupList = _useHttp3$data === void 0 ? [] : _useHttp3$data;
70
70
 
71
71
  var onUserChecked1 = useCallback(function (ids) {
72
- var items = userList.filter(function (v) {
72
+ var items = groupList.filter(function (v) {
73
73
  return ids.includes(v.id);
74
74
  });
75
75
  var arr = [];
@@ -90,7 +90,7 @@ function GroupSelectModalContent(_ref, ref) {
90
90
  selectIds: uniq([].concat(_toConsumableArray(old.selectIds), _toConsumableArray(ids)))
91
91
  });
92
92
  });
93
- }, [userList, orgList]);
93
+ }, [groupList, orgList]);
94
94
  var onUserChecked2 = useCallback(function (ids) {
95
95
  return setState(function (old) {
96
96
  return Object.assign(Object.assign({}, old), {
@@ -99,12 +99,12 @@ function GroupSelectModalContent(_ref, ref) {
99
99
  });
100
100
  }, []);
101
101
  var list1CheckedKeys = useMemo(function () {
102
- return intersectionWith(userList, state.selectUsers, function (a, b) {
102
+ return intersectionWith(groupList, state.selectUsers, function (a, b) {
103
103
  return a.id === b.value;
104
104
  }).map(function (v) {
105
105
  return v.id;
106
106
  });
107
- }, [userList, state.selectUsers]);
107
+ }, [groupList, state.selectUsers]);
108
108
  useImperativeHandle(ref, function () {
109
109
  return {
110
110
  userList: state.selectUsers.filter(function (v) {
@@ -117,8 +117,9 @@ function GroupSelectModalContent(_ref, ref) {
117
117
  }, [state.selectUsers]);
118
118
  return /*#__PURE__*/React.createElement("div", {
119
119
  className: "user-select-modal-content"
120
- }, /*#__PURE__*/React.createElement(OrgTree, {
120
+ }, /*#__PURE__*/React.createElement(TreeMode, {
121
121
  treeData: treeData,
122
+ mode: "Org",
122
123
  title: "\u7EC4\u7EC7\u673A\u6784",
123
124
  onSelect: function onSelect(ids) {
124
125
  return setState(function (old) {
@@ -127,11 +128,11 @@ function GroupSelectModalContent(_ref, ref) {
127
128
  });
128
129
  });
129
130
  },
130
- activeKey: selectId
131
+ selectedKeys: [selectId]
131
132
  }), /*#__PURE__*/React.createElement(List, {
132
133
  onChecked: onUserChecked1,
133
- list: userList,
134
- key: userList.length,
134
+ list: groupList,
135
+ key: groupList.length,
135
136
  checkedKeys: list1CheckedKeys,
136
137
  itemKey: "id",
137
138
  itemNameKey: "postName",
@@ -7,7 +7,8 @@ function NotifierForm(_ref) {
7
7
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UserSet, {
8
8
  userType: item.userType,
9
9
  nodeUserList: item.nodeUserList,
10
- onChange: onChange
10
+ onChange: onChange,
11
+ includeUserTypes: [1]
11
12
  }));
12
13
  }
13
14
 
@@ -22,7 +22,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
22
 
23
23
  import React, { useCallback, useMemo, useState, forwardRef, useImperativeHandle } from 'react';
24
24
  import api from '../../Api';
25
- import OrgUserTree from '../../OrgUserTree';
25
+ import TreeMode from '../../TreeMode';
26
26
  import List from '../../List';
27
27
  import { uniq, intersectionWith, uniqBy, differenceWith } from 'lodash';
28
28
  var UserSelectModalContent = /*#__PURE__*/forwardRef(function UserSelectModalContent(_ref, ref) {
@@ -100,7 +100,7 @@ var UserSelectModalContent = /*#__PURE__*/forwardRef(function UserSelectModalCon
100
100
  }, [state.selectUsers, state.selectIds]);
101
101
  return /*#__PURE__*/React.createElement("div", {
102
102
  className: "user-select-modal-content"
103
- }, /*#__PURE__*/React.createElement(OrgUserTree, {
103
+ }, /*#__PURE__*/React.createElement(TreeMode, {
104
104
  title: "\u7EC4\u7EC7\u673A\u6784",
105
105
  onDefailtSelect: function onDefailtSelect(orgId) {
106
106
  return setState(function (old) {
@@ -117,7 +117,8 @@ var UserSelectModalContent = /*#__PURE__*/forwardRef(function UserSelectModalCon
117
117
  });
118
118
  });
119
119
  },
120
- activeKey: state.orgId
120
+ selectedKeys: [state.orgId],
121
+ mode: "Org"
121
122
  }), /*#__PURE__*/React.createElement(List, {
122
123
  onChecked: onUserChecked1,
123
124
  list: userList,
@@ -73,6 +73,9 @@ function UserSet(_ref) {
73
73
  return cloneDeep(Object.assign(Object.assign({}, old), options));
74
74
  });
75
75
  }, []);
76
+ var users = useMemo(function () {
77
+ return state[state.type];
78
+ }, [state]);
76
79
  var data = useMemo(function () {
77
80
  return {
78
81
  userType: state.type,
@@ -106,7 +109,7 @@ function UserSet(_ref) {
106
109
  })), /*#__PURE__*/React.createElement(Content, {
107
110
  type: state.type,
108
111
  emptyUsers: state.emptyUsers,
109
- users: state[state.type],
112
+ users: users,
110
113
  chargeLevel: state.chargeLevel,
111
114
  usersHandType: state.usersHandType,
112
115
  onChange: function onChange(options) {
@@ -205,7 +208,7 @@ function UserSelectType3(_ref4) {
205
208
  emptyUsers = _ref4.emptyUsers;
206
209
  var userList = useMemo(function () {
207
210
  return users.filter(function (v) {
208
- return v.key === 'userId';
211
+ return v.key === 'groupId';
209
212
  });
210
213
  }, [users]);
211
214
  return /*#__PURE__*/React.createElement("div", {
@@ -1,5 +1,6 @@
1
1
  import _useChangeEffect from "@cloud-app-dev/basic-components/es/useChangeEffect";
2
- import _Modal from "@cloud-app-dev/basic-components/es/Modal";
2
+ import "antd/lib/modal/style";
3
+ import _Modal from "antd/lib/modal";
3
4
 
4
5
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
6
 
@@ -61,6 +62,11 @@ function WorkerFlow(_ref, ref) {
61
62
 
62
63
  var drawerRef = useRef(null);
63
64
 
65
+ var _Modal$useModal = _Modal.useModal(),
66
+ _Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
67
+ modal = _Modal$useModal2[0],
68
+ contextHolder = _Modal$useModal2[1];
69
+
64
70
  var updateNode = function updateNode() {
65
71
  return setConfig(Object.assign({}, config));
66
72
  }; // 链表操作: 几种行为, 添加行为,删除行为,点击行为 pRef.childNode -> node.childNode -> 后继
@@ -117,8 +123,9 @@ function WorkerFlow(_ref, ref) {
117
123
  return;
118
124
  }
119
125
 
126
+ var title = "\u662F\u5426\u5220\u9664\u8282\u70B9\"".concat(type === NodeTypes.BRANCH ? node.conditionNodes[index].nodeName : node.nodeName, "\"\uFF1F");
120
127
  var options = {
121
- title: "\u662F\u5426\u5220\u9664\u8282\u70B9\"".concat(type === NodeTypes.BRANCH ? node.conditionNodes[index].nodeName : node.nodeName, "\"\uFF1F"),
128
+ title: title,
122
129
  okText: '确定',
123
130
  cancelText: '取消'
124
131
  };
@@ -153,7 +160,7 @@ function WorkerFlow(_ref, ref) {
153
160
  }));
154
161
  };
155
162
 
156
- _Modal.confirm(Object.assign(Object.assign({}, options), {
163
+ modal.confirm(Object.assign(Object.assign({}, options), {
157
164
  onOk: onOk
158
165
  }));
159
166
  } // 获取节点
@@ -182,7 +189,7 @@ function WorkerFlow(_ref, ref) {
182
189
  node.form = data.form || [];
183
190
  node.userType = data.userType;
184
191
  node.usersHandType = data.usersHandType;
185
- node.owner = data.nodeUserList.map(function (v) {
192
+ node.owner = data.userType === 4 ? '直属主管' : data.nodeUserList.map(function (v) {
186
193
  return v.name;
187
194
  }).join(',');
188
195
  node.emptyUserList = data.emptyUserList;
@@ -231,7 +238,7 @@ function WorkerFlow(_ref, ref) {
231
238
 
232
239
  var blob = _exportBpmnFile(newConfig, id, name);
233
240
 
234
- var taskList = getJAVATaskData(newConfig);
241
+ var taskList = getJAVATaskData(cloneDeep(config));
235
242
  var useFormKeys = getUserFormKeys(newConfig);
236
243
  return {
237
244
  config: {
@@ -279,7 +286,7 @@ function WorkerFlow(_ref, ref) {
279
286
  }), /*#__PURE__*/React.createElement(EndNode, {
280
287
  nodeName: "\u6D41\u7A0B\u7ED3\u675F",
281
288
  id: endId
282
- })))), /*#__PURE__*/React.createElement(RefDrawer, {
289
+ }))), contextHolder), /*#__PURE__*/React.createElement(RefDrawer, {
283
290
  ref: drawerRef
284
291
  }));
285
292
  }
@@ -1,4 +1,6 @@
1
1
  import { NodeItem, SubmitFlowItemType } from './interface';
2
2
  export declare function getJAVATaskData(data: NodeItem): SubmitFlowItemType[];
3
+ export declare function getNextTaskId(node: NodeItem): string | undefined;
4
+ export declare function getNextNode(node: NodeItem): NodeItem | undefined;
3
5
  export declare function filterNoticeNode(data: NodeItem): NodeItem;
4
6
  export declare function getUserFormKeys(data: NodeItem): string[];
@@ -14,7 +14,7 @@ import _ from 'lodash';
14
14
  export function getJAVATaskData(data) {
15
15
  var arr = [];
16
16
 
17
- var fn = function fn(node) {
17
+ var fn = function fn(node, _nextNode) {
18
18
  var _a, _b, _c, _d;
19
19
 
20
20
  if (node.bpmnType === 'userTask') {
@@ -29,7 +29,7 @@ export function getJAVATaskData(data) {
29
29
  taskType: node.type === 5 ? 0 : 1
30
30
  };
31
31
 
32
- if (node.userType === 1 || node.userType === 2) {
32
+ if (node.userType === 1 || node.userType === 2 || node.userType === 3 || node.userType === 5) {
33
33
  item.assignPersonIds = node.nodeUserList.filter(function (v) {
34
34
  return v.key === 'userId';
35
35
  }).map(function (v) {
@@ -52,7 +52,12 @@ export function getJAVATaskData(data) {
52
52
  }
53
53
 
54
54
  if (((_b = node.childNode) === null || _b === void 0 ? void 0 : _b.bpmnType) === 'userTask') {
55
- item.nextTaskId = node.childNode.id;
55
+ item.nextTaskId = getNextTaskId(node.childNode);
56
+ } // 连接条件nextTaskId
57
+
58
+
59
+ if (!node.childNode) {
60
+ item.nextTaskId = _nextNode === null || _nextNode === void 0 ? void 0 : _nextNode.id;
56
61
  }
57
62
 
58
63
  if (node.form) {
@@ -73,14 +78,16 @@ export function getJAVATaskData(data) {
73
78
  arr.push(item);
74
79
  }
75
80
 
81
+ var nextNode = getNextNode(node.childNode);
82
+
76
83
  if (node.conditionNodes) {
77
84
  node.conditionNodes.forEach(function (item) {
78
- fn(item);
85
+ fn(item, nextNode);
79
86
  });
80
87
  }
81
88
 
82
- if (node.childNode) {
83
- fn(node.childNode);
89
+ if (nextNode) {
90
+ fn(nextNode, _nextNode);
84
91
  }
85
92
  };
86
93
 
@@ -92,6 +99,28 @@ export function getJAVATaskData(data) {
92
99
 
93
100
  return arr;
94
101
  }
102
+ export function getNextTaskId(node) {
103
+ if (!node) {
104
+ return undefined;
105
+ }
106
+
107
+ if (node.type !== 2) {
108
+ return node.id;
109
+ } else {
110
+ return getNextTaskId(node.childNode);
111
+ }
112
+ }
113
+ export function getNextNode(node) {
114
+ if (!node) {
115
+ return undefined;
116
+ }
117
+
118
+ if (node.type !== 2) {
119
+ return node;
120
+ } else {
121
+ return getNextNode(node.childNode);
122
+ }
123
+ }
95
124
  export function filterNoticeNode(data) {
96
125
  var newData = _.cloneDeep(data);
97
126
 
package/es/core.d.ts CHANGED
@@ -29,3 +29,94 @@ export interface PostItemType {
29
29
  postName: string;
30
30
  orgId: string;
31
31
  }
32
+
33
+ export type BzTreeItemType = {
34
+ appSysId: string;
35
+ createTime: number;
36
+ creator: number;
37
+ customType: number;
38
+ description: string;
39
+ groupName: string;
40
+ id: string;
41
+ level: number;
42
+ orderNo: number;
43
+ parentId: string;
44
+ treeDescription: string;
45
+ treeId: string;
46
+ };
47
+
48
+ export interface DeviceItemType {
49
+ ability: any;
50
+ accessType: null;
51
+ aliasBrand: null;
52
+ appSystemId: string;
53
+ areaLevel: number;
54
+ bindUserid: string;
55
+ boxNum: string;
56
+ buzGroupId: string;
57
+ buzGroupIds: string[];
58
+ buzGroupName: string;
59
+ cameraType: string;
60
+ capDirection: string;
61
+ cid: string;
62
+ createTime: string;
63
+ deleteFlag: number;
64
+ detailLiftBuild: number;
65
+ detailLiftUnit: number;
66
+ deviceBrand: number;
67
+ deviceIp: string;
68
+ deviceModel: string;
69
+ deviceName: string;
70
+ devicePlace: string;
71
+ deviceStatus: 0 | 1;
72
+ deviceType: string;
73
+ extJson: any;
74
+ fullPy: string;
75
+ gbId: string;
76
+ geoCoordinateSystem: string;
77
+ groupId: string;
78
+ groupIds: string[];
79
+ groupName: string;
80
+ hadLocaltion: boolean;
81
+ hasFrontEnd: boolean;
82
+ hasStorage: boolean;
83
+ id: string;
84
+ inOutDirection: any;
85
+ industry: any;
86
+ industry1: string;
87
+ industry2: string;
88
+ installationLocationDetail: any;
89
+ installationMethod: any;
90
+ installationSite: any;
91
+ ipAddr: any;
92
+ ipV6Addr: any;
93
+ isBind: any;
94
+ isIdleDeal: any;
95
+ latitude: number;
96
+ longitude: number;
97
+ maintenancePerson: any;
98
+ maintenancePhone: any;
99
+ maintenanceUnit: any;
100
+ manufacturerDeviceType: string;
101
+ monitorAreaDesc: any;
102
+ monitorDirection: any;
103
+ operationCenterIds: any;
104
+ orgCode: any;
105
+ parentId: any;
106
+ pathId: string[];
107
+ place: string;
108
+ placeCode: string;
109
+ placeId: string;
110
+ placeIds: string[];
111
+ placeName: null;
112
+ placeTags: string[];
113
+ port: string;
114
+ ptzControl: string;
115
+ simpPy: string;
116
+ sn: string;
117
+ snapshotMode: string;
118
+ sourceFrom: string;
119
+ superiorGbcode: string;
120
+ tags: string;
121
+ villageLocationType: string;
122
+ }
package/es/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { default as DagInitialConfig } from './DagInitialConfig';
5
5
  export { default as DagInitialRequest } from './DagInitialRequest';
6
6
  export { default as DeviceIcon } from './DeviceIcon';
7
7
  export { default as DeviceList } from './DeviceList';
8
+ export { default as DeviceSelect } from './DeviceSelect';
8
9
  export { default as DynamicDeviceList } from './DynamicDeviceList';
9
10
  export { default as FormContent } from './FormContent';
10
11
  export { default as InitialConfig } from './InitialConfig';
@@ -15,6 +16,7 @@ export { default as OrgUserTree } from './OrgUserTree';
15
16
  export { default as PlaceTree } from './PlaceTree';
16
17
  export { default as RefDrawer } from './RefDrawer';
17
18
  export { default as RefModal } from './RefModal';
19
+ export { default as TreeMode } from './TreeMode';
18
20
  export { default as TreeTitle } from './TreeTitle';
19
21
  export { default as Upload } from './Upload';
20
22
  export { default as UserSelect } from './UserSelect';
package/es/index.js CHANGED
@@ -5,6 +5,7 @@ export { default as DagInitialConfig } from './DagInitialConfig';
5
5
  export { default as DagInitialRequest } from './DagInitialRequest';
6
6
  export { default as DeviceIcon } from './DeviceIcon';
7
7
  export { default as DeviceList } from './DeviceList';
8
+ export { default as DeviceSelect } from './DeviceSelect';
8
9
  export { default as DynamicDeviceList } from './DynamicDeviceList';
9
10
  export { default as FormContent } from './FormContent';
10
11
  export { default as InitialConfig } from './InitialConfig';
@@ -15,6 +16,7 @@ export { default as OrgUserTree } from './OrgUserTree';
15
16
  export { default as PlaceTree } from './PlaceTree';
16
17
  export { default as RefDrawer } from './RefDrawer';
17
18
  export { default as RefModal } from './RefModal';
19
+ export { default as TreeMode } from './TreeMode';
18
20
  export { default as TreeTitle } from './TreeTitle';
19
21
  export { default as Upload } from './Upload';
20
22
  export { default as UserSelect } from './UserSelect';
package/es/utils.d.ts CHANGED
@@ -5,3 +5,9 @@ export declare const getHeader: () => {
5
5
  * @desc 根据id获取所有父级
6
6
  */
7
7
  export declare function getParentListById(id: string, orgList?: any[], list?: any[], key?: string, pkey?: string): any[];
8
+ /**
9
+ * 获取场所下的所有场所codes
10
+ * @param {string} orgId
11
+ * @param {Array} ids = []
12
+ */
13
+ export declare function getPlaceCodesWithParent(areaCode: string, list?: any[], areaCodes?: string[], key?: string, pkey?: string): any;