@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/es/AppRoute/index.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
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
|
-
|
|
3
|
-
import _logger from "@cloud-app-dev/utils/es/logger";
|
|
4
|
-
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
5
|
-
import _isEqual from "@cloud-app-dev/utils/es/isEqual";
|
|
6
|
-
|
|
7
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
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); } }
|
|
10
|
-
|
|
11
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
12
|
-
|
|
13
|
-
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); }
|
|
14
|
-
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
|
-
import React from 'react';
|
|
28
|
-
import { RenderComponents, RenderRoutes, RenderSingleRoute } from './Render';
|
|
29
|
-
import Rendered from './Rendered';
|
|
30
|
-
import "./index.css";
|
|
31
|
-
var _global = window;
|
|
32
|
-
|
|
33
|
-
var AppRoute = /*#__PURE__*/function (_React$Component) {
|
|
34
|
-
_inherits(AppRoute, _React$Component);
|
|
35
|
-
|
|
36
|
-
var _super = _createSuper(AppRoute);
|
|
37
|
-
|
|
38
|
-
function AppRoute(props) {
|
|
39
|
-
var _this;
|
|
40
|
-
|
|
41
|
-
_classCallCheck(this, AppRoute);
|
|
42
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
_this.isRender = false;
|
|
57
|
-
_this.state = {
|
|
58
|
-
match: undefined,
|
|
59
|
-
location: undefined,
|
|
60
|
-
history: undefined
|
|
61
|
-
};
|
|
62
|
-
return _this;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
_createClass(AppRoute, [{
|
|
66
|
-
key: "shouldComponentUpdate",
|
|
67
|
-
value: function shouldComponentUpdate(props) {
|
|
68
|
-
if (!_global._IS_RUN_MICRO_BASIC || !this.isRender || _global._IS_ALLOW_ROUTE_RENDER) {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return (props.currentId || _cache.getCache('currentTabKey', 'session')) === props.tabId;
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
key: "componentWillUnmount",
|
|
76
|
-
value: function componentWillUnmount() {
|
|
77
|
-
_logger.debug('路由销毁');
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "render",
|
|
81
|
-
value: function render() {
|
|
82
|
-
var _this2 = this;
|
|
83
|
-
|
|
84
|
-
var _this$state = this.state,
|
|
85
|
-
match = _this$state.match,
|
|
86
|
-
location = _this$state.location;
|
|
87
|
-
var isRouteMath = match && location;
|
|
88
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, this.props.routes ? /*#__PURE__*/React.createElement(RenderRoutes, Object.assign({}, this.props, {
|
|
89
|
-
setRouteProps: this.setRouteProps
|
|
90
|
-
})) : /*#__PURE__*/React.createElement(RenderSingleRoute, Object.assign({}, this.props, {
|
|
91
|
-
setRouteProps: this.setRouteProps
|
|
92
|
-
})), isRouteMath && /*#__PURE__*/React.createElement(RenderComponents, {
|
|
93
|
-
state: this.state,
|
|
94
|
-
props: this.props
|
|
95
|
-
}), isRouteMath && /*#__PURE__*/React.createElement(Rendered, {
|
|
96
|
-
onRendered: function onRendered() {
|
|
97
|
-
return _this2.isRender = true;
|
|
98
|
-
}
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
101
|
-
}]);
|
|
102
|
-
|
|
103
|
-
return AppRoute;
|
|
104
|
-
}(React.Component);
|
|
105
|
-
|
|
106
|
-
export default AppRoute;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as H from 'history';
|
|
2
|
-
import { RouteProps, match } from 'react-router-dom';
|
|
3
|
-
|
|
4
|
-
export interface IAppRouteType {
|
|
5
|
-
match?: match<any>;
|
|
6
|
-
location?: H.Location | undefined;
|
|
7
|
-
history?: H.History;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface IAppRouteProps extends RouteProps, IAppRouteType {
|
|
11
|
-
routes?: RouteProps[];
|
|
12
|
-
tabId?: string;
|
|
13
|
-
currentId?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface IRenderRouteProps extends IAppRouteType {
|
|
17
|
-
setRouteProps: (match: match<any>, location: H.Location, history: H.History) => void;
|
|
18
|
-
}
|
package/es/AppRoute/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getRouteItem: (match: any, routes: any[]) => any;
|
package/es/AppRoute/utils.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export var getRouteItem = function getRouteItem(match, routes) {
|
|
2
|
-
var matchParams = match.params || {};
|
|
3
|
-
var routeItem = routes.find(function (v) {
|
|
4
|
-
return v.path === match.url;
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
if (routeItem) {
|
|
8
|
-
return routeItem;
|
|
9
|
-
} else {
|
|
10
|
-
var keys = Object.keys(matchParams);
|
|
11
|
-
var tempPaths = routes.map(function (v) {
|
|
12
|
-
return v.path;
|
|
13
|
-
});
|
|
14
|
-
tempPaths.forEach(function (path, index) {
|
|
15
|
-
var newPath = path;
|
|
16
|
-
keys.forEach(function (key) {
|
|
17
|
-
if (path.includes(":".concat(key))) {
|
|
18
|
-
newPath = path.replace(":".concat(key), matchParams[key]);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
tempPaths[index] = newPath;
|
|
22
|
-
});
|
|
23
|
-
var index = tempPaths.findIndex(function (v) {
|
|
24
|
-
return v === match.url;
|
|
25
|
-
});
|
|
26
|
-
return routes[index];
|
|
27
|
-
}
|
|
28
|
-
};
|
package/es/DeviceList/index.css
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.lm-c-device-list-wrapper {
|
|
2
|
-
margin-left: -1px;
|
|
3
|
-
}
|
|
4
|
-
.lm-c-device-list-wrapper .list-item label .clear-item {
|
|
5
|
-
display: none;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
font-size: var(--fs);
|
|
8
|
-
}
|
|
9
|
-
.lm-c-device-list-wrapper .list-item:hover .clear-item {
|
|
10
|
-
display: inline-block;
|
|
11
|
-
}
|
|
12
|
-
.lm-c-device-list-wrapper .list-item .an-device-task {
|
|
13
|
-
width: 250px;
|
|
14
|
-
display: flex;
|
|
15
|
-
}
|
|
16
|
-
.lm-c-device-list-wrapper .list-item .an-device-task .an-device-task-operate {
|
|
17
|
-
margin-right: 8px;
|
|
18
|
-
}
|
|
19
|
-
.lm-c-device-list-wrapper .list-item .an-device-task .an-device-task-operate .operateitem {
|
|
20
|
-
margin-right: 14px;
|
|
21
|
-
font-size: 14px;
|
|
22
|
-
}
|
|
23
|
-
.lm-c-device-list-wrapper .list-item .an-device-task .an-device-task-chose {
|
|
24
|
-
display: flex;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
align-items: center;
|
|
27
|
-
width: 120px;
|
|
28
|
-
margin-left: 46px;
|
|
29
|
-
}
|
|
30
|
-
.lm-c-device-list-wrapper .list-item .an-device-task .an-device-task-chose .operate-item {
|
|
31
|
-
margin-right: 22px;
|
|
32
|
-
}
|
package/es/DeviceList/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CheckListProps } from '../List';
|
|
3
|
-
import { DeviceItemType } from '../core';
|
|
4
|
-
import './index.less';
|
|
5
|
-
interface DeviceListProps extends CheckListProps<DeviceItemType> {
|
|
6
|
-
deviceList?: Array<DeviceItemType>;
|
|
7
|
-
deleteItem?: (item: DeviceItemType) => void;
|
|
8
|
-
className?: string;
|
|
9
|
-
getIconStyle?: (item: DeviceItemType) => React.CSSProperties;
|
|
10
|
-
title?: string;
|
|
11
|
-
onKeywordChange?: (v: string) => void;
|
|
12
|
-
}
|
|
13
|
-
declare function DeviceList({ getIconStyle, className, deleteItem, deviceList, onMouseOverItem, renderItemExt, title, onKeywordChange, itemKey, ...props }: DeviceListProps): JSX.Element;
|
|
14
|
-
export default DeviceList;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import "antd/lib/tooltip/style";
|
|
2
|
-
import _Tooltip from "antd/lib/tooltip";
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import IconFont from '../IconFont';
|
|
5
|
-
|
|
6
|
-
function CheckExt(_ref) {
|
|
7
|
-
var selectCount = _ref.selectCount,
|
|
8
|
-
onCheck = _ref.onCheck,
|
|
9
|
-
count = _ref.count,
|
|
10
|
-
onCancel = _ref.onCancel;
|
|
11
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
className: "c-check-list-checkext"
|
|
13
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
14
|
-
className: "select-group"
|
|
15
|
-
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
16
|
-
title: "\u9009\u4E2D\u6240\u6709\u5DF2\u52A0\u8F7D"
|
|
17
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
18
|
-
type: "icon-S_Photo_MarkYes",
|
|
19
|
-
onClick: onCheck
|
|
20
|
-
})), /*#__PURE__*/React.createElement(_Tooltip, {
|
|
21
|
-
title: "\u53D6\u6D88\u9009\u4E2D\u6240\u6709\u5DF2\u52A0\u8F7D\u9879"
|
|
22
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
23
|
-
type: "icon-MarkNo",
|
|
24
|
-
onClick: onCancel
|
|
25
|
-
}))), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009 ", /*#__PURE__*/React.createElement("span", {
|
|
26
|
-
style: {
|
|
27
|
-
color: 'var(--success)'
|
|
28
|
-
}
|
|
29
|
-
}, selectCount), " / \u603B\u6570 ", /*#__PURE__*/React.createElement("span", {
|
|
30
|
-
style: {
|
|
31
|
-
color: 'var(--primary)'
|
|
32
|
-
}
|
|
33
|
-
}, count)));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default CheckExt;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import DynamicDeviceList from './index';
|
|
3
|
-
|
|
4
|
-
function App() {
|
|
5
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
-
style: {
|
|
7
|
-
display: 'flex'
|
|
8
|
-
}
|
|
9
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
10
|
-
style: {
|
|
11
|
-
height: 400,
|
|
12
|
-
width: 300
|
|
13
|
-
}
|
|
14
|
-
}, /*#__PURE__*/React.createElement(DynamicDeviceList, null)));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default App;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { DeviceItemType } from '../core';
|
|
2
|
-
import './index.less';
|
|
3
|
-
interface IDynamicDeviceListProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 列表点击事件
|
|
6
|
-
*/
|
|
7
|
-
onClick?: (item: DeviceItemType) => void;
|
|
8
|
-
/**
|
|
9
|
-
* @description 选中设备cid集合
|
|
10
|
-
*/
|
|
11
|
-
checkedKeys?: string[];
|
|
12
|
-
/**
|
|
13
|
-
* @description 传入onSelect列表默认渲染为checkbox模式
|
|
14
|
-
*/
|
|
15
|
-
onChecked?: (ids: string[], list: DeviceItemType[], checked: boolean) => void;
|
|
16
|
-
/**
|
|
17
|
-
* @description 传入queryList需要的参数,例如业务树ID,场所id等,分页参数除外
|
|
18
|
-
*/
|
|
19
|
-
params?: {
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* @description 自定义渲染列表
|
|
24
|
-
*/
|
|
25
|
-
renderItem?: (item: DeviceItemType, index: number) => JSX.Element;
|
|
26
|
-
/**
|
|
27
|
-
* @description 列表高度
|
|
28
|
-
*/
|
|
29
|
-
itemHeight?: number;
|
|
30
|
-
title?: string;
|
|
31
|
-
onKeywordChange?: (v: string) => void;
|
|
32
|
-
defaultCheckedIds?: string[];
|
|
33
|
-
}
|
|
34
|
-
declare function DynamicDeviceList({ onClick, checkedKeys, defaultCheckedIds, onChecked, params, renderItem, itemHeight, title, onKeywordChange }: IDynamicDeviceListProps): JSX.Element;
|
|
35
|
-
export default DynamicDeviceList;
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import "antd/lib/checkbox/style";
|
|
2
|
-
import _Checkbox from "antd/lib/checkbox";
|
|
3
|
-
|
|
4
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
-
|
|
6
|
-
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."); }
|
|
7
|
-
|
|
8
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
9
|
-
|
|
10
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
-
|
|
12
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
-
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
|
|
18
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
19
|
-
|
|
20
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
21
|
-
|
|
22
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
-
|
|
24
|
-
import { __awaiter } from "tslib";
|
|
25
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
26
|
-
import DynamicList from '../DynamicList';
|
|
27
|
-
import { queryDeviceList } from './utils';
|
|
28
|
-
import DeviceIcon from '../DeviceIcon';
|
|
29
|
-
import TreeTitle from '../TreeTitle';
|
|
30
|
-
import CheckExt from './CheckExt';
|
|
31
|
-
import "./index.css";
|
|
32
|
-
var OFFSET = 0;
|
|
33
|
-
var LIMIT = 30;
|
|
34
|
-
|
|
35
|
-
function DynamicDeviceList(_ref) {
|
|
36
|
-
var _this = this;
|
|
37
|
-
|
|
38
|
-
var onClick = _ref.onClick,
|
|
39
|
-
checkedKeys = _ref.checkedKeys,
|
|
40
|
-
defaultCheckedIds = _ref.defaultCheckedIds,
|
|
41
|
-
onChecked = _ref.onChecked,
|
|
42
|
-
params = _ref.params,
|
|
43
|
-
_renderItem = _ref.renderItem,
|
|
44
|
-
_ref$itemHeight = _ref.itemHeight,
|
|
45
|
-
itemHeight = _ref$itemHeight === void 0 ? 40 : _ref$itemHeight,
|
|
46
|
-
title = _ref.title,
|
|
47
|
-
onKeywordChange = _ref.onKeywordChange;
|
|
48
|
-
|
|
49
|
-
var _useState = useState({
|
|
50
|
-
offset: OFFSET,
|
|
51
|
-
limit: LIMIT,
|
|
52
|
-
list: [],
|
|
53
|
-
count: LIMIT,
|
|
54
|
-
checkedKeys: defaultCheckedIds || checkedKeys || []
|
|
55
|
-
}),
|
|
56
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
-
state = _useState2[0],
|
|
58
|
-
setState = _useState2[1];
|
|
59
|
-
|
|
60
|
-
var loadRef = useRef(false);
|
|
61
|
-
var listRef = useRef(null);
|
|
62
|
-
/**
|
|
63
|
-
* 列表选中处理
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
var onCheckedAction = useCallback(function (item) {
|
|
67
|
-
var ids = state.checkedKeys || [];
|
|
68
|
-
var id = item.cid;
|
|
69
|
-
var checked = !ids.includes(item.cid);
|
|
70
|
-
|
|
71
|
-
if (checked) {
|
|
72
|
-
ids.push(id);
|
|
73
|
-
} else {
|
|
74
|
-
ids = ids.filter(function (v) {
|
|
75
|
-
return v !== id;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
setState(function (old) {
|
|
80
|
-
return Object.assign(Object.assign({}, old), {
|
|
81
|
-
checkedKeys: _toConsumableArray(ids)
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
onChecked && onChecked(ids, [item], checked);
|
|
85
|
-
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
|
-
[state.checkedKeys]);
|
|
87
|
-
var onSelectAll = useCallback(function () {
|
|
88
|
-
var ids = state.list.map(function (v) {
|
|
89
|
-
return v.cid;
|
|
90
|
-
});
|
|
91
|
-
setState(function (old) {
|
|
92
|
-
return Object.assign(Object.assign({}, old), {
|
|
93
|
-
checkedKeys: ids
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
onChecked && onChecked(ids, state.list, true);
|
|
97
|
-
}, [state.list]);
|
|
98
|
-
var onCancelAll = useCallback(function () {
|
|
99
|
-
setState(function (old) {
|
|
100
|
-
return Object.assign(Object.assign({}, old), {
|
|
101
|
-
checkedKeys: []
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
onChecked && onChecked([], [], false);
|
|
105
|
-
}, []);
|
|
106
|
-
/**
|
|
107
|
-
* @desc 参数变化列表需要重新初始化
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
useEffect(function () {
|
|
111
|
-
loadRef.current = true;
|
|
112
|
-
var data = params || {};
|
|
113
|
-
setState(function (old) {
|
|
114
|
-
return Object.assign(Object.assign({}, old), {
|
|
115
|
-
list: [],
|
|
116
|
-
count: LIMIT
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
queryDeviceList(Object.assign({
|
|
120
|
-
offset: 0,
|
|
121
|
-
limit: LIMIT
|
|
122
|
-
}, data)).then(function (res) {
|
|
123
|
-
setState(function (old) {
|
|
124
|
-
return Object.assign(Object.assign({}, old), {
|
|
125
|
-
list: res.data || [],
|
|
126
|
-
count: res.totalCount,
|
|
127
|
-
offset: LIMIT,
|
|
128
|
-
limit: LIMIT
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
Promise.resolve().then(function () {
|
|
132
|
-
loadRef.current = false;
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}, [params]);
|
|
136
|
-
/**
|
|
137
|
-
* @desc 懒加载方法
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
var loadNextPage = useCallback(function () {
|
|
141
|
-
return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
142
|
-
var offset;
|
|
143
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
144
|
-
while (1) {
|
|
145
|
-
switch (_context.prev = _context.next) {
|
|
146
|
-
case 0:
|
|
147
|
-
if (!loadRef.current) {
|
|
148
|
-
_context.next = 2;
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return _context.abrupt("return", Promise.resolve());
|
|
153
|
-
|
|
154
|
-
case 2:
|
|
155
|
-
offset = state.offset;
|
|
156
|
-
_context.next = 5;
|
|
157
|
-
return queryDeviceList(Object.assign({
|
|
158
|
-
offset: offset,
|
|
159
|
-
limit: LIMIT
|
|
160
|
-
}, params)).then(function (res) {
|
|
161
|
-
setState(function (old) {
|
|
162
|
-
return Object.assign(Object.assign({}, old), {
|
|
163
|
-
list: [].concat(_toConsumableArray(old.list), _toConsumableArray(res.data || [])),
|
|
164
|
-
offset: offset + LIMIT
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
}).catch(console.error);
|
|
168
|
-
|
|
169
|
-
case 5:
|
|
170
|
-
case "end":
|
|
171
|
-
return _context.stop();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}, _callee);
|
|
175
|
-
}));
|
|
176
|
-
}, [state.offset, state.limit, params]);
|
|
177
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
className: "zenview-c-dynamic-device-list-layout"
|
|
179
|
-
}, /*#__PURE__*/React.createElement(TreeTitle, {
|
|
180
|
-
title: title,
|
|
181
|
-
onChange: onKeywordChange,
|
|
182
|
-
inputPlaceholder: "\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0"
|
|
183
|
-
}), onChecked && /*#__PURE__*/React.createElement(CheckExt, {
|
|
184
|
-
count: state.count,
|
|
185
|
-
selectCount: state.checkedKeys.length,
|
|
186
|
-
onCancel: onCancelAll,
|
|
187
|
-
onCheck: onSelectAll
|
|
188
|
-
}), /*#__PURE__*/React.createElement(DynamicList, {
|
|
189
|
-
list: state.list,
|
|
190
|
-
loadMore: loadNextPage,
|
|
191
|
-
rowCount: state.count,
|
|
192
|
-
renderItem: function renderItem(item, index) {
|
|
193
|
-
return _renderItem ? _renderItem(item, index) : /*#__PURE__*/React.createElement("div", {
|
|
194
|
-
className: "device-item-box ".concat(state.checkedKeys.includes(item.cid) ? 'device-item-selected' : '')
|
|
195
|
-
}, onChecked ? /*#__PURE__*/React.createElement(_Checkbox, {
|
|
196
|
-
className: "device-name device-checkbox-name",
|
|
197
|
-
checked: state.checkedKeys.includes(item.cid),
|
|
198
|
-
value: item.cid,
|
|
199
|
-
onClick: function onClick() {
|
|
200
|
-
return onCheckedAction(item);
|
|
201
|
-
}
|
|
202
|
-
}, /*#__PURE__*/React.createElement(DeviceIcon, {
|
|
203
|
-
type: item.deviceType,
|
|
204
|
-
status: item.deviceStatus
|
|
205
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
206
|
-
title: item.deviceName
|
|
207
|
-
}, item.deviceName)) : /*#__PURE__*/React.createElement("span", {
|
|
208
|
-
className: "device-name",
|
|
209
|
-
onClick: onClick ? function () {
|
|
210
|
-
return onClick(item);
|
|
211
|
-
} : undefined
|
|
212
|
-
}, /*#__PURE__*/React.createElement(DeviceIcon, {
|
|
213
|
-
type: item.deviceType,
|
|
214
|
-
status: item.deviceStatus
|
|
215
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
216
|
-
title: item.deviceName
|
|
217
|
-
}, item.deviceName)));
|
|
218
|
-
},
|
|
219
|
-
itemHeight: itemHeight,
|
|
220
|
-
ref: listRef
|
|
221
|
-
}));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export default DynamicDeviceList;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import Service from '../Service';
|
|
2
|
-
import { getHeader } from '../utils';
|
|
3
|
-
export function queryDeviceList() {
|
|
4
|
-
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5
|
-
return Service.$http({
|
|
6
|
-
method: 'post',
|
|
7
|
-
url: '/api/udm-api/device/queryList',
|
|
8
|
-
requestId: 'queryDeviceList',
|
|
9
|
-
headers: getHeader(),
|
|
10
|
-
data: Object.assign(Object.assign({}, params), {
|
|
11
|
-
includeSubOrganizations: 1,
|
|
12
|
-
isPagination: true
|
|
13
|
-
})
|
|
14
|
-
});
|
|
15
|
-
}
|
package/es/DynamicList/index.css
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
interface IDynamicListProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description 列表数据
|
|
6
|
-
*/
|
|
7
|
-
list: any[];
|
|
8
|
-
/**
|
|
9
|
-
* @description 懒加载触发触发条件
|
|
10
|
-
*/
|
|
11
|
-
threshold?: number;
|
|
12
|
-
/**
|
|
13
|
-
* @description 列表渲染函数
|
|
14
|
-
*/
|
|
15
|
-
renderItem: (item: any, index: number) => JSX.Element;
|
|
16
|
-
className?: string;
|
|
17
|
-
/**
|
|
18
|
-
* @description 单个列表高度
|
|
19
|
-
*/
|
|
20
|
-
itemHeight?: number;
|
|
21
|
-
/**
|
|
22
|
-
* @description 懒加载方法,注意需要自己手动控制节流
|
|
23
|
-
*/
|
|
24
|
-
loadMore: () => Promise<any>;
|
|
25
|
-
/**
|
|
26
|
-
* @description 列表总数
|
|
27
|
-
*/
|
|
28
|
-
rowCount: number;
|
|
29
|
-
}
|
|
30
|
-
declare const DynamicList: React.ForwardRefExoticComponent<IDynamicListProps & React.RefAttributes<any>>;
|
|
31
|
-
export default DynamicList;
|