@cloud-app-dev/vidc 2.0.0-alpha.2 → 2.0.0-alpha.20

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/AppRoute/index.d.ts +3 -7
  7. package/es/AppRoute/index.js +48 -44
  8. package/es/AppRoute/interface.d.ts +2 -12
  9. package/es/Auth/index.js +1 -1
  10. package/es/AutoExit/index.js +12 -10
  11. package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
  12. package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
  13. package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
  14. package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
  15. package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
  16. package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
  17. package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
  18. package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
  19. package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
  20. package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
  21. package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
  22. package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
  23. package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
  24. package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
  25. package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
  26. package/es/{ContentBox → Box}/index.css +0 -0
  27. package/es/{ContentBox → Box}/index.d.ts +3 -3
  28. package/es/{ContentBox → Box}/index.js +5 -5
  29. package/es/CheckGroupFixed/index.js +4 -2
  30. package/es/Config/index.js +51 -15
  31. package/es/Config/interface.d.ts +27 -10
  32. package/es/Config/utils.d.ts +2 -16
  33. package/es/Config/utils.js +1 -12
  34. package/es/ConfigContext/index.d.ts +15 -2
  35. package/es/ConfigContext/index.js +25 -3
  36. package/es/DeviceSelect/TreeType.d.ts +6 -0
  37. package/es/DeviceSelect/TreeType.js +36 -0
  38. package/es/DeviceSelect/demo.js +2 -2
  39. package/es/DeviceSelect/index.css +6 -1
  40. package/es/DeviceSelect/index.d.ts +5 -0
  41. package/es/DeviceSelect/index.js +21 -52
  42. package/es/Dict/desc.js +3 -3
  43. package/es/Dict/utils.js +3 -3
  44. package/es/IconFont/index.d.ts +0 -1
  45. package/es/IconFont/index.js +12 -13
  46. package/es/InitialConfig/index.js +2 -2
  47. package/es/InitialConfig/utils.d.ts +1 -1
  48. package/es/InitialConfig/utils.js +11 -34
  49. package/es/InitialRequest/index.d.ts +1 -1
  50. package/es/InitialRequest/index.js +19 -11
  51. package/es/InitialRequest/utils.d.ts +5 -4
  52. package/es/InitialRequest/utils.js +59 -95
  53. package/es/Input/index.js +3 -2
  54. package/es/InstanceHistory/index.d.ts +3 -0
  55. package/es/InstanceHistory/index.js +9 -0
  56. package/es/List/CheckExt.d.ts +3 -5
  57. package/es/List/CheckExt.js +21 -13
  58. package/es/{AppRoute → List/DeviceList}/index.css +0 -0
  59. package/es/List/DeviceList/index.d.ts +11 -0
  60. package/es/{DeviceList → List/DeviceList}/index.js +6 -18
  61. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  62. package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
  63. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  64. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  65. package/es/List/DynamicDeviceList/index.js +205 -0
  66. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  67. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  68. package/es/List/DynamicDeviceList/utils.js +61 -0
  69. package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
  70. package/es/List/DynamicGridList/Demo.js +70 -0
  71. package/es/List/DynamicGridList/index.d.ts +26 -0
  72. package/es/List/DynamicGridList/index.js +73 -0
  73. package/es/List/GridList/Demo.d.ts +2 -0
  74. package/es/List/GridList/Demo.js +91 -0
  75. package/es/List/GridList/hook.d.ts +13 -0
  76. package/es/List/GridList/hook.js +301 -0
  77. package/es/List/GridList/index.css +7 -0
  78. package/es/List/GridList/index.d.ts +15 -0
  79. package/es/List/GridList/index.js +47 -0
  80. package/es/List/GridList/interface.d.ts +59 -0
  81. package/es/List/GridList/utils.d.ts +9 -0
  82. package/es/List/GridList/utils.js +43 -0
  83. package/es/List/ListExt/index.css +3 -0
  84. package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
  85. package/es/{ListExt → List/ListExt}/index.js +3 -3
  86. package/es/List/VList/index.css +6 -0
  87. package/es/List/VList/index.d.ts +18 -0
  88. package/es/List/VList/index.js +51 -0
  89. package/es/List/VList/utils.d.ts +14 -0
  90. package/es/{VList → List/VList}/utils.js +0 -0
  91. package/es/List/index.css +11 -12
  92. package/es/List/index.d.ts +5 -70
  93. package/es/List/index.js +32 -24
  94. package/es/List/interface.d.ts +87 -0
  95. package/es/List/renderItem.d.ts +1 -1
  96. package/es/List/renderItem.js +13 -10
  97. package/es/LoaderApp/index.css +3 -0
  98. package/es/LoaderApp/index.d.ts +31 -0
  99. package/es/LoaderApp/index.js +145 -0
  100. package/es/LoaderApp/interface.d.ts +6 -0
  101. package/es/LoaderApp/loader.d.ts +20 -0
  102. package/es/LoaderApp/loader.js +86 -0
  103. package/es/LoaderApp/utils.d.ts +14 -0
  104. package/es/LoaderApp/utils.js +123 -0
  105. package/es/LoaderScript/index.js +7 -89
  106. package/es/LoaderScript/utils.d.ts +2 -0
  107. package/es/LoaderScript/utils.js +170 -33
  108. package/es/Picture/component/MoveContent/index.js +3 -3
  109. package/es/RefDrawer/index.js +1 -1
  110. package/es/RefModal/index.js +1 -1
  111. package/es/Service/http.d.ts +6 -4
  112. package/es/Service/http.js +20 -22
  113. package/es/Service/index.d.ts +3 -3
  114. package/es/Service/index.js +7 -11
  115. package/es/Service/interface.d.ts +4 -9
  116. package/es/Service/middleware.d.ts +1 -1
  117. package/es/TableLayout/index.d.ts +3 -0
  118. package/es/TableLayout/index.js +14 -45
  119. package/es/{TreeTitle → Title}/index.css +5 -5
  120. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  121. package/es/{TreeTitle → Title}/index.js +7 -4
  122. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  123. package/es/Tree/BaseTree/demo.js +69 -0
  124. package/es/Tree/BaseTree/index.css +64 -0
  125. package/es/Tree/BaseTree/index.d.ts +24 -0
  126. package/es/Tree/BaseTree/index.js +83 -0
  127. package/es/Tree/demo.js +19 -56
  128. package/es/Tree/index.css +29 -55
  129. package/es/Tree/index.d.ts +19 -20
  130. package/es/Tree/index.js +185 -70
  131. package/es/UserSelect/index.js +6 -4
  132. package/es/WorkerFlow/Form/Condition.js +2 -4
  133. package/es/WorkerFlow/Form/EmptyUserSet.js +2 -4
  134. package/es/WorkerFlow/Form/FormAuth.js +2 -2
  135. package/es/WorkerFlow/Form/GroupList.js +2 -2
  136. package/es/WorkerFlow/Form/GroupSelect.js +2 -4
  137. package/es/WorkerFlow/Form/GroupSelectModalContent.js +1 -1
  138. package/es/WorkerFlow/Form/LevelGroupSelect.js +3 -5
  139. package/es/WorkerFlow/Form/UserAndGroupSelect.js +2 -4
  140. package/es/WorkerFlow/Form/UserSelect.js +2 -4
  141. package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -3
  142. package/es/WorkerFlow/Form/UserSet.js +2 -2
  143. package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
  144. package/es/WorkerFlow/index.css +9 -3
  145. package/es/WorkerFlow/index.js +13 -8
  146. package/es/WorkerFlow/utils.js +2 -2
  147. package/es/index.d.ts +4 -10
  148. package/es/index.js +4 -10
  149. package/es/useDrawer/index.d.ts +1 -1
  150. package/es/useDrawer/index.js +3 -2
  151. package/es/useHistory/index.d.ts +2 -2
  152. package/es/useHistory/index.js +3 -6
  153. package/es/useHttp/index.js +1 -1
  154. package/es/useModal/index.d.ts +1 -1
  155. package/es/useModal/index.js +3 -2
  156. package/es/utils.d.ts +9 -0
  157. package/es/utils.js +36 -1
  158. package/package.json +10 -12
  159. package/tsconfig.json +1 -1
  160. package/es/AppRoute/Render.d.ts +0 -23
  161. package/es/AppRoute/Render.js +0 -111
  162. package/es/AppRoute/Rendered.d.ts +0 -4
  163. package/es/AppRoute/Rendered.js +0 -11
  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 -261
  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,16 +1,2 @@
