@cloud-app-dev/vidc 2.0.0-alpha.11 → 2.0.0-alpha.12

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 (155) hide show
  1. package/.umirc.ts +1 -1
  2. package/es/AppRedirect/index.js +7 -11
  3. package/es/AppRoute/index.d.ts +2 -6
  4. package/es/AppRoute/index.js +46 -37
  5. package/es/AppRoute/interface.d.ts +1 -11
  6. package/es/AutoExit/index.js +7 -7
  7. package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
  8. package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
  9. package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
  10. package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
  11. package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
  12. package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
  13. package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
  14. package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
  15. package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
  16. package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
  17. package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
  18. package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
  19. package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
  20. package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
  21. package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
  22. package/es/{ContentBox → Box}/index.css +0 -0
  23. package/es/{ContentBox → Box}/index.d.ts +3 -3
  24. package/es/{ContentBox → Box}/index.js +5 -5
  25. package/es/CheckGroupFixed/index.js +4 -2
  26. package/es/Config/interface.d.ts +3 -1
  27. package/es/DeviceSelect/TreeType.d.ts +6 -0
  28. package/es/DeviceSelect/TreeType.js +36 -0
  29. package/es/DeviceSelect/demo.js +2 -2
  30. package/es/DeviceSelect/index.css +6 -1
  31. package/es/DeviceSelect/index.d.ts +5 -0
  32. package/es/DeviceSelect/index.js +22 -54
  33. package/es/IconFont/index.d.ts +0 -1
  34. package/es/IconFont/index.js +12 -13
  35. package/es/InitialRequest/utils.js +8 -9
  36. package/es/Input/index.js +3 -2
  37. package/es/List/CheckExt.d.ts +3 -5
  38. package/es/List/CheckExt.js +21 -13
  39. package/es/{AppRoute → List/DeviceList}/index.css +0 -0
  40. package/es/List/DeviceList/index.d.ts +11 -0
  41. package/es/{DeviceList → List/DeviceList}/index.js +6 -18
  42. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  43. package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
  44. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  45. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  46. package/es/List/DynamicDeviceList/index.js +205 -0
  47. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  48. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  49. package/es/List/DynamicDeviceList/utils.js +61 -0
  50. package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
  51. package/es/List/DynamicGridList/Demo.js +70 -0
  52. package/es/List/DynamicGridList/index.d.ts +26 -0
  53. package/es/List/DynamicGridList/index.js +73 -0
  54. package/es/List/GridList/Demo.d.ts +2 -0
  55. package/es/List/GridList/Demo.js +91 -0
  56. package/es/List/GridList/hook.d.ts +13 -0
  57. package/es/List/GridList/hook.js +301 -0
  58. package/es/List/GridList/index.css +7 -0
  59. package/es/List/GridList/index.d.ts +15 -0
  60. package/es/List/GridList/index.js +47 -0
  61. package/es/List/GridList/interface.d.ts +59 -0
  62. package/es/List/GridList/utils.d.ts +9 -0
  63. package/es/List/GridList/utils.js +43 -0
  64. package/es/List/ListExt/index.css +3 -0
  65. package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
  66. package/es/{ListExt → List/ListExt}/index.js +3 -3
  67. package/es/List/VList/index.css +6 -0
  68. package/es/List/VList/index.d.ts +18 -0
  69. package/es/List/VList/index.js +51 -0
  70. package/es/List/VList/utils.d.ts +14 -0
  71. package/es/{VList → List/VList}/utils.js +0 -0
  72. package/es/List/index.css +11 -12
  73. package/es/List/index.d.ts +5 -70
  74. package/es/List/index.js +32 -25
  75. package/es/List/interface.d.ts +87 -0
  76. package/es/List/renderItem.d.ts +1 -1
  77. package/es/List/renderItem.js +13 -10
  78. package/es/LoaderApp/index.js +4 -1
  79. package/es/LoaderScript/utils.js +60 -37
  80. package/es/Service/http.d.ts +1 -1
  81. package/es/Service/http.js +2 -8
  82. package/es/TableLayout/index.d.ts +3 -0
  83. package/es/TableLayout/index.js +14 -45
  84. package/es/{TreeTitle → Title}/index.css +5 -5
  85. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  86. package/es/{TreeTitle → Title}/index.js +7 -4
  87. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  88. package/es/Tree/BaseTree/demo.js +69 -0
  89. package/es/Tree/BaseTree/index.css +64 -0
  90. package/es/Tree/BaseTree/index.d.ts +24 -0
  91. package/es/Tree/BaseTree/index.js +83 -0
  92. package/es/Tree/demo.js +19 -56
  93. package/es/Tree/index.css +29 -55
  94. package/es/Tree/index.d.ts +19 -20
  95. package/es/Tree/index.js +185 -70
  96. package/es/UserSelect/index.js +6 -4
  97. package/es/WorkerFlow/Form/Condition.js +2 -4
  98. package/es/WorkerFlow/Form/FormAuth.js +2 -2
  99. package/es/WorkerFlow/Form/GroupList.js +2 -2
  100. package/es/WorkerFlow/Form/GroupSelectModalContent.js +1 -1
  101. package/es/WorkerFlow/Form/UserSelectModalContent.js +2 -2
  102. package/es/WorkerFlow/Form/UserSet.js +2 -2
  103. package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
  104. package/es/WorkerFlow/index.css +9 -3
  105. package/es/WorkerFlow/index.js +3 -2
  106. package/es/index.d.ts +3 -11
  107. package/es/index.js +3 -11
  108. package/es/useDrawer/index.d.ts +1 -1
  109. package/es/useDrawer/index.js +2 -1
  110. package/es/useModal/index.d.ts +1 -1
  111. package/es/useModal/index.js +2 -1
  112. package/es/{IconFont → useNavigate}/index.css +0 -0
  113. package/es/useNavigate/index.d.ts +4 -0
  114. package/es/useNavigate/index.js +14 -0
  115. package/es/utils.d.ts +9 -0
  116. package/es/utils.js +36 -1
  117. package/package.json +4 -8
  118. package/es/AppRoute/Render.d.ts +0 -23
  119. package/es/AppRoute/Render.js +0 -111
  120. package/es/AppRoute/Rendered.d.ts +0 -4
  121. package/es/AppRoute/Rendered.js +0 -11
  122. package/es/AppRoute/utils.d.ts +0 -1
  123. package/es/AppRoute/utils.js +0 -28
  124. package/es/DeviceList/index.css +0 -32
  125. package/es/DeviceList/index.d.ts +0 -14
  126. package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
  127. package/es/DynamicDeviceList/CheckExt.js +0 -36
  128. package/es/DynamicDeviceList/Demo.js +0 -17
  129. package/es/DynamicDeviceList/index.d.ts +0 -35
  130. package/es/DynamicDeviceList/index.js +0 -224
  131. package/es/DynamicDeviceList/utils.d.ts +0 -2
  132. package/es/DynamicDeviceList/utils.js +0 -15
  133. package/es/DynamicList/index.css +0 -7
  134. package/es/DynamicList/index.d.ts +0 -31
  135. package/es/DynamicList/index.js +0 -132
  136. package/es/List/utils.d.ts +0 -5
  137. package/es/List/utils.js +0 -18
  138. package/es/ListExt/index.css +0 -9
  139. package/es/ScrollList/index.css +0 -73
  140. package/es/ScrollList/index.d.ts +0 -24
  141. package/es/ScrollList/index.js +0 -262
  142. package/es/ScrollList/utils.js +0 -84
  143. package/es/TreeMode/demo.js +0 -32
  144. package/es/TreeMode/index.css +0 -38
  145. package/es/TreeMode/index.d.ts +0 -23
  146. package/es/TreeMode/index.js +0 -201
  147. package/es/VList/index.css +0 -4
  148. package/es/VList/index.d.ts +0 -16
  149. package/es/VList/index.js +0 -56
  150. package/es/VList/utils.d.ts +0 -10
  151. package/es/useChangeEffect/index.d.ts +0 -3
  152. package/es/useChangeEffect/index.js +0 -32
  153. package/es/useHistory/index.css +0 -0
  154. package/es/useHistory/index.d.ts +0 -3
  155. package/es/useHistory/index.js +0 -14
