@cloud-app-dev/vidc 2.0.0-alpha.9 → 2.1.0-alpha.10

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 (207) hide show
  1. package/.fatherrc.js +11 -4
  2. package/.umirc.ts +1 -1
  3. package/es/Api/index.js +7 -7
  4. package/es/AppRedirect/index.d.ts +1 -1
  5. package/es/AppRedirect/index.js +7 -12
  6. package/es/AppRouter/index.d.ts +8 -0
  7. package/es/AppRouter/index.js +17 -0
  8. package/es/Auth/index.js +1 -1
  9. package/es/AutoExit/index.js +12 -10
  10. package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
  11. package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
  12. package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
  13. package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
  14. package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
  15. package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
  16. package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
  17. package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
  18. package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
  19. package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
  20. package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
  21. package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
  22. package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
  23. package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
  24. package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
  25. package/es/{ContentBox → Box}/index.css +0 -0
  26. package/es/{ContentBox → Box}/index.d.ts +3 -3
  27. package/es/{ContentBox → Box}/index.js +5 -5
  28. package/es/CheckGroupFixed/index.js +4 -2
  29. package/es/Config/index.js +12 -12
  30. package/es/Config/interface.d.ts +6 -4
  31. package/es/ConfigContext/index.d.ts +15 -2
  32. package/es/ConfigContext/index.js +25 -3
  33. package/es/DeviceSelect/TreeType.d.ts +6 -0
  34. package/es/DeviceSelect/TreeType.js +36 -0
  35. package/es/DeviceSelect/demo.js +2 -2
  36. package/es/DeviceSelect/index.css +6 -1
  37. package/es/DeviceSelect/index.d.ts +5 -0
  38. package/es/DeviceSelect/index.js +22 -54
  39. package/es/Dict/hook.d.ts +0 -1
  40. package/es/Dict/hook.js +5 -21
  41. package/es/Dict/index.d.ts +1 -5
  42. package/es/Dict/index.js +2 -6
  43. package/es/Dict/utils.d.ts +0 -1
  44. package/es/Dict/utils.js +2 -9
  45. package/es/HightLevel/index.js +1 -2
  46. package/es/IconFont/index.d.ts +0 -1
  47. package/es/IconFont/index.js +12 -13
  48. package/es/InitialConfig/index.js +7 -6
  49. package/es/InitialConfig/utils.d.ts +5 -0
  50. package/es/InitialConfig/utils.js +33 -6
  51. package/es/InitialRequest/index.d.ts +3 -1
  52. package/es/InitialRequest/index.js +20 -18
  53. package/es/InitialRequest/utils.d.ts +4 -3
  54. package/es/InitialRequest/utils.js +28 -29
  55. package/es/Input/index.js +3 -2
  56. package/es/InstanceHistory/index.d.ts +3 -0
  57. package/es/InstanceHistory/index.js +9 -0
  58. package/es/List/CheckExt.d.ts +3 -5
  59. package/es/List/CheckExt.js +21 -13
  60. package/es/{AppRoute → List/DeviceList}/index.css +0 -0
  61. package/es/List/DeviceList/index.d.ts +11 -0
  62. package/es/{DeviceList → List/DeviceList}/index.js +6 -18
  63. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  64. package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
  65. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  66. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  67. package/es/List/DynamicDeviceList/index.js +205 -0
  68. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  69. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  70. package/es/List/DynamicDeviceList/utils.js +61 -0
  71. package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
  72. package/es/List/DynamicGridList/Demo.js +70 -0
  73. package/es/List/DynamicGridList/index.d.ts +26 -0
  74. package/es/List/DynamicGridList/index.js +73 -0
  75. package/es/List/GridList/Demo.d.ts +2 -0
  76. package/es/List/GridList/Demo.js +91 -0
  77. package/es/List/GridList/hook.d.ts +13 -0
  78. package/es/List/GridList/hook.js +301 -0
  79. package/es/List/GridList/index.css +7 -0
  80. package/es/List/GridList/index.d.ts +15 -0
  81. package/es/List/GridList/index.js +47 -0
  82. package/es/List/GridList/interface.d.ts +59 -0
  83. package/es/List/GridList/utils.d.ts +9 -0
  84. package/es/List/GridList/utils.js +43 -0
  85. package/es/List/ListExt/index.css +3 -0
  86. package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
  87. package/es/{ListExt → List/ListExt}/index.js +3 -3
  88. package/es/List/VList/index.css +6 -0
  89. package/es/List/VList/index.d.ts +18 -0
  90. package/es/List/VList/index.js +51 -0
  91. package/es/List/VList/utils.d.ts +14 -0
  92. package/es/{VList → List/VList}/utils.js +0 -0
  93. package/es/List/index.css +11 -12
  94. package/es/List/index.d.ts +5 -70
  95. package/es/List/index.js +32 -25
  96. package/es/List/interface.d.ts +87 -0
  97. package/es/List/renderItem.d.ts +1 -1
  98. package/es/List/renderItem.js +13 -10
  99. package/es/LoaderApp/index.d.ts +1 -1
  100. package/es/LoaderApp/index.js +39 -35
  101. package/es/LoaderApp/loader.js +2 -6
  102. package/es/LoaderApp/utils.d.ts +3 -1
  103. package/es/LoaderApp/utils.js +43 -3
  104. package/es/LoaderScript/index.js +7 -89
  105. package/es/LoaderScript/utils.d.ts +2 -0
  106. package/es/LoaderScript/utils.js +170 -33
  107. package/es/Picture/component/MoveContent/index.js +3 -3
  108. package/es/Picture/index.js +1 -1
  109. package/es/Picture/utils.js +1 -1
  110. package/es/RefDrawer/index.js +1 -1
  111. package/es/RefModal/index.js +1 -1
  112. package/es/Service/http.d.ts +6 -4
  113. package/es/Service/http.js +20 -22
  114. package/es/Service/index.d.ts +3 -3
  115. package/es/Service/index.js +7 -11
  116. package/es/Service/interface.d.ts +5 -11
  117. package/es/Service/middleware.d.ts +1 -1
  118. package/es/Service/middleware.js +1 -1
  119. package/es/TableLayout/index.d.ts +3 -0
  120. package/es/TableLayout/index.js +14 -45
  121. package/es/{TreeTitle → Title}/index.css +5 -5
  122. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  123. package/es/{TreeTitle → Title}/index.js +7 -4
  124. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  125. package/es/Tree/BaseTree/demo.js +69 -0
  126. package/es/Tree/BaseTree/index.css +64 -0
  127. package/es/Tree/BaseTree/index.d.ts +24 -0
  128. package/es/Tree/BaseTree/index.js +83 -0
  129. package/es/Tree/demo.js +19 -56
  130. package/es/Tree/index.css +29 -55
  131. package/es/Tree/index.d.ts +19 -20
  132. package/es/Tree/index.js +185 -70
  133. package/es/UserSelect/index.js +7 -8
  134. package/es/WorkerFlow/Form/Condition.js +2 -4
  135. package/es/WorkerFlow/Form/EmptyUserSet.js +1 -1
  136. package/es/WorkerFlow/Form/FormAuth.js +3 -3
  137. package/es/WorkerFlow/Form/GroupList.js +2 -2
  138. package/es/WorkerFlow/Form/GroupSelect.js +1 -1
  139. package/es/WorkerFlow/Form/GroupSelectModalContent.js +2 -3
  140. package/es/WorkerFlow/Form/LevelGroupSelect.js +2 -2
  141. package/es/WorkerFlow/Form/UserAndGroupSelect.js +1 -1
  142. package/es/WorkerFlow/Form/UserSelect.js +1 -1
  143. package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -6
  144. package/es/WorkerFlow/Form/UserSet.js +3 -3
  145. package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
  146. package/es/WorkerFlow/index.css +9 -3
  147. package/es/WorkerFlow/index.js +14 -9
  148. package/es/WorkerFlow/utils.js +1 -1
  149. package/es/index.d.ts +4 -11
  150. package/es/index.js +4 -11
  151. package/es/useDrawer/index.d.ts +1 -1
  152. package/es/useDrawer/index.js +3 -2
  153. package/es/useHistory/index.d.ts +2 -2
  154. package/es/useHistory/index.js +3 -6
  155. package/es/useHttp/index.js +1 -1
  156. package/es/useModal/index.d.ts +1 -1
  157. package/es/useModal/index.js +3 -2
  158. package/es/utils.d.ts +9 -0
  159. package/es/utils.js +36 -1
  160. package/package.json +10 -12
  161. package/tsconfig.json +1 -1
  162. package/es/AppRoute/Render.d.ts +0 -23
  163. package/es/AppRoute/Render.js +0 -111
  164. package/es/AppRoute/Rendered.d.ts +0 -4
  165. package/es/AppRoute/Rendered.js +0 -11
  166. package/es/AppRoute/index.d.ts +0 -14
  167. package/es/AppRoute/index.js +0 -106
  168. package/es/AppRoute/interface.d.ts +0 -18
  169. package/es/AppRoute/utils.d.ts +0 -1
  170. package/es/AppRoute/utils.js +0 -28
  171. package/es/DeviceList/index.css +0 -32
  172. package/es/DeviceList/index.d.ts +0 -14
  173. package/es/Dict/desc.d.ts +0 -64
  174. package/es/Dict/desc.js +0 -162
  175. package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
  176. package/es/DynamicDeviceList/CheckExt.js +0 -36
  177. package/es/DynamicDeviceList/Demo.js +0 -17
  178. package/es/DynamicDeviceList/index.d.ts +0 -35
  179. package/es/DynamicDeviceList/index.js +0 -224
  180. package/es/DynamicDeviceList/utils.d.ts +0 -2
  181. package/es/DynamicDeviceList/utils.js +0 -15
  182. package/es/DynamicList/index.css +0 -7
  183. package/es/DynamicList/index.d.ts +0 -31
  184. package/es/DynamicList/index.js +0 -132
  185. package/es/IconFont/index.css +0 -0
  186. package/es/List/utils.d.ts +0 -5
  187. package/es/List/utils.js +0 -18
  188. package/es/ListExt/index.css +0 -9
  189. package/es/ScrollList/index.css +0 -73
  190. package/es/ScrollList/index.d.ts +0 -24
  191. package/es/ScrollList/index.js +0 -262
  192. package/es/ScrollList/utils.js +0 -84
  193. package/es/Service/logger.d.ts +0 -3
  194. package/es/Service/logger.js +0 -13
  195. package/es/Service/utils.d.ts +0 -3
  196. package/es/Service/utils.js +0 -11
  197. package/es/TreeMode/demo.js +0 -32
  198. package/es/TreeMode/index.css +0 -38
  199. package/es/TreeMode/index.d.ts +0 -23
  200. package/es/TreeMode/index.js +0 -201
  201. package/es/VList/index.css +0 -4
  202. package/es/VList/index.d.ts +0 -16
  203. package/es/VList/index.js +0 -56
  204. package/es/VList/utils.d.ts +0 -10
  205. package/es/useChangeEffect/index.d.ts +0 -3
  206. package/es/useChangeEffect/index.js +0 -32
  207. package/es/useHistory/index.css +0 -0
