@cloud-app-dev/vidc 2.3.0 → 3.0.0
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/Config/interface.d.ts +2 -1
- package/es/DomMove/demo.d.ts +2 -0
- package/es/DomMove/demo.js +16 -0
- package/es/DomMove/index.d.ts +16 -0
- package/es/DomMove/index.js +145 -0
- package/es/DomMove/utils.d.ts +8 -0
- package/es/{Picture/component/MoveContent → DomMove}/utils.js +19 -0
- package/es/Drawer/index.d.ts +2 -2
- package/es/Drawer/interface.d.ts +4 -174
- package/es/ErrorBoundary/index.d.ts +18 -0
- package/es/ErrorBoundary/index.js +84 -0
- package/es/List/DynamicGridList/Demo.js +40 -27
- package/es/List/DynamicGridList/index.d.ts +20 -29
- package/es/List/DynamicGridList/index.js +40 -63
- package/es/List/DynamicList/index.css +15 -0
- package/es/List/DynamicList/index.d.ts +14 -0
- package/es/List/DynamicList/index.js +105 -0
- package/es/List/DynamicList/interface.d.ts +19 -0
- package/es/List/DynamicList/utils.d.ts +4 -0
- package/es/List/DynamicList/utils.js +6 -0
- package/es/List/GridList/Demo.js +27 -4
- package/es/List/GridList/index.css +1 -0
- package/es/List/GridList/index.d.ts +2 -2
- package/es/List/GridList/index.js +8 -12
- package/es/List/GridList/interface.d.ts +1 -1
- package/es/List/VList/index.js +2 -3
- package/es/List/index.css +2 -54
- package/es/List/index.d.ts +6 -7
- package/es/List/index.js +14 -153
- package/es/List/interface.d.ts +3 -61
- package/es/LoaderApp/index.d.ts +1 -1
- package/es/LoaderApp/index.js +27 -46
- package/es/LoaderApp/interface.d.ts +3 -0
- package/es/LoaderApp/loader.d.ts +6 -7
- package/es/LoaderApp/loader.js +20 -30
- package/es/LoaderApp/sandbox.back.d.ts +18 -0
- package/es/LoaderApp/sandbox.back.js +356 -0
- package/es/LoaderApp/sandbox.d.ts +12 -0
- package/es/LoaderApp/sandbox.js +110 -0
- package/es/LoaderApp/utils.d.ts +5 -1
- package/es/LoaderApp/utils.js +98 -2
- package/es/Map/AMap.d.ts +1572 -0
- package/es/Map/BasicMap/AMapInstance.d.ts +15 -0
- package/es/Map/BasicMap/AMapInstance.js +66 -0
- package/es/Map/BasicMap/LeafletInstance.d.ts +15 -0
- package/es/Map/BasicMap/LeafletInstance.js +98 -0
- package/es/Map/BasicMap/index.css +24 -0
- package/es/Map/BasicMap/index.d.ts +9 -0
- package/es/Map/BasicMap/index.js +108 -0
- package/es/Map/ClusterLayer/hook.d.ts +5 -0
- package/es/Map/ClusterLayer/hook.js +144 -0
- package/es/Map/ClusterLayer/index.css +26 -0
- package/es/Map/ClusterLayer/index.d.ts +5 -0
- package/es/Map/ClusterLayer/index.js +31 -0
- package/es/Map/ClusterLayer/props.d.ts +8 -0
- package/es/Map/Config/index.d.ts +7 -0
- package/es/{InitialConfig → Map/Config}/index.js +35 -36
- package/es/Map/Config/utils.d.ts +2 -0
- package/es/{List/DynamicDeviceList → Map/Config}/utils.js +48 -45
- package/es/Map/Context/index.d.ts +11 -0
- package/es/Map/Context/index.js +66 -0
- package/es/Map/FindPio/index.css +7 -0
- package/es/Map/FindPio/index.d.ts +4 -0
- package/es/Map/FindPio/index.js +16 -0
- package/es/{WorkerFlow/Demo.d.ts → Map/InfoWindow/demo.d.ts} +0 -0
- package/es/{List/DynamicDeviceList/Demo.js → Map/InfoWindow/demo.js} +27 -25
- package/es/Map/InfoWindow/index.d.ts +8 -0
- package/es/Map/InfoWindow/index.js +74 -0
- package/es/Map/LevelCenter/DragMarker/index.d.ts +12 -0
- package/es/Map/LevelCenter/DragMarker/index.js +48 -0
- package/es/{List/DeviceList → Map/LevelCenter}/index.css +0 -0
- package/es/Map/LevelCenter/index.d.ts +13 -0
- package/es/Map/LevelCenter/index.js +42 -0
- package/es/Map/LoaderMap/index.d.ts +12 -0
- package/es/Map/LoaderMap/index.js +58 -0
- package/es/Map/ResetTools/index.css +32 -0
- package/es/Map/ResetTools/index.d.ts +9 -0
- package/es/Map/ResetTools/index.js +61 -0
- package/es/Map/SinglePoint/Marker/index.d.ts +7 -0
- package/es/Map/SinglePoint/Marker/index.js +29 -0
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Hover.svg +15 -0
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Normal.svg +15 -0
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Hover.svg +15 -0
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Normal.svg +15 -0
- package/es/Map/SinglePoint/index.css +29 -0
- package/es/Map/SinglePoint/index.d.ts +7 -0
- package/es/Map/SinglePoint/index.js +32 -0
- package/es/Map/hook/useMapType.d.ts +4 -0
- package/es/Map/hook/useMapType.js +13 -0
- package/es/Map/icon.d.ts +2 -0
- package/es/Map/icon.js +10 -0
- package/es/Map/index.d.ts +23 -0
- package/es/Map/index.js +25 -0
- package/es/Map/interface.d.ts +55 -0
- package/es/Map/points.json +61247 -0
- package/es/{Picture/component/MoveContent → Map/useMarker}/index.css +0 -0
- package/es/Map/useMarker/index.d.ts +11 -0
- package/es/{WorkerFlow/Form/FormAuth.js → Map/useMarker/index.js} +57 -80
- package/es/Map/withMap/index.d.ts +2 -0
- package/es/Map/withMap/index.js +12 -0
- package/es/Picture/index.d.ts +1 -1
- package/es/Picture/index.js +2 -2
- package/es/Player/api/index.d.ts +1 -0
- package/es/Player/api/index.js +7 -1
- package/es/Player/demo.js +13 -21
- package/es/Player/event/index.js +5 -1
- package/es/Player/frontend_player.d.ts +1 -1
- package/es/Player/frontend_player.js +20 -13
- package/es/Player/frontend_timeline.d.ts +1 -1
- package/es/Player/live_heart.js +45 -12
- package/es/Player/message.js +23 -12
- package/es/Player/player.d.ts +31 -7
- package/es/Player/segment_player.d.ts +1 -1
- package/es/Player/segment_player.js +30 -18
- package/es/Player/segment_timeline.js +6 -6
- package/es/Player/single_player.js +50 -9
- package/es/Player/timeline.js +8 -6
- package/es/Player/util.d.ts +2 -1
- package/es/Player/util.js +4 -1
- package/es/PlayerExt/index.css +2 -2
- package/es/PlayerExt/index.d.ts +3 -1
- package/es/PlayerExt/index.js +19 -5
- package/es/ScreenPlayer/Live.d.ts +5 -0
- package/es/ScreenPlayer/Live.js +109 -0
- package/es/ScreenPlayer/LiveTools.d.ts +15 -0
- package/es/ScreenPlayer/LiveTools.js +95 -0
- package/es/ScreenPlayer/PlayerWithExt.d.ts +22 -0
- package/es/ScreenPlayer/PlayerWithExt.js +169 -0
- package/es/ScreenPlayer/Record.d.ts +5 -0
- package/es/{WorkerFlow/index.js → ScreenPlayer/Record.js} +290 -273
- package/es/ScreenPlayer/RecordTools.d.ts +17 -0
- package/es/ScreenPlayer/RecordTools.js +102 -0
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +10 -0
- package/es/ScreenPlayer/SegmentTimeLine.js +40 -0
- package/es/ScreenPlayer/TimeSlider.d.ts +127 -0
- package/es/ScreenPlayer/TimeSlider.js +528 -0
- package/es/ScreenPlayer/demo.d.ts +2 -0
- package/es/ScreenPlayer/demo.js +25 -0
- package/es/ScreenPlayer/demo2.d.ts +2 -0
- package/es/ScreenPlayer/demo2.js +153 -0
- package/es/ScreenPlayer/index.css +50 -0
- package/es/ScreenPlayer/index.d.ts +6 -0
- package/es/ScreenPlayer/index.js +7 -0
- package/es/ScreenPlayer/interface.d.ts +81 -0
- package/es/ScreenPlayer/useRecordList.d.ts +3 -0
- package/es/{WorkerFlow/Form/UserAndGroupSelect.js → ScreenPlayer/useRecordList.js} +173 -176
- package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
- package/es/ScreenPlayer/useVideoFit.js +46 -0
- package/es/ScreenPlayer/utils.d.ts +25 -0
- package/es/ScreenPlayer/utils.js +84 -0
- package/es/Tree/demo.js +9 -12
- package/es/Tree/index.css +55 -29
- package/es/Tree/index.d.ts +20 -19
- package/es/Tree/index.js +70 -185
- package/es/index.d.ts +7 -9
- package/es/index.js +7 -9
- package/es/useInfiniteScroll/index.d.ts +16 -0
- package/es/{useHttp → useInfiniteScroll}/index.js +79 -43
- package/es/useVirtualList/index.d.ts +13 -0
- package/es/useVirtualList/index.js +175 -0
- package/es/withErrorBoundary/index.d.ts +8 -0
- package/es/withErrorBoundary/index.js +43 -0
- package/package.json +18 -21
- package/test.js +48 -0
- package/es/DeviceIcon/icon.d.ts +0 -9
- package/es/DeviceIcon/icon.js +0 -138
- package/es/DeviceIcon/index.css +0 -8
- package/es/DeviceIcon/index.d.ts +0 -14
- package/es/DeviceIcon/index.js +0 -37
- package/es/DeviceSelect/TreeType.d.ts +0 -7
- package/es/DeviceSelect/TreeType.js +0 -36
- package/es/DeviceSelect/demo.d.ts +0 -3
- package/es/DeviceSelect/demo.js +0 -22
- package/es/DeviceSelect/index.css +0 -11
- package/es/DeviceSelect/index.d.ts +0 -13
- package/es/DeviceSelect/index.js +0 -191
- package/es/Dict/cache.d.ts +0 -3
- package/es/Dict/cache.js +0 -21
- package/es/Dict/device.d.ts +0 -28
- package/es/Dict/device.js +0 -117
- package/es/Dict/hook.d.ts +0 -3
- package/es/Dict/hook.js +0 -98
- package/es/Dict/index.d.ts +0 -9
- package/es/Dict/index.js +0 -10
- package/es/Dict/interface.d.ts +0 -16
- package/es/Dict/utils.d.ts +0 -10
- package/es/Dict/utils.js +0 -44
- package/es/InitialConfig/index.d.ts +0 -8
- package/es/InitialConfig/utils.d.ts +0 -20
- package/es/InitialConfig/utils.js +0 -110
- package/es/InitialRequest/index.d.ts +0 -9
- package/es/InitialRequest/index.js +0 -97
- package/es/InitialRequest/utils.d.ts +0 -10
- package/es/InitialRequest/utils.js +0 -116
- package/es/List/CheckExt.d.ts +0 -9
- package/es/List/CheckExt.js +0 -36
- package/es/List/DeviceList/index.d.ts +0 -11
- package/es/List/DeviceList/index.js +0 -50
- package/es/List/DynamicDeviceList/Demo.d.ts +0 -3
- package/es/List/DynamicDeviceList/index.css +0 -39
- package/es/List/DynamicDeviceList/index.d.ts +0 -12
- package/es/List/DynamicDeviceList/index.js +0 -205
- package/es/List/DynamicDeviceList/interface.d.ts +0 -37
- package/es/List/DynamicDeviceList/utils.d.ts +0 -16
- package/es/List/ListExt/index.css +0 -3
- package/es/List/ListExt/index.d.ts +0 -19
- package/es/List/ListExt/index.js +0 -44
- package/es/Picture/component/MoveContent/index.d.ts +0 -39
- package/es/Picture/component/MoveContent/index.js +0 -244
- package/es/Picture/component/MoveContent/utils.d.ts +0 -4
- package/es/Title/index.css +0 -25
- package/es/Title/index.d.ts +0 -12
- package/es/Title/index.js +0 -30
- package/es/Tree/BaseTree/index.css +0 -64
- package/es/Tree/BaseTree/index.d.ts +0 -24
- package/es/Tree/BaseTree/index.js +0 -83
- package/es/UserSelect/demo.d.ts +0 -3
- package/es/UserSelect/demo.js +0 -21
- package/es/UserSelect/index.css +0 -16
- package/es/UserSelect/index.d.ts +0 -18
- package/es/UserSelect/index.js +0 -194
- package/es/WorkerFlow/Demo.js +0 -57
- package/es/WorkerFlow/Form/Approver.d.ts +0 -10
- package/es/WorkerFlow/Form/Approver.js +0 -33
- package/es/WorkerFlow/Form/Condition.d.ts +0 -11
- package/es/WorkerFlow/Form/Condition.js +0 -235
- package/es/WorkerFlow/Form/EmptyUserSet.d.ts +0 -8
- package/es/WorkerFlow/Form/EmptyUserSet.js +0 -137
- package/es/WorkerFlow/Form/FormAuth.d.ts +0 -8
- package/es/WorkerFlow/Form/GroupList.d.ts +0 -12
- package/es/WorkerFlow/Form/GroupList.js +0 -44
- package/es/WorkerFlow/Form/GroupSelect.d.ts +0 -8
- package/es/WorkerFlow/Form/GroupSelect.js +0 -167
- package/es/WorkerFlow/Form/GroupSelectModalContent.d.ts +0 -6
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +0 -177
- package/es/WorkerFlow/Form/Handle.d.ts +0 -10
- package/es/WorkerFlow/Form/Handle.js +0 -33
- package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +0 -12
- package/es/WorkerFlow/Form/LevelGroupSelect.js +0 -208
- package/es/WorkerFlow/Form/Notifier.d.ts +0 -8
- package/es/WorkerFlow/Form/Notifier.js +0 -16
- package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +0 -8
- package/es/WorkerFlow/Form/UserSelect.d.ts +0 -8
- package/es/WorkerFlow/Form/UserSelect.js +0 -150
- package/es/WorkerFlow/Form/UserSelectModalContent.d.ts +0 -6
- package/es/WorkerFlow/Form/UserSelectModalContent.js +0 -166
- package/es/WorkerFlow/Form/UserSet.d.ts +0 -14
- package/es/WorkerFlow/Form/UserSet.js +0 -308
- package/es/WorkerFlow/Form/UsersHandleType.d.ts +0 -7
- package/es/WorkerFlow/Form/UsersHandleType.js +0 -32
- package/es/WorkerFlow/Form/utils.d.ts +0 -3
- package/es/WorkerFlow/Form/utils.js +0 -47
- package/es/WorkerFlow/Nodes/Add.d.ts +0 -7
- package/es/WorkerFlow/Nodes/Add.js +0 -98
- package/es/WorkerFlow/Nodes/AddOption.d.ts +0 -10
- package/es/WorkerFlow/Nodes/AddOption.js +0 -23
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +0 -8
- package/es/WorkerFlow/Nodes/AddOptionList.js +0 -46
- package/es/WorkerFlow/Nodes/Approver.d.ts +0 -11
- package/es/WorkerFlow/Nodes/Approver.js +0 -53
- package/es/WorkerFlow/Nodes/Condition.d.ts +0 -10
- package/es/WorkerFlow/Nodes/Condition.js +0 -140
- package/es/WorkerFlow/Nodes/Constants.d.ts +0 -35
- package/es/WorkerFlow/Nodes/Constants.js +0 -150
- package/es/WorkerFlow/Nodes/End.d.ts +0 -7
- package/es/WorkerFlow/Nodes/End.js +0 -16
- package/es/WorkerFlow/Nodes/Handle.d.ts +0 -11
- package/es/WorkerFlow/Nodes/Handle.js +0 -52
- package/es/WorkerFlow/Nodes/Node.d.ts +0 -8
- package/es/WorkerFlow/Nodes/Node.js +0 -26
- package/es/WorkerFlow/Nodes/Notifier.d.ts +0 -11
- package/es/WorkerFlow/Nodes/Notifier.js +0 -52
- package/es/WorkerFlow/Nodes/Render.d.ts +0 -8
- package/es/WorkerFlow/Nodes/Render.js +0 -16
- package/es/WorkerFlow/Nodes/Start.d.ts +0 -12
- package/es/WorkerFlow/Nodes/Start.js +0 -26
- package/es/WorkerFlow/Nodes/TitleElement.d.ts +0 -10
- package/es/WorkerFlow/Nodes/TitleElement.js +0 -127
- package/es/WorkerFlow/Nodes/Wrap.d.ts +0 -13
- package/es/WorkerFlow/Nodes/Wrap.js +0 -35
- package/es/WorkerFlow/OperatorContext.d.ts +0 -4
- package/es/WorkerFlow/OperatorContext.js +0 -3
- package/es/WorkerFlow/Tools.d.ts +0 -8
- package/es/WorkerFlow/Tools.js +0 -78
- package/es/WorkerFlow/XML/CanvasTag.d.ts +0 -3
- package/es/WorkerFlow/XML/CanvasTag.js +0 -142
- package/es/WorkerFlow/XML/EndEvent.d.ts +0 -1
- package/es/WorkerFlow/XML/EndEvent.js +0 -14
- package/es/WorkerFlow/XML/ExclusiveGateway.d.ts +0 -9
- package/es/WorkerFlow/XML/ExclusiveGateway.js +0 -101
- package/es/WorkerFlow/XML/Root.d.ts +0 -1
- package/es/WorkerFlow/XML/Root.js +0 -5
- package/es/WorkerFlow/XML/StartEvent.d.ts +0 -5
- package/es/WorkerFlow/XML/StartEvent.js +0 -28
- package/es/WorkerFlow/XML/UserTask.d.ts +0 -5
- package/es/WorkerFlow/XML/UserTask.js +0 -93
- package/es/WorkerFlow/XML/index.d.ts +0 -4
- package/es/WorkerFlow/XML/index.js +0 -100
- package/es/WorkerFlow/XML/utils.d.ts +0 -6
- package/es/WorkerFlow/XML/utils.js +0 -97
- package/es/WorkerFlow/data.json +0 -83
- package/es/WorkerFlow/index.css +0 -779
- package/es/WorkerFlow/index.d.ts +0 -13
- package/es/WorkerFlow/interface.d.ts +0 -93
- package/es/WorkerFlow/template.d.ts +0 -2
- package/es/WorkerFlow/template.js +0 -17
- package/es/WorkerFlow/utils.d.ts +0 -14
- package/es/WorkerFlow/utils.js +0 -212
- package/es/useHttp/index.d.ts +0 -8
package/es/DeviceIcon/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
export interface DeviceIconProps {
|
|
4
|
-
type: string | number;
|
|
5
|
-
status?: any;
|
|
6
|
-
onlineClass?: string;
|
|
7
|
-
offlineClass?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
style?: React.CSSProperties;
|
|
10
|
-
cType?: string;
|
|
11
|
-
}
|
|
12
|
-
declare function DeviceIcon({ cType, type, status, onlineClass, offlineClass, className, style, ...props }: DeviceIconProps): JSX.Element;
|
|
13
|
-
declare const _default: React.MemoExoticComponent<typeof DeviceIcon>;
|
|
14
|
-
export default _default;
|
package/es/DeviceIcon/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
import IconFont from '../IconFont';
|
|
4
|
-
import { getCameraTypeIcon } from './icon';
|
|
5
|
-
import "./index.css";
|
|
6
|
-
|
|
7
|
-
function DeviceIcon(_a) {
|
|
8
|
-
var cType = _a.cType,
|
|
9
|
-
type = _a.type,
|
|
10
|
-
status = _a.status,
|
|
11
|
-
_a$onlineClass = _a.onlineClass,
|
|
12
|
-
onlineClass = _a$onlineClass === void 0 ? 'online-device' : _a$onlineClass,
|
|
13
|
-
_a$offlineClass = _a.offlineClass,
|
|
14
|
-
offlineClass = _a$offlineClass === void 0 ? 'offline-device' : _a$offlineClass,
|
|
15
|
-
className = _a.className,
|
|
16
|
-
style = _a.style,
|
|
17
|
-
props = __rest(_a, ["cType", "type", "status", "onlineClass", "offlineClass", "className", "style"]);
|
|
18
|
-
|
|
19
|
-
var options = useMemo(function () {
|
|
20
|
-
return cType ? {
|
|
21
|
-
icon: "icon-".concat(type, "-").concat(cType)
|
|
22
|
-
} : getCameraTypeIcon(type, status);
|
|
23
|
-
}, [type, cType, status]);
|
|
24
|
-
var onLine = useMemo(function () {
|
|
25
|
-
return status * 1 === 1;
|
|
26
|
-
}, [status]);
|
|
27
|
-
var iconClassName = useMemo(function () {
|
|
28
|
-
return onLine ? onlineClass : offlineClass;
|
|
29
|
-
}, [offlineClass, onLine, onlineClass]);
|
|
30
|
-
return /*#__PURE__*/React.createElement(IconFont, Object.assign({
|
|
31
|
-
style: style,
|
|
32
|
-
type: options.icon,
|
|
33
|
-
className: "".concat(iconClassName, " ").concat(className ? className : '')
|
|
34
|
-
}, props));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default /*#__PURE__*/React.memo(DeviceIcon);
|
|
@@ -1,36 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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: 700
|
|
14
|
-
}
|
|
15
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
style: {
|
|
17
|
-
height: 660
|
|
18
|
-
}
|
|
19
|
-
}, /*#__PURE__*/React.createElement(DeviceSelect, null))));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default App;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DeviceItemType } from '../core';
|
|
3
|
-
import './index.less';
|
|
4
|
-
interface IDeviceSelectProps {
|
|
5
|
-
selectDevices?: DeviceItemType[];
|
|
6
|
-
}
|
|
7
|
-
declare function DeviceSelect({ selectDevices }: IDeviceSelectProps): JSX.Element;
|
|
8
|
-
declare namespace DeviceSelect {
|
|
9
|
-
var defaultProps: {
|
|
10
|
-
className: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export default DeviceSelect;
|
package/es/DeviceSelect/index.js
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
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."); }
|
|
4
|
-
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
|
|
7
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
-
|
|
9
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
-
|
|
11
|
-
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."); }
|
|
12
|
-
|
|
13
|
-
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); }
|
|
14
|
-
|
|
15
|
-
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; }
|
|
16
|
-
|
|
17
|
-
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; }
|
|
18
|
-
|
|
19
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
|
|
21
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
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';
|
|
27
|
-
import "./index.css";
|
|
28
|
-
|
|
29
|
-
function DeviceSelect(_ref) {
|
|
30
|
-
var selectDevices = _ref.selectDevices;
|
|
31
|
-
|
|
32
|
-
var _useState = useState({
|
|
33
|
-
tempSelectIds: selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
|
|
34
|
-
return v.cid;
|
|
35
|
-
}),
|
|
36
|
-
selectDevices: selectDevices,
|
|
37
|
-
selectIds: selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
|
|
38
|
-
return v.cid;
|
|
39
|
-
}),
|
|
40
|
-
keyword1: '',
|
|
41
|
-
keyword2: '',
|
|
42
|
-
focusKey: Date.now(),
|
|
43
|
-
buzGroupId: '',
|
|
44
|
-
placeId: '',
|
|
45
|
-
areaCode: '',
|
|
46
|
-
mode: 'Bz'
|
|
47
|
-
}),
|
|
48
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
-
state = _useState2[0],
|
|
50
|
-
setState = _useState2[1];
|
|
51
|
-
|
|
52
|
-
useEffect(function () {
|
|
53
|
-
if (state.selectDevices || !selectDevices) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var ids = selectDevices === null || selectDevices === void 0 ? void 0 : selectDevices.map(function (v) {
|
|
58
|
-
return v.cid;
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
if (ids) {
|
|
62
|
-
setState(function (old) {
|
|
63
|
-
return Object.assign(Object.assign({}, old), {
|
|
64
|
-
selectDevices: selectDevices,
|
|
65
|
-
selectIds: ids,
|
|
66
|
-
tempSelectIds: ids
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}, [state.selectDevices, selectDevices]);
|
|
71
|
-
var onCheked1 = useCallback(function (ids, items, checked) {
|
|
72
|
-
var changIds = items.map(function (v) {
|
|
73
|
-
return v.cid;
|
|
74
|
-
});
|
|
75
|
-
var devices = state.selectDevices || [];
|
|
76
|
-
var selectIds = state.selectIds || [];
|
|
77
|
-
var list = !checked ? devices.filter(function (v) {
|
|
78
|
-
return !changIds.includes(v.cid);
|
|
79
|
-
}) : uniqBy([].concat(_toConsumableArray(devices), _toConsumableArray(items)), 'cid');
|
|
80
|
-
var selectIds2 = !checked ? selectIds.filter(function (v) {
|
|
81
|
-
return !changIds.includes(v);
|
|
82
|
-
}) : uniq([].concat(_toConsumableArray(selectIds), _toConsumableArray(changIds)));
|
|
83
|
-
setState(function (old) {
|
|
84
|
-
return Object.assign(Object.assign({}, old), {
|
|
85
|
-
selectDevices: _toConsumableArray(list),
|
|
86
|
-
tempSelectIds: ids,
|
|
87
|
-
selectIds: _toConsumableArray(selectIds2),
|
|
88
|
-
focusKey: Date.now()
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
}, [state.selectDevices, state.selectIds]);
|
|
92
|
-
var onCheked2 = useCallback(function (ids) {
|
|
93
|
-
return setState(function (old) {
|
|
94
|
-
return Object.assign(Object.assign({}, old), {
|
|
95
|
-
selectIds: ids,
|
|
96
|
-
focusKey: Date.now()
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
}, []);
|
|
100
|
-
var onSelectTree = useCallback(function (keys, _ref2) {
|
|
101
|
-
var node = _ref2.node;
|
|
102
|
-
|
|
103
|
-
if (state.mode === 'Bz') {
|
|
104
|
-
var buzGroupId = keys[0];
|
|
105
|
-
|
|
106
|
-
if (state.buzGroupId === buzGroupId) {
|
|
107
|
-
setState(function (old) {
|
|
108
|
-
return Object.assign(Object.assign({}, old), {
|
|
109
|
-
buzGroupId: ''
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
} else {
|
|
113
|
-
setState(function (old) {
|
|
114
|
-
return Object.assign(Object.assign({}, old), {
|
|
115
|
-
buzGroupId: buzGroupId
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (state.mode === 'Place') {
|
|
122
|
-
var id = node.id;
|
|
123
|
-
|
|
124
|
-
if (state.placeId === id) {
|
|
125
|
-
setState(function (old) {
|
|
126
|
-
return Object.assign(Object.assign({}, old), {
|
|
127
|
-
placeId: '',
|
|
128
|
-
areaCode: ''
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
} else {
|
|
132
|
-
setState(function (old) {
|
|
133
|
-
return Object.assign(Object.assign({}, old), {
|
|
134
|
-
placeId: id,
|
|
135
|
-
areaCode: node.areaCode
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}, [state.buzGroupId, state.placeId, state.mode]);
|
|
141
|
-
var listParams = useMemo(function () {
|
|
142
|
-
return state.mode === 'Bz' ? {
|
|
143
|
-
buzGroupId: state.buzGroupId,
|
|
144
|
-
includeSubOrganizations: 1,
|
|
145
|
-
isPagination: true
|
|
146
|
-
} : {
|
|
147
|
-
includeSceneType: 'place',
|
|
148
|
-
includeSubOrganizations: 1,
|
|
149
|
-
isPagination: true,
|
|
150
|
-
placeIds: state.placeId ? [state.placeId] : []
|
|
151
|
-
};
|
|
152
|
-
}, [state.buzGroupId, state.mode, state.placeId]);
|
|
153
|
-
var treeSelectedKeys = useMemo(function () {
|
|
154
|
-
return state.mode === 'Bz' ? [state.buzGroupId] : [state.areaCode];
|
|
155
|
-
}, [state.mode, state.buzGroupId, state.areaCode]);
|
|
156
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
157
|
-
className: "vidc-device-select-layout"
|
|
158
|
-
}, /*#__PURE__*/React.createElement(TreeMode, {
|
|
159
|
-
mode: state.mode,
|
|
160
|
-
inputPlaceholder: "\u8BF7\u8F93\u5165\u540D\u79F0",
|
|
161
|
-
onSelect: onSelectTree,
|
|
162
|
-
selectedKeys: treeSelectedKeys,
|
|
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
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
})
|
|
173
|
-
}), /*#__PURE__*/React.createElement(DynamicDeviceList, {
|
|
174
|
-
title: "\u8BBE\u5907\u5217\u8868",
|
|
175
|
-
onChecked: onCheked1,
|
|
176
|
-
key: state.mode,
|
|
177
|
-
checkedKeys: state.tempSelectIds,
|
|
178
|
-
params: listParams
|
|
179
|
-
}), /*#__PURE__*/React.createElement(DeviceList, {
|
|
180
|
-
itemKey: "cid",
|
|
181
|
-
deviceList: state.selectDevices || [],
|
|
182
|
-
onChecked: onCheked2,
|
|
183
|
-
checkedKeys: state.selectIds,
|
|
184
|
-
title: "\u5DF2\u9009\u8BBE\u5907\u5217\u8868"
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
DeviceSelect.defaultProps = {
|
|
189
|
-
className: ''
|
|
190
|
-
};
|
|
191
|
-
export default DeviceSelect;
|
package/es/Dict/cache.d.ts
DELETED
package/es/Dict/cache.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import produce from 'immer';
|
|
2
|
-
var dictMap = {
|
|
3
|
-
data: produce({}, function () {}),
|
|
4
|
-
updateDictMap: function updateDictMap(key, value) {
|
|
5
|
-
this.data = produce(this.data, function (draft) {
|
|
6
|
-
draft[key] = value;
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
var _global = window;
|
|
11
|
-
|
|
12
|
-
var LMDict = function () {
|
|
13
|
-
if (_global._LM_DICT_) {
|
|
14
|
-
return _global._LM_DICT_;
|
|
15
|
-
} else {
|
|
16
|
-
_global._LM_DICT_ = dictMap;
|
|
17
|
-
return dictMap;
|
|
18
|
-
}
|
|
19
|
-
}();
|
|
20
|
-
|
|
21
|
-
export default LMDict;
|
package/es/Dict/device.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DictItem } from './interface';
|
|
2
|
-
export declare const ptjk: DictItem;
|
|
3
|
-
export declare const rlzp: DictItem;
|
|
4
|
-
export declare const zpj: DictItem;
|
|
5
|
-
export declare const clzpj: DictItem;
|
|
6
|
-
export declare const qmbzpj: DictItem;
|
|
7
|
-
export declare const ydjc: DictItem;
|
|
8
|
-
export declare const qtzp: DictItem;
|
|
9
|
-
export declare const znxj: DictItem;
|
|
10
|
-
export declare const qj: DictItem;
|
|
11
|
-
export declare const db: DictItem;
|
|
12
|
-
export declare const qt: DictItem;
|
|
13
|
-
export declare const dz: DictItem;
|
|
14
|
-
export declare const wgsb: DictItem;
|
|
15
|
-
export declare const xfs: DictItem;
|
|
16
|
-
export declare const znjg: DictItem;
|
|
17
|
-
export declare const wifi: DictItem;
|
|
18
|
-
export declare const mj: DictItem;
|
|
19
|
-
export declare const hw: DictItem;
|
|
20
|
-
export declare const yg: DictItem;
|
|
21
|
-
export declare const deviceStatus: DictItem[];
|
|
22
|
-
export declare const deviceLocation: DictItem[];
|
|
23
|
-
export declare const deviceLocationzWithoutAll: DictItem[];
|
|
24
|
-
export declare const cameraType: DictItem[];
|
|
25
|
-
export declare const cameraDeviceType: DictItem[];
|
|
26
|
-
export declare const cameraAndSoldierType: DictItem[];
|
|
27
|
-
export declare const deviceAndMjType: DictItem[];
|
|
28
|
-
export declare const deviceType: DictItem[];
|
package/es/Dict/device.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
var all = {
|
|
2
|
-
value: '-1',
|
|
3
|
-
label: '全部'
|
|
4
|
-
}; //摄像机状态
|
|
5
|
-
|
|
6
|
-
var on = {
|
|
7
|
-
value: '1',
|
|
8
|
-
label: '在线'
|
|
9
|
-
};
|
|
10
|
-
var off = {
|
|
11
|
-
value: '0',
|
|
12
|
-
label: '离线'
|
|
13
|
-
}; //经纬度状态
|
|
14
|
-
|
|
15
|
-
var noSet = {
|
|
16
|
-
value: '0',
|
|
17
|
-
label: '未设置'
|
|
18
|
-
};
|
|
19
|
-
var isSet = {
|
|
20
|
-
value: '1',
|
|
21
|
-
label: '已设置'
|
|
22
|
-
}; //摄像机类别
|
|
23
|
-
|
|
24
|
-
export var ptjk = {
|
|
25
|
-
value: '119651',
|
|
26
|
-
label: '普通监控'
|
|
27
|
-
};
|
|
28
|
-
export var rlzp = {
|
|
29
|
-
value: '119652',
|
|
30
|
-
label: '人脸抓拍机'
|
|
31
|
-
};
|
|
32
|
-
export var zpj = {
|
|
33
|
-
value: '119653',
|
|
34
|
-
label: '人像抓拍机'
|
|
35
|
-
};
|
|
36
|
-
export var clzpj = {
|
|
37
|
-
value: '119654',
|
|
38
|
-
label: '车辆抓拍机'
|
|
39
|
-
};
|
|
40
|
-
export var qmbzpj = {
|
|
41
|
-
value: '119655',
|
|
42
|
-
label: '全目标抓拍机'
|
|
43
|
-
};
|
|
44
|
-
export var ydjc = {
|
|
45
|
-
value: '119656',
|
|
46
|
-
label: '移动监测'
|
|
47
|
-
};
|
|
48
|
-
export var qtzp = {
|
|
49
|
-
value: '119657',
|
|
50
|
-
label: '其他'
|
|
51
|
-
}; //设备类型
|
|
52
|
-
|
|
53
|
-
export var znxj = {
|
|
54
|
-
value: '100604',
|
|
55
|
-
label: '智能枪机'
|
|
56
|
-
};
|
|
57
|
-
export var qj = {
|
|
58
|
-
value: '100602',
|
|
59
|
-
label: '球机'
|
|
60
|
-
};
|
|
61
|
-
export var db = {
|
|
62
|
-
value: '100605',
|
|
63
|
-
label: '单兵'
|
|
64
|
-
};
|
|
65
|
-
export var qt = {
|
|
66
|
-
value: '100601',
|
|
67
|
-
label: '其他摄像机'
|
|
68
|
-
};
|
|
69
|
-
export var dz = {
|
|
70
|
-
value: '100607',
|
|
71
|
-
label: '道闸'
|
|
72
|
-
};
|
|
73
|
-
export var wgsb = {
|
|
74
|
-
value: '100606',
|
|
75
|
-
label: '网关设备'
|
|
76
|
-
};
|
|
77
|
-
export var xfs = {
|
|
78
|
-
value: '100612',
|
|
79
|
-
label: '消防栓'
|
|
80
|
-
};
|
|
81
|
-
export var znjg = {
|
|
82
|
-
value: '100614',
|
|
83
|
-
label: '智能井盖'
|
|
84
|
-
}; //wifi
|
|
85
|
-
|
|
86
|
-
export var wifi = {
|
|
87
|
-
value: '100611',
|
|
88
|
-
label: 'WI-FI'
|
|
89
|
-
}; //门禁
|
|
90
|
-
|
|
91
|
-
export var mj = {
|
|
92
|
-
value: '103501,103502',
|
|
93
|
-
label: '门禁'
|
|
94
|
-
}; //闸机
|
|
95
|
-
// export const zj = {value: "103407", label: "闸机"}as DictItem
|
|
96
|
-
//红外传感器
|
|
97
|
-
|
|
98
|
-
export var hw = {
|
|
99
|
-
value: '100609',
|
|
100
|
-
label: '红外传感器'
|
|
101
|
-
}; //烟感传感器
|
|
102
|
-
|
|
103
|
-
export var yg = {
|
|
104
|
-
value: '100610',
|
|
105
|
-
label: '烟感传感器'
|
|
106
|
-
};
|
|
107
|
-
export var deviceStatus = [all, on, off];
|
|
108
|
-
export var deviceLocation = [all, noSet, isSet];
|
|
109
|
-
export var deviceLocationzWithoutAll = [noSet, isSet];
|
|
110
|
-
export var cameraType = [all, ptjk, rlzp, zpj, clzpj, qmbzpj, ydjc, qtzp];
|
|
111
|
-
export var cameraDeviceType = [all, znxj, qj, db, qt]; //摄像机+单兵
|
|
112
|
-
|
|
113
|
-
export var cameraAndSoldierType = [all, znxj, qj, db, qt]; //摄像机(无单兵)+门禁
|
|
114
|
-
|
|
115
|
-
export var deviceAndMjType = [all, znxj, qj, wifi, mj, wgsb, dz, xfs, znjg, qt]; //所有设备类型
|
|
116
|
-
|
|
117
|
-
export var deviceType = [all, znxj, qj, db, wifi, mj, wgsb, dz, xfs, znjg, qt, hw, yg];
|
package/es/Dict/hook.d.ts
DELETED
package/es/Dict/hook.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
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."); }
|
|
4
|
-
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
|
|
7
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
-
|
|
9
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
-
|
|
11
|
-
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."); }
|
|
12
|
-
|
|
13
|
-
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); }
|
|
14
|
-
|
|
15
|
-
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; }
|
|
16
|
-
|
|
17
|
-
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; }
|
|
18
|
-
|
|
19
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
|
|
21
|
-
import { useMemo, useState, useEffect } from 'react';
|
|
22
|
-
import { queryByTypeCode, queryByTypeCodes, formartItemTextExt } from './utils';
|
|
23
|
-
import LMDict from './cache';
|
|
24
|
-
export function useDict(typeCode) {
|
|
25
|
-
var _useState = useState(LMDict.data[typeCode] || []),
|
|
26
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
-
codes = _useState2[0],
|
|
28
|
-
setCodes = _useState2[1];
|
|
29
|
-
|
|
30
|
-
useEffect(function () {
|
|
31
|
-
if (typeCode && !LMDict.data[typeCode]) {
|
|
32
|
-
queryByTypeCode(typeCode).then(function (res) {
|
|
33
|
-
var data = res.data || [];
|
|
34
|
-
data.forEach(function (item) {
|
|
35
|
-
item.label = item.name;
|
|
36
|
-
item.value = item.code;
|
|
37
|
-
item = Object.assign(Object.assign({}, item), formartItemTextExt(item.extText));
|
|
38
|
-
});
|
|
39
|
-
LMDict.updateDictMap(typeCode, data);
|
|
40
|
-
setCodes(data);
|
|
41
|
-
});
|
|
42
|
-
} else {
|
|
43
|
-
setCodes(function (old) {
|
|
44
|
-
return old.length > 0 ? old : LMDict.data[typeCode] || [];
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}, [typeCode]);
|
|
48
|
-
return codes;
|
|
49
|
-
}
|
|
50
|
-
export function useDicts() {
|
|
51
|
-
var typeCodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
52
|
-
var isWebVisible = arguments.length > 1 ? arguments[1] : undefined;
|
|
53
|
-
var typeStr = useMemo(function () {
|
|
54
|
-
return typeCodes.toString();
|
|
55
|
-
}, [typeCodes]);
|
|
56
|
-
|
|
57
|
-
var _useState3 = useState(function () {
|
|
58
|
-
return typeCodes.map(function (v) {
|
|
59
|
-
return LMDict.data[v] ? LMDict.data[v] : [];
|
|
60
|
-
});
|
|
61
|
-
}),
|
|
62
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
-
dicts = _useState4[0],
|
|
64
|
-
setDicts = _useState4[1];
|
|
65
|
-
|
|
66
|
-
useEffect(function () {
|
|
67
|
-
var codes = typeCodes.filter(function (v) {
|
|
68
|
-
return !LMDict.data[v];
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
if (codes.length === 0) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
queryByTypeCodes(codes, isWebVisible).then(function (res) {
|
|
76
|
-
var data = res.data;
|
|
77
|
-
data.forEach(function (item) {
|
|
78
|
-
item.label = item.name;
|
|
79
|
-
item.value = item.code;
|
|
80
|
-
item = Object.assign(Object.assign({}, item), formartItemTextExt(item.extText));
|
|
81
|
-
});
|
|
82
|
-
setDicts(function (old) {
|
|
83
|
-
codes.forEach(function (code) {
|
|
84
|
-
var itemCodes = data.filter(function (v1) {
|
|
85
|
-
return +v1.typeCode === +code;
|
|
86
|
-
});
|
|
87
|
-
var index = typeCodes.findIndex(function (v) {
|
|
88
|
-
return v === code;
|
|
89
|
-
});
|
|
90
|
-
old[index] = itemCodes;
|
|
91
|
-
LMDict.updateDictMap(code, itemCodes);
|
|
92
|
-
});
|
|
93
|
-
return _toConsumableArray(old);
|
|
94
|
-
});
|
|
95
|
-
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
-
}, [typeStr]);
|
|
97
|
-
return dicts;
|
|
98
|
-
}
|
package/es/Dict/index.d.ts
DELETED
package/es/Dict/index.js
DELETED
package/es/Dict/interface.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface DictItem {
|
|
2
|
-
label: string;
|
|
3
|
-
code: string;
|
|
4
|
-
id: string;
|
|
5
|
-
value: any;
|
|
6
|
-
name: string;
|
|
7
|
-
extText?: string;
|
|
8
|
-
typeCode?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
icon?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface CacheDictType {
|
|
14
|
-
data: { [key: string]: DictItem[] };
|
|
15
|
-
updateDictMap: (key: any, valuse: DictItem[]) => void;
|
|
16
|
-
}
|
package/es/Dict/utils.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DictItem } from './interface';
|
|
2
|
-
export declare function queryByTypeCode(typeCode: any): Promise<{
|
|
3
|
-
data: DictItem[];
|
|
4
|
-
}>;
|
|
5
|
-
export declare function queryByTypeCodes(typeCodes?: any[], isWebVisible?: boolean): Promise<{
|
|
6
|
-
data: DictItem[];
|
|
7
|
-
}>;
|
|
8
|
-
export declare function formartItemTextExt(text: string): {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|