@cloud-app-dev/vidc 1.0.47 → 2.0.0-alpha.0

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 (108) hide show
  1. package/.umirc.ts +1 -1
  2. package/README.md +4 -0
  3. package/es/AppContext/Sync.d.ts +6 -0
  4. package/es/AppContext/Sync.js +47 -0
  5. package/es/AppContext/index.d.ts +10 -0
  6. package/es/AppContext/index.js +111 -0
  7. package/es/AppContext/interface.d.ts +29 -0
  8. package/es/AppContext/static.d.ts +6 -0
  9. package/es/AppContext/static.js +6 -0
  10. package/es/AutoExit/index.d.ts +1 -1
  11. package/es/RefDrawer/index.d.ts +2 -2
  12. package/es/RefModal/index.d.ts +2 -2
  13. package/es/TreeMode/index.js +1 -2
  14. package/es/WorkerFlow/Demo.js +1 -0
  15. package/es/WorkerFlow/Form/Condition.js +8 -8
  16. package/es/WorkerFlow/Form/GroupList.d.ts +2 -1
  17. package/es/WorkerFlow/Form/GroupList.js +3 -2
  18. package/es/WorkerFlow/Form/GroupSelectModalContent.js +4 -2
  19. package/es/WorkerFlow/Form/UserSet.js +1 -6
  20. package/es/WorkerFlow/Nodes/TitleElement.js +13 -6
  21. package/es/WorkerFlow/index.js +40 -8
  22. package/es/WorkerFlow/utils.js +1 -1
  23. package/es/index.d.ts +1 -8
  24. package/es/index.js +1 -8
  25. package/package.json +4 -4
  26. package/es/AppLayout/AppHeader/index.css +0 -4
  27. package/es/AppLayout/AppHeader/index.d.ts +0 -18
  28. package/es/AppLayout/AppHeader/index.js +0 -41
  29. package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.d.ts +0 -1
  30. package/es/AppLayout/AppHorizontalMenu/MenuEmptyBox.js +0 -10
  31. package/es/AppLayout/AppHorizontalMenu/SubGroup.d.ts +0 -9
  32. package/es/AppLayout/AppHorizontalMenu/SubGroup.js +0 -57
  33. package/es/AppLayout/AppHorizontalMenu/index.css +0 -152
  34. package/es/AppLayout/AppHorizontalMenu/index.d.ts +0 -13
  35. package/es/AppLayout/AppHorizontalMenu/index.js +0 -230
  36. package/es/AppLayout/AppInlineMenu/SubGroup.d.ts +0 -9
  37. package/es/AppLayout/AppInlineMenu/SubGroup.js +0 -34
  38. package/es/AppLayout/AppInlineMenu/index.css +0 -110
  39. package/es/AppLayout/AppInlineMenu/index.d.ts +0 -12
  40. package/es/AppLayout/AppInlineMenu/index.js +0 -194
  41. package/es/AppLayout/AppLogo/index.css +0 -74
  42. package/es/AppLayout/AppLogo/index.d.ts +0 -13
  43. package/es/AppLayout/AppLogo/index.js +0 -100
  44. package/es/AppLayout/AppTools/index.css +0 -0
  45. package/es/AppLayout/AppTools/index.d.ts +0 -8
  46. package/es/AppLayout/AppTools/index.js +0 -10
  47. package/es/AppLayout/FunctionPreview/index.css +0 -128
  48. package/es/AppLayout/FunctionPreview/index.d.ts +0 -22
  49. package/es/AppLayout/FunctionPreview/index.js +0 -218
  50. package/es/AppLayout/Header/ListenceRoute.d.ts +0 -5
  51. package/es/AppLayout/Header/ListenceRoute.js +0 -28
  52. package/es/AppLayout/Header/ModifyPassword/index.d.ts +0 -6
  53. package/es/AppLayout/Header/ModifyPassword/index.js +0 -201
  54. package/es/AppLayout/Header/ModifyUserAvatar/index.css +0 -21
  55. package/es/AppLayout/Header/ModifyUserAvatar/index.d.ts +0 -10
  56. package/es/AppLayout/Header/ModifyUserAvatar/index.js +0 -98
  57. package/es/AppLayout/Header/NotifyAlarm.js +0 -122
  58. package/es/AppLayout/Header/ThemeTools.js +0 -69
  59. package/es/AppLayout/Header/Tools.d.ts +0 -11
  60. package/es/AppLayout/Header/Tools.js +0 -86
  61. package/es/AppLayout/Header/ToolsItem.d.ts +0 -1
  62. package/es/AppLayout/Header/ToolsItem.js +0 -12
  63. package/es/AppLayout/Header/UserAction.d.ts +0 -10
  64. package/es/AppLayout/Header/UserAction.js +0 -224
  65. package/es/AppLayout/Header/index.css +0 -136
  66. package/es/AppLayout/Header/index.d.ts +0 -9
  67. package/es/AppLayout/Header/index.js +0 -36
  68. package/es/AppLayout/index.css +0 -21
  69. package/es/AppLayout/index.d.ts +0 -12
  70. package/es/AppLayout/index.js +0 -38
  71. package/es/AppLayout/service/index.js +0 -174
  72. package/es/AppLayout/service/prefix.js +0 -4
  73. package/es/AppLayout/service/url.js +0 -35
  74. package/es/AppLayout/utils/menu.js +0 -24
  75. package/es/AppLayout/utils.d.ts +0 -4
  76. package/es/AppLayout/utils.js +0 -112
  77. package/es/DagInitialConfig/index.css +0 -0
  78. package/es/DagInitialConfig/index.d.ts +0 -10
  79. package/es/DagInitialConfig/index.js +0 -70
  80. package/es/DagInitialConfig/utils.js +0 -185
  81. package/es/DagInitialRequest/index.css +0 -0
  82. package/es/DagInitialRequest/index.d.ts +0 -10
  83. package/es/DagInitialRequest/index.js +0 -77
  84. package/es/DagInitialRequest/utils.js +0 -573
  85. package/es/FormContent/index.css +0 -27
  86. package/es/FormContent/index.d.ts +0 -19
  87. package/es/FormContent/index.js +0 -58
  88. package/es/OrgTree/index.css +0 -39
  89. package/es/OrgTree/index.d.ts +0 -16
  90. package/es/OrgTree/index.js +0 -177
  91. package/es/OrgUserTree/demo.d.ts +0 -2
  92. package/es/OrgUserTree/demo.js +0 -20
  93. package/es/OrgUserTree/index.css +0 -31
  94. package/es/OrgUserTree/index.d.ts +0 -28
  95. package/es/OrgUserTree/index.js +0 -132
  96. package/es/PlaceTree/demo.d.ts +0 -2
  97. package/es/PlaceTree/demo.js +0 -20
  98. package/es/PlaceTree/index.css +0 -40
  99. package/es/PlaceTree/index.d.ts +0 -26
  100. package/es/PlaceTree/index.js +0 -175
  101. package/es/Upload/AntUpload/index.css +0 -22
  102. package/es/Upload/AntUpload/index.d.ts +0 -19
  103. package/es/Upload/AntUpload/index.js +0 -226
  104. package/es/Upload/UploadChildren/index.css +0 -28
  105. package/es/Upload/UploadChildren/index.js +0 -26
  106. package/es/Upload/index.css +0 -0
  107. package/es/Upload/index.d.ts +0 -9
  108. package/es/Upload/index.js +0 -7