1
- import { ConfigJOSN } from './interface';
2
- export declare function formartThemeConfig(options: ConfigJOSN): {
3
- [x: string]: any;
4
- app: import("./interface").AppItemType[];
5
- feature: import("./interface").FeatureItemType[];
6
- pFeature: import("./interface").FeatureItemType[];
7
- bs: import("./interface").BSConfigType;
8
- theme: any;
9
- registerAppConfig: (conf: import("./interface").AppItemType) => void;
10
- registerFeatrue: (conf: import("./interface").FeatureItemType[]) => void;
11
- registerBSConfig: (conf: import("./interface").BSConfigType) => void;
12
- registerPlatformFeature: (conf: import("./interface").FeatureItemType[]) => void;
13
- registerThemeConfig: (conf: {
14
- [key: string]: any;
15
- }) => void;
16
- };
1
+ import { ThemeInfoType } from './interface';
2
+ export declare function insertThemeStyle(options: ThemeInfoType): void;
@@ -20,13 +20,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
20
20
 
21
21
  var style = document.createElement('style');
22
22
  var isInit = false;
23
- export function formartThemeConfig(options) {
23
+ export function insertThemeStyle(options) {
24
24
  var _ref;
25
25
 
26
26
  var tplStr = ':root{<content>}';
27
- var data = Object.assign({}, options);
28
- data.vars = {};
29
- data.style = {};
30
27
 
31
28
  var attrArr = (_ref = []).concat.apply(_ref, _toConsumableArray(Object.values(options.vars)));
32
29
 
@@ -43,12 +40,4 @@ export function formartThemeConfig(options) {
43
40
  isInit = true;
44
41
  document.head.appendChild(style);
45
42
  }
46
-
47
- if (options.style) {
48
- Object.keys(options.style).forEach(function (k) {
49
- data.style[k] = options.style[k];
50
- });
51
- }
52
-
53
- return data;
54
43
  }
@@ -5,5 +5,18 @@ export interface IConfigContextProps {
5
5
  */
6
6
  root: HTMLElement;
7
7
  }
8
- declare const ConfigContext: React.Context<IConfigContextProps>;
9
- export default ConfigContext;
8
+ interface IProviderProps {
9
+ getContainer: () => HTMLElement;
10
+ children: React.ReactNode;
11
+ }
12
+ declare function Provider({ getContainer, children }: IProviderProps): JSX.Element;
13
+ declare namespace Provider {
14
+ var defaultProps: {
15
+ getContainer: () => HTMLElement;
16
+ };
17
+ }
18
+ declare const _default: {
19
+ Context: React.Context<IConfigContextProps>;
20
+ Provider: typeof Provider;
21
+ };
22
+ export default _default;
@@ -1,3 +1,25 @@
1
- import React from 'react';
2
- var ConfigContext = /*#__PURE__*/React.createContext(null);
3
- export default ConfigContext;
1
+ import React, { useMemo } from 'react';
2
+ var Context = /*#__PURE__*/React.createContext(null);
3
+
4
+ function Provider(_ref) {
5
+ var getContainer = _ref.getContainer,
6
+ children = _ref.children;
7
+ var root = useMemo(function () {
8
+ return getContainer();
9
+ }, [getContainer]);
10
+ return /*#__PURE__*/React.createElement(Context.Provider, {
11
+ value: {
12
+ root: root
13
+ }
14
+ }, children);
15
+ }
16
+
17
+ Provider.defaultProps = {
18
+ getContainer: function getContainer() {
19
+ return document.body;
20
+ }
21
+ };
22
+ export default {
23
+ Context: Context,
24
+ Provider: Provider
25
+ };
@@ -0,0 +1,6 @@
1
+ interface ITreeTypeProps {
2
+ mode: string;
3
+ onChange: (mode: string) => void;
4
+ }
5
+ declare function TreeType({ mode, onChange }: ITreeTypeProps): JSX.Element;
6
+ export default TreeType;
@@ -0,0 +1,36 @@
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 React from 'react';
6
+ import IconFont from '../IconFont';
7
+
8
+ function TreeType(_ref) {
9
+ var mode = _ref.mode,
10
+ onChange = _ref.onChange;
11
+ return /*#__PURE__*/React.createElement(_Dropdown, {
12
+ overlay: /*#__PURE__*/React.createElement(_Menu, {
13
+ onClick: function onClick(info) {
14
+ return onChange(info.key);
15
+ }
16
+ }, /*#__PURE__*/React.createElement(_Menu.Item, {
17
+ style: {
18
+ fontSize: 12
19
+ },
20
+ key: "Bz"
21
+ }, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
22
+ style: {
23
+ fontSize: 12
24
+ },
25
+ key: "Place"
26
+ }, "\u884C\u653F\u533A\u5212"))
27
+ }, /*#__PURE__*/React.createElement("span", null, mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(IconFont, {
28
+ style: {
29
+ position: 'relative',
30
+ top: 1
31
+ },
32
+ type: "icon-S_Arrow_BigDown"
33
+ })));
34
+ }
35
+
36
+ export default TreeType;
@@ -10,11 +10,11 @@ function App() {
10
10
  style: {
11
11
  padding: 20,
12
12
  width: 1000,
13
- height: 500
13
+ height: 700
14
14
  }
15
15
  }, /*#__PURE__*/React.createElement("div", {
16
16
  style: {
17
- height: 400
17
+ height: 660
18
18
  }
19
19
  }, /*#__PURE__*/React.createElement(DeviceSelect, null))));
