@cloud-app-dev/vidc 2.0.0-alpha.1 → 2.0.0-alpha.13

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 (277) hide show
  1. package/.umirc.ts +2 -3
  2. package/es/Api/index.d.ts +3 -4
  3. package/es/Api/index.js +7 -8
  4. package/es/AppRedirect/index.css +0 -0
  5. package/es/AppRedirect/index.d.ts +16 -0
  6. package/es/AppRedirect/index.js +34 -0
  7. package/es/AppRoute/index.d.ts +10 -0
  8. package/es/AppRoute/index.js +115 -0
  9. package/es/AppRoute/interface.d.ts +8 -0
  10. package/es/Auth/index.d.ts +8 -0
  11. package/es/Auth/index.js +17 -0
  12. package/es/AutoExit/index.js +15 -10
  13. package/es/Box/BetweenBox/index.css +5 -0
  14. package/es/Box/BetweenBox/index.d.ts +12 -0
  15. package/es/Box/BetweenBox/index.js +24 -0
  16. package/es/Box/InfoBox/index.css +23 -0
  17. package/es/Box/InfoBox/index.d.ts +12 -0
  18. package/es/Box/InfoBox/index.js +26 -0
  19. package/es/Box/TwoColumnBox/index.css +77 -0
  20. package/es/Box/TwoColumnBox/index.d.ts +10 -0
  21. package/es/Box/TwoColumnBox/index.js +50 -0
  22. package/es/Box/deps/content-grid.d.ts +9 -0
  23. package/es/Box/deps/content-grid.js +9 -0
  24. package/es/Box/deps/grid-factory.d.ts +10 -0
  25. package/es/Box/deps/grid-factory.js +72 -0
  26. package/es/Box/deps/simple-grid.d.ts +9 -0
  27. package/es/Box/deps/simple-grid.js +8 -0
  28. package/es/Box/index.css +9 -0
  29. package/es/Box/index.d.ts +14 -0
  30. package/es/Box/index.js +28 -0
  31. package/es/CheckGroupFixed/index.css +49 -0
  32. package/es/CheckGroupFixed/index.d.ts +17 -0
  33. package/es/CheckGroupFixed/index.js +148 -0
  34. package/es/Config/index.js +63 -6
  35. package/es/Config/interface.d.ts +30 -5
  36. package/es/Config/utils.d.ts +2 -11
  37. package/es/Config/utils.js +1 -12
  38. package/es/ConfigContext/index.d.ts +3 -0
  39. package/es/DeviceIcon/icon.js +5 -5
  40. package/es/DeviceIcon/index.js +2 -2
  41. package/es/DeviceSelect/TreeType.d.ts +6 -0
  42. package/es/DeviceSelect/TreeType.js +36 -0
  43. package/es/DeviceSelect/demo.js +2 -2
  44. package/es/DeviceSelect/index.css +6 -1
  45. package/es/DeviceSelect/index.d.ts +5 -0
  46. package/es/DeviceSelect/index.js +22 -53
  47. package/es/Dict/cache.d.ts +3 -0
  48. package/es/Dict/cache.js +21 -0
  49. package/es/Dict/desc.d.ts +64 -0
  50. package/es/Dict/desc.js +162 -0
  51. package/es/Dict/device.d.ts +28 -0
  52. package/es/Dict/device.js +117 -0
  53. package/es/Dict/hook.d.ts +4 -0
  54. package/es/Dict/hook.js +114 -0
  55. package/es/Dict/index.d.ts +13 -0
  56. package/es/Dict/index.js +14 -0
  57. package/es/Dict/interface.d.ts +16 -0
  58. package/es/Dict/utils.d.ts +11 -0
  59. package/es/Dict/utils.js +51 -0
  60. package/es/Drag/DragAndDropItem.d.ts +4 -0
  61. package/es/Drag/DragAndDropItem.js +145 -0
  62. package/es/Drag/DropItem.d.ts +4 -0
  63. package/es/Drag/DropItem.js +54 -0
  64. package/es/Drag/index.css +0 -0
  65. package/es/Drag/index.d.ts +7 -0
  66. package/es/Drag/index.js +7 -0
  67. package/es/Drag/interface.d.ts +16 -0
  68. package/es/Drawer/Demo.d.ts +3 -0
  69. package/es/Drawer/Demo.js +52 -0
  70. package/es/Drawer/Footer.d.ts +4 -0
  71. package/es/Drawer/Footer.js +26 -0
  72. package/es/Drawer/index.css +39 -0
  73. package/es/Drawer/index.d.ts +12 -0
  74. package/es/Drawer/index.js +41 -0
  75. package/es/Drawer/interface.d.ts +191 -0
  76. package/es/FullScreen/index.css +16 -0
  77. package/es/FullScreen/index.d.ts +10 -0
  78. package/es/FullScreen/index.js +68 -0
  79. package/es/HightLevel/index.css +3 -0
  80. package/es/HightLevel/index.d.ts +9 -0
  81. package/es/HightLevel/index.js +23 -0
  82. package/es/IconFont/index.d.ts +12 -0
  83. package/es/IconFont/index.js +57 -0
  84. package/es/ImageView/index.css +6 -0
  85. package/es/ImageView/index.d.ts +17 -0
  86. package/es/ImageView/index.js +58 -0
  87. package/es/InitialConfig/index.js +7 -11
  88. package/es/InitialConfig/utils.d.ts +1 -1
  89. package/es/InitialConfig/utils.js +8 -31
  90. package/es/InitialRequest/index.d.ts +1 -1
  91. package/es/InitialRequest/index.js +19 -11
  92. package/es/InitialRequest/utils.d.ts +5 -4
  93. package/es/InitialRequest/utils.js +58 -94
  94. package/es/Input/index.css +8 -0
  95. package/es/Input/index.d.ts +18 -0
  96. package/es/Input/index.js +76 -0
  97. package/es/LabelValue/index.css +18 -0
  98. package/es/LabelValue/index.d.ts +23 -0
  99. package/es/LabelValue/index.js +32 -0
  100. package/es/{DynamicDeviceList → List}/CheckExt.d.ts +0 -0
  101. package/es/{DynamicDeviceList → List}/CheckExt.js +4 -4
  102. package/es/List/DeviceList/index.css +0 -0
  103. package/es/List/DeviceList/index.d.ts +11 -0
  104. package/es/{DeviceList → List/DeviceList}/index.js +8 -20
  105. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  106. package/es/List/DynamicDeviceList/Demo.js +54 -0
  107. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  108. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  109. package/es/List/DynamicDeviceList/index.js +205 -0
  110. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  111. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  112. package/es/List/DynamicDeviceList/utils.js +61 -0
  113. package/es/List/DynamicGridList/Demo.d.ts +2 -0
  114. package/es/List/DynamicGridList/Demo.js +70 -0
  115. package/es/List/DynamicGridList/index.d.ts +26 -0
  116. package/es/List/DynamicGridList/index.js +73 -0
  117. package/es/List/GridList/Demo.d.ts +2 -0
  118. package/es/List/GridList/Demo.js +91 -0
  119. package/es/List/GridList/hook.d.ts +13 -0
  120. package/es/List/GridList/hook.js +301 -0
  121. package/es/List/GridList/index.css +7 -0
  122. package/es/List/GridList/index.d.ts +15 -0
  123. package/es/List/GridList/index.js +47 -0
  124. package/es/List/GridList/interface.d.ts +59 -0
  125. package/es/List/GridList/utils.d.ts +9 -0
  126. package/es/List/GridList/utils.js +43 -0
  127. package/es/List/ListExt/index.css +3 -0
  128. package/es/List/ListExt/index.d.ts +19 -0
  129. package/es/List/ListExt/index.js +44 -0
  130. package/es/List/VList/index.css +6 -0
  131. package/es/List/VList/index.d.ts +18 -0
  132. package/es/List/VList/index.js +51 -0
  133. package/es/List/VList/utils.d.ts +14 -0
  134. package/es/List/VList/utils.js +17 -0
  135. package/es/List/index.css +60 -5
  136. package/es/List/index.d.ts +10 -13
  137. package/es/List/index.js +170 -36
  138. package/es/List/interface.d.ts +87 -0
  139. package/es/List/renderItem.d.ts +20 -0
  140. package/es/List/renderItem.js +71 -0
  141. package/es/LoaderApp/index.css +3 -0
  142. package/es/LoaderApp/index.d.ts +31 -0
  143. package/es/LoaderApp/index.js +135 -0
  144. package/es/LoaderApp/interface.d.ts +6 -0
  145. package/es/LoaderApp/loader.d.ts +20 -0
  146. package/es/LoaderApp/loader.js +86 -0
  147. package/es/LoaderApp/utils.d.ts +13 -0
  148. package/es/LoaderApp/utils.js +121 -0
  149. package/es/LoaderScript/index.d.ts +26 -0
  150. package/es/LoaderScript/index.js +127 -0
  151. package/es/LoaderScript/interface.d.ts +26 -0
  152. package/es/LoaderScript/utils.d.ts +12 -0
  153. package/es/LoaderScript/utils.js +133 -0
  154. package/es/Modal/index.css +43 -0
  155. package/es/Modal/index.d.ts +17 -0
  156. package/es/Modal/index.js +34 -0
  157. package/es/Modal/interface.d.ts +339 -0
  158. package/es/Picture/component/DefaultRects/RectInfo.d.ts +7 -0
  159. package/es/Picture/component/DefaultRects/RectInfo.js +94 -0
  160. package/es/Picture/component/DefaultRects/index.css +247 -0
  161. package/es/Picture/component/DefaultRects/index.d.ts +12 -0
  162. package/es/Picture/component/DefaultRects/index.js +47 -0
  163. package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
  164. package/es/Picture/component/DefaultRects/utils.js +11 -0
  165. package/es/Picture/component/DrawRect/index.css +8 -0
  166. package/es/Picture/component/DrawRect/index.d.ts +14 -0
  167. package/es/Picture/component/DrawRect/index.js +41 -0
  168. package/es/Picture/component/MoveContent/index.css +0 -0
  169. package/es/Picture/component/MoveContent/index.d.ts +39 -0
  170. package/es/Picture/component/MoveContent/index.js +240 -0
  171. package/es/Picture/component/MoveContent/utils.d.ts +4 -0
  172. package/es/Picture/component/MoveContent/utils.js +19 -0
  173. package/es/Picture/component/RectMenu/index.css +31 -0
  174. package/es/Picture/component/RectMenu/index.d.ts +13 -0
  175. package/es/Picture/component/RectMenu/index.js +81 -0
  176. package/es/Picture/component/RectMenu/utils.d.ts +12 -0
  177. package/es/Picture/component/RectMenu/utils.js +22 -0
  178. package/es/Picture/component/Tools/index.css +42 -0
  179. package/es/Picture/component/Tools/index.d.ts +13 -0
  180. package/es/Picture/component/Tools/index.js +83 -0
  181. package/es/Picture/component/WheelScale/index.d.ts +6 -0
  182. package/es/Picture/component/WheelScale/index.js +29 -0
  183. package/es/Picture/dragBound.d.ts +5 -0
  184. package/es/Picture/dragBound.js +77 -0
  185. package/es/Picture/index.css +12 -0
  186. package/es/Picture/index.d.ts +16 -0
  187. package/es/Picture/index.js +344 -0
  188. package/es/Picture/interface.d.ts +67 -0
  189. package/es/Picture/loadCaptureRectImage.d.ts +8 -0
  190. package/es/Picture/loadCaptureRectImage.js +119 -0
  191. package/es/Picture/useDraw.d.ts +1 -0
  192. package/es/Picture/useDraw.js +136 -0
  193. package/es/Picture/utils.d.ts +22 -0
  194. package/es/Picture/utils.js +90 -0
  195. package/es/Progress/index.css +20 -0
  196. package/es/Progress/index.d.ts +11 -0
  197. package/es/Progress/index.js +68 -0
  198. package/es/RefDrawer/index.js +4 -5
  199. package/es/RefModal/index.js +4 -5
  200. package/es/Service/http.d.ts +1 -1
  201. package/es/Service/http.js +2 -25
  202. package/es/TableLayout/index.css +4 -0
  203. package/es/TableLayout/index.d.ts +13 -0
  204. package/es/TableLayout/index.js +33 -0
  205. package/es/ThemeAntd/index.css +501 -0
  206. package/es/ThemeAntd/index.d.ts +7 -0
  207. package/es/ThemeAntd/index.js +6 -0
  208. package/es/ThemeAntd/style/button.css +46 -0
  209. package/es/ThemeAntd/style/checkbox.css +64 -0
  210. package/es/ThemeAntd/style/form.css +10 -0
  211. package/es/ThemeAntd/style/input.css +58 -0
  212. package/es/ThemeAntd/style/pagination.css +44 -0
  213. package/es/ThemeAntd/style/picker.css +86 -0
  214. package/es/ThemeAntd/style/popover.css +3 -0
  215. package/es/ThemeAntd/style/radio.css +71 -0
  216. package/es/ThemeAntd/style/scrollbar.css +19 -0
  217. package/es/ThemeAntd/style/select.css +57 -0
  218. package/es/ThemeAntd/style/table.css +36 -0
  219. package/es/ThemeAntd/style/tree.css +4 -0
  220. package/es/{TreeTitle → Title}/index.css +5 -5
  221. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  222. package/es/{TreeTitle → Title}/index.js +9 -6
  223. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  224. package/es/Tree/BaseTree/demo.js +69 -0
  225. package/es/Tree/BaseTree/index.css +64 -0
  226. package/es/Tree/BaseTree/index.d.ts +24 -0
  227. package/es/Tree/BaseTree/index.js +83 -0
  228. package/es/Tree/demo.d.ts +2 -0
  229. package/es/{TreeMode → Tree}/demo.js +0 -0
  230. package/es/{TreeMode → Tree}/index.css +1 -1
  231. package/es/{TreeMode → Tree}/index.d.ts +1 -1
  232. package/es/{TreeMode → Tree}/index.js +9 -12
  233. package/es/UserSelect/index.d.ts +3 -3
  234. package/es/UserSelect/index.js +18 -15
  235. package/es/WorkerFlow/Form/Condition.js +6 -8
  236. package/es/WorkerFlow/Form/EmptyUserSet.js +4 -6
  237. package/es/WorkerFlow/Form/FormAuth.js +3 -3
  238. package/es/WorkerFlow/Form/GroupList.js +2 -2
  239. package/es/WorkerFlow/Form/GroupSelect.js +4 -6
  240. package/es/WorkerFlow/Form/GroupSelectModalContent.js +8 -7
  241. package/es/WorkerFlow/Form/LevelGroupSelect.js +5 -7
  242. package/es/WorkerFlow/Form/UserAndGroupSelect.js +4 -6
  243. package/es/WorkerFlow/Form/UserSelect.js +4 -6
  244. package/es/WorkerFlow/Form/UserSelectModalContent.js +8 -6
  245. package/es/WorkerFlow/Form/UserSet.js +3 -3
  246. package/es/WorkerFlow/Nodes/Add.js +2 -3
  247. package/es/WorkerFlow/Nodes/AddOption.js +2 -2
  248. package/es/WorkerFlow/Nodes/Approver.js +2 -2
  249. package/es/WorkerFlow/Nodes/Condition.js +2 -2
  250. package/es/WorkerFlow/Nodes/Handle.js +2 -2
  251. package/es/WorkerFlow/Nodes/Notifier.js +2 -2
  252. package/es/WorkerFlow/Nodes/TitleElement.js +70 -36
  253. package/es/WorkerFlow/index.css +9 -3
  254. package/es/WorkerFlow/index.js +3 -3
  255. package/es/WorkerFlow/utils.js +2 -2
  256. package/es/core.d.ts +27 -0
  257. package/es/index.d.ts +27 -4
  258. package/es/index.js +27 -4
  259. package/es/useDrawer/index.d.ts +14 -0
  260. package/es/useDrawer/index.js +91 -0
  261. package/es/useHttp/index.d.ts +8 -0
  262. package/es/useHttp/index.js +78 -0
  263. package/es/useModal/index.d.ts +14 -0
  264. package/es/useModal/index.js +93 -0
  265. package/es/useNavigate/index.css +0 -0
  266. package/es/useNavigate/index.d.ts +4 -0
  267. package/es/useNavigate/index.js +14 -0
  268. package/es/utils.d.ts +11 -0
  269. package/es/utils.js +68 -1
  270. package/package.json +10 -8
  271. package/es/DeviceList/index.css +0 -32
  272. package/es/DeviceList/index.d.ts +0 -14
  273. package/es/DynamicDeviceList/Demo.js +0 -17
  274. package/es/DynamicDeviceList/index.d.ts +0 -35
  275. package/es/DynamicDeviceList/index.js +0 -224
  276. package/es/DynamicDeviceList/utils.d.ts +0 -2
  277. package/es/DynamicDeviceList/utils.js +0 -15