@@ -1,35 +0,0 @@
1
- import { DeviceItemType } from '../core';
2
- import './index.less';
3
- interface IDynamicDeviceListProps {
4
- /**
5
- * @description 列表点击事件
6
- */
7
- onClick?: (item: DeviceItemType) => void;
8
- /**
9
- * @description 选中设备cid集合
10
- */
11
- checkedKeys?: string[];
12
- /**
13
- * @description 传入onSelect列表默认渲染为checkbox模式
14
- */
15
- onChecked?: (ids: string[], list: DeviceItemType[], checked: boolean) => void;
16
- /**
17
- * @description 传入queryList需要的参数,例如业务树ID,场所id等,分页参数除外
18
- */
19
- params?: {
20
- [key: string]: any;
21
- };
22
- /**
23
- * @description 自定义渲染列表
24
- */
25
- renderItem?: (item: DeviceItemType, index: number) => JSX.Element;
26
- /**
27
- * @description 列表高度
28
- */
29
- itemHeight?: number;
30
- title?: string;
31
- onKeywordChange?: (v: string) => void;
32
- defaultCheckedIds?: string[];
33
- }
34
- declare function DynamicDeviceList({ onClick, checkedKeys, defaultCheckedIds, onChecked, params, renderItem, itemHeight, title, onKeywordChange }: IDynamicDeviceListProps): JSX.Element;
35
- export default DynamicDeviceList;
@@ -1,224 +0,0 @@
1
- import "antd/lib/checkbox/style";
2
- import _Checkbox from "antd/lib/checkbox";
3
-
4
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
-
6
- 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."); }
7
-
8
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
-
10
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
-
12
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
-
14
- 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."); }
15
-
16
- 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); }
17
-
18
- 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; }
19
-
20
- 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; }
21
-
22
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
-
24
- import { __awaiter } from "tslib";
25
- import React, { useCallback, useEffect, useRef, useState } from 'react';
26
- import DynamicList from '../DynamicList';
27
- import { queryDeviceList } from './utils';
28
- import DeviceIcon from '../DeviceIcon';
29
- import TreeTitle from '../TreeTitle';
30
- import CheckExt from './CheckExt';
31
- import "./index.css";
32
- var OFFSET = 0;
33
- var LIMIT = 30;
34
-
35
- function DynamicDeviceList(_ref) {
36
- var _this = this;
37
-
38
- var onClick = _ref.onClick,
39
- checkedKeys = _ref.checkedKeys,
40
- defaultCheckedIds = _ref.defaultCheckedIds,
41
- onChecked = _ref.onChecked,
42
- params = _ref.params,
43
- _renderItem = _ref.renderItem,
44
- _ref$itemHeight = _ref.itemHeight,
45
- itemHeight = _ref$itemHeight === void 0 ? 40 : _ref$itemHeight,
46
- title = _ref.title,
47
- onKeywordChange = _ref.onKeywordChange;
48
-
49
- var _useState = useState({
50
- offset: OFFSET,
51
- limit: LIMIT,
52
- list: [],
53
- count: LIMIT,
54
- checkedKeys: defaultCheckedIds || checkedKeys || []
55
- }),
56
- _useState2 = _slicedToArray(_useState, 2),
57
- state = _useState2[0],
58
- setState = _useState2[1];
59
-
60
- var loadRef = useRef(false);
61
- var listRef = useRef(null);
62
- /**
63
- * 列表选中处理
64
- */
65
-
66
- var onCheckedAction = useCallback(function (item) {
67
- var ids = state.checkedKeys || [];
68
- var id = item.cid;
69
- var checked = !ids.includes(item.cid);
70
-
71
- if (checked) {
72
- ids.push(id);
73
- } else {
74
- ids = ids.filter(function (v) {
75
- return v !== id;
76
- });
77
- }
78
-
79
- setState(function (old) {
80
- return Object.assign(Object.assign({}, old), {
81
- checkedKeys: _toConsumableArray(ids)
82
- });
83
- });
84
- onChecked && onChecked(ids, [item], checked);
85
- }, // eslint-disable-next-line react-hooks/exhaustive-deps
86
- [state.checkedKeys]);
87
- var onSelectAll = useCallback(function () {
88
- var ids = state.list.map(function (v) {
89
- return v.cid;
90
- });
91
- setState(function (old) {
92
- return Object.assign(Object.assign({}, old), {
93
- checkedKeys: ids
94
- });
95
- });
96
- onChecked && onChecked(ids, state.list, true);
97
- }, [state.list]);
98
- var onCancelAll = useCallback(function () {
99
- setState(function (old) {
100
- return Object.assign(Object.assign({}, old), {
101
- checkedKeys: []
102
- });
103
- });
104
- onChecked && onChecked([], [], false);
105
- }, []);
106
- /**
107
- * @desc 参数变化列表需要重新初始化
108
- */
109
-
110
- useEffect(function () {
111
- loadRef.current = true;
112
- var data = params || {};
113
- setState(function (old) {
114
- return Object.assign(Object.assign({}, old), {
115
- list: [],
116
- count: LIMIT
117
- });
118
- });
119
- queryDeviceList(Object.assign({
120
- offset: 0,
121
- limit: LIMIT
122
- }, data)).then(function (res) {
123
- setState(function (old) {
124
- return Object.assign(Object.assign({}, old), {
125
- list: res.data || [],
126
- count: res.totalCount,
127
- offset: LIMIT,
128
- limit: LIMIT
129
- });
130
- });
131
- Promise.resolve().then(function () {
132
- loadRef.current = false;
133
- });
134
- });
135
- }, [params]);
136
- /**
137
- * @desc 懒加载方法
138
- */
139
-
140
- var loadNextPage = useCallback(function () {
141
- return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
142
- var offset;
143
- return regeneratorRuntime.wrap(function _callee$(_context) {
144
- while (1) {
145
- switch (_context.prev = _context.next) {
146
- case 0:
147
- if (!loadRef.current) {
148
- _context.next = 2;
149
- break;
150
- }
151
-
152
- return _context.abrupt("return", Promise.resolve());
153
-
154
- case 2:
155
- offset = state.offset;
156
- _context.next = 5;
157
- return queryDeviceList(Object.assign({
158
- offset: offset,
159
- limit: LIMIT
160
- }, params)).then(function (res) {
161
- setState(function (old) {
162
- return Object.assign(Object.assign({}, old), {
163
- list: [].concat(_toConsumableArray(old.list), _toConsumableArray(res.data || [])),
164
- offset: offset + LIMIT
165
- });
166
- });
167
- }).catch(console.error);
168
-
169
- case 5:
170
- case "end":
171
- return _context.stop();
172
- }
173
- }
174
- }, _callee);
175
- }));
176
- }, [state.offset, state.limit, params]);
177
- return /*#__PURE__*/React.createElement("div", {
178
- className: "zenview-c-dynamic-device-list-layout"
179
- }, /*#__PURE__*/React.createElement(TreeTitle, {
180
- title: title,
181
- onChange: onKeywordChange,
182
- inputPlaceholder: "\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0"
183
- }), onChecked && /*#__PURE__*/React.createElement(CheckExt, {
184
- count: state.count,
185
- selectCount: state.checkedKeys.length,
186
- onCancel: onCancelAll,
187
- onCheck: onSelectAll
188
- }), /*#__PURE__*/React.createElement(DynamicList, {
189
- list: state.list,
190
- loadMore: loadNextPage,
191
- rowCount: state.count,
192
- renderItem: function renderItem(item, index) {
193
- return _renderItem ? _renderItem(item, index) : /*#__PURE__*/React.createElement("div", {
194
- className: "device-item-box ".concat(state.checkedKeys.includes(item.cid) ? 'device-item-selected' : '')
195
- }, onChecked ? /*#__PURE__*/React.createElement(_Checkbox, {
196
- className: "device-name device-checkbox-name",
197
- checked: state.checkedKeys.includes(item.cid),
198
- value: item.cid,
199
- onClick: function onClick() {
200
- return onCheckedAction(item);
201
- }
202
- }, /*#__PURE__*/React.createElement(DeviceIcon, {
203
- type: item.deviceType,
204
- status: item.deviceStatus
205
- }), /*#__PURE__*/React.createElement("span", {
206
- title: item.deviceName
207
- }, item.deviceName)) : /*#__PURE__*/React.createElement("span", {
208
- className: "device-name",
209
- onClick: onClick ? function () {
210
- return onClick(item);
211
- } : undefined
212
- }, /*#__PURE__*/React.createElement(DeviceIcon, {
213
- type: item.deviceType,
214
- status: item.deviceStatus
215
- }), /*#__PURE__*/React.createElement("span", {
216
- title: item.deviceName
217
- }, item.deviceName)));
218
- },
219
- itemHeight: itemHeight,
220
- ref: listRef
221
- }));
222
- }
223
-
224
- export default DynamicDeviceList;
@@ -1,2 +0,0 @@
1
- import { DeviceItemType, HttpPageResult2 } from '../core';
2
- export declare function queryDeviceList(params?: any): Promise<HttpPageResult2<DeviceItemType>>;
@@ -1,15 +0,0 @@
1
- import Service from '../Service';
2
- import { getHeader } from '../utils';
3
- export function queryDeviceList() {
4
- var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5
- return Service.$http({
6
- method: 'post',
7
- url: '/api/udm-api/device/queryList',
8
- requestId: 'queryDeviceList',
9
- headers: getHeader(),
10
- data: Object.assign(Object.assign({}, params), {
11
- includeSubOrganizations: 1,
12
- isPagination: true
13
- })
14
- });
15
- }
@@ -1,7 +0,0 @@
1
- .lm-c-dynamiclist {
2
- position: relative;
3
- background-color: transparent;
4
- width: 100%;
5
- height: 100%;
6
- border: 1px solid var(--bd-color);
7
- }
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface IDynamicListProps {
4
- /**
5
- * @description 列表数据
6
- */
7
- list: any[];
8
- /**
9
- * @description 懒加载触发触发条件
10
- */
11
- threshold?: number;
12
- /**
13
- * @description 列表渲染函数
14
- */
15
- renderItem: (item: any, index: number) => JSX.Element;
16
- className?: string;
17
- /**
18
- * @description 单个列表高度
19
- */
20
- itemHeight?: number;
21
- /**
22
- * @description 懒加载方法,注意需要自己手动控制节流
23
- */
24
- loadMore: () => Promise<any>;
25
- /**
26
- * @description 列表总数
27
- */
28
- rowCount: number;
29
- }
30
- declare const DynamicList: React.ForwardRefExoticComponent<IDynamicListProps & React.RefAttributes<any>>;
31
- export default DynamicList;
@@ -1,132 +0,0 @@
1
- import "antd/lib/skeleton/style";
2
- import _Skeleton from "antd/lib/skeleton";
3
- import { __awaiter } from "tslib";
4
- import React, { useRef, useImperativeHandle, forwardRef, useCallback } from 'react';
5
- import { AutoSizer, InfiniteLoader, List } from 'react-virtualized';
6
- import "./index.css";
7
- var DynamicList = /*#__PURE__*/forwardRef(function InfiniteScrollLayout(props, ref) {
8
- var _this = this;
9
-
10
- var list = props.list,
11
- itemHeight = props.itemHeight,
12
- threshold = props.threshold,
13
- rowCount = props.rowCount,
14
- loadMore = props.loadMore,
15
- _props$className = props.className,
16
- className = _props$className === void 0 ? '' : _props$className,
17
- renderItem = props.renderItem;
18
- var infiniteRef = useRef(null);
19
- var loadRef = useRef(false);
20
-
21
- function forceUpdateGrid() {
22
- infiniteRef.current && infiniteRef.current._registeredChild.forceUpdateGrid();
23
- }
24
-
25
- function scrollToPosition() {
26
- var _infiniteRef$current$;
27
-
28
- infiniteRef.current && (_infiniteRef$current$ = infiniteRef.current._registeredChild).scrollToPosition.apply(_infiniteRef$current$, arguments);
29
- }
30
-
31
- function scrollToRow() {
32
- var _infiniteRef$current$2;
33
-
34
- infiniteRef.current && (_infiniteRef$current$2 = infiniteRef.current._registeredChild).scrollToRow.apply(_infiniteRef$current$2, arguments);
35
- }
36
-
37
- useImperativeHandle(ref, function () {
38
- return {
39
- forceUpdateGrid: forceUpdateGrid,
40
- scrollToRow: scrollToRow,
41
- scrollToPosition: scrollToPosition
42
- };
43
- });
44
-
45
- var _isRowLoaded = useCallback(function (_ref) {
46
- var index = _ref.index;
47
- return !!list[index];
48
- }, []);
49
-
50
- var loadMoreAction = useCallback(function (params) {
51
- return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
52
- return regeneratorRuntime.wrap(function _callee$(_context) {
53
- while (1) {
54
- switch (_context.prev = _context.next) {
55
- case 0:
56
- if (!loadRef.current) {
57
- _context.next = 2;
58
- break;
59
- }
60
-
61
- return _context.abrupt("return");
62
-
63
- case 2:
64
- loadRef.current = true;
65
-
66
- if (params.stopIndex < list.length || list.length >= rowCount) {
67
- _context.next = 6;
68
- break;
69
- }
70
-
71
- _context.next = 6;
72
- return loadMore();
73
-
74
- case 6:
75
- loadRef.current = false;
76
-
77
- case 7:
78
- case "end":
79
- return _context.stop();
80
- }
81
- }
82
- }, _callee);
83
- }));
84
- }, [list, rowCount]);
85
- return /*#__PURE__*/React.createElement("div", {
86
- className: "lm-c-dynamiclist ".concat(className)
87
- }, /*#__PURE__*/React.createElement(InfiniteLoader, {
88
- isRowLoaded: _isRowLoaded,
89
- loadMoreRows: loadMoreAction,
90
- rowCount: rowCount,
91
- ref: infiniteRef,
92
- threshold: threshold
93
- }, function (_ref2) {
94
- var onRowsRendered = _ref2.onRowsRendered,
95
- registerChild = _ref2.registerChild;
96
- return /*#__PURE__*/React.createElement(AutoSizer, null, function (_ref3) {
97
- var width = _ref3.width,
98
- height = _ref3.height;
99
- return /*#__PURE__*/React.createElement(List, {
100
- width: width,
101
- onRowsRendered: onRowsRendered,
102
- ref: registerChild,
103
- height: height,
104
- rowCount: rowCount,
105
- rowHeight: itemHeight,
106
- rowRenderer: function rowRenderer(_ref4) {
107
- var key = _ref4.key,
108
- index = _ref4.index,
109
- style = _ref4.style;
110
- return /*#__PURE__*/React.createElement("div", {
111
- key: key,
112
- style: Object.assign(Object.assign({}, style), {
113
- padding: '0 10px'
114
- }),
115
- className: "dynamic-list-item"
116
- }, list[index] ? renderItem(list[index], index) : /*#__PURE__*/React.createElement(_Skeleton, {
117
- paragraph: false,
118
- loading: true,
119
- active: true
120
- }));
121
- }
122
- });
123
- });
124
- }));
125
- });
126
- DynamicList.defaultProps = {
127
- itemHeight: 40,
128
- threshold: 5,
129
- list: [],
130
- rowCount: 100
131
- };
132
- export default DynamicList;
File without changes
@@ -1,5 +0,0 @@
1
- export declare function computedCheckStatus(list?: any[], checkedKeys?: any[], key?: string): {
2
- checkHalfStatus: boolean;
3
- checkAllStatus: boolean;
4
- listKey: any[];
5
- };
package/es/List/utils.js DELETED
@@ -1,18 +0,0 @@
1
- import intersectionBy from 'lodash-es/intersectionBy'; // 计算全选半选状态
2
-
3
- export function computedCheckStatus() {
4
- var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5
- var checkedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6
- var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
7
- var listKey = list.map(function (v) {
8
- return v[key];
9
- });
10
- var temp = intersectionBy(listKey, checkedKeys);
11
- var checkHalfStatus = temp.length && temp.length < list.length;
12
- var checkAllStatus = list.length && temp.length === list.length;
13
- return {
14
- checkHalfStatus: checkHalfStatus,
15
- checkAllStatus: checkAllStatus,
16
- listKey: listKey
17
- };
18
- }
@@ -1,9 +0,0 @@
1
- .vidc-list-component {
2
- margin-left: -1px;
3
- }
4
- .vidc-list-component .lm-c-base-list-layout .list-item .item-info .anticon {
5
- color: var(--icon);
6
- }
7
- .vidc-list-component .lm-c-base-list-layout .list-item:hover .item-info .anticon {
8
- color: inherit;
9
- }
@@ -1,73 +0,0 @@
1
- .lm-c-normol-box.lm-c-infinite-scroll-layout {
2
- position: relative;
3
- background-color: transparent;
4
- }
5
- .lm-c-normol-box.lm-c-infinite-scroll-layout .row-group-part {
6
- display: flex;
7
- justify-content: center;
8
- }
9
- .lm-c-normol-box.lm-c-infinite-scroll-layout .row-group-part .row-item-part {
10
- overflow: hidden;
11
- }
12
- .lm-c-normol-box.lm-c-infinite-scroll-layout .row-group-part .row-item-part:last-child {
13
- margin-right: 0 !important;
14
- }
15
- .lm-c-normol-box.lm-c-infinite-scroll-layout .scoll-back-top {
16
- position: absolute;
17
- right: 20px;
18
- bottom: 20px;
19
- height: 40px;
20
- width: 40px;
21
- border-radius: 50%;
22
- background-color: var(--primary);
23
- color: #fff;
24
- cursor: pointer;
25
- text-align: center;
26
- line-height: 40px;
27
- font-size: 18px;
28
- }
29
- .lm-c-normol-box.lm-c-infinite-scroll-layout .scoll-back-top:hover {
30
- background-color: var(--primary);
31
- }
32
- .lm-c-normol-box.lm-c-infinite-scroll-layout.infinite-scroll-empty {
33
- background-repeat: no-repeat;
34
- background-position: center 30%;
35
- background-size: 200px;
36
- }
37
- .lm-c-normol-box.lm-c-infinite-scroll-layout .listcard-title {
38
- font-size: 14px;
39
- font-weight: 700;
40
- margin-bottom: 5px;
41
- justify-content: left;
42
- }
43
- .lm-c-normol-box.lm-c-infinite-scroll-layout .listcard-title.row-group-part:before {
44
- content: '';
45
- border-radius: 10px;
46
- border: 4px solid var(--primary);
47
- position: relative;
48
- margin-right: 10px;
49
- top: 6px;
50
- height: 8px;
51
- display: inline-block;
52
- }
53
- .lm-c-normol-box.lm-c-infinite-scroll-layout .listcard-title.row-group-part.show-line:before {
54
- content: '';
55
- border-radius: 10px;
56
- border: 4px solid var(--primary);
57
- position: relative;
58
- margin-right: 10px;
59
- margin-left: -4px;
60
- top: 6px;
61
- height: 8px;
62
- display: inline-block;
63
- }
64
- .lm-c-normol-box.lm-c-infinite-scroll-layout .row-group-part.show-line:before {
65
- content: '';
66
- border: 0.5px solid #d8d8d8;
67
- margin-right: 15px;
68
- }
69
- .lm-c-normol-box.lm-c-infinite-scroll-layout .row-group-part.hide-line:before {
70
- content: '';
71
- border: none;
72
- margin-right: 15px;
73
- }
@@ -1,24 +0,0 @@
1
- import * as React from 'react';
2
-
3
- export declare interface ScrollListProps<T> {
4
- itemHeight?: number; // 用于计算滚动条的高度
5
- data?: Array<T>;
6
- loadMore?: () => Promise<null>; //加载更多的方法,次方法应该修改props.data
7
- renderItem?: (item: T, index: number) => React.ReactNode;
8
- rowClass?: string;
9
- threshold?: number;
10
- itemClass?: string;
11
- itemGrid?: object;
12
- gutter?: number;
13
- hasLoadPrev?: boolean;
14
- hasLoadMore?: boolean;
15
- loadPrev?: func;
16
- prethreshold?: number;
17
- isNoData?: boolean;
18
- className?: string;
19
- noDataUrl?: string;
20
- }
21
-
22
- declare const ScrollList: React.StatelessComponent<ScrollListProps<T>>;
23
-
24
- export default ScrollList;