20
20
  }
@@ -1,6 +1,11 @@
1
1
  .vidc-device-select-layout {
2
2
  height: 100%;
3
+ display: flex;
3
4
  }
4
- .vidc-device-select-layout > .cloudapp-col {
5
+ .vidc-device-select-layout > div {
5
6
  height: 100%;
7
+ flex: 1;
8
+ }
9
+ .vidc-device-select-layout > div:first-child.bc-type-tree-layout {
10
+ border-right: none;
6
11
  }
@@ -4,4 +4,9 @@ interface IDeviceSelectProps {
4
4
  selectDevices?: DeviceItemType[];
5
5
  }
6
6
  declare function DeviceSelect({ selectDevices }: IDeviceSelectProps): JSX.Element;
7
+ declare namespace DeviceSelect {
8
+ var defaultProps: {
9
+ className: string;
10
+ };
11
+ }
7
12
  export default DeviceSelect;
@@ -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,11 +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';
22
+ import TreeMode from '../Tree';
23
+ import DynamicDeviceList from '../List/DynamicDeviceList';
24
+ import DeviceList from '../List/DeviceList';
34
25
  import { uniq, uniqBy } from 'lodash';
35
- import IconFont from '../IconFont';
26
+ import TreeType from './TreeType';
36
27
  import "./index.css";
37
28
 
38
29
  function DeviceSelect(_ref) {
@@ -162,61 +153,39 @@ function DeviceSelect(_ref) {
162
153
  var treeSelectedKeys = useMemo(function () {
163
154
  return state.mode === 'Bz' ? [state.buzGroupId] : [state.areaCode];
164
155
  }, [state.mode, state.buzGroupId, state.areaCode]);
165
- return /*#__PURE__*/React.createElement(_Row, {
156
+ return /*#__PURE__*/React.createElement("div", {
166
157
  className: "vidc-device-select-layout"
167
- }, /*#__PURE__*/React.createElement(_Col, {
168
- span: 7
169
158
  }, /*#__PURE__*/React.createElement(TreeMode, {
170
- key: state.mode,
171
159
  mode: state.mode,
172
160
  inputPlaceholder: "\u8BF7\u8F93\u5165\u540D\u79F0",
173
161
  onSelect: onSelectTree,
174
162
  selectedKeys: treeSelectedKeys,
175
- title: /*#__PURE__*/React.createElement(_Dropdown, {
176
- overlay: /*#__PURE__*/React.createElement(_Menu, {
177
- onClick: function onClick(info) {
178
- return setState(function (old) {
179
- return Object.assign(Object.assign({}, old), {
180
- mode: info.key
181
- });
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
182
169
  });
183
- }
184
- }, /*#__PURE__*/React.createElement(_Menu.Item, {
185
- style: {
186
- fontSize: 12
187
- },
188
- key: "Bz"
189
- }, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
190
- style: {
191
- fontSize: 12
192
- },
193
- key: "Place"
194
- }, "\u884C\u653F\u533A\u5212"))
195
- }, /*#__PURE__*/React.createElement("span", null, state.mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(IconFont, {
196
- style: {
197
- position: 'relative',
198
- top: 1
199
- },
200
- type: "icon-S_Arrow_BigDown"
201
- })))
202
- })), /*#__PURE__*/React.createElement(_Col, {
203
- span: 8
204
- }, /*#__PURE__*/React.createElement(DynamicDeviceList, {
170
+ });
171
+ }
172
+ })
173
+ }), /*#__PURE__*/React.createElement(DynamicDeviceList, {
205
174
  title: "\u8BBE\u5907\u5217\u8868",
206
175
  onChecked: onCheked1,
176
+ key: state.mode,
207
177
  checkedKeys: state.tempSelectIds,
208
178
  params: listParams
209
- })), /*#__PURE__*/React.createElement(_Col, {
210
- span: 1
211
- }), /*#__PURE__*/React.createElement(_Col, {
212
- span: 8
213
- }, /*#__PURE__*/React.createElement(DeviceList, {
179
+ }), /*#__PURE__*/React.createElement(DeviceList, {
214
180
  itemKey: "cid",
215
181
  deviceList: state.selectDevices || [],
216
182
  onChecked: onCheked2,
217
183
  checkedKeys: state.selectIds,
218
184
  title: "\u5DF2\u9009\u8BBE\u5907\u5217\u8868"
219
- })));
185
+ }));
220
186
  }
