@cloud-app-dev/vidc 4.0.15 → 4.1.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/.dumirc.ts +2 -18
- package/.eslintrc.js +3 -0
- package/.fatherrc.ts +0 -7
- package/es/AppContext/Sync.d.ts +1 -2
- package/es/AppContext/index.d.ts +10 -3
- package/es/AppContext/index.js +14 -4
- package/es/AppContext/interface.d.ts +1 -0
- package/es/CheckGroupFixed/demo.d.ts +1 -2
- package/es/CheckGroupFixed/demo.js +7 -12
- package/es/CheckGroupFixed/index.d.ts +7 -3
- package/es/CheckGroupFixed/index.js +9 -9
- package/es/CheckGroupFixed/style.d.ts +6 -0
- package/es/CheckGroupFixed/style.js +9 -0
- package/es/Config/index.js +1 -1
- package/es/CustomRenderSelect/index.d.ts +3 -2
- package/es/CustomRenderSelect/index.js +13 -10
- package/es/DBTools/index.js +1 -2
- package/es/DisableMark/index.d.ts +1 -2
- package/es/DisableMark/index.js +5 -2
- package/es/DomMove/demo.d.ts +1 -2
- package/es/DomMove/demo.js +0 -1
- package/es/DomMove/index.js +7 -8
- package/es/DynamicGridList/demo.d.ts +2 -0
- package/es/DynamicGridList/index.d.ts +1 -1
- package/es/DynamicGridList/index.js +3 -3
- package/es/DynamicList/demo.d.ts +1 -2
- package/es/DynamicList/demo.js +14 -19
- package/es/DynamicList/index.d.ts +1 -2
- package/es/DynamicList/index.js +10 -8
- package/es/ErrorFallback/index.d.ts +1 -2
- package/es/EventTools/index.d.ts +1 -1
- package/es/GridList/demo.d.ts +2 -0
- package/es/GridList/{Demo.js → demo.js} +1 -1
- package/es/GridList/hook.js +2 -2
- package/es/GridList/index.d.ts +0 -1
- package/es/GridList/index.js +5 -2
- package/es/HightLevel/index.d.ts +1 -2
- package/es/HightLevel/index.js +2 -3
- package/es/IconFont/index.d.ts +1 -1
- package/es/LabelValue/index.d.ts +1 -2
- package/es/LabelValue/index.js +5 -2
- package/es/List/demo.d.ts +1 -2
- package/es/List/demo.js +1 -2
- package/es/List/index.d.ts +2 -3
- package/es/List/index.js +25 -17
- package/es/ListWithSizeAnimate/demo.d.ts +1 -2
- package/es/ListWithSizeAnimate/index.d.ts +0 -1
- package/es/ListWithSizeAnimate/index.js +19 -10
- package/es/LoaderScript/index.d.ts +1 -1
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -2
- package/es/Picture/component/DefaultRects/RectInfo.js +6 -4
- package/es/Picture/component/DefaultRects/index.d.ts +1 -3
- package/es/Picture/component/DefaultRects/index.js +5 -5
- package/es/Picture/component/DefaultRects/style.d.ts +10 -0
- package/es/Picture/component/DefaultRects/style.js +28 -0
- package/es/Picture/component/DrawRect/index.d.ts +1 -3
- package/es/Picture/component/DrawRect/index.js +6 -3
- package/es/Picture/component/RectMenu/index.d.ts +1 -3
- package/es/Picture/component/RectMenu/index.js +13 -8
- package/es/Picture/component/Tools/index.d.ts +1 -2
- package/es/Picture/component/Tools/index.js +21 -9
- package/es/Picture/component/Tools/style.d.ts +2 -0
- package/es/Picture/component/Tools/style.js +5 -0
- package/es/Picture/component/WheelScale/index.d.ts +1 -2
- package/es/Picture/demo.d.ts +1 -2
- package/es/Picture/demo.js +1 -1
- package/es/Picture/index.d.ts +1 -3
- package/es/Picture/index.js +21 -19
- package/es/Picture/useDraw.js +4 -4
- package/es/Player/api/index.d.ts +1 -1
- package/es/Player/api/index.js +44 -18
- package/es/Player/context.d.ts +1 -1
- package/es/Player/contraller_bar/bar.d.ts +1 -1
- package/es/Player/contraller_bar/bar.js +5 -1
- package/es/Player/contraller_bar/contraller_event.d.ts +1 -1
- package/es/Player/contraller_bar/contraller_event.js +4 -5
- package/es/Player/contraller_bar/index.d.ts +1 -2
- package/es/Player/contraller_bar/index.js +8 -2
- package/es/Player/contraller_bar/left_bar.d.ts +1 -1
- package/es/Player/contraller_bar/left_bar.js +12 -3
- package/es/Player/contraller_bar/right_bar.d.ts +1 -1
- package/es/Player/contraller_bar/right_bar.js +1 -2
- package/es/Player/contraller_bar/time.d.ts +1 -2
- package/es/Player/contraller_bar/time.js +5 -2
- package/es/Player/contraller_bar/volume.d.ts +1 -2
- package/es/Player/contraller_bar/volume.js +11 -6
- package/es/Player/demo.d.ts +1 -2
- package/es/Player/demo.js +41 -29
- package/es/Player/empty.d.ts +1 -2
- package/es/Player/empty.js +0 -1
- package/es/Player/event/index.d.ts +1 -1
- package/es/Player/event/index.js +4 -3
- package/es/Player/fps_play.d.ts +1 -2
- package/es/Player/fps_play.js +6 -2
- package/es/Player/frontend_player.d.ts +1 -2
- package/es/Player/frontend_player.js +4 -5
- package/es/Player/frontend_timeline.d.ts +1 -3
- package/es/Player/frontend_timeline.js +16 -8
- package/es/Player/iconfont.d.ts +1 -2
- package/es/Player/iconfont.js +1 -2
- package/es/Player/live_heart.js +8 -9
- package/es/Player/message.d.ts +2 -4
- package/es/Player/message.js +16 -7
- package/es/Player/player.d.ts +2 -0
- package/es/Player/segment_player.d.ts +1 -2
- package/es/Player/segment_player.js +4 -5
- package/es/Player/segment_timeline.d.ts +1 -3
- package/es/Player/segment_timeline.js +19 -9
- package/es/Player/single_player.d.ts +0 -1
- package/es/Player/single_player.js +18 -15
- package/es/Player/timeline.d.ts +5 -3
- package/es/Player/timeline.js +10 -4
- package/es/Player/util.d.ts +2 -2
- package/es/Player/util.js +2 -2
- package/es/PlayerExt/demo.d.ts +1 -2
- package/es/PlayerExt/demo.js +3 -3
- package/es/PlayerExt/index.d.ts +1 -2
- package/es/PlayerExt/index.js +10 -5
- package/es/Progress/index.d.ts +1 -3
- package/es/Progress/index.js +7 -3
- package/es/ROI/demo.d.ts +1 -2
- package/es/ROI/demo.js +1 -2
- package/es/ROI/index.d.ts +1 -2
- package/es/ROI/index.js +17 -7
- package/es/RefDrawer/Footer.d.ts +1 -1
- package/es/RefDrawer/index.d.ts +1 -1
- package/es/RefDrawer/index.js +2 -2
- package/es/RefModal/demo.d.ts +1 -2
- package/es/RefModal/index.d.ts +1 -1
- package/es/RefModal/index.js +2 -2
- package/es/ScreenPlayer/Live.d.ts +1 -3
- package/es/ScreenPlayer/Live.js +10 -11
- package/es/ScreenPlayer/LiveTools.d.ts +5 -1
- package/es/ScreenPlayer/LiveTools.js +14 -9
- package/es/ScreenPlayer/PlayerWithExt.d.ts +3 -3
- package/es/ScreenPlayer/PlayerWithExt.js +14 -13
- package/es/ScreenPlayer/RatePick.d.ts +1 -2
- package/es/ScreenPlayer/RatePick.js +9 -4
- package/es/ScreenPlayer/Record.d.ts +1 -3
- package/es/ScreenPlayer/Record.js +27 -22
- package/es/ScreenPlayer/RecordTools.d.ts +1 -1
- package/es/ScreenPlayer/RecordTools.js +11 -13
- package/es/ScreenPlayer/ScreenSelect.d.ts +1 -2
- package/es/ScreenPlayer/ScreenSelect.js +11 -3
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -2
- package/es/ScreenPlayer/SegmentTimeLine.js +12 -6
- package/es/ScreenPlayer/TimeMode.d.ts +1 -2
- package/es/ScreenPlayer/TimeMode.js +7 -3
- package/es/ScreenPlayer/TimeSelect.d.ts +1 -2
- package/es/ScreenPlayer/TimeSelect.js +10 -5
- package/es/ScreenPlayer/containerStyle.d.ts +13 -0
- package/es/ScreenPlayer/containerStyle.js +32 -0
- package/es/ScreenPlayer/demo.d.ts +1 -2
- package/es/ScreenPlayer/demo.js +8 -13
- package/es/ScreenPlayer/demo2.d.ts +1 -2
- package/es/ScreenPlayer/demo2.js +112 -116
- package/es/ScreenPlayer/index.d.ts +2 -2
- package/es/ScreenPlayer/useTimeSlider.d.ts +2 -2
- package/es/ScreenPlayer/useTimeSlider.js +16 -15
- package/es/ScreenPlayer/useVideoFit.js +2 -2
- package/es/SocketEmitter/eventEmitter.d.ts +1 -1
- package/es/TableLayout/index.d.ts +1 -2
- package/es/TableLayout/index.js +7 -4
- package/es/Timeout/index.d.ts +1 -2
- package/es/Timeout/index.js +4 -5
- package/es/cache/index.d.ts +1 -1
- package/es/cache/index.js +21 -21
- package/es/index.d.ts +3 -11
- package/es/index.js +3 -11
- package/es/likeGo/index.d.ts +2 -0
- package/es/{Map/Config/utils.js → likeGo/index.js} +15 -49
- package/es/likeGoSync/index.d.ts +2 -0
- package/es/likeGoSync/index.js +10 -0
- package/es/logger/index.d.ts +4 -4
- package/es/nextTick/index.d.ts +1 -1
- package/es/nextTick/index.js +2 -6
- package/es/recorder/demo.d.ts +2 -0
- package/es/recorder/demo.js +200 -0
- package/es/recorder/index.d.ts +294 -0
- package/es/recorder/index.js +991 -0
- package/es/useDrawROI/index.js +8 -12
- package/es/useEventEmitterHandle/index.js +2 -2
- package/es/useInfiniteScroll/index.d.ts +1 -1
- package/es/useInfiniteScroll/index.js +8 -7
- package/es/useRafInterval/index.js +2 -2
- package/es/useSimpleState/index.js +3 -4
- package/es/useVirtualList/index.d.ts +1 -1
- package/es/useVirtualList/index.js +5 -8
- package/es/utils.d.ts +4 -4
- package/es/utils.js +1 -30
- package/es/uuid/index.d.ts +2 -1
- package/es/uuid/index.js +3 -12
- package/package.json +36 -37
- package/release-build.sh +3 -2
- package/scripts/{entry.js → entry.mjs} +4 -6
- package/{icon-fix.js → scripts/icon-fix.mjs} +4 -3
- package/tsconfig.json +1 -1
- package/es/Auth/index.d.ts +0 -8
- package/es/Auth/index.js +0 -18
- package/es/AutoExit/index.d.ts +0 -6
- package/es/AutoExit/index.js +0 -23
- package/es/CheckGroupFixed/index.less +0 -53
- package/es/ConfigContext/index.d.ts +0 -22
- package/es/ConfigContext/index.js +0 -25
- package/es/CustomRenderSelect/index.less +0 -25
- package/es/DisableMark/index.less +0 -9
- package/es/DynamicGridList/Demo.d.ts +0 -3
- package/es/DynamicList/index.less +0 -17
- package/es/FullScreen/index.d.ts +0 -22
- package/es/FullScreen/index.js +0 -36
- package/es/FullScreen/index.less +0 -18
- package/es/GridList/Demo.d.ts +0 -3
- package/es/GridList/index.less +0 -8
- package/es/HightLevel/index.less +0 -3
- package/es/ImageView/index.d.ts +0 -17
- package/es/ImageView/index.js +0 -58
- package/es/ImageView/index.less +0 -11
- package/es/LabelPlayer/111.png +0 -0
- package/es/LabelPlayer/demo.d.ts +0 -2
- package/es/LabelPlayer/demo.js +0 -123
- package/es/LabelPlayer/index.d.ts +0 -21
- package/es/LabelPlayer/index.js +0 -169
- package/es/LabelPlayer/index.less +0 -24
- package/es/LabelValue/index.less +0 -23
- package/es/List/index.less +0 -13
- package/es/ListWithSizeAnimate/index.less +0 -23
- package/es/Map/AMap.d.ts +0 -7109
- package/es/Map/BasicMap/AMapInstance.d.ts +0 -19
- package/es/Map/BasicMap/AMapInstance.js +0 -98
- package/es/Map/BasicMap/LeafletInstance.d.ts +0 -18
- package/es/Map/BasicMap/LeafletInstance.js +0 -111
- package/es/Map/BasicMap/index.d.ts +0 -9
- package/es/Map/BasicMap/index.js +0 -98
- package/es/Map/BasicMap/index.less +0 -29
- package/es/Map/ClusterLayer/demo.d.ts +0 -3
- package/es/Map/ClusterLayer/demo.js +0 -22
- package/es/Map/ClusterLayer/hook.d.ts +0 -5
- package/es/Map/ClusterLayer/hook.js +0 -124
- package/es/Map/ClusterLayer/index.d.ts +0 -6
- package/es/Map/ClusterLayer/index.js +0 -32
- package/es/Map/ClusterLayer/index.less +0 -29
- package/es/Map/ClusterLayer/props.d.ts +0 -8
- package/es/Map/Config/index.d.ts +0 -9
- package/es/Map/Config/index.js +0 -52
- package/es/Map/Config/utils.d.ts +0 -2
- package/es/Map/Context/index.d.ts +0 -11
- package/es/Map/Context/index.js +0 -56
- package/es/Map/FindPio/index.d.ts +0 -4
- package/es/Map/FindPio/index.js +0 -14
- package/es/Map/FindPio/index.less +0 -7
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +0 -4
- package/es/Map/InfoWindow/MakerLikeWindow.js +0 -113
- package/es/Map/InfoWindow/demo.d.ts +0 -3
- package/es/Map/InfoWindow/demo.js +0 -76
- package/es/Map/InfoWindow/index.d.ts +0 -11
- package/es/Map/InfoWindow/index.js +0 -67
- package/es/Map/LevelCenter/DragMarker/index.d.ts +0 -10
- package/es/Map/LevelCenter/DragMarker/index.js +0 -44
- package/es/Map/LevelCenter/demo.d.ts +0 -3
- package/es/Map/LevelCenter/demo.js +0 -46
- package/es/Map/LevelCenter/index.d.ts +0 -15
- package/es/Map/LevelCenter/index.js +0 -71
- package/es/Map/LoaderMap/index.d.ts +0 -12
- package/es/Map/LoaderMap/index.js +0 -71
- package/es/Map/MapDrawSelect/demo.d.ts +0 -3
- package/es/Map/MapDrawSelect/demo.js +0 -79
- package/es/Map/MapDrawSelect/index.d.ts +0 -15
- package/es/Map/MapDrawSelect/index.js +0 -62
- package/es/Map/MouseTool/index.d.ts +0 -10
- package/es/Map/MouseTool/index.js +0 -44
- package/es/Map/MouseTool/useMouseTools.d.ts +0 -7
- package/es/Map/MouseTool/useMouseTools.js +0 -83
- package/es/Map/ResetTools/index.d.ts +0 -10
- package/es/Map/ResetTools/index.js +0 -67
- package/es/Map/ResetTools/index.less +0 -39
- package/es/Map/SinglePoint/demo.d.ts +0 -3
- package/es/Map/SinglePoint/demo.js +0 -16
- package/es/Map/SinglePoint/index.d.ts +0 -27
- package/es/Map/SinglePoint/index.js +0 -57
- package/es/Map/SinglePoint/index.less +0 -41
- package/es/Map/hook/useMapEvent.d.ts +0 -2
- package/es/Map/hook/useMapEvent.js +0 -19
- package/es/Map/hook/useMapType.d.ts +0 -4
- package/es/Map/hook/useMapType.js +0 -12
- package/es/Map/icon.d.ts +0 -2
- package/es/Map/icon.js +0 -10
- package/es/Map/index.d.ts +0 -24
- package/es/Map/index.js +0 -25
- package/es/Map/interface.d.ts +0 -74
- package/es/Map/points.d.ts +0 -74
- package/es/Map/points.js +0 -1
- package/es/Map/useMarker/index.d.ts +0 -10
- package/es/Map/useMarker/index.js +0 -71
- package/es/Map/withMap/index.d.ts +0 -3
- package/es/Map/withMap/index.js +0 -18
- package/es/Picture/component/DefaultRects/index.less +0 -211
- package/es/Picture/component/DrawRect/index.less +0 -8
- package/es/Picture/component/RectMenu/index.less +0 -36
- package/es/Picture/component/Tools/index.less +0 -49
- package/es/Picture/index.less +0 -20
- package/es/Player/style/bar.less +0 -43
- package/es/Player/style/index.less +0 -34
- package/es/Player/style/message.less +0 -56
- package/es/Player/style/slider.less +0 -106
- package/es/Player/style/timeline.less +0 -116
- package/es/Player/style/volume.less +0 -24
- package/es/PlayerExt/index.less +0 -10
- package/es/Progress/index.less +0 -21
- package/es/ROI/index.less +0 -33
- package/es/ScreenPlayer/index.less +0 -335
- package/es/TableLayout/index.less +0 -4
- package/es/ThemeAntd/demo.d.ts +0 -4
- package/es/ThemeAntd/demo.js +0 -129
- package/es/ThemeAntd/demo.less +0 -20
- package/es/ThemeAntd/index.d.ts +0 -7
- package/es/ThemeAntd/index.js +0 -23
- package/es/ThemeAntd/index.less +0 -4
- package/es/VList/index.d.ts +0 -11
- package/es/VList/index.js +0 -42
- package/es/VList/index.less +0 -6
- package/es/VList/utils.d.ts +0 -14
- package/es/VList/utils.js +0 -17
- package/es/bigNumberTransformCN/index.d.ts +0 -5
- package/es/bigNumberTransformCN/index.js +0 -60
- package/es/useFullscreen/demo.d.ts +0 -2
- package/es/useFullscreen/demo.js +0 -48
- package/es/useFullscreen/index.d.ts +0 -12
- package/es/useFullscreen/index.js +0 -76
- /package/es/DynamicGridList/{Demo.js → demo.js} +0 -0
package/es/ScreenPlayer/demo2.js
CHANGED
|
@@ -17,16 +17,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
18
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
19
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
-
import {
|
|
20
|
+
import { DatePicker } from 'antd';
|
|
21
21
|
import moment from 'dayjs';
|
|
22
|
-
import
|
|
22
|
+
import { useMemo, useState } from 'react';
|
|
23
23
|
import Service from "../Service";
|
|
24
24
|
import RecordPlayer from "./Record";
|
|
25
25
|
import { completionSegments } from "./utils";
|
|
26
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
-
var token = "
|
|
29
|
-
var cids = ['
|
|
28
|
+
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InBhc3N3b3JkIjpudWxsLCJ1c2VybmFtZSI6Inh1d2VpY2hhbzEiLCJhdXRob3JpdGllcyI6W3siYXV0aG9yaXR5IjoiMTU3MDk1Nzk5NTE2MzcxNyJ9XSwiYWNjb3VudE5vbkV4cGlyZWQiOnRydWUsImFjY291bnROb25Mb2NrZWQiOnRydWUsImNyZWRlbnRpYWxzTm9uRXhwaXJlZCI6dHJ1ZSwiZW5hYmxlZCI6dHJ1ZSwiYWNjb3VudElkIjoxNTcwOTU3OTk2MTc5NTI1LCJzaWduSW5UeXBlIjoic3lzdGVtX3VzZXIiLCJzeXN0ZW1JZCI6MTU3MDk1Nzk5NDA0OTYwNSwidXNlcklkIjoxNTcwOTU3OTk2NjIxODkzLCJ1c2VyVHlwZSI6Miwib3JnSWQiOiIxMDA5IiwidXNlckdyYWRlIjo5OX0sInVzZXJfbmFtZSI6Inh1d2VpY2hhbzEiLCJzY29wZSI6WyJzeXN0ZW1fdXNlcl9yb2xlIl0sImV4cCI6MTY4Nzk1ODcwNywiYXV0aG9yaXRpZXMiOlsiMTU3MDk1Nzk5NTE2MzcxNyJdLCJqdGkiOiJkYmZhM2FhNS04YzRhLTRhZGQtOGFjNS1iMWVlZjllMjcwODgiLCJjbGllbnRfaWQiOiJzeXN0ZW1fdXNlcjoxNTcwOTU3OTk2NjIxODkzIn0.m0vP-mkaDeeKXcBuFwRfCXEfHoRjvNiHmD0-OWVxBec";
|
|
29
|
+
var cids = ['100000020', '100000014'];
|
|
30
30
|
var query = function query(_ref) {
|
|
31
31
|
var cid = _ref.cid,
|
|
32
32
|
date = _ref.date;
|
|
@@ -35,10 +35,9 @@ var query = function query(_ref) {
|
|
|
35
35
|
var endTime = m.set('hours', 23).set('minutes', 59).set('seconds', 59).unix();
|
|
36
36
|
var promise = Service.http({
|
|
37
37
|
method: 'post',
|
|
38
|
-
url: "/api/
|
|
38
|
+
url: "/api/community-manage-server/baseDevice/video/v1/historyVideo?authorization=".concat(token),
|
|
39
39
|
data: {
|
|
40
40
|
cid: cid,
|
|
41
|
-
mediaType: 'hls',
|
|
42
41
|
beginTime: beginTime,
|
|
43
42
|
endTime: endTime
|
|
44
43
|
}
|
|
@@ -68,133 +67,130 @@ export default function App() {
|
|
|
68
67
|
var _state$list$state$idx;
|
|
69
68
|
return state.list[state.idx] ? moment((_state$list$state$idx = state.list[state.idx]) === null || _state$list$state$idx === void 0 ? void 0 : _state$list$state$idx.date).set('hours', 0).set('minutes', 0).set('seconds', 0) : undefined;
|
|
70
69
|
}, [state.list, state.idx]);
|
|
71
|
-
return /*#__PURE__*/
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
71
|
+
style: {
|
|
72
|
+
width: '100%'
|
|
73
|
+
},
|
|
74
|
+
children: [/*#__PURE__*/_jsx(DatePicker, {
|
|
75
|
+
value: value,
|
|
76
|
+
onChange: /*#__PURE__*/function () {
|
|
77
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(v) {
|
|
78
|
+
var list, flag, cid, date, item, segments;
|
|
79
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
80
|
+
while (1) switch (_context.prev = _context.next) {
|
|
81
|
+
case 0:
|
|
82
|
+
list = _toConsumableArray(state.list);
|
|
83
|
+
flag = state.idx % 2 === 0;
|
|
84
|
+
cid = flag ? cids[0] : cids[1];
|
|
85
|
+
date = v === null || v === void 0 ? void 0 : v.set('hours', 0).set('minutes', 0).set('seconds', 0).valueOf();
|
|
86
|
+
item = {
|
|
87
|
+
date: date,
|
|
88
|
+
cid: cid,
|
|
89
|
+
type: 'hls',
|
|
90
|
+
recordType: 1,
|
|
91
|
+
loading: true
|
|
92
|
+
};
|
|
93
|
+
list[state.idx] = item;
|
|
94
|
+
setState(function (old) {
|
|
95
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
96
|
+
list: list
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
_context.next = 9;
|
|
100
|
+
return query(item);
|
|
101
|
+
case 9:
|
|
102
|
+
segments = _context.sent;
|
|
103
|
+
item.loading = false;
|
|
104
|
+
item.segments = segments;
|
|
105
|
+
list[state.idx] = item;
|
|
106
|
+
setState(function (old) {
|
|
107
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
108
|
+
list: _toConsumableArray(list)
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
case 14:
|
|
112
|
+
case "end":
|
|
113
|
+
return _context.stop();
|
|
114
|
+
}
|
|
115
|
+
}, _callee);
|
|
116
|
+
}));
|
|
117
|
+
return function (_x2) {
|
|
118
|
+
return _ref2.apply(this, arguments);
|
|
119
|
+
};
|
|
120
|
+
}()
|
|
121
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
74
122
|
style: {
|
|
123
|
+
height: 600,
|
|
75
124
|
width: '100%'
|
|
76
125
|
},
|
|
77
|
-
children:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
126
|
+
children: /*#__PURE__*/_jsx(RecordPlayer, {
|
|
127
|
+
list: state.list,
|
|
128
|
+
onIndexChange: function onIndexChange(idx) {
|
|
129
|
+
return setState(function (old) {
|
|
130
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
131
|
+
idx: idx
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
onTimeLineChange: /*#__PURE__*/function () {
|
|
136
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(date) {
|
|
137
|
+
var item, _state$list$state$idx2, segments;
|
|
138
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
139
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
84
140
|
case 0:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
cid: cid,
|
|
92
|
-
type: 'hls',
|
|
93
|
-
recordType: 1,
|
|
94
|
-
loading: true
|
|
95
|
-
};
|
|
96
|
-
list[state.idx] = item;
|
|
141
|
+
item = state.list[state.idx];
|
|
142
|
+
if (!state.list[state.idx]) {
|
|
143
|
+
_context2.next = 10;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
state.list[state.idx].loading = true;
|
|
97
147
|
setState(function (old) {
|
|
98
148
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
99
|
-
list: list
|
|
149
|
+
list: _toConsumableArray(state.list)
|
|
100
150
|
});
|
|
101
151
|
});
|
|
102
|
-
|
|
103
|
-
return query(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
152
|
+
_context2.next = 6;
|
|
153
|
+
return query({
|
|
154
|
+
cid: item.cid,
|
|
155
|
+
date: date,
|
|
156
|
+
recordType: 1
|
|
157
|
+
});
|
|
158
|
+
case 6:
|
|
159
|
+
segments = _context2.sent;
|
|
160
|
+
state.list[state.idx].loading = false;
|
|
161
|
+
state.list[state.idx].segments = [].concat(_toConsumableArray(segments), _toConsumableArray((_state$list$state$idx2 = state.list[state.idx].segments) !== null && _state$list$state$idx2 !== void 0 ? _state$list$state$idx2 : []));
|
|
109
162
|
setState(function (old) {
|
|
110
163
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
111
|
-
list: _toConsumableArray(list)
|
|
164
|
+
list: _toConsumableArray(state.list)
|
|
112
165
|
});
|
|
113
166
|
});
|
|
114
|
-
case
|
|
167
|
+
case 10:
|
|
115
168
|
case "end":
|
|
116
|
-
return
|
|
169
|
+
return _context2.stop();
|
|
117
170
|
}
|
|
118
|
-
},
|
|
171
|
+
}, _callee2);
|
|
119
172
|
}));
|
|
120
|
-
return function (
|
|
121
|
-
return
|
|
173
|
+
return function (_x3) {
|
|
174
|
+
return _ref3.apply(this, arguments);
|
|
122
175
|
};
|
|
123
|
-
}()
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
list: state.list,
|
|
131
|
-
onIndexChange: function onIndexChange(idx) {
|
|
132
|
-
return setState(function (old) {
|
|
133
|
-
return _objectSpread(_objectSpread({}, old), {}, {
|
|
134
|
-
idx: idx
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
},
|
|
138
|
-
onTimeLineChange: /*#__PURE__*/function () {
|
|
139
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(date) {
|
|
140
|
-
var item, _state$list$state$idx2, segments;
|
|
141
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
142
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
143
|
-
case 0:
|
|
144
|
-
item = state.list[state.idx];
|
|
145
|
-
if (!state.list[state.idx]) {
|
|
146
|
-
_context2.next = 10;
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
state.list[state.idx].loading = true;
|
|
150
|
-
setState(function (old) {
|
|
151
|
-
return _objectSpread(_objectSpread({}, old), {}, {
|
|
152
|
-
list: _toConsumableArray(state.list)
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
_context2.next = 6;
|
|
156
|
-
return query({
|
|
157
|
-
cid: item.cid,
|
|
158
|
-
date: date,
|
|
159
|
-
recordType: 1
|
|
160
|
-
});
|
|
161
|
-
case 6:
|
|
162
|
-
segments = _context2.sent;
|
|
163
|
-
state.list[state.idx].loading = false;
|
|
164
|
-
state.list[state.idx].segments = [].concat(_toConsumableArray(segments), _toConsumableArray((_state$list$state$idx2 = state.list[state.idx].segments) !== null && _state$list$state$idx2 !== void 0 ? _state$list$state$idx2 : []));
|
|
165
|
-
setState(function (old) {
|
|
166
|
-
return _objectSpread(_objectSpread({}, old), {}, {
|
|
167
|
-
list: _toConsumableArray(state.list)
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
case 10:
|
|
171
|
-
case "end":
|
|
172
|
-
return _context2.stop();
|
|
173
|
-
}
|
|
174
|
-
}, _callee2);
|
|
175
|
-
}));
|
|
176
|
-
return function (_x3) {
|
|
177
|
-
return _ref3.apply(this, arguments);
|
|
178
|
-
};
|
|
179
|
-
}(),
|
|
180
|
-
onClose: function onClose() {
|
|
181
|
-
var list = state.list;
|
|
182
|
-
list[state.idx] = undefined;
|
|
183
|
-
setState(function (old) {
|
|
184
|
-
return _objectSpread(_objectSpread({}, old), {}, {
|
|
185
|
-
list: _toConsumableArray(list)
|
|
186
|
-
});
|
|
176
|
+
}(),
|
|
177
|
+
onClose: function onClose() {
|
|
178
|
+
var list = state.list;
|
|
179
|
+
list[state.idx] = undefined;
|
|
180
|
+
setState(function (old) {
|
|
181
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
182
|
+
list: _toConsumableArray(list)
|
|
187
183
|
});
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
onCloseAll: function onCloseAll() {
|
|
187
|
+
return setState(function (old) {
|
|
188
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
189
|
+
list: []
|
|
194
190
|
});
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
})
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
})]
|
|
199
195
|
});
|
|
200
196
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const Sceenplayer: {
|
|
3
|
-
LivePlayer: import("react").
|
|
4
|
-
RecordPlayer: import("react").
|
|
3
|
+
LivePlayer: import("react").ForwardRefExoticComponent<import("./interface").ILivePlayerProps & import("react").RefAttributes<any>>;
|
|
4
|
+
RecordPlayer: import("react").ForwardRefExoticComponent<import("./interface").IRecordPlayerProps & import("react").RefAttributes<any>>;
|
|
5
5
|
};
|
|
6
6
|
export default Sceenplayer;
|
|
@@ -11,7 +11,7 @@ export interface ITimeSliderOptions {
|
|
|
11
11
|
}, outTimeline?: boolean) => void;
|
|
12
12
|
onHoursPerChange: (hour: number) => void;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type ITimeSliderState = {
|
|
15
15
|
hoursPer: number;
|
|
16
16
|
begin: number;
|
|
17
17
|
currentTime: number;
|
|
@@ -20,6 +20,6 @@ export declare type ITimeSliderState = {
|
|
|
20
20
|
time?: number;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type TimeCellItem = ISegmentType;
|
|
24
24
|
declare function useTimeSlider(canvasRef: React.RefObject<HTMLCanvasElement>, { hoursPer, begin, currentTime, segments, onTimeChange, onHoursPerChange }: ITimeSliderOptions): void;
|
|
25
25
|
export default useTimeSlider;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
import _useEventListener from "ahooks/es/useEventListener";
|
|
3
|
-
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
4
|
-
import _useSize from "ahooks/es/useSize";
|
|
5
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -13,6 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
10
|
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; }
|
|
14
11
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
15
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { useEventListener, useSize, useUpdateEffect } from 'ahooks';
|
|
16
14
|
import moment from 'dayjs';
|
|
17
15
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
18
16
|
import nextTick from "../nextTick";
|
|
@@ -99,7 +97,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
99
97
|
mousedownTime: undefined,
|
|
100
98
|
mousedownX: 0
|
|
101
99
|
});
|
|
102
|
-
var size =
|
|
100
|
+
var size = useSize(canvasRef);
|
|
103
101
|
var canvas = canvasRef.current;
|
|
104
102
|
var _useMemo = useMemo(function () {
|
|
105
103
|
return size ? size : {
|
|
@@ -233,7 +231,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
233
231
|
drawText(ctx, {
|
|
234
232
|
fillStyle: hoverLineColor,
|
|
235
233
|
font: '12px Arial',
|
|
236
|
-
x: (_state$hover$x = state.hover.x) !== null && _state$hover$x !== void 0 ? _state$hover$x : 0 - 50,
|
|
234
|
+
x: ((_state$hover$x = state.hover.x) !== null && _state$hover$x !== void 0 ? _state$hover$x : 0) - 50,
|
|
237
235
|
y: 12,
|
|
238
236
|
text: formartTimestemp((_state$hover$time = state.hover.time) !== null && _state$hover$time !== void 0 ? _state$hover$time : 0)
|
|
239
237
|
});
|
|
@@ -251,7 +249,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
251
249
|
/**
|
|
252
250
|
* 更新画布大小
|
|
253
251
|
*/
|
|
254
|
-
|
|
252
|
+
useUpdateEffect(function () {
|
|
255
253
|
if (canvas) {
|
|
256
254
|
canvas.width = width;
|
|
257
255
|
canvas.height = height;
|
|
@@ -269,17 +267,17 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
269
267
|
}
|
|
270
268
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
271
269
|
}, [canvas, state.begin, state.currentTime, state.hoursPer, segments, state.hover, size]);
|
|
272
|
-
|
|
270
|
+
useUpdateEffect(function () {
|
|
273
271
|
return update({
|
|
274
272
|
begin: begin
|
|
275
273
|
});
|
|
276
274
|
}, [begin]);
|
|
277
|
-
|
|
275
|
+
useUpdateEffect(function () {
|
|
278
276
|
return update({
|
|
279
277
|
hoursPer: hoursPer
|
|
280
278
|
});
|
|
281
279
|
}, [hoursPer]);
|
|
282
|
-
|
|
280
|
+
useUpdateEffect(function () {
|
|
283
281
|
return update({
|
|
284
282
|
currentTime: currentTime
|
|
285
283
|
});
|
|
@@ -288,7 +286,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
288
286
|
/**
|
|
289
287
|
* 触发绘制范围单位(hour)
|
|
290
288
|
*/
|
|
291
|
-
|
|
289
|
+
useEventListener('mousewheel', function (event) {
|
|
292
290
|
event.preventDefault();
|
|
293
291
|
var delta = Math.max(-1, Math.min(1, event.wheelDelta || -event.detail));
|
|
294
292
|
var middle_time = state.begin + state.hoursPer * 3600 * 1000 / 2; //ms 记住当前中间的时间
|
|
@@ -316,6 +314,9 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
316
314
|
hoursPer: new_hoursPer
|
|
317
315
|
});
|
|
318
316
|
});
|
|
317
|
+
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange({
|
|
318
|
+
begin: new_begin
|
|
319
|
+
});
|
|
319
320
|
nextTick(function () {
|
|
320
321
|
return onHoursPerChange === null || onHoursPerChange === void 0 ? void 0 : onHoursPerChange(new_hoursPer);
|
|
321
322
|
});
|
|
@@ -326,7 +327,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
326
327
|
/**
|
|
327
328
|
* 用于处理canvas移除hover效果
|
|
328
329
|
*/
|
|
329
|
-
|
|
330
|
+
useEventListener('mouseout', function () {
|
|
330
331
|
return setState(function (old) {
|
|
331
332
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
332
333
|
hover: {
|
|
@@ -342,7 +343,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
342
343
|
/**
|
|
343
344
|
* hover效果绘制
|
|
344
345
|
*/
|
|
345
|
-
|
|
346
|
+
useEventListener('mousemove', function (e) {
|
|
346
347
|
if (extRef.current.mousedownTime) {
|
|
347
348
|
setState(function (old) {
|
|
348
349
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
@@ -373,7 +374,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
373
374
|
/**
|
|
374
375
|
* 标记点击、拖动的触发器
|
|
375
376
|
*/
|
|
376
|
-
|
|
377
|
+
useEventListener('mousedown', function (e) {
|
|
377
378
|
extRef.current.mousedownTime = Date.now();
|
|
378
379
|
extRef.current.mousedownX = get_cursor_x_position(e); //记住mousedown的位置
|
|
379
380
|
}, {
|
|
@@ -383,7 +384,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
383
384
|
/**
|
|
384
385
|
* 处理点击、结束拖动的处理
|
|
385
386
|
*/
|
|
386
|
-
|
|
387
|
+
useEventListener('mouseup', function (e) {
|
|
387
388
|
if (!extRef.current.mousedownTime) {
|
|
388
389
|
// 未在canvas上触发mousedown 过滤
|
|
389
390
|
return;
|
|
@@ -424,7 +425,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
424
425
|
/**
|
|
425
426
|
* 拖动处理
|
|
426
427
|
*/
|
|
427
|
-
|
|
428
|
+
useEventListener('mousemove', function (e) {
|
|
428
429
|
if (!extRef.current.mousedownTime) {
|
|
429
430
|
return;
|
|
430
431
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _useToggle3 from "ahooks/es/useToggle";
|
|
2
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
2
|
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
3
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -9,10 +8,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
9
8
|
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; }
|
|
10
9
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
11
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { useToggle } from 'ahooks';
|
|
12
12
|
import { useEffect, useMemo } from 'react';
|
|
13
13
|
export default function useVideoFit(containerRef) {
|
|
14
14
|
var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
15
|
-
var _useToggle =
|
|
15
|
+
var _useToggle = useToggle('fill', 'contain'),
|
|
16
16
|
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
17
17
|
fit = _useToggle2[0],
|
|
18
18
|
toggle = _useToggle2[1].toggle;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
2
|
interface ITableLayoutProps {
|
|
4
3
|
className?: string;
|
|
5
4
|
children: React.ReactElement;
|
|
6
5
|
cutNum?: number;
|
|
7
6
|
x?: string | number;
|
|
8
7
|
}
|
|
9
|
-
declare function TableLayout({ className, children, cutNum, x }: ITableLayoutProps): JSX.Element;
|
|
8
|
+
declare function TableLayout({ className, children, cutNum, x }: ITableLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default TableLayout;
|
package/es/TableLayout/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { css } from '@emotion/css';
|
|
4
|
+
import { useSize } from 'ahooks';
|
|
2
5
|
import React, { useMemo, useRef } from 'react';
|
|
3
|
-
import "./index.less";
|
|
4
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
var classname = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: calc(100% - 32px);\n padding-top: 20px;\n"])));
|
|
5
8
|
function TableLayout(_ref) {
|
|
6
9
|
var _ref$className = _ref.className,
|
|
7
10
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
@@ -11,13 +14,13 @@ function TableLayout(_ref) {
|
|
|
11
14
|
_ref$x = _ref.x,
|
|
12
15
|
x = _ref$x === void 0 ? 1200 : _ref$x;
|
|
13
16
|
var domRef = useRef(null);
|
|
14
|
-
var size =
|
|
17
|
+
var size = useSize(domRef);
|
|
15
18
|
var height = useMemo(function () {
|
|
16
19
|
return size !== null && size !== void 0 && size.height ? size.height - cutNum : 0;
|
|
17
20
|
}, [size === null || size === void 0 ? void 0 : size.height, cutNum]);
|
|
18
21
|
return /*#__PURE__*/_jsx("div", {
|
|
19
22
|
ref: domRef,
|
|
20
|
-
className: "
|
|
23
|
+
className: "".concat(classname, " ").concat(className),
|
|
21
24
|
children: /*#__PURE__*/React.cloneElement(children, {
|
|
22
25
|
scroll: {
|
|
23
26
|
x: x,
|
package/es/Timeout/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { BasicTarget } from 'ahooks/es/utils/domTarget';
|
|
3
2
|
interface ITimeoutProps {
|
|
4
3
|
/**
|
|
@@ -22,7 +21,7 @@ interface ITimeoutProps {
|
|
|
22
21
|
/**
|
|
23
22
|
* @desc 用户创建界面超时回调
|
|
24
23
|
*/
|
|
25
|
-
declare function Timeout({ contianer, time, onTimeout, ignore }: ITimeoutProps): JSX.Element;
|
|
24
|
+
declare function Timeout({ contianer, time, onTimeout, ignore }: ITimeoutProps): import("react/jsx-runtime").JSX.Element;
|
|
26
25
|
declare namespace Timeout {
|
|
27
26
|
var defaultProps: {
|
|
28
27
|
time: number;
|
package/es/Timeout/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
import _useEventListener from "ahooks/es/useEventListener";
|
|
3
|
-
import _useRafInterval from "ahooks/es/useRafInterval";
|
|
4
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -12,7 +10,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
12
10
|
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; }
|
|
13
11
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
14
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
-
import
|
|
13
|
+
import { useEventListener, useRafInterval } from 'ahooks';
|
|
14
|
+
import { useEffect, useRef, useState } from 'react';
|
|
16
15
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
17
|
/**
|
|
@@ -31,7 +30,7 @@ function Timeout(_ref) {
|
|
|
31
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
31
|
state = _useState2[0],
|
|
33
32
|
setState = _useState2[1];
|
|
34
|
-
|
|
33
|
+
useRafInterval(function () {
|
|
35
34
|
var now = Date.now();
|
|
36
35
|
setState(function (old) {
|
|
37
36
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
@@ -56,7 +55,7 @@ function Timeout(_ref) {
|
|
|
56
55
|
|
|
57
56
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
57
|
}, [state.timelock, time]);
|
|
59
|
-
|
|
58
|
+
useEventListener('mousemove', function () {
|
|
60
59
|
return cuurentTimeRef.current = Date.now();
|
|
61
60
|
}, {
|
|
62
61
|
target: contianer
|
package/es/cache/index.d.ts
CHANGED
package/es/cache/index.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1
7
|
import Cookie from 'js-cookie';
|
|
8
|
+
import likeGoSync from "../likeGoSync";
|
|
2
9
|
/**
|
|
3
10
|
* 获取缓存数据
|
|
4
11
|
* @param {string} key
|
|
5
12
|
* @param {string} type: 缓存类型 'local'(默认) / cookie / session;
|
|
6
13
|
*/
|
|
7
14
|
function getCache(key) {
|
|
15
|
+
var _Cookie$get, _sessionStorage$getIt, _localStorage$getItem;
|
|
8
16
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'local';
|
|
9
|
-
var
|
|
17
|
+
var str;
|
|
10
18
|
switch (type) {
|
|
11
19
|
case 'cookie':
|
|
12
|
-
|
|
20
|
+
str = (_Cookie$get = Cookie.get(key)) !== null && _Cookie$get !== void 0 ? _Cookie$get : '';
|
|
13
21
|
break;
|
|
14
22
|
case 'session':
|
|
15
|
-
|
|
16
|
-
var strS = sessionStorage.getItem(key);
|
|
17
|
-
try {
|
|
18
|
-
data = JSON.parse(strS);
|
|
19
|
-
} catch (e) {
|
|
20
|
-
data = strS;
|
|
21
|
-
}
|
|
23
|
+
str = (_sessionStorage$getIt = sessionStorage.getItem(key)) !== null && _sessionStorage$getIt !== void 0 ? _sessionStorage$getIt : '';
|
|
22
24
|
break;
|
|
23
25
|
default:
|
|
24
|
-
|
|
25
|
-
var strL = localStorage.getItem(key);
|
|
26
|
-
try {
|
|
27
|
-
data = JSON.parse(strL);
|
|
28
|
-
} catch (e) {
|
|
29
|
-
data = strL;
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
26
|
+
str = (_localStorage$getItem = localStorage.getItem(key)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : '';
|
|
32
27
|
}
|
|
33
|
-
|
|
28
|
+
var _likeGoSync = likeGoSync(function () {
|
|
29
|
+
return JSON.parse(str);
|
|
30
|
+
}),
|
|
31
|
+
_likeGoSync2 = _slicedToArray(_likeGoSync, 2),
|
|
32
|
+
res = _likeGoSync2[0],
|
|
33
|
+
err = _likeGoSync2[1];
|
|
34
|
+
return err ? str : res;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/**
|
|
@@ -52,7 +53,6 @@ function setCache(key, value) {
|
|
|
52
53
|
break;
|
|
53
54
|
default:
|
|
54
55
|
localStorage.setItem(key, JSON.stringify(value));
|
|
55
|
-
break;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -65,7 +65,7 @@ function getUserCache(key) {
|
|
|
65
65
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'local';
|
|
66
66
|
var id = getCache('userId', 'session');
|
|
67
67
|
if (!id) {
|
|
68
|
-
console.error('
|
|
68
|
+
console.error('无法获取用户信息!,缓存获取失败!');
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
return getCache("".concat(id, "-").concat(key), type);
|
|
@@ -81,7 +81,7 @@ function setUserCache(key, value) {
|
|
|
81
81
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'local';
|
|
82
82
|
var id = getCache('userId', 'session');
|
|
83
83
|
if (!id) {
|
|
84
|
-
console.error('
|
|
84
|
+
console.error('无法获取用户信息!,缓存设置失败!');
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
return setCache("".concat(id, "-").concat(key), value, type);
|