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

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 (200) 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 +3 -0
  7. package/es/AppRouter/index.js +19 -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/desc.js +3 -3
  40. package/es/Dict/utils.js +3 -3
  41. package/es/HightLevel/index.js +1 -2
  42. package/es/IconFont/index.d.ts +0 -1
  43. package/es/IconFont/index.js +12 -13
  44. package/es/InitialConfig/index.js +7 -4
  45. package/es/InitialConfig/utils.d.ts +5 -0
  46. package/es/InitialConfig/utils.js +33 -6
  47. package/es/InitialRequest/index.d.ts +3 -1
  48. package/es/InitialRequest/index.js +20 -18
  49. package/es/InitialRequest/utils.d.ts +4 -3
  50. package/es/InitialRequest/utils.js +26 -27
  51. package/es/Input/index.js +3 -2
  52. package/es/InstanceHistory/index.d.ts +3 -0
  53. package/es/InstanceHistory/index.js +9 -0
  54. package/es/List/CheckExt.d.ts +3 -5
  55. package/es/List/CheckExt.js +21 -13
  56. package/es/{AppRoute → List/DeviceList}/index.css +0 -0
  57. package/es/List/DeviceList/index.d.ts +11 -0
  58. package/es/{DeviceList → List/DeviceList}/index.js +6 -18
  59. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  60. package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
  61. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  62. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  63. package/es/List/DynamicDeviceList/index.js +205 -0
  64. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  65. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  66. package/es/List/DynamicDeviceList/utils.js +61 -0
  67. package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
  68. package/es/List/DynamicGridList/Demo.js +70 -0
  69. package/es/List/DynamicGridList/index.d.ts +26 -0
  70. package/es/List/DynamicGridList/index.js +73 -0
  71. package/es/List/GridList/Demo.d.ts +2 -0
  72. package/es/List/GridList/Demo.js +91 -0
  73. package/es/List/GridList/hook.d.ts +13 -0
  74. package/es/List/GridList/hook.js +301 -0
  75. package/es/List/GridList/index.css +7 -0
  76. package/es/List/GridList/index.d.ts +15 -0
  77. package/es/List/GridList/index.js +47 -0
  78. package/es/List/GridList/interface.d.ts +59 -0
  79. package/es/List/GridList/utils.d.ts +9 -0
  80. package/es/List/GridList/utils.js +43 -0
  81. package/es/List/ListExt/index.css +3 -0
  82. package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
  83. package/es/{ListExt → List/ListExt}/index.js +3 -3
  84. package/es/List/VList/index.css +6 -0
  85. package/es/List/VList/index.d.ts +18 -0
  86. package/es/List/VList/index.js +51 -0
  87. package/es/List/VList/utils.d.ts +14 -0
  88. package/es/{VList → List/VList}/utils.js +0 -0
  89. package/es/List/index.css +11 -12
  90. package/es/List/index.d.ts +5 -70
  91. package/es/List/index.js +32 -25
  92. package/es/List/interface.d.ts +87 -0
  93. package/es/List/renderItem.d.ts +1 -1
  94. package/es/List/renderItem.js +13 -10
  95. package/es/LoaderApp/index.d.ts +1 -1
  96. package/es/LoaderApp/index.js +18 -18
  97. package/es/LoaderApp/utils.d.ts +2 -1
  98. package/es/LoaderApp/utils.js +6 -3
  99. package/es/LoaderScript/index.js +7 -89
  100. package/es/LoaderScript/utils.d.ts +2 -0
  101. package/es/LoaderScript/utils.js +170 -33
  102. package/es/Picture/component/MoveContent/index.js +3 -3
  103. package/es/Picture/index.js +1 -1
  104. package/es/Picture/utils.js +1 -1
  105. package/es/RefDrawer/index.js +1 -1
  106. package/es/RefModal/index.js +1 -1
  107. package/es/Service/http.d.ts +6 -4
  108. package/es/Service/http.js +20 -22
  109. package/es/Service/index.d.ts +3 -3
  110. package/es/Service/index.js +7 -11
  111. package/es/Service/interface.d.ts +5 -11
  112. package/es/Service/middleware.d.ts +1 -1
  113. package/es/Service/middleware.js +1 -1
  114. package/es/TableLayout/index.d.ts +3 -0
  115. package/es/TableLayout/index.js +14 -45
  116. package/es/{TreeTitle → Title}/index.css +5 -5
  117. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  118. package/es/{TreeTitle → Title}/index.js +7 -4
  119. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  120. package/es/Tree/BaseTree/demo.js +69 -0
  121. package/es/Tree/BaseTree/index.css +64 -0
  122. package/es/Tree/BaseTree/index.d.ts +24 -0
  123. package/es/Tree/BaseTree/index.js +83 -0
  124. package/es/Tree/demo.js +19 -56
  125. package/es/Tree/index.css +29 -55
  126. package/es/Tree/index.d.ts +19 -20
  127. package/es/Tree/index.js +185 -70
  128. package/es/UserSelect/index.js +7 -8
  129. package/es/WorkerFlow/Form/Condition.js +2 -4
  130. package/es/WorkerFlow/Form/EmptyUserSet.js +1 -1
  131. package/es/WorkerFlow/Form/FormAuth.js +3 -3
  132. package/es/WorkerFlow/Form/GroupList.js +2 -2
  133. package/es/WorkerFlow/Form/GroupSelect.js +1 -1
  134. package/es/WorkerFlow/Form/GroupSelectModalContent.js +2 -3
  135. package/es/WorkerFlow/Form/LevelGroupSelect.js +2 -2
  136. package/es/WorkerFlow/Form/UserAndGroupSelect.js +1 -1
  137. package/es/WorkerFlow/Form/UserSelect.js +1 -1
  138. package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -6
  139. package/es/WorkerFlow/Form/UserSet.js +3 -3
  140. package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
  141. package/es/WorkerFlow/index.css +9 -3
  142. package/es/WorkerFlow/index.js +14 -9
  143. package/es/WorkerFlow/utils.js +1 -1
  144. package/es/index.d.ts +4 -11
  145. package/es/index.js +4 -11
  146. package/es/useDrawer/index.d.ts +1 -1
  147. package/es/useDrawer/index.js +3 -2
  148. package/es/useHistory/index.d.ts +2 -2
  149. package/es/useHistory/index.js +3 -6
  150. package/es/useHttp/index.js +1 -1
  151. package/es/useModal/index.d.ts +1 -1
  152. package/es/useModal/index.js +3 -2
  153. package/es/utils.d.ts +9 -0
  154. package/es/utils.js +36 -1
  155. package/package.json +10 -12
  156. package/tsconfig.json +1 -1
  157. package/es/AppRoute/Render.d.ts +0 -23
  158. package/es/AppRoute/Render.js +0 -111
  159. package/es/AppRoute/Rendered.d.ts +0 -4
  160. package/es/AppRoute/Rendered.js +0 -11
  161. package/es/AppRoute/index.d.ts +0 -14
  162. package/es/AppRoute/index.js +0 -106
  163. package/es/AppRoute/interface.d.ts +0 -18
  164. package/es/AppRoute/utils.d.ts +0 -1
  165. package/es/AppRoute/utils.js +0 -28
  166. package/es/DeviceList/index.css +0 -32
  167. package/es/DeviceList/index.d.ts +0 -14
  168. package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
  169. package/es/DynamicDeviceList/CheckExt.js +0 -36
  170. package/es/DynamicDeviceList/Demo.js +0 -17
  171. package/es/DynamicDeviceList/index.d.ts +0 -35
  172. package/es/DynamicDeviceList/index.js +0 -224
  173. package/es/DynamicDeviceList/utils.d.ts +0 -2
  174. package/es/DynamicDeviceList/utils.js +0 -15
  175. package/es/DynamicList/index.css +0 -7
  176. package/es/DynamicList/index.d.ts +0 -31
  177. package/es/DynamicList/index.js +0 -132
  178. package/es/IconFont/index.css +0 -0
  179. package/es/List/utils.d.ts +0 -5
  180. package/es/List/utils.js +0 -18
  181. package/es/ListExt/index.css +0 -9
  182. package/es/ScrollList/index.css +0 -73
  183. package/es/ScrollList/index.d.ts +0 -24
  184. package/es/ScrollList/index.js +0 -262
  185. package/es/ScrollList/utils.js +0 -84
  186. package/es/Service/logger.d.ts +0 -3
  187. package/es/Service/logger.js +0 -13
  188. package/es/Service/utils.d.ts +0 -3
  189. package/es/Service/utils.js +0 -11
  190. package/es/TreeMode/demo.js +0 -32
  191. package/es/TreeMode/index.css +0 -38
  192. package/es/TreeMode/index.d.ts +0 -23
  193. package/es/TreeMode/index.js +0 -201
  194. package/es/VList/index.css +0 -4
  195. package/es/VList/index.d.ts +0 -16
  196. package/es/VList/index.js +0 -56
  197. package/es/VList/utils.d.ts +0 -10
  198. package/es/useChangeEffect/index.d.ts +0 -3
  199. package/es/useChangeEffect/index.js +0 -32
  200. package/es/useHistory/index.css +0 -0
