@cloud-app-dev/vidc 2.0.0-alpha.14 → 2.0.0-alpha.18

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 (48) hide show
  1. package/.fatherrc.js +11 -4
  2. package/es/Api/index.js +7 -7
  3. package/es/AppRedirect/index.js +1 -2
  4. package/es/AppRoute/index.d.ts +1 -2
  5. package/es/AppRoute/index.js +25 -20
  6. package/es/AutoExit/index.js +1 -1
  7. package/es/ConfigContext/index.d.ts +15 -2
  8. package/es/ConfigContext/index.js +25 -3
  9. package/es/Dict/desc.js +3 -3
  10. package/es/Dict/utils.js +3 -3
  11. package/es/InitialConfig/utils.js +3 -3
  12. package/es/InitialRequest/utils.js +5 -5
  13. package/es/InstanceHistory/index.d.ts +3 -0
  14. package/es/InstanceHistory/index.js +9 -0
  15. package/es/List/DynamicDeviceList/utils.js +1 -1
  16. package/es/LoaderApp/index.js +16 -6
  17. package/es/LoaderApp/utils.d.ts +2 -1
  18. package/es/LoaderApp/utils.js +4 -2
  19. package/es/LoaderScript/index.js +7 -89
  20. package/es/LoaderScript/utils.d.ts +2 -0
  21. package/es/LoaderScript/utils.js +115 -1
  22. package/es/Picture/component/MoveContent/index.js +3 -3
  23. package/es/RefDrawer/index.js +1 -1
  24. package/es/RefModal/index.js +1 -1
  25. package/es/Service/http.d.ts +6 -4
  26. package/es/Service/http.js +18 -14
  27. package/es/Service/index.d.ts +3 -3
  28. package/es/Service/index.js +7 -11
  29. package/es/Service/interface.d.ts +4 -9
  30. package/es/Service/middleware.d.ts +1 -1
  31. package/es/WorkerFlow/Form/LevelGroupSelect.js +1 -1
  32. package/es/WorkerFlow/index.js +10 -6
  33. package/es/index.d.ts +2 -1
  34. package/es/index.js +2 -1
  35. package/es/useDrawer/index.js +1 -1
  36. package/es/useHistory/index.d.ts +3 -0
  37. package/es/useHistory/index.js +11 -0
  38. package/es/useHttp/index.js +1 -1
  39. package/es/useModal/index.js +1 -1
  40. package/package.json +5 -3
  41. package/tsconfig.json +1 -1
  42. package/es/Service/logger.d.ts +0 -3
  43. package/es/Service/logger.js +0 -13
  44. package/es/Service/utils.d.ts +0 -3
  45. package/es/Service/utils.js +0 -11
  46. package/es/useNavigate/index.css +0 -0
  47. package/es/useNavigate/index.d.ts +0 -4
  48. package/es/useNavigate/index.js +0 -14
package/.fatherrc.js CHANGED
@@ -1,10 +1,6 @@
1
- import nodePolyfills from 'rollup-plugin-node-polyfills';
2
-
3
1
  export default {
4
2
  target: 'browser',
5
3
  esm: 'babel',
6
- extraRollupPlugins: [nodePolyfills()],
7
- lessInBabelMode: true, // babel 模式下做 less 编译
8
4
  pkgs: [
9
5
  // 组件依赖构建顺序, 例如 a组件依赖于b组件,那么需要先编译 b,在编译a,则 这里可以控制组件编译顺序
10
6
  ],
@@ -15,4 +11,15 @@ export default {
15
11
  ['import', { libraryName: 'ahooks', style: false, camel2DashComponentName: false, libraryDirectory: 'es' }, 'ahooks'],
16
12
  ['import', { libraryName: '@cloud-app-dev/map', style: false, camel2DashComponentName: false, libraryDirectory: 'es' }, 'map-components'],
17
13
  ],
14
+ lessInRollupMode: {
15
+ modifyVars: {
16
+ '@ant-prefix': 'cloudapp',
17
+ },
18
+ },
19
+ lessInBabelMode: {
20
+ // babel 模式下做 less 编译
21
+ modifyVars: {
22
+ '@ant-prefix': 'cloudapp',
23
+ },
24
+ },
18
25
  };
package/es/Api/index.js CHANGED
@@ -2,7 +2,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
2
2
 
3
3
  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); } }
4
4
 
5
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
6
 
7
7
  import { __awaiter } from "tslib";
8
8
  import Service from '../Service';
