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

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 (198) hide show
  1. package/.fatherrc.js +11 -4
  2. package/.umirc.ts +1 -1
  3. package/es/Api/index.js +7 -7
  4. package/es/AppRedirect/index.d.ts +1 -1
  5. package/es/AppRedirect/index.js +7 -12
  6. package/es/Auth/index.js +1 -1
  7. package/es/AutoExit/index.js +12 -10
  8. package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
  9. package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
  10. package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
  11. package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
  12. package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
  13. package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
  14. package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
  15. package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
  16. package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
  17. package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
  18. package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
  19. package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
  20. package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
  21. package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
  22. package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
  23. package/es/{ContentBox → Box}/index.css +0 -0
  24. package/es/{ContentBox → Box}/index.d.ts +3 -3
  25. package/es/{ContentBox → Box}/index.js +5 -5
  26. package/es/CheckGroupFixed/index.js +4 -2
  27. package/es/Config/index.js +12 -12
  28. package/es/Config/interface.d.ts +6 -4
  29. package/es/ConfigContext/index.d.ts +15 -2
  30. package/es/ConfigContext/index.js +25 -3
  31. package/es/DeviceSelect/TreeType.d.ts +6 -0
  32. package/es/DeviceSelect/TreeType.js +36 -0
  33. package/es/DeviceSelect/demo.js +2 -2
  34. package/es/DeviceSelect/index.css +6 -1
  35. package/es/DeviceSelect/index.d.ts +5 -0
  36. package/es/DeviceSelect/index.js +22 -54
  37. package/es/Dict/desc.js +3 -3
  38. package/es/Dict/utils.js +3 -3
  39. package/es/HightLevel/index.js +1 -2
  40. package/es/IconFont/index.d.ts +0 -1
  41. package/es/IconFont/index.js +12 -13
  42. package/es/InitialConfig/index.js +7 -4
  43. package/es/InitialConfig/utils.d.ts +5 -0
  44. package/es/InitialConfig/utils.js +33 -6
  45. package/es/InitialRequest/index.d.ts +3 -1
  46. package/es/InitialRequest/index.js +20 -18
  47. package/es/InitialRequest/utils.d.ts +4 -3
  48. package/es/InitialRequest/utils.js +26 -27
  49. package/es/Input/index.js +3 -2
  50. package/es/InstanceHistory/index.d.ts +3 -0
  51. package/es/InstanceHistory/index.js +9 -0
  52. package/es/List/CheckExt.d.ts +3 -5
  53. package/es/List/CheckExt.js +21 -13
  54. package/es/{AppRoute → List/DeviceList}/index.css +0 -0
  55. package/es/List/DeviceList/index.d.ts +11 -0
  56. package/es/{DeviceList → List/DeviceList}/index.js +6 -18
  57. package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
  58. package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
  59. package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
  60. package/es/List/DynamicDeviceList/index.d.ts +11 -0
  61. package/es/List/DynamicDeviceList/index.js +205 -0
  62. package/es/List/DynamicDeviceList/interface.d.ts +37 -0
  63. package/es/List/DynamicDeviceList/utils.d.ts +16 -0
  64. package/es/List/DynamicDeviceList/utils.js +61 -0
  65. package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
  66. package/es/List/DynamicGridList/Demo.js +70 -0
  67. package/es/List/DynamicGridList/index.d.ts +26 -0
  68. package/es/List/DynamicGridList/index.js +73 -0
  69. package/es/List/GridList/Demo.d.ts +2 -0
  70. package/es/List/GridList/Demo.js +91 -0
  71. package/es/List/GridList/hook.d.ts +13 -0
  72. package/es/List/GridList/hook.js +301 -0
  73. package/es/List/GridList/index.css +7 -0
  74. package/es/List/GridList/index.d.ts +15 -0
  75. package/es/List/GridList/index.js +47 -0
  76. package/es/List/GridList/interface.d.ts +59 -0
  77. package/es/List/GridList/utils.d.ts +9 -0
  78. package/es/List/GridList/utils.js +43 -0
  79. package/es/List/ListExt/index.css +3 -0
  80. package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
  81. package/es/{ListExt → List/ListExt}/index.js +3 -3
  82. package/es/List/VList/index.css +6 -0
  83. package/es/List/VList/index.d.ts +18 -0
  84. package/es/List/VList/index.js +51 -0
  85. package/es/List/VList/utils.d.ts +14 -0
  86. package/es/{VList → List/VList}/utils.js +0 -0
  87. package/es/List/index.css +11 -12
  88. package/es/List/index.d.ts +5 -70
  89. package/es/List/index.js +32 -25
  90. package/es/List/interface.d.ts +87 -0
  91. package/es/List/renderItem.d.ts +1 -1
  92. package/es/List/renderItem.js +13 -10
  93. package/es/LoaderApp/index.d.ts +1 -1
  94. package/es/LoaderApp/index.js +18 -18
  95. package/es/LoaderApp/utils.d.ts +2 -1
  96. package/es/LoaderApp/utils.js +6 -3
  97. package/es/LoaderScript/index.js +7 -89
  98. package/es/LoaderScript/utils.d.ts +2 -0
  99. package/es/LoaderScript/utils.js +170 -33
  100. package/es/Picture/component/MoveContent/index.js +3 -3
  101. package/es/Picture/index.js +1 -1
  102. package/es/Picture/utils.js +1 -1
  103. package/es/RefDrawer/index.js +1 -1
  104. package/es/RefModal/index.js +1 -1
  105. package/es/Service/http.d.ts +6 -4
  106. package/es/Service/http.js +20 -22
  107. package/es/Service/index.d.ts +3 -3
  108. package/es/Service/index.js +7 -11
  109. package/es/Service/interface.d.ts +5 -11
  110. package/es/Service/middleware.d.ts +1 -1
  111. package/es/Service/middleware.js +1 -1
  112. package/es/TableLayout/index.d.ts +3 -0
  113. package/es/TableLayout/index.js +14 -45
  114. package/es/{TreeTitle → Title}/index.css +5 -5
  115. package/es/{TreeTitle → Title}/index.d.ts +2 -2
  116. package/es/{TreeTitle → Title}/index.js +7 -4
  117. package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
  118. package/es/Tree/BaseTree/demo.js +69 -0
  119. package/es/Tree/BaseTree/index.css +64 -0
  120. package/es/Tree/BaseTree/index.d.ts +24 -0
  121. package/es/Tree/BaseTree/index.js +83 -0
  122. package/es/Tree/demo.js +19 -56
  123. package/es/Tree/index.css +29 -55
  124. package/es/Tree/index.d.ts +19 -20
  125. package/es/Tree/index.js +185 -70
  126. package/es/UserSelect/index.js +7 -8
  127. package/es/WorkerFlow/Form/Condition.js +2 -4
  128. package/es/WorkerFlow/Form/EmptyUserSet.js +1 -1
  129. package/es/WorkerFlow/Form/FormAuth.js +3 -3
  130. package/es/WorkerFlow/Form/GroupList.js +2 -2
  131. package/es/WorkerFlow/Form/GroupSelect.js +1 -1
  132. package/es/WorkerFlow/Form/GroupSelectModalContent.js +2 -3
  133. package/es/WorkerFlow/Form/LevelGroupSelect.js +2 -2
  134. package/es/WorkerFlow/Form/UserAndGroupSelect.js +1 -1
  135. package/es/WorkerFlow/Form/UserSelect.js +1 -1
  136. package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -6
  137. package/es/WorkerFlow/Form/UserSet.js +3 -3
  138. package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
  139. package/es/WorkerFlow/index.css +9 -3
  140. package/es/WorkerFlow/index.js +14 -9
  141. package/es/WorkerFlow/utils.js +1 -1
  142. package/es/index.d.ts +3 -11
  143. package/es/index.js +3 -11
  144. package/es/useDrawer/index.d.ts +1 -1
  145. package/es/useDrawer/index.js +3 -2
  146. package/es/useHistory/index.d.ts +2 -2
  147. package/es/useHistory/index.js +3 -6
  148. package/es/useHttp/index.js +1 -1
  149. package/es/useModal/index.d.ts +1 -1
  150. package/es/useModal/index.js +3 -2
  151. package/es/utils.d.ts +9 -0
  152. package/es/utils.js +36 -1
  153. package/package.json +10 -11
  154. package/tsconfig.json +1 -1
  155. package/es/AppRoute/Render.d.ts +0 -23
  156. package/es/AppRoute/Render.js +0 -111
  157. package/es/AppRoute/Rendered.d.ts +0 -4
  158. package/es/AppRoute/Rendered.js +0 -11
  159. package/es/AppRoute/index.d.ts +0 -14
  160. package/es/AppRoute/index.js +0 -106
  161. package/es/AppRoute/interface.d.ts +0 -18
  162. package/es/AppRoute/utils.d.ts +0 -1
  163. package/es/AppRoute/utils.js +0 -28
  164. package/es/DeviceList/index.css +0 -32
  165. package/es/DeviceList/index.d.ts +0 -14
  166. package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
  167. package/es/DynamicDeviceList/CheckExt.js +0 -36
  168. package/es/DynamicDeviceList/Demo.js +0 -17
  169. package/es/DynamicDeviceList/index.d.ts +0 -35
  170. package/es/DynamicDeviceList/index.js +0 -224
  171. package/es/DynamicDeviceList/utils.d.ts +0 -2
  172. package/es/DynamicDeviceList/utils.js +0 -15
  173. package/es/DynamicList/index.css +0 -7
  174. package/es/DynamicList/index.d.ts +0 -31
  175. package/es/DynamicList/index.js +0 -132
  176. package/es/IconFont/index.css +0 -0
  177. package/es/List/utils.d.ts +0 -5
  178. package/es/List/utils.js +0 -18
  179. package/es/ListExt/index.css +0 -9
  180. package/es/ScrollList/index.css +0 -73
  181. package/es/ScrollList/index.d.ts +0 -24
  182. package/es/ScrollList/index.js +0 -262
  183. package/es/ScrollList/utils.js +0 -84
  184. package/es/Service/logger.d.ts +0 -3
  185. package/es/Service/logger.js +0 -13
  186. package/es/Service/utils.d.ts +0 -3
  187. package/es/Service/utils.js +0 -11
  188. package/es/TreeMode/demo.js +0 -32
  189. package/es/TreeMode/index.css +0 -38
  190. package/es/TreeMode/index.d.ts +0 -23
  191. package/es/TreeMode/index.js +0 -201
  192. package/es/VList/index.css +0 -4
  193. package/es/VList/index.d.ts +0 -16
  194. package/es/VList/index.js +0 -56
  195. package/es/VList/utils.d.ts +0 -10
  196. package/es/useChangeEffect/index.d.ts +0 -3
  197. package/es/useChangeEffect/index.js +0 -32
  198. package/es/useHistory/index.css +0 -0
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/.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: '云应用-业务组件库',
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',
@@ -10,7 +10,7 @@ interface AppRedirectProps {
10
10
  * @description 重定向路径
11
11
  * @description -
12
12
  */
13
- to: H.LocationDescriptor<any>;
13
+ to: H.Location;
14
14
  }
