@cloud-app-dev/vidc 1.0.35 → 1.0.36

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 (46) 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/DeviceList/index.d.ts +2 -2
  5. package/es/DeviceList/index.js +5 -3
  6. package/es/DeviceSelect/demo.d.ts +2 -0
  7. package/es/DeviceSelect/demo.js +22 -0
  8. package/es/DeviceSelect/index.css +6 -0
  9. package/es/DeviceSelect/index.d.ts +7 -0
  10. package/es/DeviceSelect/index.js +222 -0
  11. package/es/DynamicDeviceList/CheckExt.d.ts +8 -0
  12. package/es/DynamicDeviceList/CheckExt.js +36 -0
  13. package/es/DynamicDeviceList/Demo.js +1 -5
  14. package/es/DynamicDeviceList/index.css +20 -0
  15. package/es/DynamicDeviceList/index.d.ts +7 -4
  16. package/es/DynamicDeviceList/index.js +100 -49
  17. package/es/DynamicDeviceList/utils.d.ts +1 -2
  18. package/es/OrgTree/index.js +5 -5
  19. package/es/OrgUserTree/index.d.ts +1 -1
  20. package/es/OrgUserTree/index.js +10 -10
  21. package/es/PlaceTree/demo.d.ts +2 -0
  22. package/es/PlaceTree/demo.js +20 -0
  23. package/es/PlaceTree/index.css +1 -0
  24. package/es/PlaceTree/index.d.ts +2 -2
  25. package/es/PlaceTree/index.js +27 -22
  26. package/es/TreeMode/demo.d.ts +2 -0
  27. package/es/TreeMode/demo.js +30 -0
  28. package/es/TreeMode/index.css +36 -0
  29. package/es/TreeMode/index.d.ts +21 -0
  30. package/es/TreeMode/index.js +190 -0
  31. package/es/TreeTitle/index.d.ts +2 -1
  32. package/es/TreeTitle/index.js +4 -2
  33. package/es/WorkerFlow/Form/GroupList.d.ts +1 -1
  34. package/es/WorkerFlow/Form/GroupList.js +3 -1
  35. package/es/WorkerFlow/Form/GroupSelectModalContent.js +11 -10
  36. package/es/WorkerFlow/Form/Notifier.js +2 -1
  37. package/es/WorkerFlow/Form/UserSelectModalContent.js +4 -3
  38. package/es/WorkerFlow/index.js +1 -1
  39. package/es/WorkerFlow/utils.js +6 -2
  40. package/es/core.d.ts +91 -0
  41. package/es/index.d.ts +2 -0
  42. package/es/index.js +2 -0
  43. package/es/utils.d.ts +6 -0
  44. package/es/utils.js +30 -1
  45. package/package.json +2 -2
  46. 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,