@@ -1,3 +1,5 @@
1
+ import _nextTick from "@cloud-app-dev/utils/es/nextTick";
2
+
1
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
4
 
3
5
  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."); }
@@ -11,7 +13,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
11
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
14
 
13
15
  import { __awaiter } from "tslib";
14
- import { useState, useEffect, useContext } from 'react';
16
+ import React, { useState, useEffect, useContext } from 'react';
15
17
  import { initialization } from './utils';
16
18
  import AppContext from '../AppContext';
17
19
  import Config from '../Config';
@@ -40,7 +42,7 @@ function InitialRequest(_ref) {
40
42
 
41
43
  var init = function init() {
42
44
  return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
43
- var _yield$initialization, userPrivileges, centerPrivileges, centerInfo, userInfo;
45
+ var _yield$initialization, userFeatures, operationInfo, systemFeatures, userInfo, themeConfig;
44
46
 
45
47
  return regeneratorRuntime.wrap(function _callee$(_context) {
46
48
  while (1) {
@@ -51,18 +53,24 @@ function InitialRequest(_ref) {
51
53
 
52
54
  case 2:
53
55
  _yield$initialization = _context.sent;
54
- userPrivileges = _yield$initialization.userPrivileges;
55
- centerPrivileges = _yield$initialization.centerPrivileges;
56
- centerInfo = _yield$initialization.centerInfo;
56
+ userFeatures = _yield$initialization.userFeatures;
57
+ operationInfo = _yield$initialization.operationInfo;
58
+ systemFeatures = _yield$initialization.systemFeatures;
57
59
  userInfo = _yield$initialization.userInfo;
60
+ themeConfig = _yield$initialization.themeConfig;
58
61
  updateUser(userInfo);
59
- updateOperation(centerInfo);
60
- Config.registerConfig('feature', userPrivileges);
61
- Config.registerConfig('pFeature', centerPrivileges);
62
- setIsInit(true);
62
+ updateOperation(operationInfo);
63
+ Config.registerFeatrueIds(userFeatures);
64
+ Config.registerPlatformFeature(systemFeatures);
65
+ Config.registerThemeConfig(themeConfig);
66
+
67
+ _nextTick(function () {
68
+ return setIsInit(true);
69
+ });
70
+
63
71
  _BASE_DATA_INIT = true;
64
72
 
65
- case 13:
73
+ case 15:
66
74
  case "end":
67
75
  return _context.stop();
68
76
  }
@@ -77,7 +85,7 @@ function InitialRequest(_ref) {
77
85
  console.error('接口初始化失败!', e);
78
86
  }
79
87
  }, []);
80
- return isInit ? children : Spin ? Spin : null;
88
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isInit ? children : Spin ? Spin : null);
81
89
  }
82
90
 
83
91
  export default InitialRequest;
@@ -1,8 +1,9 @@
1
1
  import { UserInfoType, OperationInfoType } from '../AppContext/interface';
2
- import { FeatureItemType } from '../Config/interface';
2
+ import { FeatureItemType, ThemeInfoType } from '../Config/interface';
3
3
  export declare function initialization(): Promise<{
4
4
  userInfo: UserInfoType;
5
- userPrivileges: FeatureItemType[];
6
- centerPrivileges: FeatureItemType[];
7
- centerInfo: OperationInfoType;
5
+ userFeatures: string[];
6
+ systemFeatures: FeatureItemType[];
7
+ operationInfo: OperationInfoType;
8
+ themeConfig: ThemeInfoType;
8
9
  }>;
@@ -13,24 +13,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
 
15
15
  import { __awaiter } from "tslib";
16
- import Config from '../Config';
17
16
  import Service from '../Service';
18
-
19
- function catchPromise(fn) {
20
- return new Promise(function (resolve) {
21
- fn.then(function (res) {
22
- return resolve(res);
23
- }, function (err) {
24
- console.error(err);
25
- resolve(null);
26
- });
27
- });
28
- }
29
-
30
- var method = 'post';
31
17
  export function initialization() {
18
+ var _a;
19
+
32
20
  return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
33
- var headers, result, userInfo, userId, operationCenterId, data, data2, centerUrl, centerInfo, themeInfo, themeConfig, themeId, themeUrl, themeRes, userPrivilegesUrl, centerPrivilegesUrl, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, userPrivileges, _yield$Promise$all2$2, centerPrivileges;
21
+ var headers, result, userInfo, userId, systemId, centerUrl, userPrivilegesUrl, systemFeatureUrl, themeConfigUrl, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, centerInfo, userFeaturesRes, _yield$Promise$all2$2, systemFeatures, _yield$Promise$all2$3, themeInfo, featureIds;
34
22
 
35
23
  return regeneratorRuntime.wrap(function _callee$(_context) {
36
24
  while (1) {
@@ -42,103 +30,79 @@ export function initialization() {
42
30
  _context.next = 3;
43
31
  return Service.$http({
44
32
  url: '/api/user/v1/getUserByToken',
45
- method: method,
46
- headers: headers,
47
- requestId: 'getUserInfo'
33
+ method: 'post',
34
+ headers: headers
48
35
  });
49
36
 
50
37
  case 3:
51
38
  result = _context.sent;
52
39
  userInfo = result.data;
53
40
  userId = userInfo.id;
54
- operationCenterId = userInfo.operationCenterId;
55
- data = {
56
- id: userId
57
- };
58
- data2 = {
59
- id: operationCenterId
60
- };
61
- centerUrl = "/api/user/operationCenter/v1/operationCenters/".concat(operationCenterId);
62
- _context.next = 12;
63
- return Service.$http({
64
- data: data2,
65
- method: method,
41
+ systemId = userInfo.operationCenterId;
42
+ centerUrl = "/api/user/operationCenter/v1/operationCenters/".concat(systemId);
43
+ userPrivilegesUrl = "/api/user/role/v1/queryUserRoles/".concat(userId);
44
+ systemFeatureUrl = "/api/system/".concat(systemId, "/list");
45
+ themeConfigUrl = '/api/system/config/type';
46
+ _context.next = 13;
47
+ return Promise.all([Service.$http({
66
48
  url: centerUrl,
67
49
  headers: headers,
68
- requestId: 'operationCenterInfo'
69
- });
70
-
71
- case 12:
72
- centerInfo = _context.sent;
73
- _context.next = 15;
74
- return Service.$http({
75
- url: "/api/micro/configureApplication/v1/queryConfigureApplicationById/".concat(operationCenterId)
76
- });
77
-
78
- case 15:
79
- themeInfo = _context.sent;
80
- themeConfig = themeInfo.data || {}; // eslint-disable-next-line no-eval
81
-
82
- themeId = themeConfig.themeId || centerInfo.data.hues;
83
-
84
- if (!themeId) {
85
- _context.next = 24;
86
- break;
87
- }
88
-
89
- themeUrl = "/api/micro/configure/v1/queryConfigureByConfigureId/".concat(themeId);
90
- _context.next = 22;
91
- return Service.$http({
92
- data: data2,
93
- method: 'get',
94
- url: themeUrl,
95
- headers: headers
96
- });
97
-
98
- case 22:
99
- themeRes = _context.sent;
100
-
101
- try {
102
- Config.registerConfig('theme', themeRes.data);
103
- } catch (e) {
104
- console.error(e);
105
- }
106
-
107
- case 24:
108
- userPrivilegesUrl = "/api/user/role/v1/queryUserRoles/".concat(userId);
109
- centerPrivilegesUrl = "/api/micro/applicationSystemScene/v1/queryAllFunctionByApplicationSystemId/".concat(operationCenterId);
110
- _context.next = 28;
111
- return Promise.all([catchPromise(Service.$http({
112
- data: data,
113
- method: method,
50
+ data: {
51
+ id: systemId
52
+ },
53
+ method: 'post'
54
+ }), Service.$http({
114
55
  url: userPrivilegesUrl,
115
- headers: headers
116
- })), catchPromise(Service.$http({
117
- data: data2,
118
- method: 'get',
119
- url: centerPrivilegesUrl,
120
- headers: headers
121
- }))]);
122
-
123
- case 28:
56
+ headers: headers,
57
+ data: {
58
+ id: userId
59
+ },
60
+ method: 'post'
61
+ }), Service.$http({
62
+ url: systemFeatureUrl,
63
+ headers: headers,
64
+ data: {
65
+ id: systemId
66
+ },
67
+ method: 'get'
68
+ }), Service.$http({
69
+ url: themeConfigUrl,
70
+ headers: headers,
71
+ data: {
72
+ type: 'theme',
73
+ systemId: systemId
74
+ },
75
+ method: 'post'
76
+ })]);
77
+
78
+ case 13:
124
79
  _yield$Promise$all = _context.sent;
125
- _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
80
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 4);
126
81
  _yield$Promise$all2$ = _yield$Promise$all2[0];
127
- userPrivileges = _yield$Promise$all2$ === void 0 ? {
128
- data: []
82
+ centerInfo = _yield$Promise$all2$ === void 0 ? {
83
+ data: {}
129
84
  } : _yield$Promise$all2$;
130
- _yield$Promise$all2$2 = _yield$Promise$all2[1];
131
- centerPrivileges = _yield$Promise$all2$2 === void 0 ? {
85
+ userFeaturesRes = _yield$Promise$all2[1];
86
+ _yield$Promise$all2$2 = _yield$Promise$all2[2];
87
+ systemFeatures = _yield$Promise$all2$2 === void 0 ? {
132
88
  data: []
133
89
  } : _yield$Promise$all2$2;
90
+ _yield$Promise$all2$3 = _yield$Promise$all2[3];
91
+ themeInfo = _yield$Promise$all2$3 === void 0 ? {
92
+ data: {}
93
+ } : _yield$Promise$all2$3;
94
+ featureIds = (userFeaturesRes.data || []).map(function (v) {
95
+ return v.functionCodes;
96
+ }).flat();
134
97
  return _context.abrupt("return", {
135
98
  userInfo: userInfo,
136
- userPrivileges: userPrivileges.data,
137
- centerPrivileges: centerPrivileges.data,
138
- centerInfo: centerInfo
99
+ userFeatures: featureIds,
100
+ systemFeatures: systemFeatures.data,
101
+ operationInfo: centerInfo.data,
102
+ themeConfig: ((_a = themeInfo === null || themeInfo === void 0 ? void 0 : themeInfo.data) === null || _a === void 0 ? void 0 : _a.content) || {}
139
103
  });
140
104
 
141
- case 35:
105
+ case 24:
142
106
  case "end":
143
107
  return _context.stop();
144
108
  }
@@ -0,0 +1,8 @@
1
+ .bc-search-input input.cloudapp-input {
2
+ font-weight: normal;
3
+ }
4
+ .bc-search-input .cloudapp-input-prefix > i,
5
+ .bc-search-input .cloudapp-input-suffix > i {
6
+ color: var(--icon);
7
+ font-size: 16px;
8
+ }
@@ -0,0 +1,18 @@
1
+ import { InputProps } from 'antd';
2
+ import './index.less';
3
+ interface IInputProps extends Omit<InputProps, 'onChange'> {
4
+ defaultValue?: string;
5
+ value?: string;
6
+ className?: string;
7
+ onEnter?: (val: string) => void;
8
+ onChange?: (val: string) => void;
9
+ }
10
+ declare function Input({ prefix, className, suffix, allowClear, defaultValue, value, onChange, onEnter, ...props }: IInputProps): JSX.Element;
11
+ declare namespace Input {
12
+ var defaultProps: {
13
+ className: string;
14
+ prefix: JSX.Element;
15
+ allowClear: boolean;
16
+ };
17
+ }
18
+ export default Input;
@@ -0,0 +1,76 @@
1
+ import "antd/lib/input/style";
2
+ import _Input from "antd/lib/input";
3
+ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
4
+ import _useDebounce from "ahooks/es/useDebounce";
5
+
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+
8
+ 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."); }
9
+
10
+ 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); }
11
+
12
+ 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; }
13
+
14
+ 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; }
15
+
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
+
18
+ import { __rest } from "tslib";
19
+ import React, { useState } from 'react';
20
+ import IconFont from '../IconFont';
21
+ import "./index.css";
22
+
23
+ function Input(_a) {
24
+ var prefix = _a.prefix,
25
+ className = _a.className,
26
+ suffix = _a.suffix,
27
+ allowClear = _a.allowClear,
28
+ defaultValue = _a.defaultValue,
29
+ value = _a.value,
30
+ onChange = _a.onChange,
31
+ onEnter = _a.onEnter,
32
+ props = __rest(_a, ["prefix", "className", "suffix", "allowClear", "defaultValue", "value", "onChange", "onEnter"]);
33
+
34
+ var _useState = useState({
35
+ value: defaultValue || value,
36
+ focus: false
37
+ }),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ state = _useState2[0],
40
+ setState = _useState2[1];
41
+
42
+ var debouncedValue = _useDebounce(state.value, {
43
+ wait: 500
44
+ });
45
+
46
+ _useUpdateEffect(function () {
47
+ return onChange && onChange(debouncedValue);
48
+ }, [debouncedValue]);
49
+
50
+ return /*#__PURE__*/React.createElement(_Input, Object.assign({}, props, {
51
+ className: "bc-search-input ".concat(className),
52
+ onChange: function onChange(e) {
53
+ return setState(function (old) {
54
+ return Object.assign(Object.assign({}, old), {
55
+ value: e.target.value
56
+ });
57
+ });
58
+ },
59
+ allowClear: allowClear,
60
+ prefix: prefix,
61
+ suffix: suffix,
62
+ value: state.value,
63
+ onPressEnter: onEnter ? function () {
64
+ return onEnter(state.value);
65
+ } : undefined
66
+ }));
67
+ }
68
+
69
+ Input.defaultProps = {
70
+ className: '',
71
+ prefix: /*#__PURE__*/React.createElement(IconFont, {
72
+ type: "icon-S_Edit_Search"
73
+ }),
74
+ allowClear: true
75
+ };
76
+ export default Input;
@@ -0,0 +1,18 @@
1
+ .lm-c-label-value-layout {
2
+ display: inline-flex;
3
+ font-size: var(--fs-small);
4
+ }
5
+ .lm-c-label-value-layout span:first-child {
6
+ white-space: nowrap;
7
+ padding-right: 4px;
8
+ color: var(--color);
9
+ }
10
+ .lm-c-label-value-layout span:last-child {
11
+ flex: 1;
12
+ color: var(--color-dark);
13
+ }
14
+ .lm-c-label-value-layout span:last-child.no-wrap {
15
+ white-space: nowrap;
16
+ overflow: hidden;
17
+ text-overflow: ellipsis;
18
+ }
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface ILabelValueProps {
4
+ label?: any;
5
+ value?: any;
6
+ emptyValue?: string;
7
+ className?: string;
8
+ noWrap?: boolean;
9
+ noColon?: boolean;
10
+ style?: React.CSSProperties;
11
+ labelStyle?: React.CSSProperties;
12
+ valueStyle?: React.CSSProperties;
13
+ }
14
+ declare function LabelValue({ label, value, emptyValue, className, style, labelStyle, valueStyle, noWrap, noColon }: ILabelValueProps): JSX.Element;
15
+ declare namespace LabelValue {
16
+ var defaultProps: {
17
+ value: string;
18
+ emptyValue: string;
19
+ noWrap: boolean;
20
+ className: string;
21
+ };
22
+ }
23
+ export default LabelValue;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import "./index.css";
3
+
4
+ function LabelValue(_ref) {
5
+ var label = _ref.label,
6
+ value = _ref.value,
7
+ emptyValue = _ref.emptyValue,
8
+ className = _ref.className,
9
+ style = _ref.style,
10
+ labelStyle = _ref.labelStyle,
11
+ valueStyle = _ref.valueStyle,
12
+ noWrap = _ref.noWrap,
13
+ noColon = _ref.noColon;
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ className: "lm-c-label-value-layout ".concat(className),
16
+ style: style
17
+ }, /*#__PURE__*/React.createElement("span", {
18
+ style: labelStyle
19
+ }, label, noColon ? '' : ':'), /*#__PURE__*/React.createElement("span", {
20
+ title: value,
21
+ className: "".concat(noWrap ? 'no-wrap' : ''),
22
+ style: valueStyle
23
+ }, value || emptyValue));
24
+ }
25
+
26
+ LabelValue.defaultProps = {
27
+ value: '',
28
+ emptyValue: '-',
29
+ noWrap: false,
30
+ className: ''
31
+ };
32
+ export default LabelValue;
File without changes
@@ -1,7 +1,7 @@
1
- import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
2
1
  import "antd/lib/tooltip/style";