@@ -1,9 +0,0 @@
1
- import './index.less';
2
- interface IHeaderProps {
3
- renderMenu?: boolean;
4
- isMenuHome?: boolean;
5
- portalPath?: string;
6
- menuType?: string;
7
- }
8
- declare function Header({ renderMenu, isMenuHome, portalPath, menuType }: IHeaderProps): JSX.Element;
9
- export default Header;
@@ -1,36 +0,0 @@
1
- import _Config from "@cloud-app-dev/basic-components/es/Config";
2
- import _Store from "@cloud-app-dev/basic-components/es/Store";
3
- import _useHistory from "@cloud-app-dev/basic-components/es/useHistory";
4
- import React from 'react';
5
- import AppHeader from '../AppHeader';
6
- import ListenceRoute from './ListenceRoute';
7
- import AppTools from './Tools';
8
- import "./index.css";
9
-
10
- function Header(_ref) {
11
- var renderMenu = _ref.renderMenu,
12
- isMenuHome = _ref.isMenuHome,
13
- portalPath = _ref.portalPath,
14
- menuType = _ref.menuType;
15
-
16
- var history = _useHistory();
17
-
18
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AppHeader, {
19
- userInfo: _Store.app.userInfo,
20
- systemLogo: _Store.app.appInfo.systemLogoUrl || _Store.app.systemConfig.systemLogo || _Config.BSConfig.systemLogo,
21
- systemName: _Store.app.systemConfig.systemName,
22
- menuType: menuType,
23
- history: history,
24
- renderMenu: renderMenu,
25
- isMenuHome: isMenuHome,
26
- appTools: /*#__PURE__*/React.createElement(AppTools, {
27
- history: history,
28
- isMenuHome: isMenuHome,
29
- portalPath: portalPath
30
- })
31
- }), /*#__PURE__*/React.createElement(ListenceRoute, {
32
- history: history
33
- }));
34
- }
35
-
36
- export default Header;
@@ -1,21 +0,0 @@
1
- .app-style-container {
2
- width: 100%;
3
- height: 100%;
4
- display: flex;
5
- }
6
- .app-style-container .app-layout-container {
7
- width: 100%;
8
- height: 100%;
9
- }
10
- .app-style-container .app-inline-layout {
11
- padding-left: 72px;
12
- }
13
- .app-style-container .app-layout-header {
14
- min-height: var(--nav-height);
15
- height: max-content;
16
- padding: 0;
17
- line-height: var(--nav-height);
18
- color: var(--app-header-color);
19
- background-color: var(--app-header-bg);
20
- width: 100%;
21
- }
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface IAppLayoutProps {
4
- content?: React.ReactNode;
5
- children?: React.ReactNode;
6
- menuType?: string;
7
- isMenuHome?: boolean;
8
- renderMenu?: boolean;
9
- portalPath?: string;
10
- }
11
- declare function AppLayout({ content, children, menuType, isMenuHome, renderMenu, portalPath }: IAppLayoutProps): JSX.Element;
12
- export default AppLayout;
@@ -1,38 +0,0 @@
1
- import "antd/lib/layout/style";
2
- import _Layout from "antd/lib/layout";
3
- import _useHistory from "@cloud-app-dev/basic-components/es/useHistory";
4
- import React from 'react';
5
- import Header from './Header';
6
- import AppInlineMenu from './AppInlineMenu';
7
- import "./index.css";
8
-
9
- function AppLayout(_ref) {
10
- var content = _ref.content,
11
- children = _ref.children,
12
- menuType = _ref.menuType,
13
- isMenuHome = _ref.isMenuHome,
14
- renderMenu = _ref.renderMenu,
15
- portalPath = _ref.portalPath;
16
-
17
- var history = _useHistory();
18
-
19
- var className = menuType === 'inline' ? 'app-inline-layout' : '';
20
- return /*#__PURE__*/React.createElement("div", {
21
- className: "app-style-container"
22
- }, menuType === 'inline' && /*#__PURE__*/React.createElement(AppInlineMenu, {
23
- history: history
24
- }), /*#__PURE__*/React.createElement(_Layout, {
25
- className: "app-layout-container ".concat(className)
26
- }, /*#__PURE__*/React.createElement(_Layout.Header, {
27
- className: "app-layout-header"
28
- }, /*#__PURE__*/React.createElement(Header, {
29
- isMenuHome: isMenuHome,
30
- renderMenu: renderMenu,
31
- portalPath: portalPath,
32
- menuType: menuType
33
- })), /*#__PURE__*/React.createElement(_Layout.Content, {
34
- className: "app-layout-content"
35
- }, children || content)));
36
- }
37
-
38
- export default AppLayout;
@@ -1,174 +0,0 @@
1
- import _Service from "@cloud-app-dev/basic-components/es/Service";
2
- import _cache from "@cloud-app-dev/utils/es/cache";
3
-
4
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
-
6
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
7
-
8
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
-
10
- 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); } }
11
-
12
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
13
-
14
- import URL from './url';
15
- import JSEncrypt from 'jsencrypt';
16
- var RSA = {
17
- decrypt: function decrypt(ciphertext, key) {
18
- var rsa = new JSEncrypt();
19
- rsa.setPrivateKey(key);
20
- return rsa.decrypt(ciphertext);
21
- },
22
- encrypt: function encrypt(message, key) {
23
- var rsa = new JSEncrypt();
24
- rsa.setPublicKey(key);
25
- return rsa.encrypt(message);
26
- }
27
- };
28
- var defaultHeaders = {
29
- Authorization: _cache.getCache('token', 'session')
30
- };
31
-
32
- var MainService = /*#__PURE__*/function () {
33
- function MainService() {
34
- _classCallCheck(this, MainService);
35
- }
36
-
37
- _createClass(MainService, [{
38
- key: "queryConfigureList",
39
- value:
40
- /**
41
- * 根据id查询用户信息
42
- * @param {*} id
43
- */
44
- function queryConfigureList() {
45
- return _Service.$http({
46
- method: 'get',
47
- url: URL.queryConfigureList.value,
48
- requestId: URL.queryConfigureList.requestId
49
- });
50
- } //通用类接口
51
-
52
- }, {
53
- key: "uploadImg",
54
- value: function uploadImg(options) {
55
- return _Service.$http({
56
- headers: defaultHeaders,
57
- url: URL.uploadImg.value,
58
- method: 'post',
59
- data: options,
60
- requestId: URL.uploadImg.requestId
61
- });
62
- }
63
- /**
64
- * 修改用户的头像
65
- * @param {*} data
66
- */
67
-
68
- }, {
69
- key: "changeUserAvatar",
70
- value: function changeUserAvatar(data) {
71
- return _Service.$http({
72
- headers: defaultHeaders,
73
- method: 'post',
74
- url: URL.changeUserAvatar.value,
75
- data: data,
76
- requestId: URL.changeUserAvatar.requestId
77
- });
78
- }
79
- }, {
80
- key: "getPublicKey",
81
- value: function getPublicKey() {
82
- var headers = {
83
- Authorization: _cache.getCache('token', 'session')
84
- };
85
- return _Service.$http({
86
- headers: headers,
87
- url: URL.getPublicKey.value,
88
- method: 'post',
89
- requestId: URL.getPublicKey.requestId
90
- }).then(function (res) {
91
- return res.data;
92
- });
93
- }
94
- /**
95
- * @desc 修改密码
96
- * @param {*} options
97
- */
98
-
99
- }, {
100
- key: "changePassword",
101
- value: function () {
102
- var _changePassword = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(options) {
103
- var headers, _yield$this$getPublic, publicKey;
104
-
105
- return regeneratorRuntime.wrap(function _callee$(_context) {
106
- while (1) {
107
- switch (_context.prev = _context.next) {
108
- case 0:
109
- headers = {
110
- Authorization: _cache.getCache('token', 'session')
111
- };
112
- _context.next = 3;
113
- return this.getPublicKey();
114
-
115
- case 3:
116
- _yield$this$getPublic = _context.sent;
117
- publicKey = _yield$this$getPublic.publicKey;
118
- options.newPassword = RSA.encrypt(options.newPassword, publicKey);
119
- options.oldPassword = RSA.encrypt(options.oldPassword, publicKey);
120
- return _context.abrupt("return", _Service.$http({
121
- url: URL.changePassword.value,
122
- headers: headers,
123
- method: 'post',
124
- data: options,
125
- requestId: URL.changePassword.requestId
126
- }));
127
-
128
- case 8:
129
- case "end":
130
- return _context.stop();
131
- }
132
- }
133
- }, _callee, this);
134
- }));
135
-
136
- function changePassword(_x) {
137
- return _changePassword.apply(this, arguments);
138
- }
139
-
140
- return changePassword;
141
- }()
142
- /**
143
- * @desc 用户登出
144
- */
145
-
146
- }, {
147
- key: "loginOut",
148
- value: function loginOut() {
149
- return _Service.$http({
150
- headers: defaultHeaders,
151
- url: URL.loginOut.value,
152
- method: 'post',
153
- requestId: URL.loginOut.requestId
154
- });
155
- }
156
- }, {
157
- key: "getUserByToken",
158
- value: function getUserByToken() {
159
- return _Service.$http({
160
- url: '/api/user/v1/getUserByToken',
161
- method: 'post',
162
- headers: {
163
- Authorization: _cache.getCache('token', 'session')
164
- },
165
- requestId: 'getUserInfo'
166
- });
167
- }
168
- }]);
169
-
170
- return MainService;
171
- }();
172
-
173
- var main = new MainService();
174
- export default main;
@@ -1,4 +0,0 @@
1
- var prefix = {
2
- api: '/api'
3
- };
4
- export default prefix;
@@ -1,35 +0,0 @@
1
- import config from './prefix';
2
- var api = config.api;
3
- var REQ_URL = {
4
- queryConfigureList: {
5
- value: "".concat(api, "/micro/configure/v1/queryConfigureList"),
6
- label: '配置列表',
7
- requestId: 'queryConfigureList'
8
- },
9
- uploadImg: {
10
- value: "".concat(api, "/user/v1/img/uploadImg"),
11
- label: '图片上传',
12
- requestId: 'uploadImg'
13
- },
14
- changeUserAvatar: {
15
- value: "".concat(api, "/user/v1/changeUserAvatar"),
16
- requestId: 'changeUserAvatar',
17
- label: '用户头像修改'
18
- },
19
- getPublicKey: {
20
- value: "".concat(api, "/user/v2/getPublicKey"),
21
- requestId: 'getPublicKey',
22
- label: '获取key'
23
- },
24
- changePassword: {
25
- value: "".concat(api, "/user/v2/changePassword"),
26
- requestId: 'changePassword',
27
- label: '修改密码'
28
- },
29
- loginOut: {
30
- value: "".concat(api, "/user/v1/loginOut"),
31
- label: '登出',
32
- requestId: 'loginOut'
33
- }
34
- };
35
- export default REQ_URL;
@@ -1,24 +0,0 @@
1
- import _Store from "@cloud-app-dev/basic-components/es/Store";
2
- export function setMenuKeys(keys) {
3
- var app = _Store.app,
4
- auth = _Store.auth;
5
- var arr = [];
6
-
7
- if (keys.length === 1) {
8
- var menu = auth.userAuthList.find(function (v) {
9
- return v.code === keys[0];
10
- });
11
-
12
- if (menu && menu.groups && menu.groups.group1) {
13
- arr.push(menu.groups.group1.key);
14
- }
15
-
16
- if (menu && menu.groups && menu.groups.group2) {
17
- arr.push(menu.groups.group2.key);
18
- }
19
-
20
- arr.push(menu.code + '');
21
- }
22
-
23
- app.updateCurrentMenuKeys(arr);
24
- }
@@ -1,4 +0,0 @@
1
- export declare function updateFunctionCount(name: string): Promise<void>;
2
- export declare function getFunctionCount(): Promise<any[]>;
3
- export declare function clearFunctionCount(): Promise<void>;
4
- export declare function deleteFunctionItemCount(name: string): Promise<void>;
@@ -1,112 +0,0 @@
1
- import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
2
- import _LM_DB from "@cloud-app-dev/utils/es/LM_DB";
3
- import { __awaiter } from "tslib";
4
- import { orderBy } from 'lodash';
5
- var db = new _LM_DB('functionCount');
6
- export function updateFunctionCount(name) {
7
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
8
- var item, expireTime;
9
- return regeneratorRuntime.wrap(function _callee$(_context) {
10
- while (1) {
11
- switch (_context.prev = _context.next) {
12
- case 0:
13
- _context.next = 2;
14
- return db.get({
15
- id: name
16
- });
17
-
18
- case 2:
19
- item = _context.sent;
20
- expireTime = Date.now() + 12 * 30 * 24 * 60 * 60 * 1000;
21
-
22
- if (item) {
23
- _context.next = 9;
24
- break;
25
- }
26
-
27
- _context.next = 7;
28
- return db.put({
29
- id: name,
30
- count: 1,
31
- expireTime: expireTime
32
- });
33
-
34
- case 7:
35
- _context.next = 11;
36
- break;
37
-
38
- case 9:
39
- _context.next = 11;
40
- return db.put({
41
- id: name,
42
- count: item.count + 1,
43
- expireTime: expireTime
44
- });
45
-
46
- case 11:
47
- _SocketEmitter.emit('updateFunctionCount', null);
48
-
49
- case 12:
50
- case "end":
51
- return _context.stop();
52
- }
53
- }
54
- }, _callee);
55
- }));
56
- }
57
- export function getFunctionCount() {
58
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
59
- var list;
60
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
61
- while (1) {
62
- switch (_context2.prev = _context2.next) {
63
- case 0:
64
- _context2.next = 2;
65
- return db.query();
66
-
67
- case 2:
68
- list = _context2.sent;
69
- return _context2.abrupt("return", orderBy(list, ['count'], ['desc']).slice(0, 6));
70
-
71
- case 4:
72
- case "end":
73
- return _context2.stop();
74
- }
75
- }
76
- }, _callee2);
77
- }));
78
- }
79
- export function clearFunctionCount() {
80
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
81
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
82
- while (1) {
83
- switch (_context3.prev = _context3.next) {
84
- case 0:
85
- _context3.next = 2;
86
- return db.clear();
87
-
88
- case 2:
89
- case "end":
90
- return _context3.stop();
91
- }
92
- }
93
- }, _callee3);
94
- }));
95
- }
96
- export function deleteFunctionItemCount(name) {
97
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
98
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
99
- while (1) {
100
- switch (_context4.prev = _context4.next) {
101
- case 0:
102
- _context4.next = 2;
103
- return db.remove([name]);
104
-
105
- case 2:
106
- case "end":
107
- return _context4.stop();
108
- }
109
- }
110
- }, _callee4);
111
- }));
112
- }
File without changes
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
-
3
- export interface InitialConfigProps {
4
- children: (isUpdate: boolean) => React.ReactNode;
5
- mode?: 'local' | 'server';
6
- }
7
-
8
- declare const InitialConfig: React.StatelessComponent<InitialConfig>;
9
-
10
- export default InitialConfig;
@@ -1,70 +0,0 @@
1
- import _Config from "@cloud-app-dev/basic-components/es/Config";
2
-
3
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
-
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."); }
6
-
7
- 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); }
8
-
9
- 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; }
10
-
11
- 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; }
12
-
13
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
-
15
- import React, { useState, useEffect } from 'react';
16
- import { formatAppConfig, querySystemConfig, queryThemeConfig, queryMapConfig, queryMicroApplicationList, querySystemUpdate, queryLogoConfig } from './utils';
17
- import "./index.css";
18
-
19
- function InitialConfig(_ref) {
20
- var children = _ref.children,
21
- _ref$mode = _ref.mode,
22
- mode = _ref$mode === void 0 ? 'server' : _ref$mode;
23
-
24
- var _useState = useState({
25
- isInit: false,
26
- isUpdate: false
27
- }),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- state = _useState2[0],
30
- setState = _useState2[1];
31
-
32
- useEffect(function () {
33
- Promise.all([querySystemConfig(mode), queryMapConfig(mode), queryThemeConfig(mode), queryMicroApplicationList(mode), queryLogoConfig(), querySystemUpdate()]).then(function (res) {
34
- var _res = _slicedToArray(res, 6),
35
- BSConfig = _res[0],
36
- LMapConfig = _res[1],
37
- themeConfig = _res[2],
38
- AppConfig = _res[3],
39
- LogConfig = _res[4],
40
- SystemConfig = _res[5];
41
-
42
- _Config.registerBSConfig(BSConfig);
43
-
44
- _Config.registerLMapConfig(LMapConfig);
45
-
46
- _Config.registerAppConfig(formatAppConfig(AppConfig));
47
-
48
- _Config.registerThemeConfig(themeConfig);
49
-
50
- _Config.registerLogConfig(LogConfig);
51
-
52
- setState(function () {
53
- return {
54
- isUpdate: SystemConfig.isUpdate,
55
- isInit: true
56
- };
57
- });
58
- }); // eslint-disable-next-line react-hooks/exhaustive-deps
59
- }, []);
60
- var isInit = state.isInit,
61
- isUpdate = state.isUpdate;
62
-
63
- if (!isInit) {
64
- return null;
65
- }
66
-
67
- return /*#__PURE__*/React.createElement(React.Fragment, null, children(isUpdate));
68
- }
69
-
70
- export default InitialConfig;