@cloud-app-dev/vidc 2.0.0-alpha.10 → 2.0.0-alpha.14
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/.umirc.ts +1 -1
- package/es/AppRedirect/index.js +7 -11
- package/es/AppRoute/index.d.ts +3 -6
- package/es/AppRoute/index.js +36 -37
- package/es/AppRoute/interface.d.ts +2 -12
- 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 +1 -1
- package/es/Config/interface.d.ts +3 -1
- 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/IconFont/index.d.ts +0 -1
- package/es/IconFont/index.js +12 -13
- package/es/InitialRequest/utils.js +8 -9
- package/es/Input/index.js +3 -2
- 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.js +4 -1
- package/es/LoaderScript/utils.js +60 -37
- package/es/Service/http.d.ts +1 -1
- package/es/Service/http.js +2 -8
- 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/FormAuth.js +2 -2
- package/es/WorkerFlow/Form/GroupList.js +2 -2
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +1 -1
- package/es/WorkerFlow/Form/UserSelectModalContent.js +2 -2
- 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 +3 -2
- 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 +2 -1
- package/es/useModal/index.d.ts +1 -1
- package/es/useModal/index.js +2 -1
- package/es/{IconFont → useNavigate}/index.css +0 -0
- package/es/useNavigate/index.d.ts +4 -0
- package/es/useNavigate/index.js +14 -0
- package/es/utils.d.ts +9 -0
- package/es/utils.js +36 -1
- package/package.json +4 -8
- 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/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/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/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/es/useHistory/index.d.ts +0 -3
- package/es/useHistory/index.js +0 -14
package/.umirc.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { defineConfig } from 'dumi';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
4
|
const token =
|
|
5
|
-
'eyJhbGciOiJIUzI1NiJ9.
|
|
5
|
+
'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTY0MDQwOTc4NjQ3OCwidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjQwMTUwNTg2NDc4fQ.9a8me82dxS_DJ52Ac8eBu1Y2Gigs7mZ6Cm3Rd-tj5Vk';
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
title: '云应用-业务组件库',
|
package/es/AppRedirect/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { useLocation } from 'react-router-dom';
|
|
3
|
-
import
|
|
3
|
+
import useNavigate from '../useNavigate';
|
|
4
4
|
import "./index.css";
|
|
5
5
|
|
|
6
6
|
var getKey = function getKey() {
|
|
@@ -10,24 +10,20 @@ var getKey = function getKey() {
|
|
|
10
10
|
function AppRedirect(_ref) {
|
|
11
11
|
var path = _ref.path,
|
|
12
12
|
to = _ref.to;
|
|
13
|
-
var
|
|
13
|
+
var navigate = useNavigate();
|
|
14
14
|
var location = useLocation();
|
|
15
15
|
useEffect(function () {
|
|
16
16
|
if (path === location.pathname) {
|
|
17
17
|
if (typeof to !== 'string') {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
navigate("".concat(to.pathname).concat(to.search ? "".concat(to.search, "&key=").concat(getKey()) : "?key=".concat(getKey())), {
|
|
19
|
+
replace: true,
|
|
20
20
|
state: Object.assign({}, to.state, {
|
|
21
21
|
isReplace: true
|
|
22
22
|
})
|
|
23
|
-
})
|
|
23
|
+
});
|
|
24
24
|
} else {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
search: "?key".concat(getKey()),
|
|
28
|
-
state: {
|
|
29
|
-
isReplace: true
|
|
30
|
-
}
|
|
25
|
+
navigate("".concat(to, "?key").concat(getKey()), {
|
|
26
|
+
replace: true
|
|
31
27
|
});
|
|
32
28
|
}
|
|
33
29
|
}
|
package/es/AppRoute/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import './index.less';
|
|
6
|
-
declare class AppRoute extends React.Component<IAppRouteProps, IAppRouteType> {
|
|
2
|
+
import { IAppRouteProps } from './interface';
|
|
3
|
+
declare class AppRoute extends React.PureComponent<IAppRouteProps, any> {
|
|
4
|
+
static defaultProps: IAppRouteProps;
|
|
7
5
|
private isRender;
|
|
8
6
|
constructor(props: IAppRouteProps);
|
|
9
7
|
shouldComponentUpdate(props: IAppRouteProps): boolean;
|
|
10
8
|
componentWillUnmount(): void;
|
|
11
|
-
setRouteProps: (newMatch: match<any>, newLocation: H.Location<any>, history: H.History<any>) => void;
|
|
12
9
|
render(): JSX.Element;
|
|
13
10
|
}
|
|
14
11
|
export default AppRoute;
|
package/es/AppRoute/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
import _logger from "@cloud-app-dev/utils/es/logger";
|
|
4
3
|
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
5
|
-
import
|
|
4
|
+
import _useMount from "ahooks/es/useMount";
|
|
6
5
|
|
|
7
6
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
7
|
|
|
@@ -25,13 +24,21 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
25
24
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
25
|
|
|
27
26
|
import React from 'react';
|
|
28
|
-
import {
|
|
29
|
-
import Rendered from './Rendered';
|
|
30
|
-
import "./index.css";
|
|
27
|
+
import { Route, Routes } from 'react-router-dom';
|
|
31
28
|
var _global = window;
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
function RenderSingleRoute(_ref) {
|
|
31
|
+
var onMount = _ref.onMount;
|
|
32
|
+
|
|
33
|
+
_useMount(function () {
|
|
34
|
+
return onMount();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var AppRoute = /*#__PURE__*/function (_React$PureComponent) {
|
|
41
|
+
_inherits(AppRoute, _React$PureComponent);
|
|
35
42
|
|
|
36
43
|
var _super = _createSuper(AppRoute);
|
|
37
44
|
|
|
@@ -40,24 +47,11 @@ var AppRoute = /*#__PURE__*/function (_React$Component) {
|
|
|
40
47
|
|
|
41
48
|
_classCallCheck(this, AppRoute);
|
|
42
49
|
|
|
43
|
-
_this = _super.call(this, props);
|
|
44
|
-
|
|
45
|
-
_this.setRouteProps = function (newMatch, newLocation, history) {
|
|
46
|
-
if (!_isEqual(_this.props.match, newMatch)) {
|
|
47
|
-
_this.setState({
|
|
48
|
-
match: newMatch,
|
|
49
|
-
location: newLocation,
|
|
50
|
-
history: history
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}; //可能存在路由创建但是没有render 导致UI无法渲染
|
|
54
|
-
|
|
50
|
+
_this = _super.call(this, props); //可能存在路由创建但是没有render 导致UI无法渲染
|
|
55
51
|
|
|
56
52
|
_this.isRender = false;
|
|
57
53
|
_this.state = {
|
|
58
|
-
|
|
59
|
-
location: undefined,
|
|
60
|
-
history: undefined
|
|
54
|
+
mathIndex: -1
|
|
61
55
|
};
|
|
62
56
|
return _this;
|
|
63
57
|
}
|
|
@@ -74,26 +68,28 @@ var AppRoute = /*#__PURE__*/function (_React$Component) {
|
|
|
74
68
|
}, {
|
|
75
69
|
key: "componentWillUnmount",
|
|
76
70
|
value: function componentWillUnmount() {
|
|
77
|
-
|
|
71
|
+
console.debug('路由销毁');
|
|
78
72
|
}
|
|
79
73
|
}, {
|
|
80
74
|
key: "render",
|
|
81
75
|
value: function render() {
|
|
82
76
|
var _this2 = this;
|
|
83
77
|
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
78
|
+
var routes = this.props.routes;
|
|
79
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Routes, null, routes.map(function (item, index) {
|
|
80
|
+
return /*#__PURE__*/React.createElement(Route, {
|
|
81
|
+
path: item.path,
|
|
82
|
+
key: item.path,
|
|
83
|
+
element: /*#__PURE__*/React.createElement(RenderSingleRoute, {
|
|
84
|
+
onMount: function onMount() {
|
|
85
|
+
return _this2.setState({
|
|
86
|
+
mathIndex: index
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
})), this.state.matchIndex > -1 && routes[this.state.matchIndex].element, /*#__PURE__*/React.createElement(RenderSingleRoute, {
|
|
92
|
+
onMount: function onMount() {
|
|
97
93
|
return _this2.isRender = true;
|
|
98
94
|
}
|
|
99
95
|
}));
|
|
@@ -101,6 +97,9 @@ var AppRoute = /*#__PURE__*/function (_React$Component) {
|
|
|
101
97
|
}]);
|
|
102
98
|
|
|
103
99
|
return AppRoute;
|
|
104
|
-
}(React.
|
|
100
|
+
}(React.PureComponent);
|
|
105
101
|
|
|
102
|
+
AppRoute.defaultProps = {
|
|
103
|
+
routes: []
|
|
104
|
+
};
|
|
106
105
|
export default AppRoute;
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import * as H from 'history';
|
|
2
|
-
import { RouteProps
|
|
2
|
+
import { RouteProps } from 'react-router-dom';
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
match?: match<any>;
|
|
6
|
-
location?: H.Location | undefined;
|
|
7
|
-
history?: H.History;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface IAppRouteProps extends RouteProps, IAppRouteType {
|
|
4
|
+
export interface IAppRouteProps {
|
|
11
5
|
routes?: RouteProps[];
|
|
12
6
|
tabId?: string;
|
|
13
7
|
currentId?: string;
|
|
14
8
|
}
|
|
15
|
-
|
|
16
|
-
export interface IRenderRouteProps extends IAppRouteType {
|
|
17
|
-
setRouteProps: (match: match<any>, location: H.Location, history: H.History) => void;
|
|
18
|
-
}
|
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 '../useNavigate';
|
|
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
|
@@ -16,7 +16,7 @@ var Config = {
|
|
|
16
16
|
},
|
|
17
17
|
registerFeatrueIds: function registerFeatrueIds() {
|
|
18
18
|
var featureIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
19
|
-
Config.
|
|
19
|
+
Config.featureIds = produce(Config.featureIds, function (draft) {
|
|
20
20
|
featureIds.forEach(function (id) {
|
|
21
21
|
var index = draft.findIndex(function (v) {
|
|
22
22
|
return v === id;
|
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,7 +46,7 @@ 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 };
|
|
@@ -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-es
|
|
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-es';
|
|
26
|
+
import TreeType from './TreeType';
|
|
37
27
|
import "./index.css";
|
|
38
28
|
|
|
39
29
|
function DeviceSelect(_ref) {
|
|
@@ -163,61 +153,39 @@ function DeviceSelect(_ref) {
|
|
|
163
153
|
var treeSelectedKeys = useMemo(function () {
|
|
164
154
|
return state.mode === 'Bz' ? [state.buzGroupId] : [state.areaCode];
|
|
165
155
|
}, [state.mode, state.buzGroupId, state.areaCode]);
|
|
166
|
-
return /*#__PURE__*/React.createElement(
|
|
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/IconFont/index.d.ts
CHANGED
package/es/IconFont/index.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
|
|
2
1
|
import { __rest } from "tslib";
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import "./index.css";
|
|
5
3
|
var global = window;
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
global._ICON_SCRIPT_URL = scriptUrl;
|
|
10
|
-
global._ICON_IS_INIT_ = true;
|
|
11
|
-
loadScript(scriptUrl).then(function () {
|
|
12
|
-
_SocketEmitter.emit('update-iconfont', null);
|
|
13
|
-
}).catch(function (e) {
|
|
14
|
-
console.error(e);
|
|
15
|
-
global._ICON_IS_INIT_ = false;
|
|
16
|
-
});
|
|
17
|
-
}
|
|
5
|
+
if (!global._ICON_SCRIPT_URL) {
|
|
6
|
+
global._ICON_SCRIPT_URL = {};
|
|
18
7
|
}
|
|
19
8
|
|
|
20
9
|
function loadScript(url) {
|
|
@@ -31,6 +20,16 @@ function loadScript(url) {
|
|
|
31
20
|
});
|
|
32
21
|
}
|
|
33
22
|
|
|
23
|
+
function registerIconFont(scriptUrl) {
|
|
24
|
+
if (!global._ICON_SCRIPT_URL[scriptUrl]) {
|
|
25
|
+
global._ICON_SCRIPT_URL[scriptUrl] = true;
|
|
26
|
+
loadScript(scriptUrl).catch(function (e) {
|
|
27
|
+
global._ICON_SCRIPT_URL[scriptUrl] = false;
|
|
28
|
+
console.error(e);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
34
33
|
function IconFont(_a) {
|
|
35
34
|
var type = _a.type,
|
|
36
35
|
_a$className = _a.className,
|