@@ -23,7 +23,7 @@ var Api = /*#__PURE__*/function () {
23
23
  switch (_context.prev = _context.next) {
24
24
  case 0:
25
25
  _context.next = 2;
26
- return Service.$http({
26
+ return Service.http({
27
27
  url: '/api/user/v1/organization/queryChildOrganizationsById',
28
28
  method: 'post',
29
29
  requestId: 'queryChildOrganizationsById',
@@ -60,7 +60,7 @@ var Api = /*#__PURE__*/function () {
60
60
  switch (_context2.prev = _context2.next) {
61
61
  case 0:
62
62
  _context2.next = 2;
63
- return Service.$http({
63
+ return Service.http({
64
64
  url: '/api/user/v1/queryUsers',
65
65
  method: 'post',
66
66
  requestId: 'queryUsers',
@@ -98,7 +98,7 @@ var Api = /*#__PURE__*/function () {
98
98
  switch (_context3.prev = _context3.next) {
99
99
  case 0:
100
100
  _context3.next = 2;
101
- return Service.$http({
101
+ return Service.http({
102
102
  url: "/api/user/v2/post/queryPostByOrgId/".concat(orgId),
103
103
  method: 'post',
104
104
  requestId: 'queryPostByOrgId',
@@ -128,7 +128,7 @@ var Api = /*#__PURE__*/function () {
128
128
  switch (_context4.prev = _context4.next) {
129
129
  case 0:
130
130
  _context4.next = 2;
131
- return Service.$http({
131
+ return Service.http({
132
132
  url: '/api/udm-api/DeviceBuzTree/queryList',
133
133
  method: 'post',
134
134
  requestId: 'getDeviceBzTree',
@@ -158,7 +158,7 @@ var Api = /*#__PURE__*/function () {
158
158
  switch (_context5.prev = _context5.next) {
159
159
  case 0:
160
160
  _context5.next = 2;
161
- return Service.$http({
161
+ return Service.http({
162
162
  url: '/api/udm-api/customDeviceGroup/queryList',
163
163
  method: 'post',
164
164
  requestId: 'customDeviceGroup',
@@ -188,7 +188,7 @@ var Api = /*#__PURE__*/function () {
188
188
  switch (_context6.prev = _context6.next) {
189
189
  case 0:
190
190
  _context6.next = 2;
191
- return Service.$http({
191
+ return Service.http({
192
192
  url: '/api/place/v1/getPlacesByHasDevice',
193
193
  method: 'post',
194
194
  requestId: 'getPlacesByHasDevice',
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect } from 'react';
2
- import { useLocation } from 'react-router-dom';
3
- import useNavigate from '../useNavigate';
2
+ import { useLocation, useNavigate } from 'react-router-dom';
4
3
  import "./index.css";
5
4
 
6
5
  var getKey = function getKey() {
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import { IAppRouteProps } from './interface';
3
- declare class AppRoute extends React.PureComponent<IAppRouteProps, any> {
3
+ declare class AppRoute extends React.Component<IAppRouteProps, any> {
4
4
  static defaultProps: IAppRouteProps;
5
- private isRender;
6
5
  constructor(props: IAppRouteProps);
7
6
  shouldComponentUpdate(props: IAppRouteProps): boolean;
8
7
  componentWillUnmount(): void;
@@ -1,4 +1,4 @@
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
  import _cache from "@cloud-app-dev/utils/es/cache";
4
4
  import _useMount from "ahooks/es/useMount";
@@ -7,9 +7,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
7
7
 
8
8
  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); } }
9
9
 
10
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
11
 
12
- 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); }
12
+ 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); }
13
13
 
14
14
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
15
 
@@ -23,6 +23,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
23
23
 
24
24
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
25
25
 
26
+ import { __rest } from "tslib";
26
27
  import React from 'react';
27
28
  import { Route, Routes } from 'react-router-dom';
28
29
  var _global = window;
@@ -37,8 +38,8 @@ function RenderSingleRoute(_ref) {
37
38
  return /*#__PURE__*/React.createElement(React.Fragment, null);
38
39
  }
39
40
 
40
- var AppRoute = /*#__PURE__*/function (_React$PureComponent) {
41
- _inherits(AppRoute, _React$PureComponent);
41
+ var AppRoute = /*#__PURE__*/function (_React$Component) {
42
+ _inherits(AppRoute, _React$Component);
42
43
 
43
44
  var _super = _createSuper(AppRoute);
44
45
 
@@ -47,11 +48,9 @@ var AppRoute = /*#__PURE__*/function (_React$PureComponent) {
47
48
 
48
49
  _classCallCheck(this, AppRoute);
49
50
 
50
- _this = _super.call(this, props); //可能存在路由创建但是没有render 导致UI无法渲染
51
-
52
- _this.isRender = false;
51
+ _this = _super.call(this, props);
53
52
  _this.state = {
54
- mathIndex: -1
53
+ matchIndex: -1
55
54
  };
56
55
  return _this;
57
56
  }
@@ -59,11 +58,14 @@ var AppRoute = /*#__PURE__*/function (_React$PureComponent) {
59
58
  _createClass(AppRoute, [{
60
59
  key: "shouldComponentUpdate",
61
60
  value: function shouldComponentUpdate(props) {
62
- if (!_global._IS_RUN_MICRO_BASIC || !this.isRender || _global._IS_ALLOW_ROUTE_RENDER) {
63
- return true;
61
+ var tabId = props.currentId || _cache.getCache('currentTabKey', 'session');
62
+
63
+ if (_global._IS_RUN_MICRO_BASIC && tabId !== props.tabId) {
64
+ // 页签变化拦截
65
+ return false;
64
66
  }
65
67
 
66
- return (props.currentId || _cache.getCache('currentTabKey', 'session')) === props.tabId;
68
+ return true;
67
69
  }
68
70
  }, {
69
71
  key: "componentWillUnmount",
@@ -75,7 +77,14 @@ var AppRoute = /*#__PURE__*/function (_React$PureComponent) {
75
77
  value: function render() {
76
78
  var _this2 = this;
77
79
 
78
- var routes = this.props.routes;
80
+ var matchIndex = this.state.matchIndex;
81
+
82
+ var _a = this.props,
83
+ _a$routes = _a.routes,
84
+ routes = _a$routes === void 0 ? [] : _a$routes,
85
+ props = __rest(_a, ["routes"]);
86
+
87
+ var component = matchIndex > -1 ? routes[matchIndex].element : undefined;
79
88
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Routes, null, routes.map(function (item, index) {
80
89
  return /*#__PURE__*/React.createElement(Route, {
81
90
  path: item.path,
@@ -83,21 +92,17 @@ var AppRoute = /*#__PURE__*/function (_React$PureComponent) {
83
92
  element: /*#__PURE__*/React.createElement(RenderSingleRoute, {
84
93
  onMount: function onMount() {
85
94
  return _this2.setState({
86
- mathIndex: index
95
+ matchIndex: index
87
96
  });
88
97
  }
89
98
  })
90
99
  });
91
- })), this.state.matchIndex > -1 && routes[this.state.matchIndex].element, /*#__PURE__*/React.createElement(RenderSingleRoute, {
92
- onMount: function onMount() {
93
- return _this2.isRender = true;
94
- }
95
- }));
100
+ })), component && /*#__PURE__*/React.cloneElement(component, props));
96
101
  }
97
102
  }]);
98
103
 
99
104
  return AppRoute;
100
- }(React.PureComponent);
105
+ }(React.Component);
101
106
 
102
107
  AppRoute.defaultProps = {
103
108
  routes: []
@@ -1,6 +1,6 @@
1
1
  import _nextTick from "@cloud-app-dev/utils/es/nextTick";
2
2
  import React, { useContext, useEffect } from 'react';
3
- import useNavigate from '../useNavigate';
3
+ import { useNavigate } from 'react-router-dom';
4
4
  import AppContext from '../AppContext';
5
5
 
6
6
  function AutoExit(_ref) {
@@ -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
+ };
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'
@@ -12,7 +12,7 @@ export function queryBSConfig() {
12
12
  switch (_context.prev = _context.next) {
13
13
  case 0:
14
14
  _context.next = 2;
15
- return Service.$http({
15
+ return Service.http({
16
16
  url: '/api/system/config/web'
17
17
  });
18
18
 
@@ -39,7 +39,7 @@ export function queryMicroApplicationList() {
39
39
  switch (_context2.prev = _context2.next) {
40
40
  case 0:
41
41
  _context2.next = 2;
42
- return Service.$http({
42
+ return Service.http({
43
43
  url: "/api/app/list"
44
44
  });
45
45
 
@@ -65,7 +65,7 @@ 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({
68
+ return _context3.abrupt("return", Service.http({
69
69
  url: "/api/system/config/updateStatus?".concat(Date.now())
70
70
  }));
71
71
 
@@ -28,7 +28,7 @@ export function initialization() {
28
28
  Authorization: _cache.getCache('token', 'session')
29
29
  };
30
30
  _context.next = 3;
31
- return Service.$http({
31
+ return Service.http({
32
32
  url: '/api/user/v1/getUserByToken',
33
33
  method: 'post',
34
34
  headers: headers
@@ -44,28 +44,28 @@ export function initialization() {
44
44
  systemFeatureUrl = "/api/system/".concat(systemId, "/list");
45
45
  themeConfigUrl = '/api/system/config/type';
46
46
  _context.next = 13;
47
- return Promise.all([Service.$http({
47
+ return Promise.all([Service.http({
48
48
  url: centerUrl,
49
49
  headers: headers,
50
50
  data: {
51
51
  id: systemId
52
52
  },
53
53
  method: 'post'
54
- }), Service.$http({
54
+ }), Service.http({
55
55
  url: userPrivilegesUrl,
56
56
  headers: headers,
57
57
  data: {
58
58
  id: userId
59
59
  },
60
60
  method: 'post'
61
- }), Service.$http({
61
+ }), Service.http({
62
62
  url: systemFeatureUrl,
63
63
  headers: headers,
64
64
  data: {
65
65
  id: systemId
66
66
  },
67
67
  method: 'get'
68
- }), Service.$http({
68
+ }), Service.http({
69
69
  url: themeConfigUrl,
70
70
  headers: headers,
71
71
  data: {
@@ -0,0 +1,3 @@
1
+ import type { History } from 'history';
2
+ declare const InstanceHistory: History<unknown>;
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;
@@ -3,7 +3,7 @@ import Service from '../../Service';
3
3
  import { getHeader } from '../../utils';
4
4
  export function queryDeviceList() {
5
5
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6
- return Service.$http({
6
+ return Service.http({
7
7
  method: 'post',
8
8
  url: '/api/udm-api/device/queryList',
9
9
  requestId: 'queryDeviceList',
@@ -42,18 +42,29 @@ function LoaderApp(_ref) {
42
42
  var config = getMicroConfig(appConfig, appProps, domRef.current);
43
43
 
44
44
  if (!config) {
45
- console.debug('微应用不存在', 'config ->', appConfig, 'appProps ->', appProps);
45
+ console.error('微应用不存在', 'config ->', appConfig, 'appProps ->', appProps);
46
+ return undefined;
47
+ }
48
+
49
+ if (!domRef.current || !styleRef.current) {
50
+ console.error('LoaderApp组件未正常初始化!', 'config ->', appConfig, 'appProps ->', appProps);
46
51
  return undefined;
47
52
  }
48
53
 
49
54
  var props = Object.assign(Object.assign({}, appProps), {
50
55
  container: domRef.current
51
56
  });
57
+ var routerPrefix = config.routerPrefix;
58
+
59
+ var _appConfig$resource = _slicedToArray(appConfig.resource, 2),
60
+ script = _appConfig$resource[0],
61
+ style = _appConfig$resource[1];
62
+
52
63
  var options = {
53
- script: appConfig.resource[0],
54
- style: appConfig.resource[1],
55
- name: config.name,
56
- prefix: ".".concat(appConfig.name, "-").concat(id),
64
+ script: script,
65
+ style: style,
66
+ name: routerPrefix,
67
+ prefix: ".".concat(routerPrefix, "-").concat(id),
57
68
  styleNode: styleRef.current
58
69
  };
59
70
  LoaderModule(options).then(function (mod) {
@@ -108,7 +119,6 @@ function LoaderApp(_ref) {
108
119
  var props = Object.assign(Object.assign({}, appProps), {
109
120
  container: domRef.current
110
121
  });
111
- console.debug('执行更新!', appProps);
112
122
  loadedAppRef.current.update && loadedAppRef.current.update(props);
113
123
  }
114
124
  }, [appProps.currentId, appProps.tabId, appProps.updateTime]);
@@ -1,6 +1,7 @@
1
1
  import { AppItemType } from '../Config/interface';
2
2
  export declare const getMicroConfig: (appConfig: AppItemType, appProps: any, container: HTMLDivElement) => {
3
- name: string;
3
+ title: string;
4
+ routerPrefix: string;
4
5
  container: HTMLDivElement;
5
6
  props: any;
6
7
  entry: {
@@ -3,14 +3,16 @@ export var getMicroConfig = function getMicroConfig() {
3
3
  var appProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4
4
  var container = arguments.length > 2 ? arguments[2] : undefined;
5
5
  var routerPrefix = appConfig.routerPrefix,
6
- resource = appConfig.resource;
6
+ resource = appConfig.resource,
7
+ name = appConfig.name;
7
8
  var microAppEntry = {
8
9
  scripts: [resource[0]],
9
10
  styles: [resource[1]],
10
11
  html: "<div id=\"".concat(routerPrefix, "\" style=\"height:100%\"></div>")
11
12
  };
12
13
  return {
13
- name: routerPrefix,
14
+ title: name,
15
+ routerPrefix: routerPrefix,
14
16
  container: container,
15
17
  props: appProps,
16
18
  entry: microAppEntry
@@ -10,14 +10,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
10
10
 
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
- import { __asyncValues, __awaiter } from "tslib";
14
13
  import React, { useEffect, useState } from 'react';
15
- import { createAsyncIterable } from './utils';
16
- import { nextTick, tryCatch } from '../utils';
14
+ import { createAsyncIterable, runAsyncIterable } from './utils';
17
15
 
18
16
  function LoaderScripts(_ref) {
19
- var _this = this;
20
-
21
17
  var _ref$options = _ref.options,
22
18
  options = _ref$options === void 0 ? [] : _ref$options,
23
19
  children = _ref.children,
@@ -35,90 +31,12 @@ function LoaderScripts(_ref) {
35
31
  return setInitStatus(true);
36
32
  }
37
33
 
38
- var asyncIter = createAsyncIterable(options);
39
- tryCatch(function () {
40
- return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
41
- var e_1, _a, asyncIter_1, asyncIter_1_1, x;
42
-
43
- return regeneratorRuntime.wrap(function _callee$(_context) {
44
- while (1) {
45
- switch (_context.prev = _context.next) {
46
- case 0:
47
- _context.prev = 0;
48
- asyncIter_1 = __asyncValues(asyncIter);
49
-
50
- case 2:
51
- _context.next = 4;
52
- return asyncIter_1.next();
53
-
54
- case 4:
55
- asyncIter_1_1 = _context.sent;
56
-
57
- if (asyncIter_1_1.done) {
58
- _context.next = 10;
59
- break;
60
- }
61
-
62
- x = asyncIter_1_1.value;
63
- console.log('加载完成!', options[x]);
64
-
65
- case 8:
66
- _context.next = 2;
67
- break;
68
-
69
- case 10:
70
- _context.next = 15;
71
- break;
72
-
73
- case 12:
74
- _context.prev = 12;
75
- _context.t0 = _context["catch"](0);
76
- e_1 = {
77
- error: _context.t0
78
- };
79
-
80
- case 15:
81
- _context.prev = 15;
82
- _context.prev = 16;
83
-
84
- if (!(asyncIter_1_1 && !asyncIter_1_1.done && (_a = asyncIter_1.return))) {
85
- _context.next = 20;
86
- break;
87
- }
88
-
89
- _context.next = 20;
90
- return _a.call(asyncIter_1);
91
-
92
- case 20:
93
- _context.prev = 20;
94
-
95
- if (!e_1) {
96
- _context.next = 23;
97
- break;
98
- }
99
-
100
- throw e_1.error;
101
-
102
- case 23:
103
- return _context.finish(20);
104
-
105
- case 24:
106
- return _context.finish(15);
107
-
108
- case 25:
109
- nextTick(function () {
110
- return onLoadEnd ? onLoadEnd().then(function () {
111
- return setInitStatus(true);
112
- }) : setInitStatus(true);
113
- });
114
-
115
- case 26:
116
- case "end":
117
- return _context.stop();
118
- }
119
- }
120
- }, _callee, null, [[0, 12, 15, 25], [16,, 20, 24]]);
121
- }));
34
+ runAsyncIterable(createAsyncIterable(options), function (option) {
35
+ return console.debug('LoaderScript -> Iterable加载完成!', option);
36
+ }, function () {
37
+ return onLoadEnd ? onLoadEnd().then(function () {
38
+ return setInitStatus(true);
39
+ }) : setInitStatus(true);
122
40
  });
123
41
  }, [options]);
124
42
  return /*#__PURE__*/React.createElement(React.Fragment, null, !initStatus ? Spin : children);
@@ -10,3 +10,5 @@ export declare function createAsyncIterable(options: IOptionsLoader[]): {
10
10
  }>;
11
11
  };
12
12
  };
13
+ export declare function tryCatch(resolveFn: () => Promise<any>, rejectFn?: (e: unknown) => void): Promise<void>;
14
+ export declare function runAsyncIterable(Iterables: any, runtime?: (conf: any) => void, callback?: () => void): void;
@@ -1,3 +1,5 @@
1
+ import _nextTick from "@cloud-app-dev/utils/es/nextTick";
2
+
1
3
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
4
 
3
5
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -12,7 +14,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
12
14
 
13
15
  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; }
14
16
 
15
- import { __awaiter } from "tslib";
17
+ import { __asyncValues, __awaiter } from "tslib";
16
18
  var global = window;
17
19
 
18
20
  if (!global._LOADER_SCRIPT_URL) {
@@ -130,4 +132,116 @@ export function createAsyncIterable(options) {
130
132
  }
131
133
  };
132
134
  });
135
+ }
136
+ export function tryCatch(resolveFn) {
137
+ var rejectFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : console.error;
138
+ return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
139
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
140
+ while (1) {
141
+ switch (_context2.prev = _context2.next) {
142
+ case 0:
143
+ _context2.prev = 0;
144
+ _context2.next = 3;
145
+ return resolveFn();
146
+
147
+ case 3:
148
+ _context2.next = 8;
149
+ break;
150
+
151
+ case 5:
152
+ _context2.prev = 5;
153
+ _context2.t0 = _context2["catch"](0);
154
+ rejectFn(_context2.t0);
155
+
156
+ case 8:
157
+ case "end":
158
+ return _context2.stop();
159
+ }
160
+ }
161
+ }, _callee2, null, [[0, 5]]);
162
+ }));
163
+ }
164
+ export function runAsyncIterable(Iterables, runtime, callback) {
165
+ var _this = this;
166
+
167
+ tryCatch(function () {
168
+ return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
169
+ var e_1, _a, Iterables_1, Iterables_1_1, x;
170
+
171
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
172
+ while (1) {
173
+ switch (_context3.prev = _context3.next) {
174
+ case 0:
175
+ _context3.prev = 0;
176
+ Iterables_1 = __asyncValues(Iterables);
177
+
178
+ case 2:
179
+ _context3.next = 4;
180
+ return Iterables_1.next();
181
+
182
+ case 4:
183
+ Iterables_1_1 = _context3.sent;
184
+
185
+ if (Iterables_1_1.done) {
186
+ _context3.next = 10;
187
+ break;
188
+ }
189
+
190
+ x = Iterables_1_1.value;
191
+ runtime && runtime(Iterables[x]);
192
+
193
+ case 8:
194
+ _context3.next = 2;
195
+ break;
196
+
197
+ case 10:
198
+ _context3.next = 15;
199
+ break;
200
+
201
+ case 12:
202
+ _context3.prev = 12;
203
+ _context3.t0 = _context3["catch"](0);
204
+ e_1 = {
205
+ error: _context3.t0
206
+ };
207
+
208
+ case 15:
209
+ _context3.prev = 15;
210
+ _context3.prev = 16;
211
+
212
+ if (!(Iterables_1_1 && !Iterables_1_1.done && (_a = Iterables_1.return))) {
213
+ _context3.next = 20;
214
+ break;
215
+ }
216
+
217
+ _context3.next = 20;
218
+ return _a.call(Iterables_1);
219
+
220
+ case 20:
221
+ _context3.prev = 20;
222
+
223
+ if (!e_1) {
224
+ _context3.next = 23;
225
+ break;
226
+ }
227
+
228
+ throw e_1.error;
229
+
230
+ case 23:
231
+ return _context3.finish(20);
232
+
233
+ case 24:
234
+ return _context3.finish(15);
235
+
236
+ case 25:
237
+ callback && _nextTick(callback);
238
+
239
+ case 26:
240
+ case "end":
241
+ return _context3.stop();
242
+ }
243
+ }
244
+ }, _callee3, null, [[0, 12, 15, 25], [16,, 20, 24]]);
245
+ }));
246
+ });
133
247
  }
@@ -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
 
@@ -15,7 +15,7 @@ import Drawer from '../Drawer';
15
15
  import ConfigContext from '../ConfigContext';
16
16
 
17
17
  function RefDrawer(_, ref) {
18
- var context = useContext(ConfigContext);
18
+ var context = useContext(ConfigContext.Context);
19
19
  var root = useMemo(function () {
20
20
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
21
21
  }, [context === null || context === void 0 ? void 0 : context.root]);
@@ -15,7 +15,7 @@ import Modal from '../Modal';
15
15
  import ConfigContext from '../ConfigContext';
16
16
 
17
17
  function RefModal(_, ref) {
18
- var context = useContext(ConfigContext);
18
+ var context = useContext(ConfigContext.Context);
19
19
  var root = useMemo(function () {
20
20
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
21
21
  }, [context === null || context === void 0 ? void 0 : context.root]);
@@ -1,4 +1,6 @@
1
- import { RsponseType, XHRResponse } from './interface';
2
- export declare function $http(options: RsponseType): import("fetch-like-axios").AxiosPromise<any>;
3
- export declare const $httpMultiPartInstance: import("fetch-like-axios").AxiosInstance;
4
- export declare const $httpXMLInstance: ({ url, method, data, headers, cancelHttp, isAsync }: XHRResponse) => Promise<unknown>;
1
+ import { AxiosInstance } from 'fetch-like-axios';
2
+ import type { RsponseType, XHRResponse } from './interface';
3
+ declare function http({ cancelHttp, ...newOptions }: RsponseType): Promise<any>;
4
+ declare const httpMultiPartInstance: AxiosInstance;
5
+ declare function httpXMLInstance({ url, method, data, headers, cancelHttp, isAsync }: XHRResponse): Promise<any>;
6
+ export { http as default, http, httpMultiPartInstance, httpXMLInstance };
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
- import fetchAxios from 'fetch-like-axios';
2
+ import Axios from 'fetch-like-axios';
3
3
  import * as Middleware from './middleware';
4
- var CancelToken = fetchAxios.CancelToken;
4
+ var CancelToken = Axios.CancelToken;
5
5
  var config = {
6
6
  baseURL: '/',
7
7
  timeout: 60 * 1000,
@@ -11,7 +11,7 @@ var config = {
11
11
  'Content-Type': 'application/json; charset=utf-8'
12
12
  }
13
13
  };
14
- var httpInstance = fetchAxios.create(config);
14
+ var httpInstance = Axios.create(config);
15
15
  /**
16
16
  * 请求之前拦截动作
17
17
  */
@@ -49,36 +49,38 @@ httpInstance.interceptors.response.use(function (response) {
49
49
 
50
50
  return Promise.reject(error.response);
51
51
  });
52
- export function $http(options) {
52
+
53
+ function http(_a) {
54
+ var cancelHttp = _a.cancelHttp,
55
+ newOptions = __rest(_a, ["cancelHttp"]);
56
+
53
57
  var cancel;
54
58
  var cancelToken = new CancelToken(function (c) {
55
59
  cancel = c;
56
60
 
57
- if (options.cancelHttp) {
58
- options.cancelHttp(cancel);
61
+ if (cancelHttp) {
62
+ cancelHttp(cancel);
59
63
  }
60
64
  });
61
-
62
- var cancelHttp = options.cancelHttp,
63
- newOptions = __rest(options, ["cancelHttp"]);
64
-
65
65
  return httpInstance(Object.assign(Object.assign({}, newOptions), {
66
66
  cancelToken: cancelToken
67
67
  }));
68
68
  }
69
- export var $httpMultiPartInstance = fetchAxios.create({
69
+
70
+ var httpMultiPartInstance = Axios.create({
70
71
  xhrMode: 'fetch',
71
72
  timeout: 10 * 60 * 1000,
72
73
  headers: {
73
74
  'Content-Type': 'multipart/form-data'
74
75
  }
75
76
  });
76
- $httpMultiPartInstance.interceptors.response.use(function (response) {
77
+ httpMultiPartInstance.interceptors.response.use(function (response) {
77
78
  return Promise.resolve(response.data);
78
79
  }, function (error) {
79
80
  return Promise.reject(error);
80
81
  });
81
- export var $httpXMLInstance = function xhrRequest(_ref) {
82
+
83
+ function httpXMLInstance(_ref) {
82
84
  var url = _ref.url,
83
85
  _ref$method = _ref.method,
84
86
  method = _ref$method === void 0 ? 'GET' : _ref$method,
@@ -126,4 +128,6 @@ export var $httpXMLInstance = function xhrRequest(_ref) {
126
128
 
127
129
  xhr.send(data ? JSON.stringify(data) : null);
128
130
  });
129
- };
131
+ }
132
+
133
+ export { http as default, http, httpMultiPartInstance, httpXMLInstance };
@@ -1,3 +1,3 @@
1
- import { IServiceInterface } from './interface';
2
- declare let proxy: IServiceInterface;
3
- export default proxy;
1
+ import type { IServiceInterface } from './interface';
2
+ declare const Service: IServiceInterface;
3
+ export default Service;
@@ -1,14 +1,10 @@
1
- import { $http, $httpMultiPartInstance, $httpXMLInstance } from './http';
1
+ import { http, httpMultiPartInstance, httpXMLInstance } from './http';
2
2
  import { registerResponseMiddleware, registerResponseErrorMiddleware } from './middleware';
3
- import produce from 'immer';
4
- import * as logger from './logger';
5
- var ServiceInterface = {
6
- $http: $http,
7
- $httpXMLInstance: $httpXMLInstance,
8
- $httpMultiPartInstance: $httpMultiPartInstance,
3
+ var Service = {
4
+ http: http,
5
+ httpXMLInstance: httpXMLInstance,
6
+ httpMultiPartInstance: httpMultiPartInstance,
9
7
  registerResponseMiddleware: registerResponseMiddleware,
10
- registerResponseErrorMiddleware: registerResponseErrorMiddleware,
11
- logger: logger
8
+ registerResponseErrorMiddleware: registerResponseErrorMiddleware
12
9
  };
13
- var proxy = produce(ServiceInterface, function () {});
14
- export default proxy;
10
+ export default Service;
@@ -1,8 +1,4 @@
1
- import { AxiosRequestConfig } from 'fetch-like-axios';
2
-
3
- export type loggerType = {
4
- save(options: { description: string; module: string | number; function: string | number }, token?: string): Promise<any>;
5
- };
1
+ import type { AxiosInstance, AxiosRequestConfig } from 'fetch-like-axios';
6
2
 
7
3
  export type RsponseType = AxiosRequestConfig & { requestId?: string; cancelHttp?: (cancel: Function) => void; loggerIndex?: number };
8
4
 
@@ -19,10 +15,9 @@ export type XHRResponse = {
19
15
  export type MiddleWareType = (config: any) => any;
20
16
 
21
17
  export type IServiceInterface = {
22
- $http(options: RsponseType): Promise<any>;
23
- $httpXMLInstance(options: XHRResponse): Promise<any>;
24
- $httpMultiPartInstance(options: AxiosRequestConfig): Promise<any>;
18
+ http(options: RsponseType): Promise<any>;
19
+ httpXMLInstance(options: XHRResponse): Promise<any>;
20
+ httpMultiPartInstance: AxiosInstance;
25
21
  registerResponseMiddleware(fn: MiddleWareType): void;
26
22
  registerResponseErrorMiddleware(fn: MiddleWareType): void;
27
- logger: loggerType;
28
23
  };
@@ -1,4 +1,4 @@
1
- import { MiddleWareType } from './interface';
1
+ import type { MiddleWareType } from './interface';
2
2
  export declare const responseMiddleware: Array<any>;
3
3
  export declare const responseErrorMiddleware: Array<any>;
4
4
  export declare function registerResponseMiddleware(fn: MiddleWareType): void;
@@ -99,7 +99,7 @@ function LevelGroupSelect(_ref) {
99
99
  users: state.userList,
100
100
  chargeLevel: state.chargeLevel
101
101
  });
102
- }, [state.userList, state.chargeLevel]);
102
+ }, [state.userList, state.chargeLevel, onChange]);
103
103
  var renderList = useMemo(function () {
104
104
  return formatRenderGroup(state.userList);
105
105
  }, [state.userList]);
@@ -1,4 +1,5 @@
1
1
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
2
+ import _useCreation from "ahooks/es/useCreation";
2
3
  import "antd/lib/modal/style";
3
4
  import _Modal from "antd/lib/modal";
4
5
 
@@ -23,7 +24,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
23
24
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
25
 
25
26
  import { __awaiter } from "tslib";
26
- import React, { useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
27
+ import React, { useCallback, useImperativeHandle, useRef, useState } from 'react';
27
28
  import { OptionTypes, NodeTemplates, NodeTypes, createVNodeApprover } from './Nodes/Constants';
28
29
  import { downloadBpmnFile, exportBpmnFile as _exportBpmnFile } from './XML';
29
30
  import { createId, getEndEventId } from './XML/utils';
@@ -260,15 +261,18 @@ function WorkerFlow(_ref, ref) {
260
261
  }
261
262
  }
262
263
 
263
- var endId = useMemo(function () {
264
+ var endId = _useCreation(function () {
264
265
  return getEndEventId(config);
265
266
  }, []);
266
- var id = useMemo(function () {
267
+
268
+ var id = _useCreation(function () {
267
269
  return (_data === null || _data === void 0 ? void 0 : _data.id) || createId('Process_001');
268
270
  }, []);
269
- var name = useMemo(function () {
271
+
272
+ var name = _useCreation(function () {
270
273
  return (_data === null || _data === void 0 ? void 0 : _data.name) || "\u5DE5\u4F5C\u6D41_".concat(id);
271
274
  }, [id]);
275
+
272
276
  var getConfig = useCallback(function () {
273
277
  var newConfig = filterNoticeNode(config);
274
278
 
@@ -286,7 +290,7 @@ function WorkerFlow(_ref, ref) {
286
290
  taskList: taskList,
287
291
  useFormKeys: useFormKeys
288
292
  };
289
- }, [config]);
293
+ }, [config, id, name]);
290
294
  /**
291
295
  * @description onChange传递数据
292
296
  */
@@ -303,7 +307,7 @@ function WorkerFlow(_ref, ref) {
303
307
  return {
304
308
  getConfig: getConfig
305
309
  };
306
- }, [config]);
310
+ }, [getConfig]);
307
311
  return /*#__PURE__*/React.createElement(WFC.Provider, {
308
312
  value: {
309
313
  config: config,
package/es/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { default as ImageView } from './ImageView';
20
20
  export { default as InitialConfig } from './InitialConfig';
21
21
  export { default as InitialRequest } from './InitialRequest';
22
22
  export { default as Input } from './Input';
23
+ export { default as InstanceHistory } from './InstanceHistory';
23
24
  export { default as LabelValue } from './LabelValue';
24
25
  export { default as List } from './List';
25
26
  export { default as LoaderApp } from './LoaderApp';
@@ -35,8 +36,8 @@ export { default as ThemeAntd } from './ThemeAntd';
35
36
  export { default as Title } from './Title';
36
37
  export { default as Tree } from './Tree';
37
38
  export { default as useDrawer } from './useDrawer';
39
+ export { default as useHistory } from './useHistory';
38
40
  export { default as useHttp } from './useHttp';
39
41
  export { default as useModal } from './useModal';
40
- export { default as useNavigate } from './useNavigate';
41
42
  export { default as UserSelect } from './UserSelect';
42
43
  export { default as WorkerFlow } from './WorkerFlow';
package/es/index.js CHANGED
@@ -20,6 +20,7 @@ export { default as ImageView } from './ImageView';
20
20
  export { default as InitialConfig } from './InitialConfig';
21
21
  export { default as InitialRequest } from './InitialRequest';
22
22
  export { default as Input } from './Input';
23
+ export { default as InstanceHistory } from './InstanceHistory';
23
24
  export { default as LabelValue } from './LabelValue';
24
25
  export { default as List } from './List';
25
26
  export { default as LoaderApp } from './LoaderApp';
@@ -35,8 +36,8 @@ export { default as ThemeAntd } from './ThemeAntd';
35
36
  export { default as Title } from './Title';
36
37
  export { default as Tree } from './Tree';
37
38
  export { default as useDrawer } from './useDrawer';
39
+ export { default as useHistory } from './useHistory';
38
40
  export { default as useHttp } from './useHttp';
39
41
  export { default as useModal } from './useModal';
40
- export { default as useNavigate } from './useNavigate';
41
42
  export { default as UserSelect } from './UserSelect';
42
43
  export { default as WorkerFlow } from './WorkerFlow';
@@ -20,7 +20,7 @@ import CC from '../ConfigContext';
20
20
 
21
21
  function useDrawer() {
22
22
  var prefixCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cloudapp';
23
- var context = useContext(CC);
23
+ var context = useContext(CC.Context);
24
24
  var root = useMemo(function () {
25
25
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
26
26
  }, [context === null || context === void 0 ? void 0 : context.root]);
@@ -0,0 +1,3 @@
1
+ import type { History } from 'history';
2
+ declare function useHistory(): History<unknown>;
3
+ export default useHistory;
@@ -0,0 +1,11 @@
1
+ import { useMemo } from 'react';
2
+ import InstanceHistory from '../InstanceHistory';
3
+
4
+ function useHistory() {
5
+ var history = useMemo(function () {
6
+ return InstanceHistory;
7
+ }, []);
8
+ return history;
9
+ }
10
+
11
+ export default useHistory;
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
10
10
 
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
- 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); }
13
+ 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); }
14
14
 
15
15
  import { useCallback, useEffect, useMemo, useState } from 'react';
16
16
  var cacheMemory = {};
@@ -20,7 +20,7 @@ import CC from '../ConfigContext';
20
20
 
21
21
  function useModal() {
22
22
  var prefixCls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cloudapp';
23
- var context = useContext(CC);
23
+ var context = useContext(CC.Context);
24
24
  var root = useMemo(function () {
25
25
  return (context === null || context === void 0 ? void 0 : context.root) || document.body;
26
26
  }, [context === null || context === void 0 ? void 0 : context.root]);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "name": "@cloud-app-dev/vidc",
4
4
  "description": "Video Image Data Componennts",
5
- "version": "2.0.0-alpha.14",
5
+ "version": "2.0.0-alpha.18",
6
6
  "scripts": {
7
7
  "start": "dumi dev",
8
8
  "docs:build": "dumi build",
@@ -39,10 +39,11 @@
39
39
  "rc-queue-anim": "^2.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@cloud-app-dev/utils": "^3.0.2",
42
+ "@cloud-app-dev/utils": "^3.0.3",
43
43
  "@types/add-dom-event-listener": "^1.1.0",
44
44
  "@types/chroma-js": "^2.1.3",
45
45
  "@types/lodash-es": "^4.17.5",
46
+ "@types/node": "^17.0.5",
46
47
  "@umijs/test": "^3.0.5",
47
48
  "antd": "^4.17.0",
48
49
  "babel-plugin-import": "^1.13.3",
@@ -50,12 +51,13 @@
50
51
  "father-build": "^1.19.8",
51
52
  "gh-pages": "^3.0.0",
52
53
  "lint-staged": "^10.0.7",
53
- "mobx-react": "^7.2.0",
54
54
  "prettier": "^2.2.1",
55
55
  "react": "^17.0.2",
56
56
  "react-dom": "^17.0.2",
57
57
  "react-router-dom": "^6.2.1",
58
58
  "rollup-plugin-node-polyfills": "^0.2.1",
59
+ "tslib": "^2.3.1",
60
+ "typescript": "^4.5.4",
59
61
  "yorkie": "^2.0.0"
60
62
  },
61
63
  "repository": {
package/tsconfig.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "target": "es6",
5
5
  "module": "esnext",
6
- "lib": ["es2018", "dom"],
6
+ "lib": ["es2018", "dom", "es2019"],
7
7
  "rootDir": "./",
8
8
  "outDir": "es",
9
9
  "moduleResolution": "node",
@@ -1,3 +0,0 @@
1
- export declare function save(data: {
2
- [key: string]: any;
3
- }, token?: string): import("fetch-like-axios").AxiosPromise<any>;
@@ -1,13 +0,0 @@
1
- import _cache from "@cloud-app-dev/utils/es/cache";
2
- import { $http } from './http';
3
- export function save(data, token) {
4
- return $http({
5
- method: 'post',
6
- url: "/api/log/v1/addLog",
7
- data: data,
8
- requestId: 'addLog',
9
- headers: {
10
- Authorization: token || _cache.getCache('token', 'session')
11
- }
12
- });
13
- }
@@ -1,3 +0,0 @@
1
- export declare function formartDesc(desc: string, data: {
2
- [key: string]: any;
3
- }): string;
@@ -1,11 +0,0 @@
1
- export function formartDesc(desc, data) {
2
- try {
3
- Object.keys(data).forEach(function (key) {
4
- desc = desc.replace("<".concat(key, ">"), data[key]);
5
- });
6
- } catch (e) {
7
- console.warn('日志描述转换异常!', e);
8
- }
9
-
10
- return desc;
11
- }
File without changes
@@ -1,4 +0,0 @@
1
- import { NavigateFunction } from 'react-router-dom';
2
- import './index.less';
3
- declare function useNavigate(): NavigateFunction;
4
- export default useNavigate;
@@ -1,14 +0,0 @@
1
- import { useMemo } from 'react';
2
- import { useNavigate as useNativeNavigate } from 'react-router-dom';
3
- import "./index.css";
4
- var _global = window;
5
-
6
- function useNavigate() {
7
- var naticeNavigate = useNativeNavigate();
8
- var navigate = useMemo(function () {
9
- return _global.BasicNavigate || naticeNavigate;
10
- }, [naticeNavigate]);
11
- return navigate;
12
- }
13
-
14
- export default useNavigate;