wargerm 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Video/index.d.ts +14 -5
- package/dist/index.css +171 -48
- package/dist/index.esm.css +171 -48
- package/dist/index.esm.js +182 -78
- package/dist/index.js +181 -77
- package/dist/utils/useModelPlugin/Provider.d.ts +4 -0
- package/dist/utils/useModelPlugin/composeRootApp.d.ts +2 -0
- package/dist/utils/useModelPlugin/helpers/dispatcher.d.ts +5 -0
- package/dist/utils/useModelPlugin/helpers/executor.d.ts +7 -0
- package/dist/utils/useModelPlugin/helpers/storeContext.d.ts +3 -0
- package/dist/utils/useModelPlugin/index.d.ts +5 -0
- package/dist/utils/useModelPlugin/useModel.d.ts +1 -0
- package/package.json +90 -90
package/dist/index.esm.js
CHANGED
@@ -3,7 +3,7 @@ import React, { useRef, useEffect, useMemo, useState, useCallback, useImperative
|
|
3
3
|
import { cloneDeep, uniqBy, isEmpty } from 'lodash-es';
|
4
4
|
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
5
5
|
import { Menu, Dropdown, Button, Input, Upload as Upload$1, Modal as Modal$2, message, InputNumber, DatePicker, Radio, Space, Checkbox, Select, Switch, Tooltip, TreeSelect as TreeSelect$1, Cascader, Form, Row, Col, Spin, Pagination, Breadcrumb, ConfigProvider } from 'antd';
|
6
|
-
import { createFromIconfontCN, PlusOutlined, SearchOutlined, ReloadOutlined,
|
6
|
+
import { createFromIconfontCN, PlusOutlined, CloseCircleOutlined, SearchOutlined, ReloadOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined, LeftOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
|
7
7
|
import FileViewer from 'react-file-viewer';
|
8
8
|
import classnames from 'classnames';
|
9
9
|
import zhCN from 'antd/es/date-picker/locale/zh_CN';
|
@@ -2593,9 +2593,21 @@ dayjs.locale('zh-cn');
|
|
2593
2593
|
var WDatePicker = function WDatePicker(props) {
|
2594
2594
|
var extraProps = _extends({}, props);
|
2595
2595
|
|
2596
|
-
return /*#__PURE__*/React.createElement(DatePicker, _objectSpread2({
|
2596
|
+
return /*#__PURE__*/React.createElement(DatePicker, _objectSpread2(_objectSpread2({
|
2597
2597
|
locale: zhCN
|
2598
|
-
}, extraProps)
|
2598
|
+
}, extraProps), {}, {
|
2599
|
+
clearIcon: /*#__PURE__*/React.createElement("div", {
|
2600
|
+
className: "clearIconBox"
|
2601
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined, {
|
2602
|
+
className: "clearIcon"
|
2603
|
+
})),
|
2604
|
+
suffixIcon: /*#__PURE__*/React.createElement("div", {
|
2605
|
+
className: "dateIcon"
|
2606
|
+
}, /*#__PURE__*/React.createElement("img", {
|
2607
|
+
className: "datePickerIcon",
|
2608
|
+
src: require('../../assets/icon/datePickerIcon.png')
|
2609
|
+
}))
|
2610
|
+
}));
|
2599
2611
|
};
|
2600
2612
|
|
2601
2613
|
WDatePicker.defaultProps = {};
|
@@ -2622,6 +2634,17 @@ var RangePicker = function RangePicker(props) {
|
|
2622
2634
|
if (panelType === 'within') {
|
2623
2635
|
return /*#__PURE__*/React.createElement(RangePicker, _objectSpread2({
|
2624
2636
|
locale: zhCN,
|
2637
|
+
clearIcon: /*#__PURE__*/React.createElement("div", {
|
2638
|
+
className: "clearIconBox"
|
2639
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined, {
|
2640
|
+
className: "clearIcon"
|
2641
|
+
})),
|
2642
|
+
suffixIcon: /*#__PURE__*/React.createElement("div", {
|
2643
|
+
className: "dateIcon"
|
2644
|
+
}, /*#__PURE__*/React.createElement("img", {
|
2645
|
+
className: "datePickerIcon",
|
2646
|
+
src: require('../../assets/icon/datePickerIcon.png')
|
2647
|
+
})),
|
2625
2648
|
value: rangePickerValue,
|
2626
2649
|
onChange: function onChange(date) {
|
2627
2650
|
setRadioValue('');
|
@@ -2654,7 +2677,7 @@ var RangePicker = function RangePicker(props) {
|
|
2654
2677
|
}
|
2655
2678
|
}, /*#__PURE__*/React.createElement(Space, {
|
2656
2679
|
direction: "vertical",
|
2657
|
-
size:
|
2680
|
+
size: 28
|
2658
2681
|
}, /*#__PURE__*/React.createElement(Radio.Button, {
|
2659
2682
|
value: '1',
|
2660
2683
|
onClick: function onClick() {
|
@@ -2711,6 +2734,17 @@ var RangePicker = function RangePicker(props) {
|
|
2711
2734
|
}
|
2712
2735
|
}, /*#__PURE__*/React.createElement("span", null, "\u65E5")))), /*#__PURE__*/React.createElement(RangePicker, _objectSpread2({
|
2713
2736
|
locale: zhCN,
|
2737
|
+
clearIcon: /*#__PURE__*/React.createElement("div", {
|
2738
|
+
className: "clearIconBox"
|
2739
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined, {
|
2740
|
+
className: "clearIcon"
|
2741
|
+
})),
|
2742
|
+
suffixIcon: /*#__PURE__*/React.createElement("div", {
|
2743
|
+
className: "dateIcon"
|
2744
|
+
}, /*#__PURE__*/React.createElement("img", {
|
2745
|
+
className: "datePickerIcon",
|
2746
|
+
src: require('../../assets/icon/datePickerIcon.png')
|
2747
|
+
})),
|
2714
2748
|
value: rangePickerValue,
|
2715
2749
|
onChange: function onChange(date) {
|
2716
2750
|
setRadioValue('');
|
@@ -2720,6 +2754,17 @@ var RangePicker = function RangePicker(props) {
|
|
2720
2754
|
}
|
2721
2755
|
|
2722
2756
|
return /*#__PURE__*/React.createElement(DatePicker.RangePicker, _objectSpread2({
|
2757
|
+
clearIcon: /*#__PURE__*/React.createElement("div", {
|
2758
|
+
className: "clearIconBox"
|
2759
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined, {
|
2760
|
+
className: "clearIcon"
|
2761
|
+
})),
|
2762
|
+
suffixIcon: /*#__PURE__*/React.createElement("div", {
|
2763
|
+
className: "dateIcon"
|
2764
|
+
}, /*#__PURE__*/React.createElement("img", {
|
2765
|
+
className: "datePickerIcon",
|
2766
|
+
src: require('../../assets/icon/datePickerIcon.png')
|
2767
|
+
})),
|
2723
2768
|
locale: zhCN
|
2724
2769
|
}, extraProps));
|
2725
2770
|
};
|
@@ -3164,7 +3209,7 @@ var NumericInput = /*#__PURE__*/function (_React$Component) {
|
|
3164
3209
|
valueTemp = value.slice(0, -1);
|
3165
3210
|
}
|
3166
3211
|
|
3167
|
-
onChange && onChange(valueTemp.replace(/0*(\d+)/, '$1'));
|
3212
|
+
valueTemp && onChange && onChange(valueTemp.replace(/0*(\d+)/, '$1'));
|
3168
3213
|
|
3169
3214
|
if (onBlur) {
|
3170
3215
|
onBlur && onBlur();
|
@@ -8298,7 +8343,8 @@ function VideoPlayer(_ref, ref) {
|
|
8298
8343
|
style = _ref.style,
|
8299
8344
|
_ref$config = _ref.config,
|
8300
8345
|
config = _ref$config === void 0 ? {} : _ref$config,
|
8301
|
-
layoutIndex = _ref.layoutIndex,
|
8346
|
+
_ref$layoutIndex = _ref.layoutIndex,
|
8347
|
+
layoutIndex = _ref$layoutIndex === void 0 ? 0 : _ref$layoutIndex,
|
8302
8348
|
_ref$url = _ref.url,
|
8303
8349
|
url = _ref$url === void 0 ? [] : _ref$url,
|
8304
8350
|
_ref$layouts = _ref.layouts,
|
@@ -8350,6 +8396,9 @@ function VideoPlayer(_ref, ref) {
|
|
8350
8396
|
useEffect(function () {
|
8351
8397
|
setUrls(url);
|
8352
8398
|
}, [url]);
|
8399
|
+
useEffect(function () {
|
8400
|
+
setCurrentLayoutIndex(layoutIndex);
|
8401
|
+
}, [layoutIndex]);
|
8353
8402
|
var initPlayerIndex = allLayouts[layoutIndex || 0].span >= url.length ? url.length - 1 >= 0 ? url.length - 1 : 0 : allLayouts[layoutIndex || 0].span - 1;
|
8354
8403
|
|
8355
8404
|
var _useState5 = useState(initPlayerIndex),
|
@@ -8498,14 +8547,14 @@ function VideoPlayer(_ref, ref) {
|
|
8498
8547
|
|
8499
8548
|
var index$6 = /*#__PURE__*/forwardRef(VideoPlayer);
|
8500
8549
|
|
8501
|
-
var _excluded$m = ["id", "videoUrls", "definitionList", "isLoop", "muted", "currentIndex", "setCurrentIndex", "className", "style", "
|
8550
|
+
var _excluded$m = ["id", "videoUrls", "definitionList", "isLoop", "muted", "currentIndex", "setCurrentIndex", "className", "style", "visible", "autoplay", "videoInit", "enableMemory", "lastPlayTimeHideDelay"];
|
8502
8551
|
|
8503
8552
|
var DEFAULT_PLAY_BACK_RATE = [0.5, 0.75, 1, 1.5, 2]; // 默认记忆提示文字展示时长(s)
|
8504
8553
|
|
8505
8554
|
var DEFAULT_LAST_PLAY_TIME_DELAY = 5; // 默认音量大小
|
8506
8555
|
|
8507
8556
|
var DEFAULT_VOLUME = 0.6;
|
8508
|
-
var index$7 = (function (_ref) {
|
8557
|
+
var index$7 = /*#__PURE__*/forwardRef(function (_ref, playerRef) {
|
8509
8558
|
var id = _ref.id,
|
8510
8559
|
_ref$videoUrls = _ref.videoUrls,
|
8511
8560
|
videoUrls = _ref$videoUrls === void 0 ? [] : _ref$videoUrls,
|
@@ -8519,8 +8568,8 @@ var index$7 = (function (_ref) {
|
|
8519
8568
|
setParentIndex = _ref.setCurrentIndex,
|
8520
8569
|
className = _ref.className,
|
8521
8570
|
style = _ref.style,
|
8522
|
-
_ref$
|
8523
|
-
|
8571
|
+
_ref$visible = _ref.visible,
|
8572
|
+
visible = _ref$visible === void 0 ? true : _ref$visible,
|
8524
8573
|
_ref$autoplay = _ref.autoplay,
|
8525
8574
|
autoplay = _ref$autoplay === void 0 ? false : _ref$autoplay,
|
8526
8575
|
_ref$videoInit = _ref.videoInit,
|
@@ -8532,19 +8581,26 @@ var index$7 = (function (_ref) {
|
|
8532
8581
|
props = _objectWithoutProperties(_ref, _excluded$m);
|
8533
8582
|
|
8534
8583
|
var player = useRef();
|
8535
|
-
var currentPlayerIndex = useRef(0); // 内置的 index 状态管理
|
8536
8584
|
|
8537
|
-
var _useState = useState(
|
8585
|
+
var _useState = useState(true),
|
8538
8586
|
_useState2 = _slicedToArray(_useState, 2),
|
8539
|
-
|
8540
|
-
|
8541
|
-
|
8542
|
-
var
|
8543
|
-
|
8544
|
-
|
8545
|
-
|
8546
|
-
|
8547
|
-
|
8587
|
+
firstRender = _useState2[0],
|
8588
|
+
setFirstRender = _useState2[1];
|
8589
|
+
|
8590
|
+
var _useState3 = useState(false),
|
8591
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
8592
|
+
ready = _useState4[0],
|
8593
|
+
setReady = _useState4[1];
|
8594
|
+
|
8595
|
+
var currentPlayerIndex = useRef(0); // 内置的 index 状态管理
|
8596
|
+
|
8597
|
+
var _useState5 = useState(0),
|
8598
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
8599
|
+
videoIndex = _useState6[0],
|
8600
|
+
setVideoIndex = _useState6[1];
|
8601
|
+
|
8602
|
+
var currentIndex = parentIndex !== null && parentIndex !== void 0 ? parentIndex : videoIndex;
|
8603
|
+
var setCurrentIndex = setParentIndex !== null && setParentIndex !== void 0 ? setParentIndex : setVideoIndex;
|
8548
8604
|
var config = useRef(_objectSpread2({
|
8549
8605
|
url: videoUrls[0],
|
8550
8606
|
playbackRate: DEFAULT_PLAY_BACK_RATE,
|
@@ -8558,25 +8614,52 @@ var index$7 = (function (_ref) {
|
|
8558
8614
|
}, props));
|
8559
8615
|
/** 设置当前播放 index */
|
8560
8616
|
|
8561
|
-
var handleSetCurrentIndex = useCallback(function (
|
8617
|
+
var handleSetCurrentIndex = useCallback(function (_ref2) {
|
8618
|
+
var currentIdx = _ref2.currentIdx,
|
8619
|
+
videoUrls = _ref2.videoUrls;
|
8562
8620
|
var newIdx = currentIdx !== null && currentIdx !== void 0 ? currentIdx : currentPlayerIndex.current + 1;
|
8563
8621
|
|
8564
8622
|
if (newIdx >= videoUrls.length) {
|
8565
|
-
|
8566
|
-
// 允许循环则播放起始视频
|
8567
|
-
newIdx = 0;
|
8568
|
-
} else if (player.current && player.current.video) {
|
8569
|
-
// 不允许循环则进度条快进到最后
|
8570
|
-
player.current.currentTime = player.current.video.duration;
|
8571
|
-
return;
|
8572
|
-
}
|
8623
|
+
newIdx = 0;
|
8573
8624
|
}
|
8574
8625
|
|
8575
8626
|
setCurrentIndex(newIdx);
|
8576
|
-
}, [
|
8627
|
+
}, [setCurrentIndex]);
|
8628
|
+
/** 结束事件 */
|
8629
|
+
|
8630
|
+
var onEnd = useCallback(function (isLoop, videoUrls) {
|
8631
|
+
return function () {
|
8632
|
+
// 如果是循环或有其他视频未播放完,继续播放下一个
|
8633
|
+
if (isLoop || !isLoop && currentPlayerIndex.current < videoUrls.length - 1) {
|
8634
|
+
setTimeout(function () {
|
8635
|
+
var _player$current;
|
8636
|
+
|
8637
|
+
return (_player$current = player.current) === null || _player$current === void 0 ? void 0 : _player$current.play();
|
8638
|
+
});
|
8639
|
+
}
|
8640
|
+
|
8641
|
+
handleSetCurrentIndex({
|
8642
|
+
videoUrls: videoUrls
|
8643
|
+
});
|
8644
|
+
};
|
8645
|
+
}, [handleSetCurrentIndex]);
|
8646
|
+
/** 点击下一个事件 */
|
8647
|
+
|
8648
|
+
var onPlayNextBtnClick = useCallback(function (videoUrls) {
|
8649
|
+
return function () {
|
8650
|
+
if (player.current) {
|
8651
|
+
// 防止 next 按钮消失
|
8652
|
+
player.current.currentVideoIndex = videoUrls.length - 2;
|
8653
|
+
}
|
8654
|
+
|
8655
|
+
handleSetCurrentIndex({
|
8656
|
+
videoUrls: videoUrls
|
8657
|
+
});
|
8658
|
+
};
|
8659
|
+
}, [handleSetCurrentIndex]);
|
8577
8660
|
/** 播放下一个 */
|
8578
8661
|
|
8579
|
-
var handlePlayNext = useCallback(function (currentIdx) {
|
8662
|
+
var handlePlayNext = useCallback(function (currentIdx, isLoop) {
|
8580
8663
|
if (!player.current) {
|
8581
8664
|
return;
|
8582
8665
|
}
|
@@ -8590,7 +8673,7 @@ var index$7 = (function (_ref) {
|
|
8590
8673
|
// 防止 next 按钮消失
|
8591
8674
|
player.current.currentVideoIndex = -videoUrls.length;
|
8592
8675
|
}
|
8593
|
-
}, [videoUrls
|
8676
|
+
}, [videoUrls]);
|
8594
8677
|
/** 重置视频 */
|
8595
8678
|
|
8596
8679
|
var handleReset = useCallback(function () {
|
@@ -8606,47 +8689,47 @@ var index$7 = (function (_ref) {
|
|
8606
8689
|
/** 弹窗中的视频关闭以后重置 */
|
8607
8690
|
|
8608
8691
|
useEffect(function () {
|
8609
|
-
if (!
|
8692
|
+
if (!visible) {
|
8610
8693
|
handleReset();
|
8611
8694
|
}
|
8612
|
-
}, [handleReset,
|
8695
|
+
}, [handleReset, visible]);
|
8613
8696
|
/** 当 currentIndex 改变以后自动播放下一个 */
|
8614
8697
|
|
8615
8698
|
useEffect(function () {
|
8616
|
-
if (!player.current || !
|
8699
|
+
if (!player.current || !visible) {
|
8617
8700
|
return;
|
8618
8701
|
}
|
8619
8702
|
|
8620
|
-
handlePlayNext(currentIndex !== null && currentIndex !== void 0 ? currentIndex : currentPlayerIndex.current);
|
8621
|
-
}, [currentIndex, handlePlayNext,
|
8703
|
+
handlePlayNext(currentIndex !== null && currentIndex !== void 0 ? currentIndex : currentPlayerIndex.current, isLoop);
|
8704
|
+
}, [currentIndex, handlePlayNext, isLoop, visible]);
|
8622
8705
|
/** 播放器初始化并绑定事件 */
|
8623
8706
|
|
8624
8707
|
useEffect(function () {
|
8625
|
-
|
8708
|
+
var _player$current4;
|
8709
|
+
|
8710
|
+
if (!visible || isEmpty(videoUrls) || player.current) {
|
8626
8711
|
return;
|
8627
8712
|
}
|
8628
8713
|
|
8629
|
-
|
8630
|
-
|
8631
|
-
|
8632
|
-
|
8633
|
-
|
8634
|
-
|
8635
|
-
setTimeout(function () {
|
8636
|
-
var _player$current;
|
8714
|
+
var newConfig = _objectSpread2(_objectSpread2({}, config.current), {}, {
|
8715
|
+
muted: muted,
|
8716
|
+
volume: muted ? 0 : DEFAULT_VOLUME,
|
8717
|
+
autoplay: autoplay,
|
8718
|
+
videoInit: videoInit
|
8719
|
+
});
|
8637
8720
|
|
8638
|
-
|
8639
|
-
|
8640
|
-
} else {
|
8641
|
-
var _player$current2;
|
8721
|
+
setReady(false);
|
8722
|
+
setFirstRender(false); // @ts-ignore
|
8642
8723
|
|
8643
|
-
|
8644
|
-
|
8645
|
-
|
8724
|
+
player.current = new Player(newConfig);
|
8725
|
+
player.current.currentVideoIndex = -videoUrls.length;
|
8726
|
+
player.current.on('ended', onEnd(isLoop, videoUrls)); // 播放记忆缓存
|
8646
8727
|
|
8647
8728
|
if (enableMemory) {
|
8729
|
+
var _player$current2;
|
8730
|
+
|
8648
8731
|
var videoPlayedTimeObj = JSON.parse(localStorage.getItem('videoPlayedTime') || '{}');
|
8649
|
-
player.current.on('timeupdate', function () {
|
8732
|
+
(_player$current2 = player.current) === null || _player$current2 === void 0 ? void 0 : _player$current2.on('timeupdate', function () {
|
8650
8733
|
var _player$current3;
|
8651
8734
|
|
8652
8735
|
if (currentPlayerIndex.current === -1) {
|
@@ -8660,27 +8743,23 @@ var index$7 = (function (_ref) {
|
|
8660
8743
|
});
|
8661
8744
|
}
|
8662
8745
|
|
8663
|
-
player.current.on('playNextBtnClick',
|
8664
|
-
|
8665
|
-
// 防止 next 按钮消失
|
8666
|
-
player.current.currentVideoIndex = videoUrls.length - 2;
|
8667
|
-
}
|
8668
|
-
|
8669
|
-
handleSetCurrentIndex();
|
8670
|
-
});
|
8671
|
-
}, [autoplay, enableMemory, handleSetCurrentIndex, id, isLoop, videoUrls, videoUrls.length, open]);
|
8746
|
+
(_player$current4 = player.current) === null || _player$current4 === void 0 ? void 0 : _player$current4.on('playNextBtnClick', onPlayNextBtnClick(videoUrls));
|
8747
|
+
}, [ready, autoplay, enableMemory, handleSetCurrentIndex, id, isLoop, videoUrls, videoUrls.length, visible, muted, videoInit, onEnd, onPlayNextBtnClick]);
|
8672
8748
|
/** 读取缓存的播放记忆并跳转 */
|
8673
8749
|
|
8674
8750
|
useEffect(function () {
|
8675
|
-
if (enableMemory &&
|
8751
|
+
if (enableMemory && visible) {
|
8676
8752
|
var _JSON$parse;
|
8677
8753
|
|
8678
|
-
var
|
8679
|
-
lastPlayTime =
|
8680
|
-
_videoIndex =
|
8754
|
+
var _ref3 = ((_JSON$parse = JSON.parse(localStorage.getItem('videoPlayedTime') || '{}')) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse[id]) || {},
|
8755
|
+
lastPlayTime = _ref3.lastPlayTime,
|
8756
|
+
_videoIndex = _ref3.videoIndex;
|
8681
8757
|
|
8682
8758
|
setTimeout(function () {
|
8683
|
-
handleSetCurrentIndex(
|
8759
|
+
handleSetCurrentIndex({
|
8760
|
+
currentIdx: _videoIndex,
|
8761
|
+
videoUrls: videoUrls
|
8762
|
+
});
|
8684
8763
|
setTimeout(function () {
|
8685
8764
|
if (player.current) {
|
8686
8765
|
player.current.currentTime = lastPlayTime;
|
@@ -8688,7 +8767,7 @@ var index$7 = (function (_ref) {
|
|
8688
8767
|
});
|
8689
8768
|
});
|
8690
8769
|
}
|
8691
|
-
}, [
|
8770
|
+
}, [visible, enableMemory, handleSetCurrentIndex, id, videoUrls]);
|
8692
8771
|
/** 加载清晰度配置 */
|
8693
8772
|
|
8694
8773
|
useEffect(function () {
|
@@ -8696,8 +8775,21 @@ var index$7 = (function (_ref) {
|
|
8696
8775
|
player.current.emit('resourceReady', definitionList[currentIndex]);
|
8697
8776
|
}
|
8698
8777
|
}, [currentIndex, definitionList]);
|
8778
|
+
useEffect(function () {
|
8779
|
+
var _player$current5, _player$current6, _player$current7;
|
8780
|
+
|
8781
|
+
if (firstRender) {
|
8782
|
+
return;
|
8783
|
+
}
|
8784
|
+
|
8785
|
+
(_player$current5 = player.current) === null || _player$current5 === void 0 ? void 0 : _player$current5.off('ended', onEnd(isLoop, videoUrls));
|
8786
|
+
(_player$current6 = player.current) === null || _player$current6 === void 0 ? void 0 : _player$current6.off('playNextBtnClick', onPlayNextBtnClick(videoUrls));
|
8787
|
+
(_player$current7 = player.current) === null || _player$current7 === void 0 ? void 0 : _player$current7.destroy();
|
8788
|
+
player.current = undefined;
|
8789
|
+
setReady(true); // eslint-disable-next-line react-hooks/exhaustive-deps
|
8790
|
+
}, [muted, isLoop, videoUrls, autoplay, videoInit, onEnd, onPlayNextBtnClick]);
|
8699
8791
|
var getRef = useCallback(function (ref) {
|
8700
|
-
if (ref &&
|
8792
|
+
if (ref && visible) {
|
8701
8793
|
var newConfig = _objectSpread2(_objectSpread2({}, config.current), {}, {
|
8702
8794
|
el: ref,
|
8703
8795
|
url: videoUrls[0],
|
@@ -8709,8 +8801,8 @@ var index$7 = (function (_ref) {
|
|
8709
8801
|
if (enableMemory) {
|
8710
8802
|
var _JSON$parse2;
|
8711
8803
|
|
8712
|
-
var
|
8713
|
-
lastPlayTime =
|
8804
|
+
var _ref4 = ((_JSON$parse2 = JSON.parse(localStorage.getItem('videoPlayedTime') || '{}')) === null || _JSON$parse2 === void 0 ? void 0 : _JSON$parse2[id]) || {},
|
8805
|
+
lastPlayTime = _ref4.lastPlayTime;
|
8714
8806
|
|
8715
8807
|
Object.assign(newConfig, {
|
8716
8808
|
lastPlayTime: lastPlayTime,
|
@@ -8720,7 +8812,15 @@ var index$7 = (function (_ref) {
|
|
8720
8812
|
|
8721
8813
|
config.current = newConfig;
|
8722
8814
|
}
|
8723
|
-
|
8815
|
+
|
8816
|
+
if (playerRef) {
|
8817
|
+
if (typeof playerRef === 'function') {
|
8818
|
+
playerRef(player.current);
|
8819
|
+
} else {
|
8820
|
+
playerRef.current = player.current;
|
8821
|
+
}
|
8822
|
+
}
|
8823
|
+
}, [visible, playerRef, videoUrls, enableMemory, id, lastPlayTimeHideDelay]);
|
8724
8824
|
return /*#__PURE__*/React.createElement("div", {
|
8725
8825
|
className: className,
|
8726
8826
|
ref: getRef,
|
@@ -9009,7 +9109,7 @@ function NtTable(_ref) {
|
|
9009
9109
|
return item.value == record[c.dataIndex];
|
9010
9110
|
})) === null || _columnsFields$c$data === void 0 ? void 0 : _columnsFields$c$data.label : record[c.dataIndex])));
|
9011
9111
|
} else {
|
9012
|
-
var _columnsFields$c$data2, _columnsFields$c$data3;
|
9112
|
+
var _columnsFields$c$data2, _columnsFields$c$data3, _columnsFields$c$data4, _columnsFields$c$data5;
|
9013
9113
|
|
9014
9114
|
return /*#__PURE__*/React.createElement("div", {
|
9015
9115
|
key: c.dataIndex,
|
@@ -9033,9 +9133,13 @@ function NtTable(_ref) {
|
|
9033
9133
|
}
|
9034
9134
|
}, c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data2 = columnsFields[c.dataIndex].find(function (item) {
|
9035
9135
|
return item.value == record[c.dataIndex];
|
9036
|
-
})) === null || _columnsFields$c$data2 === void 0 ? void 0 : _columnsFields$c$data2.label : record[c.dataIndex]) : c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data3 = columnsFields[c.dataIndex].find(function (item) {
|
9136
|
+
})) === null || _columnsFields$c$data2 === void 0 ? void 0 : _columnsFields$c$data2.label : record[c.dataIndex]) : c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? ((_columnsFields$c$data3 = columnsFields[c.dataIndex].find(function (item) {
|
9037
9137
|
return item.value == record[c.dataIndex];
|
9038
|
-
})) === null || _columnsFields$c$data3 === void 0 ? void 0 : _columnsFields$c$data3.label
|
9138
|
+
})) === null || _columnsFields$c$data3 === void 0 ? void 0 : _columnsFields$c$data3.label) && ((_columnsFields$c$data4 = columnsFields[c.dataIndex].find(function (item) {
|
9139
|
+
return item.value == record[c.dataIndex];
|
9140
|
+
})) === null || _columnsFields$c$data4 === void 0 ? void 0 : _columnsFields$c$data4.label) !== 0 ? (_columnsFields$c$data5 = columnsFields[c.dataIndex].find(function (item) {
|
9141
|
+
return item.value == record[c.dataIndex];
|
9142
|
+
})) === null || _columnsFields$c$data5 === void 0 ? void 0 : _columnsFields$c$data5.label : '-' : record[c.dataIndex]);
|
9039
9143
|
}
|
9040
9144
|
}
|
9041
9145
|
});
|
@@ -10132,7 +10236,7 @@ console.log(REACT_APP_ENV, 'REACT_APP_ENV');
|
|
10132
10236
|
|
10133
10237
|
if (REACT_APP_ENV == 'development') {
|
10134
10238
|
var COLOR_ATTR_NAME = 'data-prefers-color';
|
10135
|
-
document.documentElement.setAttribute(COLOR_ATTR_NAME, '
|
10239
|
+
document.documentElement.setAttribute(COLOR_ATTR_NAME, 'nt');
|
10136
10240
|
}
|
10137
10241
|
|
10138
10242
|
export { Index$b as AutoScroll, Index$d as Breadcrumb, WButton as Button, index$5 as Calendar, index$3 as Card, WCascader as Cascader, Index$4 as Checkbox, Index$a as CountUp, Index$2 as DatePicker, DragBox, index as IconFont, Index as Input, WInputNumber as InputNumber, LineEcharts, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, index$8 as NtTable, Index$9 as Number, NumericInput, Index$3 as Radio, index$2 as RequestRenderDom, Index$5 as Select, Index$c as Swiper, WSwitch as Switch, index$4 as TabelCard, index$1 as Table, Index$7 as TreeSelect, Upload, index$7 as Video, index$6 as VideoPlayer, Index$6 as WDatePicker, WForm$1 as WForm, WaterLevelCharts, WebsocketHeart, useEventEmitter, useStateWithCall, wTracing, create as whox, wmox };
|