@cloud-app-dev/vidc 2.0.0-alpha.7 → 2.1.0-alpha.10
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/AppRouter/index.d.ts +8 -0
- package/es/AppRouter/index.js +17 -0
- 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 +44 -14
- package/es/Config/interface.d.ts +12 -5
- package/es/Config/utils.d.ts +1 -1
- package/es/Config/utils.js +1 -3
- 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 +21 -52
- package/es/Dict/hook.d.ts +0 -1
- package/es/Dict/hook.js +5 -21
- package/es/Dict/index.d.ts +1 -5
- package/es/Dict/index.js +2 -6
- package/es/Dict/utils.d.ts +0 -1
- package/es/Dict/utils.js +2 -9
- package/es/IconFont/index.d.ts +0 -1
- package/es/IconFont/index.js +12 -13
- package/es/InitialConfig/index.js +7 -6
- 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 -16
- package/es/InitialRequest/utils.d.ts +6 -4
- package/es/InitialRequest/utils.js +52 -70
- 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 -24
- 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 +39 -35
- package/es/LoaderApp/loader.js +2 -6
- package/es/LoaderApp/utils.d.ts +3 -1
- package/es/LoaderApp/utils.js +43 -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/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 +6 -4
- package/es/WorkerFlow/Form/Condition.js +2 -4
- package/es/WorkerFlow/Form/EmptyUserSet.js +2 -4
- package/es/WorkerFlow/Form/FormAuth.js +2 -2
- package/es/WorkerFlow/Form/GroupList.js +2 -2
- package/es/WorkerFlow/Form/GroupSelect.js +2 -4
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +1 -1
- package/es/WorkerFlow/Form/LevelGroupSelect.js +3 -5
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +2 -4
- package/es/WorkerFlow/Form/UserSelect.js +2 -4
- package/es/WorkerFlow/Form/UserSelectModalContent.js +3 -3
- package/es/WorkerFlow/Form/UserSet.js +2 -2
- package/es/WorkerFlow/Nodes/TitleElement.js +71 -34
- package/es/WorkerFlow/index.css +9 -3
- package/es/WorkerFlow/index.js +13 -8
- package/es/WorkerFlow/utils.js +2 -2
- package/es/index.d.ts +4 -11
- package/es/index.js +4 -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 -12
- 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/Dict/desc.d.ts +0 -64
- package/es/Dict/desc.js +0 -162
- 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 -261
- 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
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Router, Routes } from 'react-router-dom';
|
|
4
|
+
import InstanceHistory from '../InstanceHistory';
|
|
5
|
+
|
|
6
|
+
function AppRouter(_a) {
|
|
7
|
+
var children = _a.children,
|
|
8
|
+
props = __rest(_a, ["children"]);
|
|
9
|
+
|
|
10
|
+
return /*#__PURE__*/React.createElement(Router, Object.assign({}, props, {
|
|
11
|
+
navigator: InstanceHistory,
|
|
12
|
+
navigationType: InstanceHistory.action,
|
|
13
|
+
location: InstanceHistory.location
|
|
14
|
+
}), /*#__PURE__*/React.createElement(Routes, null, children));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default AppRouter;
|
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
|
@@ -1,36 +1,66 @@
|
|
|
1
1
|
import produce from 'immer';
|
|
2
|
-
import {
|
|
2
|
+
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
|
-
registerAppConfig: function registerAppConfig(
|
|
9
|
+
registerAppConfig: function registerAppConfig() {
|
|
10
|
+
var app = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
10
11
|
Config.app = produce(Config.app, function (draft) {
|
|
11
12
|
app.forEach(function (item) {
|
|
12
13
|
draft[item.routerPrefix] = item;
|
|
13
14
|
});
|
|
14
15
|
});
|
|
15
16
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
var index = draft.findIndex(function (v) {
|
|
22
|
+
return v === id;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
if (index === -1) {
|
|
26
|
+
draft.push(id);
|
|
27
|
+
} else {
|
|
28
|
+
draft[index] = id;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
19
31
|
});
|
|
20
32
|
},
|
|
21
|
-
registerBSConfig: function registerBSConfig(
|
|
33
|
+
registerBSConfig: function registerBSConfig() {
|
|
34
|
+
var bs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
22
35
|
Config.bs = produce(Config.bs, function (draft) {
|
|
23
|
-
|
|
36
|
+
Object.keys(bs).forEach(function (key) {
|
|
37
|
+
draft[key] = bs[key];
|
|
38
|
+
});
|
|
24
39
|
});
|
|
25
40
|
},
|
|
26
|
-
registerPlatformFeature: function registerPlatformFeature(
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
registerPlatformFeature: function registerPlatformFeature() {
|
|
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
|
+
var index = draft.findIndex(function (v) {
|
|
46
|
+
return v.id === item.id;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
if (index === -1) {
|
|
50
|
+
draft.push(item);
|
|
51
|
+
} else {
|
|
52
|
+
draft[index] = item;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
29
55
|
});
|
|
30
56
|
},
|
|
31
|
-
registerThemeConfig: function registerThemeConfig(
|
|
57
|
+
registerThemeConfig: function registerThemeConfig() {
|
|
58
|
+
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
59
|
+
insertThemeStyle(theme);
|
|
32
60
|
Config.theme = produce(Config.theme, function (draft) {
|
|
33
|
-
|
|
61
|
+
Object.keys(theme).forEach(function (key) {
|
|
62
|
+
draft[key] = theme[key];
|
|
63
|
+
});
|
|
34
64
|
});
|
|
35
65
|
},
|
|
36
66
|
getThemeVarValue: function getThemeVarValue(themeKey) {
|
package/es/Config/interface.d.ts
CHANGED
|
@@ -21,14 +21,21 @@ 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 = {
|
|
27
28
|
systemLogo: string;
|
|
28
29
|
systemName: string;
|
|
30
|
+
parterLogo: string[];
|
|
31
|
+
loginBG: string;
|
|
29
32
|
icp: string[];
|
|
30
33
|
openSocket: boolean;
|
|
31
34
|
chromeDownloadUrl: string;
|
|
35
|
+
AppTimeOut: number;
|
|
36
|
+
shortcut: string;
|
|
37
|
+
download: { chrome: string; player: string };
|
|
38
|
+
[key: string]: any;
|
|
32
39
|
};
|
|
33
40
|
|
|
34
41
|
export type ThemeInfoType = {
|
|
@@ -39,19 +46,19 @@ export type ThemeInfoType = {
|
|
|
39
46
|
};
|
|
40
47
|
};
|
|
41
48
|
|
|
42
|
-
export type ConfigKey = 'app' | 'feature' | '
|
|
49
|
+
export type ConfigKey = 'app' | 'feature' | 'featureIds' | 'bs' | 'theme';
|
|
43
50
|
|
|
44
51
|
export type ConfigJOSN = {
|
|
45
52
|
app: { [key: string]: AppItemType };
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
features: FeatureItemType[];
|
|
54
|
+
featureIds: string[];
|
|
48
55
|
bs: BSConfigType;
|
|
49
56
|
theme: ThemeInfoType;
|
|
50
57
|
registerAppConfig: (conf: AppItemType[]) => void;
|
|
51
|
-
|
|
58
|
+
registerFeatrueIds: (conf: string[]) => void;
|
|
52
59
|
registerBSConfig: (conf: BSConfigType) => void;
|
|
53
60
|
registerPlatformFeature: (conf: FeatureItemType[]) => void;
|
|
54
61
|
registerThemeConfig: (conf: ThemeInfoType) => void;
|
|
55
|
-
|
|
62
|
+
getThemeVarValue: (themeKey: string) => string;
|
|
56
63
|
[key: string]: any;
|
|
57
64
|
};
|
package/es/Config/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ThemeInfoType } from './interface';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function insertThemeStyle(options: ThemeInfoType): void;
|
package/es/Config/utils.js
CHANGED
|
@@ -20,7 +20,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
20
20
|
|
|
21
21
|
var style = document.createElement('style');
|
|
22
22
|
var isInit = false;
|
|
23
|
-
export function
|
|
23
|
+
export function insertThemeStyle(options) {
|
|
24
24
|
var _ref;
|
|
25
25
|
|
|
26
26
|
var tplStr = ':root{<content>}';
|
|
@@ -40,6 +40,4 @@ export function formartThemeConfig(options) {
|
|
|
40
40
|
isInit = true;
|
|
41
41
|
document.head.appendChild(style);
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
return options;
|
|
45
43
|
}
|
|
@@ -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;
|