@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
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.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTYzNzQ4NTk5ODI0MiwidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjM3MjI2Nzk4MjQyfQ.6hGwhWJIfT3kU4P0YjaldFMhBOn-t6tPQykUcdnBNio';
5
+ 'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTYzNzgwNjQ5ODI3OSwidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjM3NTQ3Mjk4Mjc5fQ.FX6-kuuaituBjzuBxY0s51V_V_tVRVMuiWp8fIZI6YQ';
6
6
 
7
7
  export default defineConfig({
8
8
  title: '云应用-业务组件库',
package/es/Api/index.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  import { OrgItemType } from '@cloud-app-dev/basic-components/es/Store/org';
2
2
  import { UserInfo } from '@cloud-app-dev/basic-components/es/Store/app';
3
- import { PostItemType } from '../core';
3
+ import { BzTreeItemType, PostItemType } from '../core';
4
4
  declare class Api {
5
5
  getOrgs(): Promise<OrgItemType[]>;
6
6
  getUsers(organizationId: string): Promise<UserInfo[]>;
7
7
  getPosts(orgId: string): Promise<PostItemType[]>;
8
+ getDeviceBzTree(): Promise<BzTreeItemType[]>;
9
+ getCustomDeviceGroup(): Promise<BzTreeItemType[]>;
10
+ getPlacesByHasDevice(): Promise<BzTreeItemType[]>;
8
11
  }
9
12
  declare const _default: Api;
10
13
  export default _default;
package/es/Api/index.js CHANGED
@@ -112,6 +112,96 @@ var Api = /*#__PURE__*/function () {
112
112
  }, _callee3);
113
113
  }));
114
114
  }
115
+ }, {
116
+ key: "getDeviceBzTree",
117
+ value: function getDeviceBzTree() {
118
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
119
+ var res;
120
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
121
+ while (1) {
122
+ switch (_context4.prev = _context4.next) {
123
+ case 0:
124
+ _context4.next = 2;
125
+ return _Service.$http({
126
+ url: '/api/udm-api/DeviceBuzTree/queryList',
127
+ method: 'post',
128
+ requestId: 'getDeviceBzTree',
129
+ data: {},
130
+ headers: getHeader()
131
+ });
132
+
133
+ case 2:
134
+ res = _context4.sent;
135
+ return _context4.abrupt("return", res.data);
136
+
137
+ case 4:
138
+ case "end":
139
+ return _context4.stop();
140
+ }
141
+ }
142
+ }, _callee4);
143
+ }));
144
+ }
145
+ }, {
146
+ key: "getCustomDeviceGroup",
147
+ value: function getCustomDeviceGroup() {
148
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
149
+ var res;
150
+ return regeneratorRuntime.wrap(function _callee5$(_context5) {
151
+ while (1) {
152
+ switch (_context5.prev = _context5.next) {
153
+ case 0:
154
+ _context5.next = 2;
155
+ return _Service.$http({
156
+ url: '/api/udm-api/customDeviceGroup/queryList',
157
+ method: 'post',
158
+ requestId: 'customDeviceGroup',
159
+ data: {},
160
+ headers: getHeader()
161
+ });
162
+
163
+ case 2:
164
+ res = _context5.sent;
165
+ return _context5.abrupt("return", res.data);
166
+
167
+ case 4:
168
+ case "end":
169
+ return _context5.stop();
170
+ }
171
+ }
172
+ }, _callee5);
173
+ }));
174
+ }
175
+ }, {
176
+ key: "getPlacesByHasDevice",
177
+ value: function getPlacesByHasDevice() {
178
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
179
+ var res;
180
+ return regeneratorRuntime.wrap(function _callee6$(_context6) {
181
+ while (1) {
182
+ switch (_context6.prev = _context6.next) {
183
+ case 0:
184
+ _context6.next = 2;
185
+ return _Service.$http({
186
+ url: '/api/place/v1/getPlacesByHasDevice',
187
+ method: 'post',
188
+ requestId: 'getPlacesByHasDevice',
189
+ data: {},
190
+ headers: getHeader()
191
+ });
192
+
193
+ case 2:
194
+ res = _context6.sent;
195
+ return _context6.abrupt("return", res.data);
196
+
197
+ case 4:
198
+ case "end":
199
+ return _context6.stop();
200
+ }
201
+ }
202
+ }, _callee6);
203
+ }));
204
+ }
115
205
  }]);
116
206
 
117
207
  return Api;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DeviceItemType } from '../DynamicDeviceList/interface';
2
+ import { DeviceItemType } from '../core';
3
3
  import { CheckListProps } from '@cloud-app-dev/basic-components/es/CheckList';