@@ -1,12 +1,3 @@
1
- import "antd/lib/menu/style";
2
- import _Menu from "antd/lib/menu";
3
- import "antd/lib/dropdown/style";
4
- import _Dropdown from "antd/lib/dropdown";
5
- import "antd/lib/col/style";
6
- import _Col from "antd/lib/col";
7
- import "antd/lib/row/style";
8
- import _Row from "antd/lib/row";
9
-
10
1
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
11
2
 
12
3
  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."); }
@@ -28,12 +19,11 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
28
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
20
 
30
21
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
31
- import TreeMode from '../TreeMode';
32
- import DynamicDeviceList from '../DynamicDeviceList';
33
- import DeviceList from '../DeviceList';
34
- import uniq from 'lodash-es/uniq';
35
- import uniqBy from 'lodash-es/uniqBy';
36
- import IconFont from '../IconFont';
22
+ import TreeMode from '../Tree';
23
+ import DynamicDeviceList from '../List/DynamicDeviceList';
24
+ import DeviceList from '../List/DeviceList';
25
+ import { uniq, uniqBy } from 'lodash';
26
+ import TreeType from './TreeType';
37
27
  import "./index.css";
38
28
 
39
29
  function DeviceSelect(_ref) {
@@ -163,61 +153,39 @@ function DeviceSelect(_ref) {
163
153
  var treeSelectedKeys = useMemo(function () {
164
154
  return state.mode === 'Bz' ? [state.buzGroupId] : [state.areaCode];
165
155
  }, [state.mode, state.buzGroupId, state.areaCode]);
166
- return /*#__PURE__*/React.createElement(_Row, {
156
+ return /*#__PURE__*/React.createElement("div", {
167
157
  className: "vidc-device-select-layout"
168
- }, /*#__PURE__*/React.createElement(_Col, {
169
- span: 7
170
158
  }, /*#__PURE__*/React.createElement(TreeMode, {
171
- key: state.mode,
172
159
  mode: state.mode,
173
160
  inputPlaceholder: "\u8BF7\u8F93\u5165\u540D\u79F0",
174
161
  onSelect: onSelectTree,
175
162
  selectedKeys: treeSelectedKeys,
176
- title: /*#__PURE__*/React.createElement(_Dropdown, {
177
- overlay: /*#__PURE__*/React.createElement(_Menu, {
178
- onClick: function onClick(info) {
179
- return setState(function (old) {
180
- return Object.assign(Object.assign({}, old), {
181
- mode: info.key
182
- });
163
+ title: /*#__PURE__*/React.createElement(TreeType, {
164
+ mode: state.mode,
165
+ onChange: function onChange(mode) {
166
+ return setState(function (old) {
167
+ return Object.assign(Object.assign({}, old), {
168
+ mode: mode
183
169
  });
184
- }
185
- }, /*#__PURE__*/React.createElement(_Menu.Item, {
186
- style: {
187
- fontSize: 12
188
- },
189
- key: "Bz"
190
- }, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
191
- style: {
192
- fontSize: 12
193
- },
194
- key: "Place"
195
- }, "\u884C\u653F\u533A\u5212"))
196
- }, /*#__PURE__*/React.createElement("span", null, state.mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(IconFont, {
197
- style: {
198
- position: 'relative',
199
- top: 1
200
- },
201
- type: "icon-S_Arrow_BigDown"
202
- })))
203
- })), /*#__PURE__*/React.createElement(_Col, {
204
- span: 8
205
- }, /*#__PURE__*/React.createElement(DynamicDeviceList, {
170
+ });
171
+ }
172
+ })
173
+ }), /*#__PURE__*/React.createElement(DynamicDeviceList, {
206
174
  title: "\u8BBE\u5907\u5217\u8868",
207
175
  onChecked: onCheked1,
176
+ key: state.mode,
208
177
  checkedKeys: state.tempSelectIds,
209
178
  params: listParams
210
- })), /*#__PURE__*/React.createElement(_Col, {
211
- span: 1
212
- }), /*#__PURE__*/React.createElement(_Col, {
213
- span: 8
214
- }, /*#__PURE__*/React.createElement(DeviceList, {
179
+ }), /*#__PURE__*/React.createElement(DeviceList, {
215
180
  itemKey: "cid",
216
181
  deviceList: state.selectDevices || [],
217
182
  onChecked: onCheked2,
218
183
  checkedKeys: state.selectIds,
219
184
  title: "\u5DF2\u9009\u8BBE\u5907\u5217\u8868"
220
- })));
185
+ }));
221
186
  }
222
187
 
188
+ DeviceSelect.defaultProps = {
189
+ className: ''
190
+ };
223
191
  export default DeviceSelect;
package/es/Dict/desc.js CHANGED
@@ -1,12 +1,12 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
 
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
 
5
5
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
6
 
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
8
 
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
10
 
11
11
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
12
 
package/es/Dict/utils.js CHANGED
@@ -4,7 +4,7 @@ export function queryByTypeCode(typeCode) {
4
4
  var headers = {
5
5
  Authorization: _cache.getCache('token', 'session')
6
6
  };
7
- return Service.$http({
7
+ return Service.http({
8
8
  url: "/api/dictionary/v1/queryByTypeCode/".concat(typeCode),
9
9
  method: 'get',
10
10
  requestId: 'queryByTypeCode',
@@ -18,7 +18,7 @@ export function queryByTypeCodes() {
18
18
  var headers = {
19
19
  Authorization: _cache.getCache('token', 'session')
20
20
  };
21
- return Service.$http({
21
+ return Service.http({
22
22
  url: "/api/dictionary/v1/queryDictionaryListByCondition",
23
23
  method: 'post',
24
24
  requestId: 'queryByTypeCode',
@@ -30,7 +30,7 @@ export function queryByTypeCodes() {
30
30
  });
31
31
  }
32
32
  export function queryTypeCodes() {
33
- return Service.$http({
33
+ return Service.http({
34
34
  url: "/micro-apps/micro-dep-librarys/config/typeCodes.json",
35
35
  method: 'get',
36
36
  requestId: 'queryTypeCodes'
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import replace from 'lodash-es/replace';
3
- import escapeRegExp from 'lodash-es/escapeRegExp';
2
+ import { replace, escapeRegExp } from 'lodash';
4
3
  import "./index.css";
5
4
 
6
5
  function HighLevel(_ref) {
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import './index.less';
3
2
  interface IconFontProps extends React.HTMLAttributes<HTMLSpanElement> {
4
3
  type?: string;
5
4
  className?: string;
@@ -1,20 +1,9 @@
1
- import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
2
1
  import { __rest } from "tslib";
3
2
  import React from 'react';
4
- import "./index.css";
5
3
  var global = window;
6
4
 
7
- function registerIconFont(scriptUrl) {
8
- if (!global._ICON_IS_INIT_) {
9
- global._ICON_SCRIPT_URL = scriptUrl;
10
- global._ICON_IS_INIT_ = true;
11
- loadScript(scriptUrl).then(function () {
12
- _SocketEmitter.emit('update-iconfont', null);
13
- }).catch(function (e) {
14
- console.error(e);
15
- global._ICON_IS_INIT_ = false;
16
- });
17
- }
5
+ if (!global._ICON_SCRIPT_URL) {
6
+ global._ICON_SCRIPT_URL = {};
18
7
  }
19
8
 
20
9
  function loadScript(url) {
@@ -31,6 +20,16 @@ function loadScript(url) {
31
20
  });
32
21
  }
33
22
 
23
+ function registerIconFont(scriptUrl) {
24
+ if (!global._ICON_SCRIPT_URL[scriptUrl]) {
25
+ global._ICON_SCRIPT_URL[scriptUrl] = true;
26
+ loadScript(scriptUrl).catch(function (e) {
27
+ global._ICON_SCRIPT_URL[scriptUrl] = false;
28
+ console.error(e);
29
+ });
30
+ }
31
+ }
32
+
34
33
  function IconFont(_a) {
35
34
  var type = _a.type,
36
35
  _a$className = _a.className,
@@ -13,7 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import React, { useState, useEffect } from 'react';
14
14
  import Dict from '../Dict';
15
15
  import Config from '../Config';
16
- import { queryBSConfig, queryMicroApplicationList, querySystemUpdate } from './utils';
16
+ import { queryBSConfig, queryMicroApplicationList, querySystemUpdate, queryDefaultTheme } from './utils';
17
17
 
18
18
  function InitialConfig(_ref) {
19
19
  var children = _ref.children,
@@ -30,14 +30,17 @@ function InitialConfig(_ref) {
30
30
 
31
31
  Dict.useTypeCodes();
32
32
  useEffect(function () {
33
- Promise.all([queryBSConfig(), queryMicroApplicationList(), querySystemUpdate()]).then(function (_ref2) {
34
- var _ref3 = _slicedToArray(_ref2, 3),
33
+ var arr = [queryBSConfig(), queryMicroApplicationList(), querySystemUpdate(), queryDefaultTheme()];
34
+ Promise.all(arr).then(function (_ref2) {
35
+ var _ref3 = _slicedToArray(_ref2, 4),
35
36
  BSConfig = _ref3[0],
36
37
  AppConfig = _ref3[1],
37
- SystemConfig = _ref3[2];
38
+ SystemConfig = _ref3[2],
39
+ ThemeConfig = _ref3[3];
38
40
 
39
41
  Config.registerBSConfig(BSConfig);
40
42
  Config.registerAppConfig(AppConfig);
43
+ Config.registerThemeConfig(ThemeConfig.content);
41
44
  setState(function () {
42
45
  return {
43
46
  isUpdate: SystemConfig.isUpdate,
@@ -13,3 +13,8 @@ export declare function queryMicroApplicationList(): Promise<any>;
13
13
  * @description 获取平台升级状态
14
14
  */
15
15
  export declare function querySystemUpdate(): Promise<any>;
16
+ /**
17
+ *
18
+ * @description 获取平台配色
19
+ */
20
+ export declare function queryDefaultTheme(): Promise<any>;
@@ -12,8 +12,8 @@ export function queryBSConfig() {
12
12
  switch (_context.prev = _context.next) {
13
13
  case 0:
14
14
  _context.next = 2;
15
- return Service.$http({
16
- url: '/api/system/config/web'
15
+ return Service.http({
16
+ url: "/statics/config/web.conf.json?".concat(Date.now())
17
17
  });
18
18
 
19
19
  case 2:
@@ -39,8 +39,8 @@ export function queryMicroApplicationList() {
39
39
  switch (_context2.prev = _context2.next) {
40
40
  case 0:
41
41
  _context2.next = 2;
42
- return Service.$http({
43
- url: "/api/app/list"
42
+ return Service.http({
43
+ url: "/statics/config/app.conf.json?".concat(Date.now())
44
44
  });
45
45
 
46
46
  case 2:
@@ -65,8 +65,8 @@ export function querySystemUpdate() {
65
65
  while (1) {
66
66
  switch (_context3.prev = _context3.next) {
67
67
  case 0:
68
- return _context3.abrupt("return", Service.$http({
69
- url: "/api/system/config/updateStatus?".concat(Date.now())
68
+ return _context3.abrupt("return", Service.http({
69
+ url: "/statics/config/update.status.conf.json?".concat(Date.now())
70
70
  }));
71
71
 
72
72
  case 1:
@@ -76,4 +76,31 @@ export function querySystemUpdate() {
76
76
  }
77
77
  }, _callee3);
78
78
  }));
79
+ }
80
+ /**
81
+ *
82
+ * @description 获取平台配色
83
+ */
84
+
85
+ export function queryDefaultTheme() {
86
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
87
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
88
+ while (1) {
89
+ switch (_context4.prev = _context4.next) {
90
+ case 0:
91
+ _context4.next = 2;
92
+ return Service.http({
93
+ url: "/statics/config/theme.info.json?".concat(Date.now())
94
+ });
95
+
96
+ case 2:
97
+ return _context4.abrupt("return", _context4.sent.data);
98
+
99
+ case 3:
100
+ case "end":
101
+ return _context4.stop();
102
+ }
103
+ }
104
+ }, _callee4);
105
+ }));
79
106
  }
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
+ import { InitDataType } from './utils';
2
3
  interface IInitialRequestProps {
3
4
  children: React.ReactNode;
4
5
  Spin?: React.ReactNode;
6
+ customInitialization?: () => Promise<InitDataType>;
5
7
  }
6
- declare function InitialRequest({ children, Spin }: IInitialRequestProps): JSX.Element;
8
+ declare function InitialRequest({ children, Spin, customInitialization }: IInitialRequestProps): JSX.Element;
7
9
  export default InitialRequest;
@@ -23,7 +23,8 @@ function InitialRequest(_ref) {
23
23
  var _this = this;
24
24
 
25
25
  var children = _ref.children,
26
- Spin = _ref.Spin;
26
+ Spin = _ref.Spin,
27
+ customInitialization = _ref.customInitialization;
27
28
 
28
29
  var _useContext = useContext(AppContext.Context),
29
30
  updateUser = _useContext.updateUser,
@@ -42,27 +43,28 @@ function InitialRequest(_ref) {
42
43
 
43
44
  var init = function init() {
44
45
  return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
45
- var _yield$initialization, userFeatures, operationInfo, systemFeatures, userInfo, themeConfig;
46
+ var fetchInitData, _yield$fetchInitData, userFeatures, operationInfo, systemFeatures, userInfo, themeConfig;
46
47
 
47
48
  return regeneratorRuntime.wrap(function _callee$(_context) {
48
49
  while (1) {
49
50
  switch (_context.prev = _context.next) {
50
51
  case 0:
51
- _context.next = 2;
52
- return initialization();
53
-
54
- case 2:
55
- _yield$initialization = _context.sent;
56
- userFeatures = _yield$initialization.userFeatures;
57
- operationInfo = _yield$initialization.operationInfo;
58
- systemFeatures = _yield$initialization.systemFeatures;
59
- userInfo = _yield$initialization.userInfo;
60
- themeConfig = _yield$initialization.themeConfig;
61
- updateUser(userInfo);
62
- updateOperation(operationInfo);
63
- Config.registerFeatrue(userFeatures);
64
- Config.registerPlatformFeature(systemFeatures);
65
- Config.registerThemeConfig(themeConfig);
52
+ fetchInitData = customInitialization || initialization;
53
+ _context.next = 3;
54
+ return fetchInitData();
55
+
56
+ case 3:
57
+ _yield$fetchInitData = _context.sent;
58
+ userFeatures = _yield$fetchInitData.userFeatures;
59
+ operationInfo = _yield$fetchInitData.operationInfo;
60
+ systemFeatures = _yield$fetchInitData.systemFeatures;
61
+ userInfo = _yield$fetchInitData.userInfo;
62
+ themeConfig = _yield$fetchInitData.themeConfig;
63
+ userInfo && updateUser(userInfo);
64
+ operationInfo && updateOperation(operationInfo);
65
+ userFeatures && Config.registerFeatrueIds(userFeatures);
66
+ systemFeatures && Config.registerPlatformFeature(systemFeatures);
67
+ themeConfig && Config.registerThemeConfig(themeConfig);
66
68
 
67
69
  _nextTick(function () {
68
70
  return setIsInit(true);
@@ -70,7 +72,7 @@ function InitialRequest(_ref) {
70
72
 
71
73
  _BASE_DATA_INIT = true;
72
74
 
73
- case 15:
75
+ case 16:
74
76
  case "end":
75
77
  return _context.stop();
76
78
  }
@@ -1,9 +1,10 @@
1
1
  import { UserInfoType, OperationInfoType } from '../AppContext/interface';
2
2
  import { FeatureItemType, ThemeInfoType } from '../Config/interface';
3
- export declare function initialization(): Promise<{
3
+ export declare type InitDataType = {
4
4
  userInfo: UserInfoType;
5
- userFeatures: FeatureItemType[];
5
+ userFeatures: string[];
6
6
  systemFeatures: FeatureItemType[];
7
7
  operationInfo: OperationInfoType;
8
8
  themeConfig: ThemeInfoType;
9
- }>;
9
+ };
10
+ export declare function initialization(): Promise<InitDataType>;
@@ -14,12 +14,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
 
15
15
  import { __awaiter } from "tslib";
16
16
  import Service from '../Service';
17
- var method = 'post';
18
17
  export function initialization() {
19
18
  var _a;
20
19
 
21
20
  return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
22
- var headers, result, userInfo, userId, systemId, centerUrl, userPrivilegesUrl, systemFeatureUrl, themeConfigUrl, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, centerInfo, _yield$Promise$all2$2, userFeatures, _yield$Promise$all2$3, systemFeatures, _yield$Promise$all2$4, themeInfo;
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;
23
22
 
24
23
  return regeneratorRuntime.wrap(function _callee$(_context) {
25
24
  while (1) {
@@ -29,9 +28,9 @@ export function initialization() {
29
28
  Authorization: _cache.getCache('token', 'session')
30
29
  };
31
30
  _context.next = 3;
32
- return Service.$http({
31
+ return Service.http({
33
32
  url: '/api/user/v1/getUserByToken',
34
- method: method,
33
+ method: 'post',
35
34
  headers: headers
36
35
  });
37
36
 
@@ -42,38 +41,38 @@ export function initialization() {
42
41
  systemId = userInfo.operationCenterId;
43
42
  centerUrl = "/api/user/operationCenter/v1/operationCenters/".concat(systemId);
44
43
  userPrivilegesUrl = "/api/user/role/v1/queryUserRoles/".concat(userId);
45
- systemFeatureUrl = "/api/system/".concat(systemId, "/list");
46
- themeConfigUrl = '/api/system/config/type';
44
+ systemFeatureUrl = "/api/micro-app-service/feature/v1/system/list/".concat(systemId);
45
+ themeConfigUrl = '/api/micro-app-service/config/v1/type/default';
47
46
  _context.next = 13;
48
- return Promise.all([Service.$http({
47
+ return Promise.all([Service.http({
49
48
  url: centerUrl,
49
+ headers: headers,
50
50
  data: {
51
51
  id: systemId
52
52
  },
53
- headers: headers,
54
- method: method
55
- }), Service.$http({
53
+ method: 'post'
54
+ }), Service.http({
56
55
  url: userPrivilegesUrl,
57
56
  headers: headers,
58
57
  data: {
59
58
  id: userId
60
59
  },
61
- method: method
62
- }), Service.$http({
60
+ method: 'post'
61
+ }), Service.http({
63
62
  url: systemFeatureUrl,
63
+ headers: headers,
64
64
  data: {
65
65
  id: systemId
66
66
  },
67
- method: 'get',
68
- headers: headers
69
- }), Service.$http({
67
+ method: 'get'
68
+ }), Service.http({
70
69
  url: themeConfigUrl,
71
70
  headers: headers,
72
- method: method,
73
71
  data: {
74
72
  type: 'theme',
75
73
  systemId: systemId
76
- }
74
+ },
75
+ method: 'post'
77
76
  })]);
78
77
 
79
78
  case 13:
@@ -83,21 +82,21 @@ export function initialization() {
83
82
  centerInfo = _yield$Promise$all2$ === void 0 ? {
84
83
  data: {}
85
84
  } : _yield$Promise$all2$;
86
- _yield$Promise$all2$2 = _yield$Promise$all2[1];
87
- userFeatures = _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 ? {
88
88
  data: []
89
89
  } : _yield$Promise$all2$2;
90
- _yield$Promise$all2$3 = _yield$Promise$all2[2];
91
- systemFeatures = _yield$Promise$all2$3 === void 0 ? {
92
- data: []
93
- } : _yield$Promise$all2$3;
94
- _yield$Promise$all2$4 = _yield$Promise$all2[3];
95
- themeInfo = _yield$Promise$all2$4 === void 0 ? {
90
+ _yield$Promise$all2$3 = _yield$Promise$all2[3];
91
+ themeInfo = _yield$Promise$all2$3 === void 0 ? {
96
92
  data: {}
97
- } : _yield$Promise$all2$4;
93
+ } : _yield$Promise$all2$3;
94
+ featureIds = (userFeaturesRes.data || []).map(function (v) {
95
+ return v.functionCodes;
96
+ }).flat();
98
97
  return _context.abrupt("return", {
99
98
  userInfo: userInfo,
100
- userFeatures: userFeatures.data,
99
+ userFeatures: featureIds,
101
100
  systemFeatures: systemFeatures.data,
102
101
  operationInfo: centerInfo.data,
103
102
  themeConfig: ((_a = themeInfo === null || themeInfo === void 0 ? void 0 : themeInfo.data) === null || _a === void 0 ? void 0 : _a.content) || {}
package/es/Input/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import "antd/lib/input/style";
2
2
  import _Input from "antd/lib/input";
3
+ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
3
4
  import _useDebounce from "ahooks/es/useDebounce";
4
5
 
5
6
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -17,7 +18,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
18
  import { __rest } from "tslib";
18
19
  import React, { useState } from 'react';
19
20
  import IconFont from '../IconFont';
20
- import useChangeEffect from '../useChangeEffect';
21
21
  import "./index.css";
22
22
 
23
23
  function Input(_a) {
@@ -43,9 +43,10 @@ function Input(_a) {
43
43
  wait: 500
44
44
  });
45
45
 
46
- useChangeEffect(function () {
46
+ _useUpdateEffect(function () {
47
47
  return onChange && onChange(debouncedValue);
48
48
  }, [debouncedValue]);
49
+
49
50
  return /*#__PURE__*/React.createElement(_Input, Object.assign({}, props, {
50
51
  className: "bc-search-input ".concat(className),
51
52
  onChange: function onChange(e) {
@@ -0,0 +1,3 @@
1
+ import type { History } from 'history';
2
+ declare const InstanceHistory: History;
3
+ export default InstanceHistory;
@@ -0,0 +1,9 @@
1
+ import { createBrowserHistory } from 'history';
2
+ var _global = window;
3
+
4
+ if (!_global._BSIC_HISTORY_) {
5
+ _global._BSIC_HISTORY_ = createBrowserHistory();
6
+ }
7
+
8
+ var InstanceHistory = _global._BSIC_HISTORY_;
9
+ export default InstanceHistory;
@@ -1,10 +1,8 @@
1
- import { CheckboxChangeEvent } from 'antd/lib/checkbox';
2
1
  interface ICheckExtProps {
3
- checkHalfStatus: boolean;
4
- checkAllStatus: boolean;
5
2
  selectCount: number;
6
- onChange: (e: CheckboxChangeEvent) => void;
7
3
  count: number;
4
+ onCheck: () => void;
5
+ onCancel: () => void;
8
6
  }
9
- declare function CheckExt({ checkHalfStatus, checkAllStatus, selectCount, onChange, count }: ICheckExtProps): JSX.Element;
7
+ declare function CheckExt({ selectCount, onCheck, count, onCancel }: ICheckExtProps): JSX.Element;
10
8
  export default CheckExt;
@@ -1,20 +1,28 @@
1
- import "antd/lib/checkbox/style";
2
- import _Checkbox from "antd/lib/checkbox";
1
+ import "antd/lib/tooltip/style";
2
+ import _Tooltip from "antd/lib/tooltip";
3
3
  import React from 'react';
4
+ import IconFont from '../IconFont';
4
5
 
5
6
  function CheckExt(_ref) {
6
- var checkHalfStatus = _ref.checkHalfStatus,
7
- checkAllStatus = _ref.checkAllStatus,
8
- selectCount = _ref.selectCount,
9
- onChange = _ref.onChange,
10
- count = _ref.count;
7
+ var selectCount = _ref.selectCount,
8
+ onCheck = _ref.onCheck,
9
+ count = _ref.count,
10
+ onCancel = _ref.onCancel;
11
11
  return /*#__PURE__*/React.createElement("div", {
12
- className: "c-check-list-checkext"
13
- }, /*#__PURE__*/React.createElement(_Checkbox, {
14
- indeterminate: checkHalfStatus,
15
- checked: checkAllStatus,
16
- onChange: onChange
17
- }, "\u5168\u9009"), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009 ", /*#__PURE__*/React.createElement("span", {
12
+ className: "cloudapp-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", {
18
26
  style: {
19
27
  color: 'var(--success)'
20
28
  }
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;