15
15
  declare function AppRedirect({ path, to }: AppRedirectProps): JSX.Element;
16
16
  export default AppRedirect;
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect } from 'react';
2
- import { useLocation } from 'react-router-dom';
3
- import useHistory from '../useHistory';
2
+ import { useLocation, useNavigate } from 'react-router-dom';
4
3
  import "./index.css";
5
4
 
6
5
  var getKey = function getKey() {
@@ -10,24 +9,20 @@ var getKey = function getKey() {
10
9
  function AppRedirect(_ref) {
11
10
  var path = _ref.path,
12
11
  to = _ref.to;
13
- var history = useHistory();
12
+ var navigate = useNavigate();
14
13
  var location = useLocation();
15
14
  useEffect(function () {
16
15
  if (path === location.pathname) {
17
16
  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()),
17
+ navigate("".concat(to.pathname).concat(to.search ? "".concat(to.search, "&key=").concat(getKey()) : "?key=".concat(getKey())), {
18
+ replace: true,
20
19
  state: Object.assign({}, to.state, {
21
20
  isReplace: true
22
21
  })
23
- }));
22
+ });
24
23
  } else {
25
- history.push({
26
- pathname: to,
27
- search: "?key".concat(getKey()),
28
- state: {
29
- isReplace: true
30
- }
24
+ navigate("".concat(to, "?key").concat(getKey()), {
25
+ replace: true
31
26
  });
32
27
  }
33
28
  }
package/es/Auth/index.js CHANGED
@@ -7,7 +7,7 @@ function Auth(_ref) {
7
7
  children = _ref.children;
8
8
  var action = useMemo(function () {
9
9
  return !!Config.feature.find(function (v) {
10
- return v.id === featureId;
10
+ return v === featureId;
11
11
  });
12
12
  }, [featureId]); //获取按钮权限
13
13
 
@@ -1,5 +1,6 @@
1
- import React, { useContext } from 'react';
2
- import useHistory from '../useHistory';
1
+ import _nextTick from "@cloud-app-dev/utils/es/nextTick";
2
+ import React, { useContext, useEffect } from 'react';
3
+ import { useNavigate } from 'react-router-dom';
3
4
  import AppContext from '../AppContext';
4
5
 
5
6
  function AutoExit(_ref) {
@@ -8,14 +9,15 @@ function AutoExit(_ref) {
8
9
  var _useContext = useContext(AppContext.Context),
9
10
  loginStatus = _useContext.loginStatus;
10
11
 
11
- var history = useHistory();
12
-
13
- if (!loginStatus) {
14
- history.replace('/login');
15
- return null;
16
- }
17
-
18
- return /*#__PURE__*/React.createElement(React.Fragment, null, children);
12
+ var navigate = useNavigate();
13
+ useEffect(function () {
14
+ if (!loginStatus) {
15
+ _nextTick(function () {
16
+ return navigate('/login');
17
+ });
18
+ }
19
+ }, [loginStatus, navigate]);
20
+ return /*#__PURE__*/React.createElement(React.Fragment, null, loginStatus ? children : null);
19
21
  }
20
22
 
21
23
  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));"));
@@ -3,8 +3,8 @@ import { insertThemeStyle } from './utils';
3
3
  var Config = {
4
4
  app: produce({}, function () {}),
5
5
  bs: produce({}, function () {}),
6
- feature: produce([], function () {}),
7
- pFeature: produce([], function () {}),
6
+ features: produce([], function () {}),
7
+ featureIds: produce([], function () {}),
8
8
  theme: produce({}, function () {}),
9
9
  registerAppConfig: function registerAppConfig() {
10
10
  var app = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -14,18 +14,18 @@ var Config = {
14
14
  });
15
15
  });
16
16
  },