@@ -231,7 +231,7 @@ function WorkerFlow(_ref, ref) {
231
231
 
232
232
  var blob = _exportBpmnFile(newConfig, id, name);
233
233
 
234
- var taskList = getJAVATaskData(newConfig);
234
+ var taskList = getJAVATaskData(cloneDeep(config));
235
235
  var useFormKeys = getUserFormKeys(newConfig);
236
236
  return {
237
237
  config: {
@@ -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) {
@@ -80,7 +80,11 @@ export function getJAVATaskData(data) {
80
80
  }
81
81
 
82
82
  if (node.childNode) {
83
- fn(node.childNode);
83
+ if (node.childNode.type === 2 && node.childNode.childNode) {
84
+ fn(node.childNode.childNode);
85
+ } else {
86
+ fn(node.childNode);
87
+ }
84
88
  }
85
89
  };
86
90
 
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;
package/es/utils.js CHANGED
@@ -21,10 +21,39 @@ export function getParentListById(id) {
21
21
  list.push(item);
22
22
 
23
23
  if (item[pkey]) {
24
- getParentListById(item[pkey], list, orgList);
24
+ getParentListById(item[pkey], orgList, list, key, pkey);
25
25
  }
26
26
  }
27
27
  }
28
28
 
29
29
  return list;
30
+ }
31
+ /**
32
+ * 获取场所下的所有场所codes
33
+ * @param {string} orgId
34
+ * @param {Array} ids = []
35
+ */
36
+
37
+ export function getPlaceCodesWithParent(areaCode) {
38
+ var list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
39
+ var areaCodes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
40
+ var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'areaCode';
41
+ var pkey = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'parentCode';
42
+ var info = list.find(function (v) {
43
+ return v[key] === areaCode;
44
+ });
45
+
46
+ if (info && info.pcodes) {
47
+ return info.pcodes.reverse();
48
+ }
49
+
50
+ if (info) {
51
+ areaCodes.push(areaCode);
52
+
53
+ if (info[pkey] && info[pkey] * 1 !== 0) {
54
+ getPlaceCodesWithParent(info.parentCode, areaCodes, list, key, pkey);
55
+ }
56
+ }
57
+
58
+ return areaCodes;
30
59
  }
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.35",
5
+ "version": "1.0.36",
6
6
  "scripts": {
7
7
  "start": "dumi dev",
8
8
  "docs:build": "dumi build",
@@ -38,7 +38,7 @@
38
38
  "rc-queue-anim": "^2.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@cloud-app-dev/basic-components": "^1.0.47",
41
+ "@cloud-app-dev/basic-components": "^1.0.49",
42
42
  "@types/chroma-js": "^2.1.3",
43
43
  "@types/lodash": "^4.14.172",
44
44
  "@umijs/test": "^3.0.5",
@@ -1,75 +0,0 @@
1
- export interface DeviceItemType {
2
- ability: any;
3
- accessType: null;
4
- aliasBrand: null;
5
- appSystemId: string;
6
- areaLevel: number;
7
- bindUserid: string;
8
- boxNum: string;
9
- buzGroupId: string;
10
- buzGroupIds: string[];
11
- buzGroupName: string;
12
- cameraType: string;
13
- capDirection: string;
14
- cid: string;
15
- createTime: string;
16
- deleteFlag: number;
17
- detailLiftBuild: number;
18
- detailLiftUnit: number;
19
- deviceBrand: number;
20
- deviceIp: string;
21
- deviceModel: string;
22
- deviceName: string;
23
- devicePlace: string;
24
- deviceStatus: 0 | 1;
25
- deviceType: string;
26
- extJson: any;
27
- fullPy: string;
28
- gbId: string;
29
- geoCoordinateSystem: string;
30
- groupId: string;
31
- groupIds: string[];
32
- groupName: string;
33
- hadLocaltion: boolean;
34
- hasFrontEnd: boolean;
35
- hasStorage: boolean;
36
- id: string;
37
- inOutDirection: any;
38
- industry: any;
39
- industry1: string;
40
- industry2: string;
41
- installationLocationDetail: any;
42
- installationMethod: any;
43
- installationSite: any;
44
- ipAddr: any;
45
- ipV6Addr: any;
46
- isBind: any;
47
- isIdleDeal: any;
48
- latitude: number;
49
- longitude: number;
50
- maintenancePerson: any;
51
- maintenancePhone: any;
52
- maintenanceUnit: any;
53
- manufacturerDeviceType: string;
54
- monitorAreaDesc: any;
55
- monitorDirection: any;
56
- operationCenterIds: any;
57
- orgCode: any;
58
- parentId: any;
59
- pathId: string[];
60
- place: string;
61
- placeCode: string;
62
- placeId: string;
63
- placeIds: string[];
64
- placeName: null;
65
- placeTags: string[];
66
- port: string;
67
- ptzControl: string;
68
- simpPy: string;
69
- sn: string;
70
- snapshotMode: string;
71
- sourceFrom: string;
72
- superiorGbcode: string;
73
- tags: string;
74
- villageLocationType: string;
75
- }