@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.
- package/.fatherrc.js +11 -4
- package/.umirc.ts +1 -1
- package/es/Api/index.js +7 -7
- package/es/AppRedirect/index.d.ts +1 -1
- package/es/AppRedirect/index.js +7 -12
- package/es/Auth/index.js +1 -1
- package/es/AutoExit/index.js +12 -10
- package/es/{ContentBox → Box}/BetweenBox/index.css +0 -0
- package/es/{ContentBox → Box}/BetweenBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/BetweenBox/index.js +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.css +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/InfoBox/index.js +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.css +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.d.ts +0 -0
- package/es/{ContentBox → Box}/TwoColumnBox/index.js +0 -0
- package/es/{ContentBox → Box}/deps/content-grid.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/content-grid.js +0 -0
- package/es/{ContentBox → Box}/deps/grid-factory.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/grid-factory.js +0 -0
- package/es/{ContentBox → Box}/deps/simple-grid.d.ts +0 -0
- package/es/{ContentBox → Box}/deps/simple-grid.js +0 -0
- package/es/{ContentBox → Box}/index.css +0 -0
- package/es/{ContentBox → Box}/index.d.ts +3 -3
- package/es/{ContentBox → Box}/index.js +5 -5
- package/es/CheckGroupFixed/index.js +4 -2
- package/es/Config/index.js +12 -12
- package/es/Config/interface.d.ts +6 -4
- package/es/ConfigContext/index.d.ts +15 -2
- package/es/ConfigContext/index.js +25 -3
- package/es/DeviceSelect/TreeType.d.ts +6 -0
- package/es/DeviceSelect/TreeType.js +36 -0
- package/es/DeviceSelect/demo.js +2 -2
- package/es/DeviceSelect/index.css +6 -1
- package/es/DeviceSelect/index.d.ts +5 -0
- package/es/DeviceSelect/index.js +22 -54
- package/es/Dict/desc.js +3 -3
- package/es/Dict/utils.js +3 -3
- package/es/HightLevel/index.js +1 -2
- package/es/IconFont/index.d.ts +0 -1
- package/es/IconFont/index.js +12 -13
- package/es/InitialConfig/index.js +7 -4
- package/es/InitialConfig/utils.d.ts +5 -0
- package/es/InitialConfig/utils.js +33 -6
- package/es/InitialRequest/index.d.ts +3 -1
- package/es/InitialRequest/index.js +20 -18
- package/es/InitialRequest/utils.d.ts +4 -3
- package/es/InitialRequest/utils.js +26 -27
- package/es/Input/index.js +3 -2
- package/es/InstanceHistory/index.d.ts +3 -0
- package/es/InstanceHistory/index.js +9 -0
- package/es/List/CheckExt.d.ts +3 -5
- package/es/List/CheckExt.js +21 -13
- package/es/{AppRoute → List/DeviceList}/index.css +0 -0
- package/es/List/DeviceList/index.d.ts +11 -0
- package/es/{DeviceList → List/DeviceList}/index.js +6 -18
- package/es/{DynamicDeviceList → List/DynamicDeviceList}/Demo.d.ts +0 -0
- package/es/{DynamicList/demo.js → List/DynamicDeviceList/Demo.js} +25 -42
- package/es/{DynamicDeviceList → List/DynamicDeviceList}/index.css +5 -17
- package/es/List/DynamicDeviceList/index.d.ts +11 -0
- package/es/List/DynamicDeviceList/index.js +205 -0
- package/es/List/DynamicDeviceList/interface.d.ts +37 -0
- package/es/List/DynamicDeviceList/utils.d.ts +16 -0
- package/es/List/DynamicDeviceList/utils.js +61 -0
- package/es/{DynamicList/demo.d.ts → List/DynamicGridList/Demo.d.ts} +0 -0
- package/es/List/DynamicGridList/Demo.js +70 -0
- package/es/List/DynamicGridList/index.d.ts +26 -0
- package/es/List/DynamicGridList/index.js +73 -0
- package/es/List/GridList/Demo.d.ts +2 -0
- package/es/List/GridList/Demo.js +91 -0
- package/es/List/GridList/hook.d.ts +13 -0
- package/es/List/GridList/hook.js +301 -0
- package/es/List/GridList/index.css +7 -0
- package/es/List/GridList/index.d.ts +15 -0
- package/es/List/GridList/index.js +47 -0
- package/es/List/GridList/interface.d.ts +59 -0
- package/es/List/GridList/utils.d.ts +9 -0
- package/es/List/GridList/utils.js +43 -0
- package/es/List/ListExt/index.css +3 -0
- package/es/{ListExt → List/ListExt}/index.d.ts +1 -1
- package/es/{ListExt → List/ListExt}/index.js +3 -3
- package/es/List/VList/index.css +6 -0
- package/es/List/VList/index.d.ts +18 -0
- package/es/List/VList/index.js +51 -0
- package/es/List/VList/utils.d.ts +14 -0
- package/es/{VList → List/VList}/utils.js +0 -0
- package/es/List/index.css +11 -12
- package/es/List/index.d.ts +5 -70
- package/es/List/index.js +32 -25
- package/es/List/interface.d.ts +87 -0
- package/es/List/renderItem.d.ts +1 -1
- package/es/List/renderItem.js +13 -10
- package/es/LoaderApp/index.d.ts +1 -1
- package/es/LoaderApp/index.js +18 -18
- package/es/LoaderApp/utils.d.ts +2 -1
- package/es/LoaderApp/utils.js +6 -3
- package/es/LoaderScript/index.js +7 -89
- package/es/LoaderScript/utils.d.ts +2 -0
- package/es/LoaderScript/utils.js +170 -33
- package/es/Picture/component/MoveContent/index.js +3 -3
- package/es/Picture/index.js +1 -1
- package/es/Picture/utils.js +1 -1
- package/es/RefDrawer/index.js +1 -1
- package/es/RefModal/index.js +1 -1
- package/es/Service/http.d.ts +6 -4
- package/es/Service/http.js +20 -22
- package/es/Service/index.d.ts +3 -3
- package/es/Service/index.js +7 -11
- package/es/Service/interface.d.ts +5 -11
- package/es/Service/middleware.d.ts +1 -1
- package/es/Service/middleware.js +1 -1
- package/es/TableLayout/index.d.ts +3 -0
- package/es/TableLayout/index.js +14 -45
- package/es/{TreeTitle → Title}/index.css +5 -5
- package/es/{TreeTitle → Title}/index.d.ts +2 -2
- package/es/{TreeTitle → Title}/index.js +7 -4
- package/es/{TreeMode → Tree/BaseTree}/demo.d.ts +0 -0
- package/es/Tree/BaseTree/demo.js +69 -0
- package/es/Tree/BaseTree/index.css +64 -0
- package/es/Tree/BaseTree/index.d.ts +24 -0
- package/es/Tree/BaseTree/index.js +83 -0
- package/es/Tree/demo.js +19 -56
- package/es/Tree/index.css +29 -55
- package/es/Tree/index.d.ts +19 -20
- package/es/Tree/index.js +185 -70
- package/es/UserSelect/index.js +7 -8
- package/es/WorkerFlow/Form/Condition.js +2 -4
- package/es/WorkerFlow/Form/EmptyUserSet.js +1 -1
- package/es/WorkerFlow/Form/FormAuth.js +3 -3
- package/es/WorkerFlow/Form/GroupList.js +2 -2
- package/es/WorkerFlow/Form/GroupSelect.js +1 -1
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +2 -3
- package/es/WorkerFlow/Form/LevelGroupSelect.js +2 -2
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +1 -1
- package/es/WorkerFlow/Form/UserSelect.js +1 -1
- package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -6
- package/es/WorkerFlow/Form/UserSet.js +3 -3
- package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
- package/es/WorkerFlow/index.css +9 -3
- package/es/WorkerFlow/index.js +14 -9
- package/es/WorkerFlow/utils.js +1 -1
- package/es/index.d.ts +3 -11
- package/es/index.js +3 -11
- package/es/useDrawer/index.d.ts +1 -1
- package/es/useDrawer/index.js +3 -2
- package/es/useHistory/index.d.ts +2 -2
- package/es/useHistory/index.js +3 -6
- package/es/useHttp/index.js +1 -1
- package/es/useModal/index.d.ts +1 -1
- package/es/useModal/index.js +3 -2
- package/es/utils.d.ts +9 -0
- package/es/utils.js +36 -1
- package/package.json +10 -11
- package/tsconfig.json +1 -1
- package/es/AppRoute/Render.d.ts +0 -23
- package/es/AppRoute/Render.js +0 -111
- package/es/AppRoute/Rendered.d.ts +0 -4
- package/es/AppRoute/Rendered.js +0 -11
- package/es/AppRoute/index.d.ts +0 -14
- package/es/AppRoute/index.js +0 -106
- package/es/AppRoute/interface.d.ts +0 -18
- package/es/AppRoute/utils.d.ts +0 -1
- package/es/AppRoute/utils.js +0 -28
- package/es/DeviceList/index.css +0 -32
- package/es/DeviceList/index.d.ts +0 -14
- package/es/DynamicDeviceList/CheckExt.d.ts +0 -8
- package/es/DynamicDeviceList/CheckExt.js +0 -36
- package/es/DynamicDeviceList/Demo.js +0 -17
- package/es/DynamicDeviceList/index.d.ts +0 -35
- package/es/DynamicDeviceList/index.js +0 -224
- package/es/DynamicDeviceList/utils.d.ts +0 -2
- package/es/DynamicDeviceList/utils.js +0 -15
- package/es/DynamicList/index.css +0 -7
- package/es/DynamicList/index.d.ts +0 -31
- package/es/DynamicList/index.js +0 -132
- package/es/IconFont/index.css +0 -0
- package/es/List/utils.d.ts +0 -5
- package/es/List/utils.js +0 -18
- package/es/ListExt/index.css +0 -9
- package/es/ScrollList/index.css +0 -73
- package/es/ScrollList/index.d.ts +0 -24
- package/es/ScrollList/index.js +0 -262
- package/es/ScrollList/utils.js +0 -84
- package/es/Service/logger.d.ts +0 -3
- package/es/Service/logger.js +0 -13
- package/es/Service/utils.d.ts +0 -3
- package/es/Service/utils.js +0 -11
- package/es/TreeMode/demo.js +0 -32
- package/es/TreeMode/index.css +0 -38
- package/es/TreeMode/index.d.ts +0 -23
- package/es/TreeMode/index.js +0 -201
- package/es/VList/index.css +0 -4
- package/es/VList/index.d.ts +0 -16
- package/es/VList/index.js +0 -56
- package/es/VList/utils.d.ts +0 -10
- package/es/useChangeEffect/index.d.ts +0 -3
- package/es/useChangeEffect/index.js +0 -32
- 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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
191
|
+
return Service.http({
|
|
192
192
|
url: '/api/place/v1/getPlacesByHasDevice',
|
|
193
193
|
method: 'post',
|
|
194
194
|
requestId: 'getPlacesByHasDevice',
|
package/es/AppRedirect/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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
package/es/AutoExit/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
9
|
-
declare namespace
|
|
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
|
|
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
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export default
|
|
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
|
-
|
|
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));"));
|
package/es/Config/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { insertThemeStyle } from './utils';
|
|
|
3
3
|
var Config = {
|
|
4
4
|
app: produce({}, function () {}),
|
|
5
5
|
bs: produce({}, function () {}),
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
18
|
-
var
|
|
19
|
-
Config.
|
|
20
|
-
|
|
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
|
|
22
|
+
return v === id;
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
if (index === -1) {
|
|
26
|
-
draft.push(
|
|
26
|
+
draft.push(id);
|
|
27
27
|
} else {
|
|
28
|
-
draft[index] =
|
|
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
|
|
43
|
-
Config.
|
|
44
|
-
|
|
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
|
});
|
package/es/Config/interface.d.ts
CHANGED
|
@@ -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' | '
|
|
49
|
+
export type ConfigKey = 'app' | 'feature' | 'featureIds' | 'bs' | 'theme';
|
|
48
50
|
|
|
49
51
|
export type ConfigJOSN = {
|
|
50
52
|
app: { [key: string]: AppItemType };
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
features: FeatureItemType[];
|
|
54
|
+
featureIds: string[];
|
|
53
55
|
bs: BSConfigType;
|
|
54
56
|
theme: ThemeInfoType;
|
|
55
57
|
registerAppConfig: (conf: AppItemType[]) => void;
|
|
56
|
-
|
|
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
|
-
|
|
9
|
-
|
|
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
|
|
3
|
-
|
|
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,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;
|
package/es/DeviceSelect/demo.js
CHANGED
|
@@ -10,11 +10,11 @@ function App() {
|
|
|
10
10
|
style: {
|
|
11
11
|
padding: 20,
|
|
12
12
|
width: 1000,
|
|
13
|
-
height:
|
|
13
|
+
height: 700
|
|
14
14
|
}
|
|
15
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
16
16
|
style: {
|
|
17
|
-
height:
|
|
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 >
|
|
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;
|
package/es/DeviceSelect/index.js
CHANGED
|
@@ -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 '../
|
|
32
|
-
import DynamicDeviceList from '../DynamicDeviceList';
|
|
33
|
-
import DeviceList from '../DeviceList';
|
|
34
|
-
import uniq from 'lodash
|
|
35
|
-
import
|
|
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(
|
|
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(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
})
|
|
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";
|
|
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
|
|