17
- registerFeatrue: function registerFeatrue() {
18
- var feature = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
19
- Config.feature = produce(Config.feature, function (draft) {
20
- feature.forEach(function (item) {
17
+ registerFeatrueIds: function registerFeatrueIds() {
18
+ var featureIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
19
+ Config.featureIds = produce(Config.featureIds, function (draft) {
20
+ featureIds.forEach(function (id) {
21
21
  var index = draft.findIndex(function (v) {
22
- return v.id === item.id;
22
+ return v === id;
23
23
  });
24
24
 
25
25
  if (index === -1) {
26
- draft.push(item);
26
+ draft.push(id);
27
27
  } else {
28
- draft[index] = item;
28
+ draft[index] = id;
29
29
  }
30
30
  });
31
31
  });
@@ -39,9 +39,9 @@ var Config = {
39
39
  });
40
40
  },
41
41
  registerPlatformFeature: function registerPlatformFeature() {
42
- var pFeature = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
43
- Config.pFeature = produce(Config.pFeature, function (draft) {
44
- pFeature.forEach(function (item) {
42
+ var features = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
43
+ Config.features = produce(Config.features, function (draft) {
44
+ features.forEach(function (item) {
45
45
  var index = draft.findIndex(function (v) {
46
46
  return v.id === item.id;
47
47
  });
@@ -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,16 +46,16 @@ 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 };
51
- feature: FeatureItemType[];
52
- pFeature: FeatureItemType[];
53
+ features: FeatureItemType[];
54
+ featureIds: string[];
53
55
  bs: BSConfigType;
54
56
  theme: ThemeInfoType;
55
57
  registerAppConfig: (conf: AppItemType[]) => void;
56
- registerFeatrue: (conf: FeatureItemType[]) => void;
58
+ registerFeatrueIds: (conf: string[]) => void;
57
59
  registerBSConfig: (conf: BSConfigType) => void;
58
60
  registerPlatformFeature: (conf: FeatureItemType[]) => void;
59
61
  registerThemeConfig: (conf: ThemeInfoType) => void;
@@ -5,5 +5,18 @@ export interface IConfigContextProps {
5
5
  */
6
6
  root: HTMLElement;
7
7
  }
8
- declare const ConfigContext: React.Context<IConfigContextProps>;
9
- export default ConfigContext;
8
+ interface IProviderProps {
9
+ getContainer: () => HTMLElement;
10
+ children: React.ReactNode;
11
+ }
12
+ declare function Provider({ getContainer, children }: IProviderProps): JSX.Element;
13
+ declare namespace Provider {
14
+ var defaultProps: {
15
+ getContainer: () => HTMLElement;
16
+ };
17
+ }
18
+ declare const _default: {
19
+ Context: React.Context<IConfigContextProps>;
20
+ Provider: typeof Provider;
21
+ };
22
+ export default _default;
@@ -1,3 +1,25 @@
1
- import React from 'react';
2
- var ConfigContext = /*#__PURE__*/React.createContext(null);
3
- export default ConfigContext;
1
+ import React, { useMemo } from 'react';
2
+ var Context = /*#__PURE__*/React.createContext(null);
3
+
4
+ function Provider(_ref) {
5
+ var getContainer = _ref.getContainer,
6
+ children = _ref.children;
7
+ var root = useMemo(function () {
8
+ return getContainer();
9
+ }, [getContainer]);
10
+ return /*#__PURE__*/React.createElement(Context.Provider, {
11
+ value: {
12
+ root: root
13
+ }
14
+ }, children);
15
+ }
16
+
17
+ Provider.defaultProps = {
18
+ getContainer: function getContainer() {
19
+ return document.body;
20
+ }
21
+ };
22
+ export default {
23
+ Context: Context,
24
+ Provider: Provider
25
+ };
@@ -0,0 +1,6 @@
1
+ interface ITreeTypeProps {
2
+ mode: string;
3
+ onChange: (mode: string) => void;
4
+ }
5
+ declare function TreeType({ mode, onChange }: ITreeTypeProps): JSX.Element;
6
+ export default TreeType;
@@ -0,0 +1,36 @@
1
+ import "antd/lib/menu/style";
2
+ import _Menu from "antd/lib/menu";
3
+ import "antd/lib/dropdown/style";
4
+ import _Dropdown from "antd/lib/dropdown";
5
+ import React from 'react';
6
+ import IconFont from '../IconFont';
7
+
8
+ function TreeType(_ref) {
9
+ var mode = _ref.mode,
10
+ onChange = _ref.onChange;
11
+ return /*#__PURE__*/React.createElement(_Dropdown, {
12
+ overlay: /*#__PURE__*/React.createElement(_Menu, {
13
+ onClick: function onClick(info) {
14
+ return onChange(info.key);
15
+ }
16
+ }, /*#__PURE__*/React.createElement(_Menu.Item, {
17
+ style: {
18
+ fontSize: 12
19
+ },
20
+ key: "Bz"
21
+ }, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
22
+ style: {
23
+ fontSize: 12
24
+ },
25
+ key: "Place"
26
+ }, "\u884C\u653F\u533A\u5212"))
27
+ }, /*#__PURE__*/React.createElement("span", null, mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(IconFont, {
28
+ style: {
29
+ position: 'relative',
30
+ top: 1
31
+ },
32
+ type: "icon-S_Arrow_BigDown"
33
+ })));
34
+ }
35
+
36
+ export default TreeType;
@@ -10,11 +10,11 @@ function App() {
10
10
  style: {
11
11
  padding: 20,
12
12
  width: 1000,
13
- height: 500
13
+ height: 700
14
14
  }
15
15
  }, /*#__PURE__*/React.createElement("div", {
16
16
  style: {
17
- height: 400
17
+ height: 660
18
18
  }
19
19
  }, /*#__PURE__*/React.createElement(DeviceSelect, null))));
20
20
  }
@@ -1,6 +1,11 @@
1
1
  .vidc-device-select-layout {
2
2
  height: 100%;
3
+ display: flex;
3
4
  }
4
- .vidc-device-select-layout > .cloudapp-col {
5
+ .vidc-device-select-layout > div {
5
6
  height: 100%;
7
+ flex: 1;
8
+ }
9
+ .vidc-device-select-layout > div:first-child.bc-type-tree-layout {
10
+ border-right: none;
6
11
  }
@@ -4,4 +4,9 @@ interface IDeviceSelectProps {
4
4
  selectDevices?: DeviceItemType[];
5
5
  }
6
6
  declare function DeviceSelect({ selectDevices }: IDeviceSelectProps): JSX.Element;
7
+ declare namespace DeviceSelect {
8
+ var defaultProps: {
9
+ className: string;
10
+ };
11
+ }
7
12
  export default DeviceSelect;
@@ -1,12 +1,3 @@
1
- import "antd/lib/menu/style";
2
- import _Menu from "antd/lib/menu";
3
- import "antd/lib/dropdown/style";
4
- import _Dropdown from "antd/lib/dropdown";
5
- import "antd/lib/col/style";
6
- import _Col from "antd/lib/col";
7
- import "antd/lib/row/style";
8
- import _Row from "antd/lib/row";
9
-
10
1
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
11
2
 
12
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -28,12 +19,11 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
28
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
20
 
30
21
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
31
- import TreeMode from '../TreeMode';
32
- import DynamicDeviceList from '../DynamicDeviceList';
33
- import DeviceList from '../DeviceList';
34
- import uniq from 'lodash-es/uniq';
35
- import uniqBy from 'lodash-es/uniqBy';
36
- import IconFont from '../IconFont';
22
+ import TreeMode from '../Tree';
23
+ import DynamicDeviceList from '../List/DynamicDeviceList';
24
+ import DeviceList from '../List/DeviceList';
25
+ import { uniq, uniqBy } from 'lodash';
26
+ import TreeType from './TreeType';
37
27
  import "./index.css";
38
28
 
39
29
  function DeviceSelect(_ref) {
@@ -163,61 +153,39 @@ function DeviceSelect(_ref) {
163
153
  var treeSelectedKeys = useMemo(function () {
164
154
  return state.mode === 'Bz' ? [state.buzGroupId] : [state.areaCode];
165
155
  }, [state.mode, state.buzGroupId, state.areaCode]);
166
- return /*#__PURE__*/React.createElement(_Row, {
156
+ return /*#__PURE__*/React.createElement("div", {
167
157
  className: "vidc-device-select-layout"
168
- }, /*#__PURE__*/React.createElement(_Col, {
169
- span: 7
170
158
  }, /*#__PURE__*/React.createElement(TreeMode, {
171
- key: state.mode,
172
159
  mode: state.mode,
173
160
  inputPlaceholder: "\u8BF7\u8F93\u5165\u540D\u79F0",
174
161
  onSelect: onSelectTree,
175
162
  selectedKeys: treeSelectedKeys,
176
- title: /*#__PURE__*/React.createElement(_Dropdown, {
177
- overlay: /*#__PURE__*/React.createElement(_Menu, {
178
- onClick: function onClick(info) {
179
- return setState(function (old) {
180
- return Object.assign(Object.assign({}, old), {
181
- mode: info.key
182
- });
163
+ title: /*#__PURE__*/React.createElement(TreeType, {
164
+ mode: state.mode,
165
+ onChange: function onChange(mode) {
166
+ return setState(function (old) {
167
+ return Object.assign(Object.assign({}, old), {
168
+ mode: mode
183
169
  });
184
- }
185
- }, /*#__PURE__*/React.createElement(_Menu.Item, {
186
- style: {
187
- fontSize: 12
188
- },
189
- key: "Bz"
190
- }, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
191
- style: {
192
- fontSize: 12
193
- },
194
- key: "Place"
195
- }, "\u884C\u653F\u533A\u5212"))
196
- }, /*#__PURE__*/React.createElement("span", null, state.mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(IconFont, {
197
- style: {
198
- position: 'relative',
199
- top: 1
200
- },
201
- type: "icon-S_Arrow_BigDown"
202
- })))
203
- })), /*#__PURE__*/React.createElement(_Col, {
204
- span: 8
205
- }, /*#__PURE__*/React.createElement(DynamicDeviceList, {
170
+ });
171
+ }
172
+ })
173
+ }), /*#__PURE__*/React.createElement(DynamicDeviceList, {
206
174
  title: "\u8BBE\u5907\u5217\u8868",
207
175
  onChecked: onCheked1,
176
+ key: state.mode,
208
177
  checkedKeys: state.tempSelectIds,
209
178
  params: listParams
210
- })), /*#__PURE__*/React.createElement(_Col, {
211
- span: 1
212
- }), /*#__PURE__*/React.createElement(_Col, {
213
- span: 8
214
- }, /*#__PURE__*/React.createElement(DeviceList, {
179
+ }), /*#__PURE__*/React.createElement(DeviceList, {
215
180
  itemKey: "cid",
216
181
  deviceList: state.selectDevices || [],
217
182
  onChecked: onCheked2,
218
183
  checkedKeys: state.selectIds,
219
184
  title: "\u5DF2\u9009\u8BBE\u5907\u5217\u8868"
220
- })));
185
+ }));
221
186
  }
222
187
 
188
+ DeviceSelect.defaultProps = {
189
+ className: ''
190
+ };
223
191
  export default DeviceSelect;
package/es/Dict/desc.js CHANGED
@@ -1,12 +1,12 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
 
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
 
5
5
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
6
 
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
8
 
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
10
 
11
11
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
12