4
4
  import './index.less';
5
5
  interface DeviceListProps extends CheckListProps<DeviceItemType> {
@@ -10,5 +10,5 @@ interface DeviceListProps extends CheckListProps<DeviceItemType> {
10
10
  title?: string;
11
11
  onKeywordChange?: (v: string) => void;
12
12
  }
13
- declare function DeviceList({ getIconStyle, className, deleteItem, deviceList, onMouseOverItem, renderItemExt, title, onKeywordChange, ...props }: DeviceListProps): JSX.Element;
13
+ declare function DeviceList({ getIconStyle, className, deleteItem, deviceList, onMouseOverItem, renderItemExt, title, onKeywordChange, itemKey, ...props }: DeviceListProps): JSX.Element;
14
14
  export default DeviceList;
@@ -15,7 +15,8 @@ function DeviceList(_a) {
15
15
  _renderItemExt = _a.renderItemExt,
16
16
  title = _a.title,
17
17
  onKeywordChange = _a.onKeywordChange,
18
- props = __rest(_a, ["getIconStyle", "className", "deleteItem", "deviceList", "onMouseOverItem", "renderItemExt", "title", "onKeywordChange"]);
18
+ itemKey = _a.itemKey,
19
+ props = __rest(_a, ["getIconStyle", "className", "deleteItem", "deviceList", "onMouseOverItem", "renderItemExt", "title", "onKeywordChange", "itemKey"]);
19
20
 
20
21
  var whatIcon = useCallback(function (item) {
21
22
  return /*#__PURE__*/React.createElement(DeviceIcon, {
@@ -33,6 +34,7 @@ function DeviceList(_a) {
33
34
  className: "lm-c-device-list-wrapper ".concat(className),
34
35
  list: deviceList,
35
36
  itemNameKey: "deviceName",
37
+ itemKey: itemKey,
36
38
  rowHeight: 30,
37
39
  renderHeader: function renderHeader() {
38
40
  return /*#__PURE__*/React.createElement(TreeTitle, {
@@ -44,7 +46,7 @@ function DeviceList(_a) {
44
46
  whatIcon: whatIcon,
45
47
  onMouseOverItem: onMouseOverItem,
46
48
  renderItemExt: function renderItemExt(item) {
47
- return _renderItemExt ? _renderItemExt(item) : deleteItem && /*#__PURE__*/React.createElement("span", {
49
+ return _renderItemExt ? _renderItemExt(item) : deleteItem ? /*#__PURE__*/React.createElement("span", {
48
50
  className: "clear-item",
49
51
  onClick: function onClick(e) {
50
52
  return deleteItemAction(item, e);
@@ -52,7 +54,7 @@ function DeviceList(_a) {
52
54
  }, /*#__PURE__*/React.createElement(_IconFont, {
53
55
  type: "icon-S_Edit_LineClose",
54
56
  title: "\u5220\u9664"
55
- }));
57
+ })) : undefined;
56
58
  }
57
59
  }));
58
60
  }
@@ -0,0 +1,2 @@
1
+ declare function App(): JSX.Element;
2
+ export default App;
@@ -0,0 +1,22 @@
1
+ import "antd/lib/config-provider/style";
2
+ import _ConfigProvider from "antd/lib/config-provider";
3
+ import React from 'react';
4
+ import DeviceSelect from './index';
5
+
6
+ function App() {
7
+ return /*#__PURE__*/React.createElement(_ConfigProvider, {
8
+ prefixCls: "cloudapp"
9
+ }, /*#__PURE__*/React.createElement("div", {
10
+ style: {
11
+ padding: 20,
12
+ width: 1000,
13
+ height: 500
14
+ }
15
+ }, /*#__PURE__*/React.createElement("div", {
16
+ style: {
17
+ height: 400
18
+ }
19
+ }, /*#__PURE__*/React.createElement(DeviceSelect, null))));
20
+ }
21
+
22
+ export default App;
@@ -0,0 +1,6 @@
1
+ .vidc-device-select-layout {
2
+ height: 100%;
3
+ }
4
+ .vidc-device-select-layout > .cloudapp-col {
5
+ height: 100%;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { DeviceItemType } from '../core';
2
+ import './index.less';
3
+ interface IDeviceSelectProps {
4
+ selectDevices?: DeviceItemType[];
5
+ }
6
+ declare function DeviceSelect({ selectDevices }: IDeviceSelectProps): JSX.Element;
7
+ export default DeviceSelect;
@@ -0,0 +1,222 @@
1
+ import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
2
+ import "antd/lib/menu/style";
3
+ import _Menu from "antd/lib/menu";
4
+ import "antd/lib/dropdown/style";
5
+ import _Dropdown from "antd/lib/dropdown";
6
+ import "antd/lib/col/style";
7
+ import _Col from "antd/lib/col";
8
+ import "antd/lib/row/style";
9
+ import _Row from "antd/lib/row";
10
+
11
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
+
13
+ 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."); }
14
+
15
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
+
17
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
+
19
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
20
+
21
+ 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."); }
22
+
23
+ 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); }
24
+
25
+ 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; }
26
+
27
+ 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; }
28
+
29
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
+
31
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
32
+ import TreeMode from '../TreeMode';
33
+ import DynamicDeviceList from '../DynamicDeviceList';
34
+ import DeviceList from '../DeviceList';
35
+ import { uniq, uniqBy } from 'lodash';
36
+ import "./index.css";
37
+
38
+ function DeviceSelect(_ref) {
39
+ var selectDevices = _ref.selectDevices;
40
+
41
+ var _useState = useState({
42
+ tempSelectIds: selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
43
+ return v.cid;
44
+ }),
45
+ selectDevices: selectDevices,
46
+ selectIds: selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
47
+ return v.cid;
48
+ }),
49
+ keyword1: '',
50
+ keyword2: '',
51
+ focusKey: Date.now(),
52
+ buzGroupId: '',
53
+ placeId: '',
54
+ areaCode: '',
55
+ mode: 'Bz'
56
+ }),
57
+ _useState2 = _slicedToArray(_useState, 2),
58
+ state = _useState2[0],
59
+ setState = _useState2[1];
60
+
61
+ useEffect(function () {
62
+ if (state.selectDevices || !selectDevices) {
63
+ return null;
64
+ }
65
+
66
+ var ids = selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
67
+ return v.cid;
68
+ });
69
+
70
+ if (ids) {
71
+ setState(function (old) {
72
+ return Object.assign(Object.assign({}, old), {
73
+ selectDevices: selectDevices,
74
+ selectIds: ids,
75
+ tempSelectIds: ids
76
+ });
77
+ });
78
+ }
79
+ }, [state.selectDevices, selectDevices]);
80
+ var onCheked1 = useCallback(function (ids, items, checked) {
81
+ var changIds = items.map(function (v) {
82
+ return v.cid;
83
+ });
84
+ var devices = state.selectDevices || [];
85
+ var selectIds = state.selectIds || [];
86
+ var list = !checked ? devices.filter(function (v) {
87
+ return !changIds.includes(v.cid);
88
+ }) : uniqBy([].concat(_toConsumableArray(devices), _toConsumableArray(items)), 'cid');
89
+ var selectIds2 = !checked ? selectIds.filter(function (v) {
90
+ return !changIds.includes(v);
91
+ }) : uniq([].concat(_toConsumableArray(selectIds), _toConsumableArray(changIds)));
92
+ setState(function (old) {
93
+ return Object.assign(Object.assign({}, old), {
94
+ selectDevices: _toConsumableArray(list),
95
+ tempSelectIds: ids,
96
+ selectIds: _toConsumableArray(selectIds2),
97
+ focusKey: Date.now()
98
+ });
99
+ });
100
+ }, [state.selectDevices, state.selectIds]);
101
+ var onCheked2 = useCallback(function (ids) {
102
+ return setState(function (old) {
103
+ return Object.assign(Object.assign({}, old), {
104
+ selectIds: ids,
105
+ focusKey: Date.now()
106
+ });
107
+ });
108
+ }, []);
109
+ var onSelectTree = useCallback(function (keys, _ref2) {
110
+ var node = _ref2.node;
111
+
112
+ if (state.mode === 'Bz') {
113
+ var buzGroupId = keys[0];
114
+
115
+ if (state.buzGroupId === buzGroupId) {
116
+ setState(function (old) {
117
+ return Object.assign(Object.assign({}, old), {
118
+ buzGroupId: ''
119
+ });
120
+ });
121
+ } else {
122
+ setState(function (old) {
123
+ return Object.assign(Object.assign({}, old), {
124
+ buzGroupId: buzGroupId
125
+ });
126
+ });
127
+ }
128
+ }
129
+
130
+ if (state.mode === 'Place') {
131
+ var id = node.id;
132
+
133
+ if (state.placeId === id) {
134
+ setState(function (old) {
135
+ return Object.assign(Object.assign({}, old), {
136
+ placeId: '',
137
+ areaCode: ''
138
+ });
139
+ });
140
+ } else {
141
+ setState(function (old) {
142
+ return Object.assign(Object.assign({}, old), {
143
+ placeId: id,
144
+ areaCode: node.areaCode
145
+ });
146
+ });
147
+ }
148
+ }
149
+ }, [state.buzGroupId, state.placeId, state.mode]);
150
+ var listParams = useMemo(function () {
151
+ return state.mode === 'Bz' ? {
152
+ buzGroupId: state.buzGroupId,
153
+ includeSubOrganizations: 1,
154
+ isPagination: true
155
+ } : {
156
+ includeSceneType: 'place',
157
+ includeSubOrganizations: 1,
158
+ isPagination: true,
159
+ placeIds: state.placeId ? [state.placeId] : []
160
+ };
161
+ }, [state.buzGroupId, state.mode, state.placeId]);
162
+ var treeSelectedKeys = useMemo(function () {
163
+ return state.mode === 'Bz' ? [state.buzGroupId] : [state.areaCode];
164
+ }, [state.mode, state.buzGroupId, state.areaCode]);
165
+ return /*#__PURE__*/React.createElement(_Row, {
166
+ className: "vidc-device-select-layout"
167
+ }, /*#__PURE__*/React.createElement(_Col, {
168
+ span: 7
169
+ }, /*#__PURE__*/React.createElement(TreeMode, {
170
+ key: state.mode,
171
+ mode: state.mode,
172
+ inputPlaceholder: "\u8BF7\u8F93\u5165\u540D\u79F0",
173
+ onSelect: onSelectTree,
174
+ selectedKeys: treeSelectedKeys,
175
+ title: /*#__PURE__*/React.createElement(_Dropdown, {
176
+ overlay: /*#__PURE__*/React.createElement(_Menu, {
177
+ onClick: function onClick(info) {
178
+ return setState(function (old) {
179
+ return Object.assign(Object.assign({}, old), {
180
+ mode: info.key
181
+ });
182
+ });
183
+ }
184
+ }, /*#__PURE__*/React.createElement(_Menu.Item, {
185
+ style: {
186
+ fontSize: 12
187
+ },
188
+ key: "Bz"
189
+ }, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
190
+ style: {
191
+ fontSize: 12
192
+ },
193
+ key: "Place"
194
+ }, "\u884C\u653F\u533A\u5212"))
195
+ }, /*#__PURE__*/React.createElement("span", null, state.mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(_IconFont, {
196
+ style: {
197
+ position: 'relative',
198
+ top: 1
199
+ },
200
+ type: "icon-S_Arrow_BigDown"
201
+ })))
202
+ })), /*#__PURE__*/React.createElement(_Col, {
203
+ span: 8
204
+ }, /*#__PURE__*/React.createElement(DynamicDeviceList, {
205
+ title: "\u8BBE\u5907\u5217\u8868",
206
+ onChecked: onCheked1,
207
+ checkedKeys: state.tempSelectIds,
208
+ params: listParams
209
+ })), /*#__PURE__*/React.createElement(_Col, {
210
+ span: 1
211
+ }), /*#__PURE__*/React.createElement(_Col, {
212
+ span: 8
213
+ }, /*#__PURE__*/React.createElement(DeviceList, {
214
+ itemKey: "cid",
215
+ deviceList: state.selectDevices || [],
216
+ onChecked: onCheked2,
217
+ checkedKeys: state.selectIds,
218
+ title: "\u5DF2\u9009\u8BBE\u5907\u5217\u8868"
219
+ })));
220
+ }
221
+
222
+ export default DeviceSelect;
@@ -0,0 +1,8 @@
1
+ interface ICheckExtProps {
2
+ selectCount: number;
3
+ count: number;
4
+ onCheck: () => void;
5
+ onCancel: () => void;
6
+ }
7
+ declare function CheckExt({ selectCount, onCheck, count, onCancel }: ICheckExtProps): JSX.Element;
8
+ export default CheckExt;
@@ -0,0 +1,36 @@
1
+ import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
2
+ import "antd/lib/tooltip/style";
3
+ import _Tooltip from "antd/lib/tooltip";
4
+ import React from 'react';
5
+
6
+ function CheckExt(_ref) {
7
+ var selectCount = _ref.selectCount,
8
+ onCheck = _ref.onCheck,
9
+ count = _ref.count,
10
+ onCancel = _ref.onCancel;
11
+ return /*#__PURE__*/React.createElement("div", {
12
+ className: "c-check-list-checkext"
13
+ }, /*#__PURE__*/React.createElement("span", {
14
+ className: "select-group"
15
+ }, /*#__PURE__*/React.createElement(_Tooltip, {
16
+ title: "\u9009\u4E2D\u6240\u6709\u5DF2\u52A0\u8F7D"
17
+ }, /*#__PURE__*/React.createElement(_IconFont, {
18
+ type: "icon-S_Photo_MarkYes",
19
+ onClick: onCheck
20
+ })), /*#__PURE__*/React.createElement(_Tooltip, {
21
+ title: "\u53D6\u6D88\u9009\u4E2D\u6240\u6709\u5DF2\u52A0\u8F7D\u9879"
22
+ }, /*#__PURE__*/React.createElement(_IconFont, {
23
+ type: "icon-MarkNo",
24
+ onClick: onCancel
25
+ }))), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009 ", /*#__PURE__*/React.createElement("span", {
26
+ style: {
27
+ color: 'var(--success)'
28
+ }
29
+ }, selectCount), " / \u603B\u6570 ", /*#__PURE__*/React.createElement("span", {
30
+ style: {
31
+ color: 'var(--primary)'
32
+ }
33
+ }, count)));
34
+ }
35
+
36
+ export default CheckExt;
@@ -11,11 +11,7 @@ function App() {
11
11
  height: 400,
12
12
  width: 300
13
13
  }
