@cloud-app-dev/vidc 1.0.33 → 1.0.37
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 +2 -2
- package/es/{WorkerFlow/api.d.ts → Api/index.d.ts} +4 -1
- package/es/{WorkerFlow/api.js → Api/index.js} +90 -0
- package/es/AppLayout/index.d.ts +2 -2
- package/es/DeviceList/index.css +3 -0
- package/es/DeviceList/index.d.ts +12 -11
- package/es/DeviceList/index.js +54 -110
- package/es/DeviceSelect/demo.d.ts +2 -0
- package/es/DeviceSelect/demo.js +22 -0
- package/es/DeviceSelect/index.css +6 -0
- package/es/DeviceSelect/index.d.ts +7 -0
- package/es/DeviceSelect/index.js +222 -0
- package/es/DynamicDeviceList/CheckExt.d.ts +8 -0
- package/es/DynamicDeviceList/CheckExt.js +36 -0
- package/es/DynamicDeviceList/Demo.js +1 -5
- package/es/DynamicDeviceList/index.css +20 -0
- package/es/DynamicDeviceList/index.d.ts +7 -4
- package/es/DynamicDeviceList/index.js +100 -49
- package/es/DynamicDeviceList/utils.d.ts +1 -2
- package/es/List/index.css +2 -2
- package/es/OrgTree/index.js +5 -5
- package/es/OrgUserTree/demo.d.ts +2 -0
- package/es/OrgUserTree/demo.js +20 -0
- package/es/OrgUserTree/index.css +31 -0
- package/es/OrgUserTree/index.d.ts +22 -0
- package/es/OrgUserTree/index.js +128 -0
- package/es/PlaceTree/demo.d.ts +2 -0
- package/es/PlaceTree/demo.js +20 -0
- package/es/PlaceTree/index.css +1 -0
- package/es/PlaceTree/index.d.ts +2 -2
- package/es/PlaceTree/index.js +27 -22
- package/es/{WorkerFlow/RefDrawer → RefDrawer}/index.d.ts +5 -1
- package/es/{WorkerFlow/RefDrawer → RefDrawer}/index.js +6 -17
- package/es/{WorkerFlow/RefModal → RefModal}/index.d.ts +5 -1
- package/es/{WorkerFlow/RefModal → RefModal}/index.js +6 -17
- package/es/TreeMode/demo.d.ts +2 -0
- package/es/TreeMode/demo.js +30 -0
- package/es/TreeMode/index.css +36 -0
- package/es/TreeMode/index.d.ts +21 -0
- package/es/TreeMode/index.js +190 -0
- package/es/TreeTitle/index.css +1 -0
- package/es/TreeTitle/index.d.ts +3 -2
- package/es/TreeTitle/index.js +4 -2
- package/es/UserSelect/index.css +16 -0
- package/es/UserSelect/index.d.ts +10 -0
- package/es/UserSelect/index.js +168 -0
- package/es/WorkerFlow/Form/Condition.js +1 -1
- package/es/WorkerFlow/Form/EmptyUserSet.js +1 -1
- package/es/WorkerFlow/Form/GroupList.d.ts +1 -1
- package/es/WorkerFlow/Form/GroupList.js +3 -1
- package/es/WorkerFlow/Form/GroupSelect.js +1 -1
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +12 -11
- package/es/WorkerFlow/Form/LevelGroupSelect.js +1 -1
- package/es/WorkerFlow/Form/Notifier.js +2 -1
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +1 -1
- package/es/WorkerFlow/Form/UserSelect.js +1 -1
- package/es/WorkerFlow/Form/UserSelectModalContent.js +26 -25
- package/es/WorkerFlow/index.css +1 -1
- package/es/WorkerFlow/index.js +2 -2
- package/es/WorkerFlow/utils.js +6 -2
- package/es/core.d.ts +91 -0
- package/es/index.d.ts +7 -0
- package/es/index.js +7 -0
- package/es/utils.d.ts +10 -0
- package/es/utils.js +54 -1
- package/package.json +5 -5
- package/tsconfig.json +0 -1
- package/es/DynamicDeviceList/interface.d.ts +0 -75
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.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NiIsImV4dCI6MTYzNzgwNjQ5ODI3OSwidWlkIjoiMTAxMDAwMDAwMjQ5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTAzODddLCJ2YWxpZFRpbWUiOm51bGwsIm9wdENlbnRlcklkIjoiMTAwMTAwMDAwMjMzIiwidXNlclR5cGUiOjEwMDcwMiwiaWF0IjoxNjM3NTQ3Mjk4Mjc5fQ.FX6-kuuaituBjzuBxY0s51V_V_tVRVMuiWp8fIZI6YQ';
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
title: '云应用-业务组件库',
|
|
@@ -30,7 +30,7 @@ export default defineConfig({
|
|
|
30
30
|
},
|
|
31
31
|
proxy: {
|
|
32
32
|
'/api': {
|
|
33
|
-
target: 'http://192.168.101.
|
|
33
|
+
target: 'http://192.168.101.23',
|
|
34
34
|
changeOrigin: true,
|
|
35
35
|
onProxyReq(proxyReq: any) {
|
|
36
36
|
proxyReq.setHeader('authorization', token);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { OrgItemType } from '@cloud-app-dev/basic-components/es/Store/org';
|
|
2
2
|
import { UserInfo } from '@cloud-app-dev/basic-components/es/Store/app';
|
|
3
|
-
import { PostItemType } from '../core';
|
|
3
|
+
import { BzTreeItemType, PostItemType } from '../core';
|
|
4
4
|
declare class Api {
|
|
5
5
|
getOrgs(): Promise<OrgItemType[]>;
|
|
6
6
|
getUsers(organizationId: string): Promise<UserInfo[]>;
|
|
7
7
|
getPosts(orgId: string): Promise<PostItemType[]>;
|
|
8
|
+
getDeviceBzTree(): Promise<BzTreeItemType[]>;
|
|
9
|
+
getCustomDeviceGroup(): Promise<BzTreeItemType[]>;
|
|
10
|
+
getPlacesByHasDevice(): Promise<BzTreeItemType[]>;
|
|
8
11
|
}
|
|
9
12
|
declare const _default: Api;
|
|
10
13
|
export default _default;
|
|
@@ -112,6 +112,96 @@ var Api = /*#__PURE__*/function () {
|
|
|
112
112
|
}, _callee3);
|
|
113
113
|
}));
|
|
114
114
|
}
|
|
115
|
+
}, {
|
|
116
|
+
key: "getDeviceBzTree",
|
|
117
|
+
value: function getDeviceBzTree() {
|
|
118
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
119
|
+
var res;
|
|
120
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
121
|
+
while (1) {
|
|
122
|
+
switch (_context4.prev = _context4.next) {
|
|
123
|
+
case 0:
|
|
124
|
+
_context4.next = 2;
|
|
125
|
+
return _Service.$http({
|
|
126
|
+
url: '/api/udm-api/DeviceBuzTree/queryList',
|
|
127
|
+
method: 'post',
|
|
128
|
+
requestId: 'getDeviceBzTree',
|
|
129
|
+
data: {},
|
|
130
|
+
headers: getHeader()
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
case 2:
|
|
134
|
+
res = _context4.sent;
|
|
135
|
+
return _context4.abrupt("return", res.data);
|
|
136
|
+
|
|
137
|
+
case 4:
|
|
138
|
+
case "end":
|
|
139
|
+
return _context4.stop();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}, _callee4);
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "getCustomDeviceGroup",
|
|
147
|
+
value: function getCustomDeviceGroup() {
|
|
148
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
149
|
+
var res;
|
|
150
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
151
|
+
while (1) {
|
|
152
|
+
switch (_context5.prev = _context5.next) {
|
|
153
|
+
case 0:
|
|
154
|
+
_context5.next = 2;
|
|
155
|
+
return _Service.$http({
|
|
156
|
+
url: '/api/udm-api/customDeviceGroup/queryList',
|
|
157
|
+
method: 'post',
|
|
158
|
+
requestId: 'customDeviceGroup',
|
|
159
|
+
data: {},
|
|
160
|
+
headers: getHeader()
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
case 2:
|
|
164
|
+
res = _context5.sent;
|
|
165
|
+
return _context5.abrupt("return", res.data);
|
|
166
|
+
|
|
167
|
+
case 4:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context5.stop();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, _callee5);
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
}, {
|
|
176
|
+
key: "getPlacesByHasDevice",
|
|
177
|
+
value: function getPlacesByHasDevice() {
|
|
178
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
|
|
179
|
+
var res;
|
|
180
|
+
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
181
|
+
while (1) {
|
|
182
|
+
switch (_context6.prev = _context6.next) {
|
|
183
|
+
case 0:
|
|
184
|
+
_context6.next = 2;
|
|
185
|
+
return _Service.$http({
|
|
186
|
+
url: '/api/place/v1/getPlacesByHasDevice',
|
|
187
|
+
method: 'post',
|
|
188
|
+
requestId: 'getPlacesByHasDevice',
|
|
189
|
+
data: {},
|
|
190
|
+
headers: getHeader()
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
case 2:
|
|
194
|
+
res = _context6.sent;
|
|
195
|
+
return _context6.abrupt("return", res.data);
|
|
196
|
+
|
|
197
|
+
case 4:
|
|
198
|
+
case "end":
|
|
199
|
+
return _context6.stop();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}, _callee6);
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
115
205
|
}]);
|
|
116
206
|
|
|
117
207
|
return Api;
|
package/es/AppLayout/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
interface AppLayoutProps {
|
|
4
4
|
content?: React.ReactNode;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
-
menuType
|
|
6
|
+
menuType?: string;
|
|
7
7
|
isMenuHome?: boolean;
|
|
8
|
-
renderMenu
|
|
8
|
+
renderMenu?: boolean;
|
|
9
9
|
portalPath?: string;
|
|
10
10
|
}
|
|
11
11
|
|
package/es/DeviceList/index.css
CHANGED
package/es/DeviceList/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DeviceItemType } from '../core';
|
|
3
|
+
import { CheckListProps } from '@cloud-app-dev/basic-components/es/CheckList';
|
|
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;
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
declare const DeviceList: React.Component<DeviceListProps>;
|
|
12
|
-
|
|
13
|
+
declare function DeviceList({ getIconStyle, className, deleteItem, deviceList, onMouseOverItem, renderItemExt, title, onKeywordChange, itemKey, ...props }: DeviceListProps): JSX.Element;
|
|
13
14
|
export default DeviceList;
|
package/es/DeviceList/index.js
CHANGED
|
@@ -1,118 +1,62 @@
|
|
|
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 _CheckList from "@cloud-app-dev/basic-components/es/CheckList";
|
|
4
1
|
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
|
|
11
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
-
|
|
13
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
-
|
|
15
|
-
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); } }
|
|
16
|
-
|
|
17
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
18
|
-
|
|
19
|
-
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); }
|
|
20
|
-
|
|
21
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
|
-
|
|
23
|
-
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); }; }
|
|
24
|
-
|
|
25
|
-
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); }
|
|
26
|
-
|
|
27
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
-
|
|
29
|
-
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; } }
|
|
30
|
-
|
|
31
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
|
-
|
|
33
|
-
import React from 'react';
|
|
2
|
+
import _CheckList from "@cloud-app-dev/basic-components/es/CheckList";
|
|
3
|
+
import { __rest } from "tslib";
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
34
5
|
import DeviceIcon from '../DeviceIcon';
|
|
6
|
+
import TreeTitle from '../TreeTitle';
|
|
35
7
|
import "./index.css";
|
|
36
8
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
9
|
+
function DeviceList(_a) {
|
|
10
|
+
var getIconStyle = _a.getIconStyle,
|
|
11
|
+
className = _a.className,
|
|
12
|
+
deleteItem = _a.deleteItem,
|
|
13
|
+
deviceList = _a.deviceList,
|
|
14
|
+
onMouseOverItem = _a.onMouseOverItem,
|
|
15
|
+
_renderItemExt = _a.renderItemExt,
|
|
16
|
+
title = _a.title,
|
|
17
|
+
onKeywordChange = _a.onKeywordChange,
|
|
18
|
+
itemKey = _a.itemKey,
|
|
19
|
+
props = __rest(_a, ["getIconStyle", "className", "deleteItem", "deviceList", "onMouseOverItem", "renderItemExt", "title", "onKeywordChange", "itemKey"]);
|
|
20
|
+
|
|
21
|
+
var whatIcon = useCallback(function (item) {
|
|
22
|
+
return /*#__PURE__*/React.createElement(DeviceIcon, {
|
|
23
|
+
style: getIconStyle ? getIconStyle(item) : undefined,
|
|
24
|
+
type: item.deviceType,
|
|
25
|
+
status: item.deviceStatus
|
|
26
|
+
});
|
|
27
|
+
}, [getIconStyle]);
|
|
28
|
+
var deleteItemAction = useCallback(function (item, e) {
|
|
29
|
+
e.stopPropagation(e);
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
deleteItem && deleteItem(item);
|
|
32
|
+
}, []);
|
|
33
|
+
return /*#__PURE__*/React.createElement(_CheckList, Object.assign({}, props, {
|
|
34
|
+
className: "lm-c-device-list-wrapper ".concat(className),
|
|
35
|
+
list: deviceList,
|
|
36
|
+
itemNameKey: "deviceName",
|
|
37
|
+
itemKey: itemKey,
|
|
38
|
+
rowHeight: 30,
|
|
39
|
+
renderHeader: function renderHeader() {
|
|
40
|
+
return /*#__PURE__*/React.createElement(TreeTitle, {
|
|
41
|
+
title: title,
|
|
42
|
+
onChange: onKeywordChange,
|
|
43
|
+
inputPlaceholder: "\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0"
|
|
59
44
|
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return _this;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
_createClass(DeviceList, [{
|
|
73
|
-
key: "render",
|
|
74
|
-
value: function render() {
|
|
75
|
-
var _this2 = this;
|
|
76
|
-
|
|
77
|
-
var _this$props = this.props,
|
|
78
|
-
_this$props$className = _this$props.className,
|
|
79
|
-
className = _this$props$className === void 0 ? '' : _this$props$className,
|
|
80
|
-
_this$props$deviceLis = _this$props.deviceList,
|
|
81
|
-
deviceList = _this$props$deviceLis === void 0 ? [] : _this$props$deviceLis,
|
|
82
|
-
deleteItem = _this$props.deleteItem,
|
|
83
|
-
setDeviceType = _this$props.setDeviceType,
|
|
84
|
-
componentsType = _this$props.componentsType,
|
|
85
|
-
_renderItemExt = _this$props.renderItemExt,
|
|
86
|
-
deleteDeviceAll = _this$props.deleteDeviceAll,
|
|
87
|
-
selectDevicesType = _this$props.selectDevicesType,
|
|
88
|
-
showVideoSet = _this$props.showVideoSet,
|
|
89
|
-
showData = _this$props.showData,
|
|
90
|
-
onMouseOverItem = _this$props.onMouseOverItem,
|
|
91
|
-
props = _objectWithoutProperties(_this$props, _excluded);
|
|
92
|
-
|
|
93
|
-
return /*#__PURE__*/React.createElement(_CheckList, _extends({}, props, {
|
|
94
|
-
className: "lm-c-device-list-wrapper ".concat(className),
|
|
95
|
-
list: deviceList,
|
|
96
|
-
itemNameKey: "deviceName",
|
|
97
|
-
rowHeight: 30,
|
|
98
|
-
whatIcon: this.whatIcon,
|
|
99
|
-
onMouseOverItem: onMouseOverItem,
|
|
100
|
-
renderItemExt: function renderItemExt(item) {
|
|
101
|
-
return _renderItemExt ? _renderItemExt(item) : deleteItem && /*#__PURE__*/React.createElement("span", {
|
|
102
|
-
className: "clear-item",
|
|
103
|
-
onClick: function onClick(e) {
|
|
104
|
-
return _this2.deleteItem(item, e);
|
|
105
|
-
}
|
|
106
|
-
}, /*#__PURE__*/React.createElement(_IconFont, {
|
|
107
|
-
type: "icon-S_Edit_LineClose",
|
|
108
|
-
title: "\u5220\u9664"
|
|
109
|
-
}));
|
|
45
|
+
},
|
|
46
|
+
whatIcon: whatIcon,
|
|
47
|
+
onMouseOverItem: onMouseOverItem,
|
|
48
|
+
renderItemExt: function renderItemExt(item) {
|
|
49
|
+
return _renderItemExt ? _renderItemExt(item) : deleteItem ? /*#__PURE__*/React.createElement("span", {
|
|
50
|
+
className: "clear-item",
|
|
51
|
+
onClick: function onClick(e) {
|
|
52
|
+
return deleteItemAction(item, e);
|
|
110
53
|
}
|
|
111
|
-
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement(_IconFont, {
|
|
55
|
+
type: "icon-S_Edit_LineClose",
|
|
56
|
+
title: "\u5220\u9664"
|
|
57
|
+
})) : undefined;
|
|
112
58
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return DeviceList;
|
|
116
|
-
}(React.Component);
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
117
61
|
|
|
118
|
-
export
|
|
62
|
+
export default DeviceList;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "antd/lib/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import DeviceSelect from './index';
|
|
5
|
+
|
|
6
|
+
function App() {
|
|
7
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
8
|
+
prefixCls: "cloudapp"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
style: {
|
|
11
|
+
padding: 20,
|
|
12
|
+
width: 1000,
|
|
13
|
+
height: 500
|
|
14
|
+
}
|
|
15
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
style: {
|
|
17
|
+
height: 400
|
|
18
|
+
}
|
|
19
|
+
}, /*#__PURE__*/React.createElement(DeviceSelect, null))));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default App;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
|
+
import "antd/lib/menu/style";
|
|
3
|
+
import _Menu from "antd/lib/menu";
|
|
4
|
+
import "antd/lib/dropdown/style";
|
|
5
|
+
import _Dropdown from "antd/lib/dropdown";
|
|
6
|
+
import "antd/lib/col/style";
|
|
7
|
+
import _Col from "antd/lib/col";
|
|
8
|
+
import "antd/lib/row/style";
|
|
9
|
+
import _Row from "antd/lib/row";
|
|
10
|
+
|
|
11
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
|
+
|
|
13
|
+
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."); }
|
|
14
|
+
|
|
15
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
16
|
+
|
|
17
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
18
|
+
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
+
|
|
21
|
+
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."); }
|
|
22
|
+
|
|
23
|
+
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); }
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
|
|
29
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
|
+
|
|
31
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
32
|
+
import TreeMode from '../TreeMode';
|
|
33
|
+
import DynamicDeviceList from '../DynamicDeviceList';
|
|
34
|
+
import DeviceList from '../DeviceList';
|
|
35
|
+
import { uniq, uniqBy } from 'lodash';
|
|
36
|
+
import "./index.css";
|
|
37
|
+
|
|
38
|
+
function DeviceSelect(_ref) {
|
|
39
|
+
var selectDevices = _ref.selectDevices;
|
|
40
|
+
|
|
41
|
+
var _useState = useState({
|
|
42
|
+
tempSelectIds: selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
|
|
43
|
+
return v.cid;
|
|
44
|
+
}),
|
|
45
|
+
selectDevices: selectDevices,
|
|
46
|
+
selectIds: selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
|
|
47
|
+
return v.cid;
|
|
48
|
+
}),
|
|
49
|
+
keyword1: '',
|
|
50
|
+
keyword2: '',
|
|
51
|
+
focusKey: Date.now(),
|
|
52
|
+
buzGroupId: '',
|
|
53
|
+
placeId: '',
|
|
54
|
+
areaCode: '',
|
|
55
|
+
mode: 'Bz'
|
|
56
|
+
}),
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
state = _useState2[0],
|
|
59
|
+
setState = _useState2[1];
|
|
60
|
+
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
if (state.selectDevices || !selectDevices) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var ids = selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
|
|
67
|
+
return v.cid;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
if (ids) {
|
|
71
|
+
setState(function (old) {
|
|
72
|
+
return Object.assign(Object.assign({}, old), {
|
|
73
|
+
selectDevices: selectDevices,
|
|
74
|
+
selectIds: ids,
|
|
75
|
+
tempSelectIds: ids
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}, [state.selectDevices, selectDevices]);
|
|
80
|
+
var onCheked1 = useCallback(function (ids, items, checked) {
|
|
81
|
+
var changIds = items.map(function (v) {
|
|
82
|
+
return v.cid;
|
|
83
|
+
});
|
|
84
|
+
var devices = state.selectDevices || [];
|
|
85
|
+
var selectIds = state.selectIds || [];
|
|
86
|
+
var list = !checked ? devices.filter(function (v) {
|
|
87
|
+
return !changIds.includes(v.cid);
|
|
88
|
+
}) : uniqBy([].concat(_toConsumableArray(devices), _toConsumableArray(items)), 'cid');
|
|
89
|
+
var selectIds2 = !checked ? selectIds.filter(function (v) {
|
|
90
|
+
return !changIds.includes(v);
|
|
91
|
+
}) : uniq([].concat(_toConsumableArray(selectIds), _toConsumableArray(changIds)));
|
|
92
|
+
setState(function (old) {
|
|
93
|
+
return Object.assign(Object.assign({}, old), {
|
|
94
|
+
selectDevices: _toConsumableArray(list),
|
|
95
|
+
tempSelectIds: ids,
|
|
96
|
+
selectIds: _toConsumableArray(selectIds2),
|
|
97
|
+
focusKey: Date.now()
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}, [state.selectDevices, state.selectIds]);
|
|
101
|
+
var onCheked2 = useCallback(function (ids) {
|
|
102
|
+
return setState(function (old) {
|
|
103
|
+
return Object.assign(Object.assign({}, old), {
|
|
104
|
+
selectIds: ids,
|
|
105
|
+
focusKey: Date.now()
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}, []);
|
|
109
|
+
var onSelectTree = useCallback(function (keys, _ref2) {
|
|
110
|
+
var node = _ref2.node;
|
|
111
|
+
|
|
112
|
+
if (state.mode === 'Bz') {
|
|
113
|
+
var buzGroupId = keys[0];
|
|
114
|
+
|
|
115
|
+
if (state.buzGroupId === buzGroupId) {
|
|
116
|
+
setState(function (old) {
|
|
117
|
+
return Object.assign(Object.assign({}, old), {
|
|
118
|
+
buzGroupId: ''
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
} else {
|
|
122
|
+
setState(function (old) {
|
|
123
|
+
return Object.assign(Object.assign({}, old), {
|
|
124
|
+
buzGroupId: buzGroupId
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (state.mode === 'Place') {
|
|
131
|
+
var id = node.id;
|
|
132
|
+
|
|
133
|
+
if (state.placeId === id) {
|
|
134
|
+
setState(function (old) {
|
|
135
|
+
return Object.assign(Object.assign({}, old), {
|
|
136
|
+
placeId: '',
|
|
137
|
+
areaCode: ''
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
} else {
|
|
141
|
+
setState(function (old) {
|
|
142
|
+
return Object.assign(Object.assign({}, old), {
|
|
143
|
+
placeId: id,
|
|
144
|
+
areaCode: node.areaCode
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, [state.buzGroupId, state.placeId, state.mode]);
|
|
150
|
+
var listParams = useMemo(function () {
|
|
151
|
+
return state.mode === 'Bz' ? {
|
|
152
|
+
buzGroupId: state.buzGroupId,
|
|
153
|
+
includeSubOrganizations: 1,
|
|
154
|
+
isPagination: true
|
|
155
|
+
} : {
|
|
156
|
+
includeSceneType: 'place',
|
|
157
|
+
includeSubOrganizations: 1,
|
|
158
|
+
isPagination: true,
|
|
159
|
+
placeIds: state.placeId ? [state.placeId] : []
|
|
160
|
+
};
|
|
161
|
+
}, [state.buzGroupId, state.mode, state.placeId]);
|
|
162
|
+
var treeSelectedKeys = useMemo(function () {
|
|
163
|
+
return state.mode === 'Bz' ? [state.buzGroupId] : [state.areaCode];
|
|
164
|
+
}, [state.mode, state.buzGroupId, state.areaCode]);
|
|
165
|
+
return /*#__PURE__*/React.createElement(_Row, {
|
|
166
|
+
className: "vidc-device-select-layout"
|
|
167
|
+
}, /*#__PURE__*/React.createElement(_Col, {
|
|
168
|
+
span: 7
|
|
169
|
+
}, /*#__PURE__*/React.createElement(TreeMode, {
|
|
170
|
+
key: state.mode,
|
|
171
|
+
mode: state.mode,
|
|
172
|
+
inputPlaceholder: "\u8BF7\u8F93\u5165\u540D\u79F0",
|
|
173
|
+
onSelect: onSelectTree,
|
|
174
|
+
selectedKeys: treeSelectedKeys,
|
|
175
|
+
title: /*#__PURE__*/React.createElement(_Dropdown, {
|
|
176
|
+
overlay: /*#__PURE__*/React.createElement(_Menu, {
|
|
177
|
+
onClick: function onClick(info) {
|
|
178
|
+
return setState(function (old) {
|
|
179
|
+
return Object.assign(Object.assign({}, old), {
|
|
180
|
+
mode: info.key
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}, /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
185
|
+
style: {
|
|
186
|
+
fontSize: 12
|
|
187
|
+
},
|
|
188
|
+
key: "Bz"
|
|
189
|
+
}, "\u8BBE\u5907\u4E1A\u52A1\u6811"), /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
190
|
+
style: {
|
|
191
|
+
fontSize: 12
|
|
192
|
+
},
|
|
193
|
+
key: "Place"
|
|
194
|
+
}, "\u884C\u653F\u533A\u5212"))
|
|
195
|
+
}, /*#__PURE__*/React.createElement("span", null, state.mode === 'Place' ? '行政区划' : '设备业务树', " ", /*#__PURE__*/React.createElement(_IconFont, {
|
|
196
|
+
style: {
|
|
197
|
+
position: 'relative',
|
|
198
|
+
top: 1
|
|
199
|
+
},
|
|
200
|
+
type: "icon-S_Arrow_BigDown"
|
|
201
|
+
})))
|
|
202
|
+
})), /*#__PURE__*/React.createElement(_Col, {
|
|
203
|
+
span: 8
|
|
204
|
+
}, /*#__PURE__*/React.createElement(DynamicDeviceList, {
|
|
205
|
+
title: "\u8BBE\u5907\u5217\u8868",
|
|
206
|
+
onChecked: onCheked1,
|
|
207
|
+
checkedKeys: state.tempSelectIds,
|
|
208
|
+
params: listParams
|
|
209
|
+
})), /*#__PURE__*/React.createElement(_Col, {
|
|
210
|
+
span: 1
|
|
211
|
+
}), /*#__PURE__*/React.createElement(_Col, {
|
|
212
|
+
span: 8
|
|
213
|
+
}, /*#__PURE__*/React.createElement(DeviceList, {
|
|
214
|
+
itemKey: "cid",
|
|
215
|
+
deviceList: state.selectDevices || [],
|
|
216
|
+
onChecked: onCheked2,
|
|
217
|
+
checkedKeys: state.selectIds,
|
|
218
|
+
title: "\u5DF2\u9009\u8BBE\u5907\u5217\u8868"
|
|
219
|
+
})));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export default DeviceSelect;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _IconFont from "@cloud-app-dev/basic-components/es/IconFont";
|
|
2
|
+
import "antd/lib/tooltip/style";
|
|
3
|
+
import _Tooltip from "antd/lib/tooltip";
|
|
4
|
+
import React from 'react';
|
|
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;
|