3
2
  import _Tooltip from "antd/lib/tooltip";
4
3
  import React from 'react';
4
+ import IconFont from '../IconFont';
5
5
 
6
6
  function CheckExt(_ref) {
7
7
  var selectCount = _ref.selectCount,
@@ -9,17 +9,17 @@ function CheckExt(_ref) {
9
9
  count = _ref.count,
10
10
  onCancel = _ref.onCancel;
11
11
  return /*#__PURE__*/React.createElement("div", {
12
- className: "c-check-list-checkext"
12
+ className: "cloudapp-c-check-list-checkext"
13
13
  }, /*#__PURE__*/React.createElement("span", {
14
14
  className: "select-group"
15
15
  }, /*#__PURE__*/React.createElement(_Tooltip, {
16
16
  title: "\u9009\u4E2D\u6240\u6709\u5DF2\u52A0\u8F7D"
17
- }, /*#__PURE__*/React.createElement(_IconFont, {
17
+ }, /*#__PURE__*/React.createElement(IconFont, {
18
18
  type: "icon-S_Photo_MarkYes",
19
19
  onClick: onCheck
20
20
  })), /*#__PURE__*/React.createElement(_Tooltip, {
21
21
  title: "\u53D6\u6D88\u9009\u4E2D\u6240\u6709\u5DF2\u52A0\u8F7D\u9879"
22
- }, /*#__PURE__*/React.createElement(_IconFont, {
22
+ }, /*#__PURE__*/React.createElement(IconFont, {
23
23
  type: "icon-MarkNo",
24
24
  onClick: onCancel
25
25
  }))), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009 ", /*#__PURE__*/React.createElement("span", {
File without changes
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { IListProps } from '../ListExt';
3
+ import { DeviceItemType } from '../../core';
4
+ import './index.less';
5
+ interface DeviceListProps extends Exclude<IListProps<DeviceItemType>, 'list' | 'itemKey' | 'itemNameKey' | 'whatIcon' | 'inputPlaceholder' | 'rowHeight'> {
6
+ deviceList?: Array<DeviceItemType>;
7
+ deleteItem?: (item: DeviceItemType) => void;
8
+ getIconStyle?: (item: DeviceItemType) => React.CSSProperties;
9
+ }
10
+ declare function DeviceList({ getIconStyle, className, deleteItem, deviceList, renderItemExt, ...props }: DeviceListProps): JSX.Element;
11
+ export default DeviceList;
@@ -1,9 +1,8 @@
1
- import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
2
- import _CheckList from "@cloud-app-dev/basic-components/es/CheckList";
3
1
  import { __rest } from "tslib";
4
2
  import React, { useCallback } from 'react';
5
- import DeviceIcon from '../DeviceIcon';
6
- import TreeTitle from '../TreeTitle';
3
+ import List from '../ListExt';
4
+ import IconFont from '../../IconFont';
5
+ import DeviceIcon from '../../DeviceIcon';
7
6
  import "./index.css";
8
7
 
9
8
  function DeviceList(_a) {
@@ -11,12 +10,8 @@ function DeviceList(_a) {
11
10
  className = _a.className,
12
11
  deleteItem = _a.deleteItem,
13
12
  deviceList = _a.deviceList,
14
- onMouseOverItem = _a.onMouseOverItem,
15
13
  _renderItemExt = _a.renderItemExt,
16
- title = _a.title,
17
- onKeywordChange = _a.onKeywordChange,
18
- itemKey = _a.itemKey,
19
- props = __rest(_a, ["getIconStyle", "className", "deleteItem", "deviceList", "onMouseOverItem", "renderItemExt", "title", "onKeywordChange", "itemKey"]);
14
+ props = __rest(_a, ["getIconStyle", "className", "deleteItem", "deviceList", "renderItemExt"]);
20
15
 
21
16
  var whatIcon = useCallback(function (item) {
22
17
  return /*#__PURE__*/React.createElement(DeviceIcon, {
@@ -30,28 +25,21 @@ function DeviceList(_a) {
30
25
  e.preventDefault();
31
26
  deleteItem && deleteItem(item);
32
27
  }, []);
33
- return /*#__PURE__*/React.createElement(_CheckList, Object.assign({}, props, {
28
+ return /*#__PURE__*/React.createElement(List, Object.assign({}, props, {
34
29
  className: "lm-c-device-list-wrapper ".concat(className),
35
30
  list: deviceList,
36
31
  itemNameKey: "deviceName",
37
- itemKey: itemKey,
32
+ itemKey: "cid",
38
33
  rowHeight: 30,
39
- renderHeader: function renderHeader() {
40
- return /*#__PURE__*/React.createElement(TreeTitle, {
41
- title: title,
42
- onChange: onKeywordChange,
43
- inputPlaceholder: "\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0"
44
- });
45
- },
34
+ inputPlaceholder: "\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0",
46
35
  whatIcon: whatIcon,
47
- onMouseOverItem: onMouseOverItem,
48
36
  renderItemExt: function renderItemExt(item) {
49
37
  return _renderItemExt ? _renderItemExt(item) : deleteItem ? /*#__PURE__*/React.createElement("span", {
50
38
  className: "clear-item",
51
39
  onClick: function onClick(e) {
52
40
  return deleteItemAction(item, e);
53
41
  }
54
- }, /*#__PURE__*/React.createElement(_IconFont, {
42
+ }, /*#__PURE__*/React.createElement(IconFont, {
55
43
  type: "icon-S_Edit_LineClose",
56
44
  title: "\u5220\u9664"
57
45
  })) : undefined;
@@ -0,0 +1,54 @@
1
+ import "antd/lib/config-provider/style";
2
+ import _ConfigProvider from "antd/lib/config-provider";
3
+
4
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+
6
+ 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."); }
7
+
8
+ 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); }
9
+
10
+ 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; }
11
+
12
+ 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; }
13
+
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+
16
+ import React, { useState } from 'react';
17
+ import DynamicDeviceList from './index';
18
+
19
+ function App() {
20
+ var _useState = useState({
21
+ keyword: ''
22
+ }),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ state = _useState2[0],
25
+ setState = _useState2[1];
26
+
27
+ return /*#__PURE__*/React.createElement(_ConfigProvider, {
28
+ prefixCls: "cloudapp"
29
+ }, /*#__PURE__*/React.createElement("div", {
30
+ style: {
31
+ display: 'flex'
32
+ }
33
+ }, /*#__PURE__*/React.createElement("div", {
34
+ style: {
35
+ height: 400,
36
+ width: 300
37
+ }
38
+ }, /*#__PURE__*/React.createElement(DynamicDeviceList, {
39
+ onChecked: console.log,
40
+ params: {
41
+ keywords: state.keyword
42
+ },
43
+ title: "\u5217\u8868",
44
+ onKeywordChange: function onKeywordChange(e) {
45
+ return setState(function (old) {
46
+ return Object.assign(Object.assign({}, old), {
47
+ keyword: e
48
+ });
49
+ });
50
+ }
51
+ }))));
52
+ }
53
+
54
+ export default App;
@@ -3,17 +3,21 @@
3
3
  flex-direction: column;
4
4
  width: 100%;
5
5
  height: 100%;
6
+ border: 1px solid var(--bd-color);
6
7
  }
7
8
  .zenview-c-dynamic-device-list-layout .dynamic-list-item {
8
9
  padding: 0 10px;
9
10
  }
10
- .zenview-c-dynamic-device-list-layout .lm-c-dynamiclist {
11
+ .zenview-c-dynamic-device-list-layout .zenview-c-dynamic-device-box {
11
12
  flex: 1;
13
+ overflow: auto;
14
+ contain: strict;
12
15
  }
13
16
  .zenview-c-dynamic-device-list-layout .device-item-box {
14
17
  height: 40px;
15
18
  line-height: 40px;
16
19
  display: flex;
20
+ padding: 0 10px;
17
21
  }
18
22
  .zenview-c-dynamic-device-list-layout .device-item-box .device-name {
19
23
  flex: 1;
@@ -33,19 +37,3 @@
33
37
  text-overflow: ellipsis;
34
38
  white-space: nowrap;
35
39
  }
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
- }