14
- }, /*#__PURE__*/React.createElement(DynamicDeviceList, {
15
- onSelect: function onSelect(item) {
16
- return console.log(item);
17
- }
18
- })));
14
+ }, /*#__PURE__*/React.createElement(DynamicDeviceList, null)));
19
15
  }
20
16
 
21
17
  export default App;
@@ -1,11 +1,15 @@
1
1
  .zenview-c-dynamic-device-list-layout {
2
2
  display: flex;
3
+ flex-direction: column;
3
4
  width: 100%;
4
5
  height: 100%;
5
6
  }
6
7
  .zenview-c-dynamic-device-list-layout .dynamic-list-item {
7
8
  padding: 0 10px;
8
9
  }
10
+ .zenview-c-dynamic-device-list-layout .lm-c-dynamiclist {
11
+ flex: 1;
12
+ }
9
13
  .zenview-c-dynamic-device-list-layout .device-item-box {
10
14
  height: 40px;
11
15
  line-height: 40px;
@@ -29,3 +33,19 @@
29
33
  text-overflow: ellipsis;
30
34
  white-space: nowrap;
31
35
  }
36
+ .zenview-c-dynamic-device-list-layout .c-check-list-checkext {
37
+ font-size: var(--fs-small);
38
+ padding: 5px 12px;
39
+ display: flex;
40
+ justify-content: space-between;
41
+ border-bottom: 1px solid var(--bd-color);
42
+ }
43
+ .zenview-c-dynamic-device-list-layout .c-check-list-checkext .select-group .anticon {
44
+ font-size: 16px;
45
+ cursor: pointer;
46
+ padding-right: 8px;
47
+ color: var(--icon);
48
+ }
49
+ .zenview-c-dynamic-device-list-layout .c-check-list-checkext .select-group .anticon:hover {
50
+ color: var(--primary);
51
+ }
@@ -1,4 +1,4 @@
1
- import { DeviceItemType } from './interface';
1
+ import { DeviceItemType } from '../core';
2
2
  import './index.less';