package/.umirc.ts CHANGED
@@ -2,7 +2,7 @@ import { defineConfig } from 'dumi';
2
2
  import path from 'path';
3
3
 
4
4
  const token =
5
- 'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTYzODY4NzgyNzEwNywidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjM4NDI4NjI3MTA3fQ.eEvUc9_eGBdUi2QCMDNjOYgTzTKwiLX-7DEQ_O9kjhs';
5
+ 'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTY0MDQwOTc4NjQ3OCwidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjQwMTUwNTg2NDc4fQ.9a8me82dxS_DJ52Ac8eBu1Y2Gigs7mZ6Cm3Rd-tj5Vk';
6
6
 
7
7
  export default defineConfig({
8
8
  title: '云应用-业务组件库',
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { useLocation } from 'react-router-dom';
3
- import useHistory from '../useHistory';
3
+ import useNavigate from '../useNavigate';
4
4
  import "./index.css";
5
5
 
6
6
  var getKey = function getKey() {
@@ -10,24 +10,20 @@ var getKey = function getKey() {
10
10
  function AppRedirect(_ref) {
11
11
  var path = _ref.path,
12
12
  to = _ref.to;
13
- var history = useHistory();
13
+ var navigate = useNavigate();
14
14
  var location = useLocation();
15
15
  useEffect(function () {
16
16
  if (path === location.pathname) {
17
17
  if (typeof to !== 'string') {
18
- history.replace(Object.assign(Object.assign({}, to), {
19
- search: to.search ? "".concat(to.search, "&key=").concat(getKey()) : "?key=".concat(getKey()),
18
+ navigate("".concat(to.pathname).concat(to.search ? "".concat(to.search, "&key=").concat(getKey()) : "?key=".concat(getKey())), {
19
+ replace: true,
20
20
  state: Object.assign({}, to.state, {
21
21
  isReplace: true
22
22
  })
23
- }));
23
+ });
24
24
  } else {
25
- history.push({
26
- pathname: to,
27
- search: "?key".concat(getKey()),
28
- state: {
29
- isReplace: true
30
- }
25
+ navigate("".concat(to, "?key").concat(getKey()), {
26
+ replace: true
31
27
  });
32
28
  }
33
29
  }
@@ -1,14 +1,10 @@
1
1
  import React from 'react';
2
- import { match } from 'react-router-dom';
3
- import { IAppRouteType, IAppRouteProps } from './interface';
4
- import * as H from 'history';
5
- import './index.less';
6
- declare class AppRoute extends React.Component<IAppRouteProps, IAppRouteType> {
2
+ import { IAppRouteProps } from './interface';
3
+ declare class AppRoute extends React.PureComponent<IAppRouteProps, any> {
7
4
  private isRender;
8
5
  constructor(props: IAppRouteProps);
9
6
  shouldComponentUpdate(props: IAppRouteProps): boolean;
10
7
  componentWillUnmount(): void;
11
- setRouteProps: (newMatch: match<any>, newLocation: H.Location<any>, history: H.History<any>) => void;
12
8
  render(): JSX.Element;
13
9
  }
14
10
  export default AppRoute;
@@ -1,8 +1,8 @@
1
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); }
2
2
 
3
- import _logger from "@cloud-app-dev/utils/es/logger";
4
3
  import _cache from "@cloud-app-dev/utils/es/cache";
5
- import _isEqual from "@cloud-app-dev/utils/es/isEqual";
4
+ import _useUnmount from "ahooks/es/useUnmount";
5
+ import _useMount from "ahooks/es/useMount";
6
6
 
7
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
8
 
@@ -25,13 +25,26 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
25
25
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
26
26
 
27
27
  import React from 'react';
28
- import { RenderComponents, RenderRoutes, RenderSingleRoute } from './Render';
29
- import Rendered from './Rendered';
30
- import "./index.css";
28
+ import { Route } from 'react-router-dom';
31
29
  var _global = window;
32
30
 
33
- var AppRoute = /*#__PURE__*/function (_React$Component) {
34
- _inherits(AppRoute, _React$Component);
31
+ function RenderSingleRoute(_ref) {
32
+ var onMount = _ref.onMount,
33
+ onUnmount = _ref.onUnmount;
34
+
35
+ _useMount(function () {
36
+ return onMount();
37
+ });
38
+
39
+ _useUnmount(function () {
40
+ return onUnmount();
41
+ });
42
+
43
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
44
+ }
45
+
46
+ var AppRoute = /*#__PURE__*/function (_React$PureComponent) {
47
+ _inherits(AppRoute, _React$PureComponent);
35
48
 
36
49
  var _super = _createSuper(AppRoute);
37
50
 
@@ -40,24 +53,11 @@ var AppRoute = /*#__PURE__*/function (_React$Component) {
40
53
 
41
54
  _classCallCheck(this, AppRoute);
42
55
 
43
- _this = _super.call(this, props);
44
-
45
- _this.setRouteProps = function (newMatch, newLocation, history) {
46
- if (!_isEqual(_this.props.match, newMatch)) {
47
- _this.setState({
48
- match: newMatch,
49
- location: newLocation,
50
- history: history
51
- });
52
- }
53
- }; //可能存在路由创建但是没有render 导致UI无法渲染
54
-
56
+ _this = _super.call(this, props); //可能存在路由创建但是没有render 导致UI无法渲染
55
57
 
56
58
  _this.isRender = false;
57
59
  _this.state = {
58
- match: undefined,
59
- location: undefined,
60
- history: undefined
60
+ isMatch: false
61
61
  };
62
62
  return _this;
63
63
  }
@@ -74,33 +74,42 @@ var AppRoute = /*#__PURE__*/function (_React$Component) {
74
74
  }, {
75
75
  key: "componentWillUnmount",
76
76
  value: function componentWillUnmount() {
77
- _logger.debug('路由销毁');
77
+ console.debug('路由销毁');
78
78
  }
79
79
  }, {
80
80
  key: "render",
81
81
  value: function render() {
82
82
  var _this2 = this;
83
83
 
84
- var _this$state = this.state,
85
- match = _this$state.match,
86
- location = _this$state.location;
87
- var isRouteMath = match && location;
88
- return /*#__PURE__*/React.createElement(React.Fragment, null, this.props.routes ? /*#__PURE__*/React.createElement(RenderRoutes, Object.assign({}, this.props, {
89
- setRouteProps: this.setRouteProps
90
- })) : /*#__PURE__*/React.createElement(RenderSingleRoute, Object.assign({}, this.props, {
91
- setRouteProps: this.setRouteProps
92
- })), isRouteMath && /*#__PURE__*/React.createElement(RenderComponents, {
93
- state: this.state,
94
- props: this.props
95
- }), isRouteMath && /*#__PURE__*/React.createElement(Rendered, {
96
- onRendered: function onRendered() {
84
+ var _this$props = this.props,
85
+ element = _this$props.element,
86
+ path = _this$props.path;
87
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Route, {
88
+ path: path,
89
+ element: /*#__PURE__*/React.createElement(RenderSingleRoute, {
90
+ onMount: function onMount() {
91
+ return _this2.setState({
92
+ isMatch: true
93
+ });
94
+ },
95
+ onUnmount: function onUnmount() {
96
+ return _this2.setState({
97
+ isMatch: false
98
+ });
99
+ }
100
+ })
101
+ }), this.state.isMatch && element, /*#__PURE__*/React.createElement(RenderSingleRoute, {
102
+ onMount: function onMount() {
97
103
  return _this2.isRender = true;
104
+ },
105
+ onUnmount: function onUnmount() {
106
+ return _this2.isRender = false;
98
107
  }
99
108
  }));
100
109
  }
101
110
  }]);
102
111
 
103
112
  return AppRoute;
104
- }(React.Component);
113
+ }(React.PureComponent);
105
114
 
106
115
  export default AppRoute;
@@ -1,18 +1,8 @@
1
1
  import * as H from 'history';
2
- import { RouteProps, match } from 'react-router-dom';
3
-
4
- export interface IAppRouteType {
5
- match?: match<any>;
6
- location?: H.Location | undefined;
7
- history?: H.History;
8
- }
2
+ import { RouteProps } from 'react-router-dom';
9
3
 
10
4
  export interface IAppRouteProps extends RouteProps, IAppRouteType {
11
5
  routes?: RouteProps[];
12
6
  tabId?: string;
13
7
  currentId?: string;
14
8
  }
15
-
16
- export interface IRenderRouteProps extends IAppRouteType {
17
- setRouteProps: (match: match<any>, location: H.Location, history: H.History) => void;
18
- }
@@ -1,5 +1,6 @@
1
+ import _useMount from "ahooks/es/useMount";
1
2
  import React, { useContext } from 'react';
2
- import useHistory from '../useHistory';
3
+ import useNavigate from '../useNavigate';
3
4
  import AppContext from '../AppContext';
4
5
 
5
6
  function AutoExit(_ref) {
@@ -8,14 +9,13 @@ function AutoExit(_ref) {
8
9
  var _useContext = useContext(AppContext.Context),
9
10
  loginStatus = _useContext.loginStatus;
10
11
 
11
- var history = useHistory();
12
+ var navigate = useNavigate();
12
13
 
13
- if (!loginStatus) {
14
- history.replace('/login');
15
- return null;
16
- }
14
+ _useMount(function () {
15
+ !loginStatus && navigate('/login');
16
+ });
17
17
 
18
- return /*#__PURE__*/React.createElement(React.Fragment, null, children);
18
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !loginStatus ? children : null);
19
19
  }
20
20
 
21
21
  export default AutoExit;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,10 +5,10 @@ export interface ContentBoxProps {
5
5
  contentGrid?: any;
6
6
  children?: React.ReactNode;
7
7
  }
8
- declare function ContentBox({ className, contentGrid, children }: ContentBoxProps): JSX.Element;
9
- declare namespace ContentBox {
8
+ declare function Box({ className, contentGrid, children }: ContentBoxProps): JSX.Element;
9
+ declare namespace Box {
10
10
  var TwoColumnBox: typeof import("./TwoColumnBox").default;
11
11
  var InfoBox: typeof import("./InfoBox").default;
12
12
  var BetweenBox: typeof import("./BetweenBox").default;
13
13
  }
14
- export default ContentBox;
14
+ export default Box;
@@ -9,7 +9,7 @@ import defaultContentGrid from './deps/content-grid';
9
9
  import BetweenBox from './BetweenBox';
10
10
  import "./index.css";
11
11
 
12
- function ContentBox(_ref) {
12
+ function Box(_ref) {
13
13
  var _ref$className = _ref.className,
14
14
  className = _ref$className === void 0 ? '' : _ref$className,
15
15
  _ref$contentGrid = _ref.contentGrid,
@@ -22,7 +22,7 @@ function ContentBox(_ref) {
22
22
  }, contentGrid), children));
23
23
  }
24
24
 
25
- ContentBox.TwoColumnBox = TwoColumnBox;
26
- ContentBox.InfoBox = InfoBox;
27
- ContentBox.BetweenBox = BetweenBox;
28
- export default ContentBox;
25
+ Box.TwoColumnBox = TwoColumnBox;
26
+ Box.InfoBox = InfoBox;
27
+ Box.BetweenBox = BetweenBox;
28
+ export default Box;
@@ -2,6 +2,7 @@ import "antd/lib/badge/style";
2
2
  import _Badge from "antd/lib/badge";
3
3
  import "antd/lib/checkbox/style";
4
4
  import _Checkbox from "antd/lib/checkbox";
5
+ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
5
6
 
6
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
8
 
@@ -16,7 +17,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
18
 
18
19
  import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
19
- import useChangeEffect from '../useChangeEffect';
20
20
  import "./index.css";
21
21
 
22
22
  function CheckGroupFixed(_ref) {
@@ -72,9 +72,11 @@ function CheckGroupFixed(_ref) {
72
72
  boxShadow: ' 0 0 10px rgba(0,0,0,0.1)'
73
73
  } : {};
74
74
  }, [state.sider, state.w]);
75
- useChangeEffect(function () {
75
+
76
+ _useUpdateEffect(function () {
76
77
  return onChange && onChange(state.selectKeys);
77
78
  }, [state.selectKeys]);
79
+
78
80
  useLayoutEffect(function () {
79
81
  var dom = domRef.current.querySelector('.check-box-group-layout');
80
82
  dom === null || dom === void 0 ? void 0 : dom.setAttribute('style', "grid-template-columns:repeat(auto-fill, minmax(".concat(checboxSize, "px, 1fr));"));
@@ -21,6 +21,7 @@ export type FeatureItemType = {
21
21
  sort: number;
22
22
  children?: FeatureItemType[];
23
23
  parentId?: string;
24
+ level?: number;
24
25
  };
25
26
 
26
27
  export type BSConfigType = {
@@ -34,6 +35,7 @@ export type BSConfigType = {
34
35
  AppTimeOut: number;
35
36
  shortcut: string;
36
37
  download: { chrome: string; player: string };
38
+ [key: string]: any;
37
39
  };
38
40
 
39
41
  export type ThemeInfoType = {
@@ -44,7 +46,7 @@ export type ThemeInfoType = {
44
46
  };
45
47
  };
46
48
 
47
- export type ConfigKey = 'app' | 'feature' | 'pFeature' | 'bs';
49
+ export type ConfigKey = 'app' | 'feature' | 'featureIds' | 'bs' | 'theme';
48
50
 
49
51
  export type ConfigJOSN = {
50
52
  app: { [key: string]: AppItemType };
@@ -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,12 +19,11 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
28
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
20
 
30
21
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
31
- import TreeMode from '../TreeMode';
32
- import DynamicDeviceList from '../DynamicDeviceList';
33
- import DeviceList from '../DeviceList';
34
- import uniq from 'lodash-es/uniq';
35
- import uniqBy from 'lodash-es/uniqBy';
36
- import IconFont from '../IconFont';
22
+ import TreeMode from '../Tree';
23
+ import DynamicDeviceList from '../List/DynamicDeviceList';
24
+ import DeviceList from '../List/DeviceList';
25
+ import { uniq, uniqBy } from 'lodash-es';
26
+ import TreeType from './TreeType';
37
27
  import "./index.css";
38
28
 
39
29
  function DeviceSelect(_ref) {
@@ -163,61 +153,39 @@ function DeviceSelect(_ref) {
163
153
  var treeSelectedKeys = useMemo(function () {
164
154
  return state.mode === 'Bz' ? [state.buzGroupId] : [state.areaCode];
165
155
  }, [state.mode, state.buzGroupId, state.areaCode]);
166
- return /*#__PURE__*/React.createElement(_Row, {
156
+ return /*#__PURE__*/React.createElement("div", {
167
157
  className: "vidc-device-select-layout"
168
- }, /*#__PURE__*/React.createElement(_Col, {
169
- span: 7
170
158
  }, /*#__PURE__*/React.createElement(TreeMode, {
171
- key: state.mode,
172
159
  mode: state.mode,
173
160
  inputPlaceholder: "\u8BF7\u8F93\u5165\u540D\u79F0",
174
161
  onSelect: onSelectTree,
175
162
  selectedKeys: treeSelectedKeys,
176
- title: /*#__PURE__*/React.createElement(_Dropdown, {
177
- overlay: /*#__PURE__*/React.createElement(_Menu, {
178
- onClick: function onClick(info) {
179
- return setState(function (old) {
180
- return Object.assign(Object.assign({}, old), {
181
- mode: info.key
182
- });
163
+ title: /*#__PURE__*/React.createElement(TreeType, {
164
+ mode: state.mode,
165
+ onChange: function onChange(mode) {
166
+ return setState(function (old) {
167
+ return Object.assign(Object.assign({}, old), {
168
+ mode: mode
183
169
  });
184
- }
185
- }, /*#__PURE__*/React.createElement(_Menu.Item, {
186
- style: {
187
- fontSize: 12
188
- },
189
- key: "Bz"
190
- }, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
191
- style: {
192
- fontSize: 12
193
- },
194
- key: "Place"
195
- }, "\u884C\u653F\u533A\u5212"))
196
- }, /*#__PURE__*/React.createElement("span", null, state.mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(IconFont, {
197
- style: {
198
- position: 'relative',
199
- top: 1
200
- },
201
- type: "icon-S_Arrow_BigDown"
202
- })))
203
- })), /*#__PURE__*/React.createElement(_Col, {
204
- span: 8
205
- }, /*#__PURE__*/React.createElement(DynamicDeviceList, {
170
+ });
171
+ }
172
+ })
173
+ }), /*#__PURE__*/React.createElement(DynamicDeviceList, {
206
174
  title: "\u8BBE\u5907\u5217\u8868",
207
175
  onChecked: onCheked1,
176
+ key: state.mode,
208
177
  checkedKeys: state.tempSelectIds,
209
178
  params: listParams
210
- })), /*#__PURE__*/React.createElement(_Col, {
211
- span: 1
212
- }), /*#__PURE__*/React.createElement(_Col, {
213
- span: 8
214
- }, /*#__PURE__*/React.createElement(DeviceList, {
179
+ }), /*#__PURE__*/React.createElement(DeviceList, {
215
180
  itemKey: "cid",
216
181
  deviceList: state.selectDevices || [],
217
182
  onChecked: onCheked2,
218
183
  checkedKeys: state.selectIds,
219
184
  title: "\u5DF2\u9009\u8BBE\u5907\u5217\u8868"
220
- })));
185
+ }));
221
186
  }
222
187
 
188
+ DeviceSelect.defaultProps = {
189
+ className: ''
190
+ };
223
191
  export default DeviceSelect;
@@ -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,