221
187
 
188
+ DeviceSelect.defaultProps = {
189
+ className: ''
190
+ };
222
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,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 { querySystemConfig, queryMicroApplicationList, querySystemUpdate } from './utils';
16
+ import { queryBSConfig, queryMicroApplicationList, querySystemUpdate } from './utils';
17
17
 
18
18
  function InitialConfig(_ref) {
19
19
  var children = _ref.children,
@@ -30,7 +30,7 @@ function InitialConfig(_ref) {
30
30
 
31
31
  Dict.useTypeCodes();
32
32
  useEffect(function () {
33
- Promise.all([querySystemConfig(), queryMicroApplicationList(), querySystemUpdate()]).then(function (_ref2) {
33
+ Promise.all([queryBSConfig(), queryMicroApplicationList(), querySystemUpdate()]).then(function (_ref2) {
34
34
  var _ref3 = _slicedToArray(_ref2, 3),
35
35
  BSConfig = _ref3[0],
36
36
  AppConfig = _ref3[1],
@@ -2,7 +2,7 @@
2
2
  *
3
3
  * @description 获取系统配置
4
4
  */
5
- export declare function querySystemConfig(): Promise<any>;
5
+ export declare function queryBSConfig(): Promise<any>;
6
6
  /**
7
7
  *
8
8
  * @description 获取所有微应用配置
@@ -5,38 +5,21 @@ import Service from '../Service';
5
5
  * @description 获取系统配置
6
6
  */
7
7
 
8
- export function querySystemConfig() {
8
+ export function queryBSConfig() {
9
9
  return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
10
- var res1;
11
10
  return regeneratorRuntime.wrap(function _callee$(_context) {
12
11
  while (1) {
13
12
  switch (_context.prev = _context.next) {
14
13
  case 0:
15
14
  _context.next = 2;
16
- return Service.$http({
17
- url: '/api/micro/configure/v1/queryConfigureIsDefaultByType/1',
18
- requestId: 'systemConfig'
19
- }).catch(function () {
20
- return false;
15
+ return Service.http({
16
+ url: '/api/system/config/web'
21
17
  });
22
18
 
23
19
  case 2:
24
- res1 = _context.sent;
20
+ return _context.abrupt("return", _context.sent.data);
25
21
 
26
- if (!(res1 && res1.data && res1.data.info)) {
27
- _context.next = 5;
28
- break;
29
- }
30
-
31
- return _context.abrupt("return", res1.data.info);
32
-
33
- case 5:
34
- return _context.abrupt("return", Service.$http({
35
- url: "/micro-apps/micro-dep-librarys/config/systemConfig.json?".concat(Date.now()),
36
- requestId: 'systemConfig'
37
- }));
38
-
39
- case 6:
22
+ case 3:
40
23
  case "end":
41
24
  return _context.stop();
42
25
  }
@@ -51,22 +34,19 @@ export function querySystemConfig() {
51
34
 
52
35
  export function queryMicroApplicationList() {
53
36
  return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
54
- var res;
55
37
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
56
38
  while (1) {
57
39
  switch (_context2.prev = _context2.next) {
58
40
  case 0:
59
41
  _context2.next = 2;
60
- return Service.$http({
61
- url: "/api/micro/microApplication/v1/queryMicroApplicationList",
62
- requestId: 'appConfig'
42
+ return Service.http({
43
+ url: "/api/app/list"
63
44
  });
64
45
 
65
46
  case 2:
66
- res = _context2.sent;
67
- return _context2.abrupt("return", res.data);
47
+ return _context2.abrupt("return", _context2.sent.data);
68
48
 
69
- case 4:
49
+ case 3:
70
50
  case "end":
71
51
  return _context2.stop();
72
52
  }
@@ -85,11 +65,8 @@ export function querySystemUpdate() {
85
65
  while (1) {
86
66
  switch (_context3.prev = _context3.next) {
87
67
  case 0:
88
- return _context3.abrupt("return", Service.$http({
89
- url: "/micro-apps/micro-dep-librarys/config/systemUpdate.json?".concat(Date.now()),
90
- requestId: 'querySystemUpdate'
91
- }).catch(function () {
92
- return {};
68
+ return _context3.abrupt("return", Service.http({
69
+ url: "/api/system/config/updateStatus?".concat(Date.now())
93
70
  }));
94
71
 
95
72
  case 1:
@@ -3,5 +3,5 @@ interface IInitialRequestProps {
3
3
  children: React.ReactNode;
4
4
  Spin?: React.ReactNode;
5
5
  }
6
- declare function InitialRequest({ children, Spin }: IInitialRequestProps): React.ReactNode;
6
+ declare function InitialRequest({ children, Spin }: IInitialRequestProps): JSX.Element;
7
7
  export default InitialRequest;
@@ -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.registerFeatrue(userPrivileges);
61
- Config.registerPlatformFeature(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
  }>;