3
3
  interface IDynamicDeviceListProps {
4
4
  /**
@@ -8,11 +8,11 @@ interface IDynamicDeviceListProps {
8
8
  /**
9
9
  * @description 选中设备cid集合
10
10
  */
11
- selectKeys?: string[];
11
+ checkedKeys?: string[];
12
12
  /**
13
13
  * @description 传入onSelect列表默认渲染为checkbox模式
14
14
  */
15
- onSelect?: (item: DeviceItemType) => void;
15
+ onChecked?: (ids: string[], list: DeviceItemType[], checked: boolean) => void;
16
16
  /**
17
17
  * @description 传入queryList需要的参数,例如业务树ID,场所id等,分页参数除外
18
18
  */
@@ -27,6 +27,9 @@ interface IDynamicDeviceListProps {
27
27
  * @description 列表高度
28
28
  */
29
29
  itemHeight?: number;
30
+ title?: string;
31
+ onKeywordChange?: (v: string) => void;
32
+ defaultCheckedIds?: string[];
30
33
  }
31
- declare function DynamicDeviceList({ onClick, selectKeys, onSelect, params, renderItem, itemHeight }: IDynamicDeviceListProps): JSX.Element;
34
+ declare function DynamicDeviceList({ onClick, checkedKeys, defaultCheckedIds, onChecked, params, renderItem, itemHeight, title, onKeywordChange }: IDynamicDeviceListProps): JSX.Element;
32
35
  export default DynamicDeviceList;