wargerm 0.4.10 → 0.4.13
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/VideoPlayer/index.d.ts +13 -0
- package/dist/components/VideoPlayer/xgplayer.d.ts +3 -0
- package/dist/index.css +140 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.css +140 -2
- package/dist/index.esm.js +275 -7
- package/dist/index.js +277 -5
- package/package.json +7 -2
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
declare type propsType = {
|
3
|
+
footer?: boolean;
|
4
|
+
style?: {
|
5
|
+
height: number | string;
|
6
|
+
width: number | string;
|
7
|
+
};
|
8
|
+
layoutIndex?: number;
|
9
|
+
config?: Object;
|
10
|
+
url?: string[];
|
11
|
+
};
|
12
|
+
declare const _default: React.ForwardRefExoticComponent<propsType & React.RefAttributes<unknown>>;
|
13
|
+
export default _default;
|
package/dist/index.css
CHANGED
@@ -653,7 +653,7 @@
|
|
653
653
|
}
|
654
654
|
[data-prefers-color='dark'] .autoScroll-outer {
|
655
655
|
overflow: auto;
|
656
|
-
height: 100px;
|
656
|
+
min-height: 100px;
|
657
657
|
}
|
658
658
|
@font-face {
|
659
659
|
font-family: 'swiper-icons';
|
@@ -1354,6 +1354,75 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
|
|
1354
1354
|
[data-prefers-color='dark'] .ant-modal-confirm-btns {
|
1355
1355
|
display: flex;
|
1356
1356
|
}
|
1357
|
+
[data-prefers-color='dark'] .empty {
|
1358
|
+
background: #16191e;
|
1359
|
+
width: 100%;
|
1360
|
+
height: 100%;
|
1361
|
+
position: relative;
|
1362
|
+
}
|
1363
|
+
[data-prefers-color='dark'] .empty .none {
|
1364
|
+
width: 100%;
|
1365
|
+
height: 100%;
|
1366
|
+
position: absolute;
|
1367
|
+
top: 50%;
|
1368
|
+
left: 50%;
|
1369
|
+
transform: translate(-50%, -50%);
|
1370
|
+
-webkit-user-select: none;
|
1371
|
+
-moz-user-select: none;
|
1372
|
+
-ms-user-select: none;
|
1373
|
+
user-select: none;
|
1374
|
+
}
|
1375
|
+
[data-prefers-color='dark'] .camera {
|
1376
|
+
border: 1px solid #216fa3;
|
1377
|
+
width: 100%;
|
1378
|
+
height: 100%;
|
1379
|
+
}
|
1380
|
+
[data-prefers-color='dark'] .activeCamera {
|
1381
|
+
border: 1px solid red;
|
1382
|
+
}
|
1383
|
+
[data-prefers-color='dark'] .camera:hover {
|
1384
|
+
border: 1px solid red;
|
1385
|
+
}
|
1386
|
+
[data-prefers-color='dark'] .xgplayer-live {
|
1387
|
+
display: none !important;
|
1388
|
+
}
|
1389
|
+
[data-prefers-color='dark'] .xgplayer-fullscreen {
|
1390
|
+
display: none !important;
|
1391
|
+
}
|
1392
|
+
[data-prefers-color='dark'] .tools {
|
1393
|
+
background: #484d53;
|
1394
|
+
height: 30px;
|
1395
|
+
width: 100%;
|
1396
|
+
display: flex;
|
1397
|
+
justify-content: flex-end;
|
1398
|
+
}
|
1399
|
+
[data-prefers-color='dark'] .btnbox {
|
1400
|
+
background: #333333;
|
1401
|
+
border-radius: 5px;
|
1402
|
+
color: #fff;
|
1403
|
+
margin: 1px 5px;
|
1404
|
+
width: 26px;
|
1405
|
+
height: 26px;
|
1406
|
+
font-size: 18px;
|
1407
|
+
line-height: 26px;
|
1408
|
+
cursor: pointer;
|
1409
|
+
text-align: center;
|
1410
|
+
}
|
1411
|
+
[data-prefers-color='dark'] .btnbox:hover {
|
1412
|
+
background: #0f6ab7;
|
1413
|
+
}
|
1414
|
+
[data-prefers-color='dark'] .videoContainer {
|
1415
|
+
width: 100%;
|
1416
|
+
height: 100%;
|
1417
|
+
display: grid;
|
1418
|
+
grid-template-columns: 1fr;
|
1419
|
+
grid-template-rows: 1fr;
|
1420
|
+
grid-gap: 1px 1px;
|
1421
|
+
background: #0f6ab7;
|
1422
|
+
}
|
1423
|
+
[data-prefers-color='dark'] .xgplayer-skin-default {
|
1424
|
+
height: 100% !important;
|
1425
|
+
}
|
1357
1426
|
|
1358
1427
|
/* Color
|
1359
1428
|
----------------------- */
|
@@ -1821,7 +1890,7 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
|
|
1821
1890
|
}
|
1822
1891
|
[data-prefers-color='light'] .autoScroll-outer {
|
1823
1892
|
overflow: auto;
|
1824
|
-
height: 100px;
|
1893
|
+
min-height: 100px;
|
1825
1894
|
}
|
1826
1895
|
@font-face {
|
1827
1896
|
font-family: 'swiper-icons';
|
@@ -2671,6 +2740,75 @@ button[data-prefers-color='light'] .swiper-pagination-bullet {
|
|
2671
2740
|
[data-prefers-color='light'] .ant-input-number-handler-down-inner {
|
2672
2741
|
color: #708191;
|
2673
2742
|
}
|
2743
|
+
[data-prefers-color='light'] .empty {
|
2744
|
+
background: #16191e;
|
2745
|
+
width: 100%;
|
2746
|
+
height: 100%;
|
2747
|
+
position: relative;
|
2748
|
+
}
|
2749
|
+
[data-prefers-color='light'] .empty .none {
|
2750
|
+
width: 100%;
|
2751
|
+
height: 100%;
|
2752
|
+
position: absolute;
|
2753
|
+
top: 50%;
|
2754
|
+
left: 50%;
|
2755
|
+
transform: translate(-50%, -50%);
|
2756
|
+
-webkit-user-select: none;
|
2757
|
+
-moz-user-select: none;
|
2758
|
+
-ms-user-select: none;
|
2759
|
+
user-select: none;
|
2760
|
+
}
|
2761
|
+
[data-prefers-color='light'] .camera {
|
2762
|
+
border: 1px solid #216fa3;
|
2763
|
+
width: 100%;
|
2764
|
+
height: 100%;
|
2765
|
+
}
|
2766
|
+
[data-prefers-color='light'] .activeCamera {
|
2767
|
+
border: 1px solid red;
|
2768
|
+
}
|
2769
|
+
[data-prefers-color='light'] .camera:hover {
|
2770
|
+
border: 1px solid red;
|
2771
|
+
}
|
2772
|
+
[data-prefers-color='light'] .xgplayer-live {
|
2773
|
+
display: none !important;
|
2774
|
+
}
|
2775
|
+
[data-prefers-color='light'] .xgplayer-fullscreen {
|
2776
|
+
display: none !important;
|
2777
|
+
}
|
2778
|
+
[data-prefers-color='light'] .tools {
|
2779
|
+
background: #484d53;
|
2780
|
+
height: 30px;
|
2781
|
+
width: 100%;
|
2782
|
+
display: flex;
|
2783
|
+
justify-content: flex-end;
|
2784
|
+
}
|
2785
|
+
[data-prefers-color='light'] .btnbox {
|
2786
|
+
background: #333333;
|
2787
|
+
border-radius: 5px;
|
2788
|
+
color: #fff;
|
2789
|
+
margin: 1px 5px;
|
2790
|
+
width: 26px;
|
2791
|
+
height: 26px;
|
2792
|
+
font-size: 18px;
|
2793
|
+
line-height: 26px;
|
2794
|
+
cursor: pointer;
|
2795
|
+
text-align: center;
|
2796
|
+
}
|
2797
|
+
[data-prefers-color='light'] .btnbox:hover {
|
2798
|
+
background: #0f6ab7;
|
2799
|
+
}
|
2800
|
+
[data-prefers-color='light'] .videoContainer {
|
2801
|
+
width: 100%;
|
2802
|
+
height: 100%;
|
2803
|
+
display: grid;
|
2804
|
+
grid-template-columns: 1fr;
|
2805
|
+
grid-template-rows: 1fr;
|
2806
|
+
grid-gap: 1px 1px;
|
2807
|
+
background: #0f6ab7;
|
2808
|
+
}
|
2809
|
+
[data-prefers-color='light'] .xgplayer-skin-default {
|
2810
|
+
height: 100% !important;
|
2811
|
+
}
|
2674
2812
|
|
2675
2813
|
.frame {
|
2676
2814
|
width: 40px;
|
package/dist/index.d.ts
CHANGED
@@ -26,3 +26,4 @@ export { default as ModalForm } from './components/ModalForm';
|
|
26
26
|
export { default as TabelCard } from './components/TabelCard';
|
27
27
|
export { default as Cascader } from './components/Cascader';
|
28
28
|
export { default as WebsocketHeart } from './components/WebsocketHeart';
|
29
|
+
export { default as VideoPlayer } from './components/VideoPlayer';
|
package/dist/index.esm.css
CHANGED
@@ -653,7 +653,7 @@
|
|
653
653
|
}
|
654
654
|
[data-prefers-color='dark'] .autoScroll-outer {
|
655
655
|
overflow: auto;
|
656
|
-
height: 100px;
|
656
|
+
min-height: 100px;
|
657
657
|
}
|
658
658
|
@font-face {
|
659
659
|
font-family: 'swiper-icons';
|
@@ -1354,6 +1354,75 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
|
|
1354
1354
|
[data-prefers-color='dark'] .ant-modal-confirm-btns {
|
1355
1355
|
display: flex;
|
1356
1356
|
}
|
1357
|
+
[data-prefers-color='dark'] .empty {
|
1358
|
+
background: #16191e;
|
1359
|
+
width: 100%;
|
1360
|
+
height: 100%;
|
1361
|
+
position: relative;
|
1362
|
+
}
|
1363
|
+
[data-prefers-color='dark'] .empty .none {
|
1364
|
+
width: 100%;
|
1365
|
+
height: 100%;
|
1366
|
+
position: absolute;
|
1367
|
+
top: 50%;
|
1368
|
+
left: 50%;
|
1369
|
+
transform: translate(-50%, -50%);
|
1370
|
+
-webkit-user-select: none;
|
1371
|
+
-moz-user-select: none;
|
1372
|
+
-ms-user-select: none;
|
1373
|
+
user-select: none;
|
1374
|
+
}
|
1375
|
+
[data-prefers-color='dark'] .camera {
|
1376
|
+
border: 1px solid #216fa3;
|
1377
|
+
width: 100%;
|
1378
|
+
height: 100%;
|
1379
|
+
}
|
1380
|
+
[data-prefers-color='dark'] .activeCamera {
|
1381
|
+
border: 1px solid red;
|
1382
|
+
}
|
1383
|
+
[data-prefers-color='dark'] .camera:hover {
|
1384
|
+
border: 1px solid red;
|
1385
|
+
}
|
1386
|
+
[data-prefers-color='dark'] .xgplayer-live {
|
1387
|
+
display: none !important;
|
1388
|
+
}
|
1389
|
+
[data-prefers-color='dark'] .xgplayer-fullscreen {
|
1390
|
+
display: none !important;
|
1391
|
+
}
|
1392
|
+
[data-prefers-color='dark'] .tools {
|
1393
|
+
background: #484d53;
|
1394
|
+
height: 30px;
|
1395
|
+
width: 100%;
|
1396
|
+
display: flex;
|
1397
|
+
justify-content: flex-end;
|
1398
|
+
}
|
1399
|
+
[data-prefers-color='dark'] .btnbox {
|
1400
|
+
background: #333333;
|
1401
|
+
border-radius: 5px;
|
1402
|
+
color: #fff;
|
1403
|
+
margin: 1px 5px;
|
1404
|
+
width: 26px;
|
1405
|
+
height: 26px;
|
1406
|
+
font-size: 18px;
|
1407
|
+
line-height: 26px;
|
1408
|
+
cursor: pointer;
|
1409
|
+
text-align: center;
|
1410
|
+
}
|
1411
|
+
[data-prefers-color='dark'] .btnbox:hover {
|
1412
|
+
background: #0f6ab7;
|
1413
|
+
}
|
1414
|
+
[data-prefers-color='dark'] .videoContainer {
|
1415
|
+
width: 100%;
|
1416
|
+
height: 100%;
|
1417
|
+
display: grid;
|
1418
|
+
grid-template-columns: 1fr;
|
1419
|
+
grid-template-rows: 1fr;
|
1420
|
+
grid-gap: 1px 1px;
|
1421
|
+
background: #0f6ab7;
|
1422
|
+
}
|
1423
|
+
[data-prefers-color='dark'] .xgplayer-skin-default {
|
1424
|
+
height: 100% !important;
|
1425
|
+
}
|
1357
1426
|
|
1358
1427
|
/* Color
|
1359
1428
|
----------------------- */
|
@@ -1821,7 +1890,7 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
|
|
1821
1890
|
}
|
1822
1891
|
[data-prefers-color='light'] .autoScroll-outer {
|
1823
1892
|
overflow: auto;
|
1824
|
-
height: 100px;
|
1893
|
+
min-height: 100px;
|
1825
1894
|
}
|
1826
1895
|
@font-face {
|
1827
1896
|
font-family: 'swiper-icons';
|
@@ -2671,6 +2740,75 @@ button[data-prefers-color='light'] .swiper-pagination-bullet {
|
|
2671
2740
|
[data-prefers-color='light'] .ant-input-number-handler-down-inner {
|
2672
2741
|
color: #708191;
|
2673
2742
|
}
|
2743
|
+
[data-prefers-color='light'] .empty {
|
2744
|
+
background: #16191e;
|
2745
|
+
width: 100%;
|
2746
|
+
height: 100%;
|
2747
|
+
position: relative;
|
2748
|
+
}
|
2749
|
+
[data-prefers-color='light'] .empty .none {
|
2750
|
+
width: 100%;
|
2751
|
+
height: 100%;
|
2752
|
+
position: absolute;
|
2753
|
+
top: 50%;
|
2754
|
+
left: 50%;
|
2755
|
+
transform: translate(-50%, -50%);
|
2756
|
+
-webkit-user-select: none;
|
2757
|
+
-moz-user-select: none;
|
2758
|
+
-ms-user-select: none;
|
2759
|
+
user-select: none;
|
2760
|
+
}
|
2761
|
+
[data-prefers-color='light'] .camera {
|
2762
|
+
border: 1px solid #216fa3;
|
2763
|
+
width: 100%;
|
2764
|
+
height: 100%;
|
2765
|
+
}
|
2766
|
+
[data-prefers-color='light'] .activeCamera {
|
2767
|
+
border: 1px solid red;
|
2768
|
+
}
|
2769
|
+
[data-prefers-color='light'] .camera:hover {
|
2770
|
+
border: 1px solid red;
|
2771
|
+
}
|
2772
|
+
[data-prefers-color='light'] .xgplayer-live {
|
2773
|
+
display: none !important;
|
2774
|
+
}
|
2775
|
+
[data-prefers-color='light'] .xgplayer-fullscreen {
|
2776
|
+
display: none !important;
|
2777
|
+
}
|
2778
|
+
[data-prefers-color='light'] .tools {
|
2779
|
+
background: #484d53;
|
2780
|
+
height: 30px;
|
2781
|
+
width: 100%;
|
2782
|
+
display: flex;
|
2783
|
+
justify-content: flex-end;
|
2784
|
+
}
|
2785
|
+
[data-prefers-color='light'] .btnbox {
|
2786
|
+
background: #333333;
|
2787
|
+
border-radius: 5px;
|
2788
|
+
color: #fff;
|
2789
|
+
margin: 1px 5px;
|
2790
|
+
width: 26px;
|
2791
|
+
height: 26px;
|
2792
|
+
font-size: 18px;
|
2793
|
+
line-height: 26px;
|
2794
|
+
cursor: pointer;
|
2795
|
+
text-align: center;
|
2796
|
+
}
|
2797
|
+
[data-prefers-color='light'] .btnbox:hover {
|
2798
|
+
background: #0f6ab7;
|
2799
|
+
}
|
2800
|
+
[data-prefers-color='light'] .videoContainer {
|
2801
|
+
width: 100%;
|
2802
|
+
height: 100%;
|
2803
|
+
display: grid;
|
2804
|
+
grid-template-columns: 1fr;
|
2805
|
+
grid-template-rows: 1fr;
|
2806
|
+
grid-gap: 1px 1px;
|
2807
|
+
background: #0f6ab7;
|
2808
|
+
}
|
2809
|
+
[data-prefers-color='light'] .xgplayer-skin-default {
|
2810
|
+
height: 100% !important;
|
2811
|
+
}
|
2674
2812
|
|
2675
2813
|
.frame {
|
2676
2814
|
width: 40px;
|
package/dist/index.esm.js
CHANGED
@@ -41,13 +41,16 @@ import _Cascader from 'antd/es/cascader';
|
|
41
41
|
import cloneDeep from 'lodash/cloneDeep';
|
42
42
|
import CountUp from 'react-countup';
|
43
43
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
44
|
-
import SwiperCore, { Pagination, Navigation, Autoplay } from 'swiper';
|
44
|
+
import SwiperCore, { Pagination, Navigation, Autoplay, Virtual } from 'swiper';
|
45
45
|
import 'antd/es/breadcrumb/style';
|
46
46
|
import _Breadcrumb from 'antd/es/breadcrumb';
|
47
47
|
import ReactDOM from 'react-dom';
|
48
48
|
import 'antd/es/modal/style';
|
49
49
|
import _Modal from 'antd/es/modal';
|
50
50
|
import ProTable from '@ant-design/pro-table';
|
51
|
+
import Player from 'xgplayer';
|
52
|
+
import FlvPlayer from 'xgplayer-flv.js';
|
53
|
+
import HlsJsPlayer from 'xgplayer-hls.js';
|
51
54
|
|
52
55
|
function ownKeys(object, enumerableOnly) {
|
53
56
|
var keys = Object.keys(object);
|
@@ -460,8 +463,8 @@ WButton.defaultProps = {};
|
|
460
463
|
/*
|
461
464
|
* @Author: lijin
|
462
465
|
* @Date: 2021-08-04 16:24:47
|
463
|
-
* @LastEditTime:
|
464
|
-
* @LastEditors:
|
466
|
+
* @LastEditTime: 2022-06-08 11:02:39
|
467
|
+
* @LastEditors: cadelle 793238465@qq.com
|
465
468
|
* @Description:
|
466
469
|
* @FilePath: \wargerm\src\IconFont\index.tsx
|
467
470
|
* 可以输入预定的版权声明、个性签名、空行等
|
@@ -473,7 +476,7 @@ WButton.defaultProps = {};
|
|
473
476
|
// <IconFont type='icon-demo' className='xxx-xxx' />
|
474
477
|
|
475
478
|
var index = createFromIconfontCN({
|
476
|
-
scriptUrl: '//at.alicdn.com/t/
|
479
|
+
scriptUrl: '//at.alicdn.com/t/font_3425259_s93peuz62an.js'
|
477
480
|
});
|
478
481
|
|
479
482
|
var WInput = function WInput(props) {
|
@@ -8886,7 +8889,7 @@ var Index$9 = function Index(_ref) {
|
|
8886
8889
|
|
8887
8890
|
var _excluded$b = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem"];
|
8888
8891
|
|
8889
|
-
SwiperCore.use([Pagination, Navigation, Autoplay]);
|
8892
|
+
SwiperCore.use([Pagination, Navigation, Autoplay, Virtual]);
|
8890
8893
|
|
8891
8894
|
var Index$a = function Index(props) {
|
8892
8895
|
var data = props.data,
|
@@ -10659,6 +10662,21 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10659
10662
|
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
|
10660
10663
|
};
|
10661
10664
|
|
10665
|
+
useEffect(function () {
|
10666
|
+
var _searchFormRef$curren, _searchFormRef$curren2;
|
10667
|
+
|
10668
|
+
if ((_searchFormRef$curren = searchFormRef.current) === null || _searchFormRef$curren === void 0 ? void 0 : (_searchFormRef$curren2 = _searchFormRef$curren.form) === null || _searchFormRef$curren2 === void 0 ? void 0 : _searchFormRef$curren2.getFieldsValue) {
|
10669
|
+
var _searchFormRef$curren3, _searchFormRef$curren4;
|
10670
|
+
|
10671
|
+
var obj = filterObj((_searchFormRef$curren3 = searchFormRef.current) === null || _searchFormRef$curren3 === void 0 ? void 0 : (_searchFormRef$curren4 = _searchFormRef$curren3.form) === null || _searchFormRef$curren4 === void 0 ? void 0 : _searchFormRef$curren4.getFieldsValue()) || {};
|
10672
|
+
(columns || []).filter(function (c) {
|
10673
|
+
return c.notInitialValueInSearch;
|
10674
|
+
}).forEach(function (item) {
|
10675
|
+
delete obj[item.dataIndex];
|
10676
|
+
});
|
10677
|
+
setFormSearch(obj);
|
10678
|
+
}
|
10679
|
+
}, [columns]);
|
10662
10680
|
var formSearchColumn = columns || [];
|
10663
10681
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
|
10664
10682
|
ref: modalFormRef,
|
@@ -10792,7 +10810,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10792
10810
|
return obj;
|
10793
10811
|
}),
|
10794
10812
|
search: false,
|
10795
|
-
pagination: pagination
|
10813
|
+
pagination: pagination !== null && pagination !== void 0 ? pagination : {
|
10796
10814
|
pageSize: 20
|
10797
10815
|
}
|
10798
10816
|
}, extraProps)));
|
@@ -10962,4 +10980,254 @@ var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
|
|
10962
10980
|
this.heartCheck = null;
|
10963
10981
|
});
|
10964
10982
|
|
10965
|
-
|
10983
|
+
function Xgplay(_ref, fRef) {
|
10984
|
+
var config = _ref.config,
|
10985
|
+
type = _ref.type,
|
10986
|
+
setRef = _ref.setRef;
|
10987
|
+
var ref = useRef(null);
|
10988
|
+
var playerRef = useRef(null);
|
10989
|
+
|
10990
|
+
var _useState = useState(null),
|
10991
|
+
_useState2 = _slicedToArray(_useState, 2),
|
10992
|
+
player = _useState2[0],
|
10993
|
+
setPlayer = _useState2[1];
|
10994
|
+
|
10995
|
+
useEffect(function () {
|
10996
|
+
if (ref.current) {
|
10997
|
+
if (type.indexOf('hls') !== -1) {
|
10998
|
+
playerRef.current = new HlsJsPlayer(_objectSpread2({
|
10999
|
+
el: ref.current,
|
11000
|
+
width: '100%',
|
11001
|
+
height: '100%',
|
11002
|
+
autoplay: true,
|
11003
|
+
isLive: true,
|
11004
|
+
autoplayMuted: true
|
11005
|
+
}, config));
|
11006
|
+
} else if (type.indexOf('flv') !== -1) {
|
11007
|
+
playerRef.current = new FlvPlayer(_objectSpread2({
|
11008
|
+
el: ref.current,
|
11009
|
+
width: '100%',
|
11010
|
+
height: '100%',
|
11011
|
+
autoplay: true,
|
11012
|
+
isLive: true,
|
11013
|
+
autoplayMuted: true
|
11014
|
+
}, config));
|
11015
|
+
} else if (type.indexOf('mp4') !== -1) {
|
11016
|
+
playerRef.current = new Player(_objectSpread2({
|
11017
|
+
el: ref.current,
|
11018
|
+
width: '100%',
|
11019
|
+
height: '100%',
|
11020
|
+
autoplay: true,
|
11021
|
+
isLive: true,
|
11022
|
+
autoplayMuted: true
|
11023
|
+
}, config));
|
11024
|
+
}
|
11025
|
+
}
|
11026
|
+
|
11027
|
+
return function () {
|
11028
|
+
playerRef.current = null;
|
11029
|
+
};
|
11030
|
+
}, []);
|
11031
|
+
useEffect(function () {
|
11032
|
+
if (playerRef.current) {
|
11033
|
+
setRef(playerRef.current);
|
11034
|
+
}
|
11035
|
+
});
|
11036
|
+
useImperativeHandle(fRef, function () {
|
11037
|
+
return {
|
11038
|
+
player: playerRef.current
|
11039
|
+
};
|
11040
|
+
});
|
11041
|
+
return /*#__PURE__*/React.createElement("div", {
|
11042
|
+
ref: ref,
|
11043
|
+
style: {
|
11044
|
+
overflow: 'hidden'
|
11045
|
+
}
|
11046
|
+
});
|
11047
|
+
}
|
11048
|
+
|
11049
|
+
var Xgplay$1 = /*#__PURE__*/forwardRef(Xgplay);
|
11050
|
+
|
11051
|
+
/*
|
11052
|
+
* @Author: lijin
|
11053
|
+
* @Date: 2021-08-04 16:24:47
|
11054
|
+
* @LastEditTime: 2022-06-08 11:02:39
|
11055
|
+
* @LastEditors: cadelle 793238465@qq.com
|
11056
|
+
* @Description:
|
11057
|
+
* @FilePath: \wargerm\src\IconFont\index.tsx
|
11058
|
+
* 可以输入预定的版权声明、个性签名、空行等
|
11059
|
+
*/
|
11060
|
+
// iconFontScriptUrl 修改成自己的iconfont图标项目地址
|
11061
|
+
// 注意:如果需要图标多色,Iconfont图标项目里要进行批量去色处理
|
11062
|
+
// 使用:
|
11063
|
+
// import IconFont from '@/components/IconFont';
|
11064
|
+
// <IconFont type='icon-demo' className='xxx-xxx' />
|
11065
|
+
|
11066
|
+
var IconFont = createFromIconfontCN({
|
11067
|
+
scriptUrl: '//at.alicdn.com/t/font_3425259_s93peuz62an.js'
|
11068
|
+
});
|
11069
|
+
|
11070
|
+
function VideoPlayer(_ref, ref) {
|
11071
|
+
var _ref$footer = _ref.footer,
|
11072
|
+
footer = _ref$footer === void 0 ? true : _ref$footer,
|
11073
|
+
_ref$style = _ref.style,
|
11074
|
+
style = _ref$style === void 0 ? {
|
11075
|
+
width: 400,
|
11076
|
+
height: 400
|
11077
|
+
} : _ref$style,
|
11078
|
+
_ref$config = _ref.config,
|
11079
|
+
config = _ref$config === void 0 ? {} : _ref$config,
|
11080
|
+
layoutIndex = _ref.layoutIndex,
|
11081
|
+
_ref$url = _ref.url,
|
11082
|
+
url = _ref$url === void 0 ? [] : _ref$url;
|
11083
|
+
var layouts = [{
|
11084
|
+
title: '1x1布局',
|
11085
|
+
style: {
|
11086
|
+
gridTemplateColumns: '1fr',
|
11087
|
+
gridTemplateRows: '1fr'
|
11088
|
+
},
|
11089
|
+
icon: /*#__PURE__*/React.createElement(IconFont, {
|
11090
|
+
type: "icon-dantupailie"
|
11091
|
+
}),
|
11092
|
+
span: 1
|
11093
|
+
}, {
|
11094
|
+
title: '2x2布局',
|
11095
|
+
style: {
|
11096
|
+
gridTemplateColumns: '1fr 1fr',
|
11097
|
+
gridTemplateRows: '1fr 1fr'
|
11098
|
+
},
|
11099
|
+
icon: /*#__PURE__*/React.createElement(IconFont, {
|
11100
|
+
type: "icon-split-screen-compare-full"
|
11101
|
+
}),
|
11102
|
+
span: 4
|
11103
|
+
}, {
|
11104
|
+
title: '3x3布局',
|
11105
|
+
style: {
|
11106
|
+
gridTemplateColumns: '1fr 1fr 1fr',
|
11107
|
+
gridTemplateRows: '1fr 1fr 1fr'
|
11108
|
+
},
|
11109
|
+
icon: /*#__PURE__*/React.createElement(IconFont, {
|
11110
|
+
type: "icon-all-full",
|
11111
|
+
className: "f21"
|
11112
|
+
}),
|
11113
|
+
span: 9
|
11114
|
+
}];
|
11115
|
+
|
11116
|
+
var _useState = useState(layoutIndex || 0),
|
11117
|
+
_useState2 = _slicedToArray(_useState, 2),
|
11118
|
+
currentLayoutIndex = _useState2[0],
|
11119
|
+
setCurrentLayoutIndex = _useState2[1];
|
11120
|
+
|
11121
|
+
var initPlayerIndex = layouts[layoutIndex || 0].span >= url.length ? url.length - 1 >= 0 ? url.length - 1 : 0 : layouts[layoutIndex || 0].span - 1;
|
11122
|
+
|
11123
|
+
var _useState3 = useState(initPlayerIndex),
|
11124
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
11125
|
+
currentPlayerIndex = _useState4[0],
|
11126
|
+
setCurrentPlayerIndex = _useState4[1];
|
11127
|
+
|
11128
|
+
var domRef = useRef(null);
|
11129
|
+
var playerRef = useRef({});
|
11130
|
+
|
11131
|
+
var _useState5 = useState([]),
|
11132
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
11133
|
+
players = _useState6[0],
|
11134
|
+
setPlayers = _useState6[1];
|
11135
|
+
|
11136
|
+
var renderDom = useMemo(function () {
|
11137
|
+
var arr = new Array(layouts[currentLayoutIndex].span).fill(0);
|
11138
|
+
return arr.map(function (item, index) {
|
11139
|
+
return /*#__PURE__*/React.createElement("div", {
|
11140
|
+
key: index,
|
11141
|
+
className: "camera ".concat(currentPlayerIndex == index ? 'activeCamera' : ''),
|
11142
|
+
onClickCapture: function onClickCapture() {
|
11143
|
+
setCurrentPlayerIndex(index);
|
11144
|
+
}
|
11145
|
+
}, url[index] ? /*#__PURE__*/React.createElement(Xgplay$1, {
|
11146
|
+
setRef: function setRef(ref) {
|
11147
|
+
return setPlayers(function (players) {
|
11148
|
+
players[index] = ref;
|
11149
|
+
return players;
|
11150
|
+
});
|
11151
|
+
},
|
11152
|
+
type: url[index],
|
11153
|
+
config: _objectSpread2({
|
11154
|
+
url: url[index],
|
11155
|
+
fluid: true
|
11156
|
+
}, config)
|
11157
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
11158
|
+
className: "empty",
|
11159
|
+
onDoubleClick: function onDoubleClick() {
|
11160
|
+
var _domRef$current;
|
11161
|
+
|
11162
|
+
var fullscreenElement = document.fullscreenElement;
|
11163
|
+
fullscreenElement ? exitFullscreen() : requestFullScreen(domRef === null || domRef === void 0 ? void 0 : (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.childNodes[index]);
|
11164
|
+
}
|
11165
|
+
}));
|
11166
|
+
});
|
11167
|
+
}, [currentLayoutIndex, currentPlayerIndex, playerRef, url]);
|
11168
|
+
|
11169
|
+
function exitFullscreen() {
|
11170
|
+
if (document.exitFullscreen) {
|
11171
|
+
document.exitFullscreen();
|
11172
|
+
}
|
11173
|
+
}
|
11174
|
+
|
11175
|
+
function requestFullScreen(element) {
|
11176
|
+
if (element.requestFullscreen) {
|
11177
|
+
element.requestFullscreen();
|
11178
|
+
} //FireFox
|
11179
|
+
else if (element.mozRequestFullScreen) {
|
11180
|
+
element.mozRequestFullScreen();
|
11181
|
+
} //Chrome等
|
11182
|
+
else if (element.webkitRequestFullScreen) {
|
11183
|
+
element.webkitRequestFullScreen();
|
11184
|
+
} //IE11
|
11185
|
+
else if (element.msRequestFullscreen) {
|
11186
|
+
element.msRequestFullscreen();
|
11187
|
+
}
|
11188
|
+
}
|
11189
|
+
|
11190
|
+
var loadCamera = function loadCamera(url) {
|
11191
|
+
var currentPlayer = players[currentPlayerIndex];
|
11192
|
+
|
11193
|
+
if (currentPlayer) {
|
11194
|
+
debugger;
|
11195
|
+
currentPlayer.src = url;
|
11196
|
+
}
|
11197
|
+
};
|
11198
|
+
|
11199
|
+
useImperativeHandle(ref, function () {
|
11200
|
+
return {
|
11201
|
+
players: players,
|
11202
|
+
currentLayoutIndex: currentLayoutIndex,
|
11203
|
+
currentPlayerIndex: currentPlayerIndex,
|
11204
|
+
loadCamera: loadCamera
|
11205
|
+
};
|
11206
|
+
});
|
11207
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
11208
|
+
style: style
|
11209
|
+
}, /*#__PURE__*/React.createElement("div", {
|
11210
|
+
ref: domRef,
|
11211
|
+
className: "videoContainer",
|
11212
|
+
style: layouts[currentLayoutIndex].style
|
11213
|
+
}, renderDom), footer ? /*#__PURE__*/React.createElement("div", {
|
11214
|
+
className: "tools"
|
11215
|
+
}, layouts.map(function (item, index) {
|
11216
|
+
return /*#__PURE__*/React.createElement("div", {
|
11217
|
+
key: index,
|
11218
|
+
className: "btnbox",
|
11219
|
+
onClick: function onClick() {
|
11220
|
+
var playerIndex = layouts[index || 0].span > url.length ? url.length - 1 >= 0 ? url.length : 0 : layouts[index || 0].span - 1;
|
11221
|
+
setCurrentPlayerIndex(playerIndex);
|
11222
|
+
setCurrentLayoutIndex(index);
|
11223
|
+
}
|
11224
|
+
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
11225
|
+
placement: "top",
|
11226
|
+
title: item.title
|
11227
|
+
}, item.icon));
|
11228
|
+
})) : null));
|
11229
|
+
}
|
11230
|
+
|
11231
|
+
var index$3 = /*#__PURE__*/forwardRef(VideoPlayer);
|
11232
|
+
|
11233
|
+
export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, index$1 as Card, WCascader as Cascader, Index$3 as Checkbox, Index$8 as CountUp, Index$1 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, Index$7 as Number, NumericInput, Index$2 as Radio, Select, Index$a as Swiper, WSwitch as Switch, index$2 as TabelCard, Table, Index$6 as TreeSelect, index$3 as VideoPlayer, Index$5 as WDatePicker, WForm$1 as WForm, WebsocketHeart };
|
package/dist/index.js
CHANGED
@@ -52,6 +52,9 @@ var ReactDOM = require('react-dom');
|
|
52
52
|
require('antd/es/modal/style');
|
53
53
|
var _Modal = require('antd/es/modal');
|
54
54
|
var ProTable = require('@ant-design/pro-table');
|
55
|
+
var Player = require('xgplayer');
|
56
|
+
var FlvPlayer = require('xgplayer-flv.js');
|
57
|
+
var HlsJsPlayer = require('xgplayer-hls.js');
|
55
58
|
|
56
59
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
57
60
|
|
@@ -83,6 +86,9 @@ var _Breadcrumb__default = /*#__PURE__*/_interopDefaultLegacy(_Breadcrumb);
|
|
83
86
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
84
87
|
var _Modal__default = /*#__PURE__*/_interopDefaultLegacy(_Modal);
|
85
88
|
var ProTable__default = /*#__PURE__*/_interopDefaultLegacy(ProTable);
|
89
|
+
var Player__default = /*#__PURE__*/_interopDefaultLegacy(Player);
|
90
|
+
var FlvPlayer__default = /*#__PURE__*/_interopDefaultLegacy(FlvPlayer);
|
91
|
+
var HlsJsPlayer__default = /*#__PURE__*/_interopDefaultLegacy(HlsJsPlayer);
|
86
92
|
|
87
93
|
function ownKeys(object, enumerableOnly) {
|
88
94
|
var keys = Object.keys(object);
|
@@ -495,8 +501,8 @@ WButton.defaultProps = {};
|
|
495
501
|
/*
|
496
502
|
* @Author: lijin
|
497
503
|
* @Date: 2021-08-04 16:24:47
|
498
|
-
* @LastEditTime:
|
499
|
-
* @LastEditors:
|
504
|
+
* @LastEditTime: 2022-06-08 11:02:39
|
505
|
+
* @LastEditors: cadelle 793238465@qq.com
|
500
506
|
* @Description:
|
501
507
|
* @FilePath: \wargerm\src\IconFont\index.tsx
|
502
508
|
* 可以输入预定的版权声明、个性签名、空行等
|
@@ -508,7 +514,7 @@ WButton.defaultProps = {};
|
|
508
514
|
// <IconFont type='icon-demo' className='xxx-xxx' />
|
509
515
|
|
510
516
|
var index = icons.createFromIconfontCN({
|
511
|
-
scriptUrl: '//at.alicdn.com/t/
|
517
|
+
scriptUrl: '//at.alicdn.com/t/font_3425259_s93peuz62an.js'
|
512
518
|
});
|
513
519
|
|
514
520
|
var WInput = function WInput(props) {
|
@@ -8921,7 +8927,7 @@ var Index$9 = function Index(_ref) {
|
|
8921
8927
|
|
8922
8928
|
var _excluded$b = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem"];
|
8923
8929
|
|
8924
|
-
SwiperCore__default['default'].use([SwiperCore.Pagination, SwiperCore.Navigation, SwiperCore.Autoplay]);
|
8930
|
+
SwiperCore__default['default'].use([SwiperCore.Pagination, SwiperCore.Navigation, SwiperCore.Autoplay, SwiperCore.Virtual]);
|
8925
8931
|
|
8926
8932
|
var Index$a = function Index(props) {
|
8927
8933
|
var data = props.data,
|
@@ -10694,6 +10700,21 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10694
10700
|
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
|
10695
10701
|
};
|
10696
10702
|
|
10703
|
+
React.useEffect(function () {
|
10704
|
+
var _searchFormRef$curren, _searchFormRef$curren2;
|
10705
|
+
|
10706
|
+
if ((_searchFormRef$curren = searchFormRef.current) === null || _searchFormRef$curren === void 0 ? void 0 : (_searchFormRef$curren2 = _searchFormRef$curren.form) === null || _searchFormRef$curren2 === void 0 ? void 0 : _searchFormRef$curren2.getFieldsValue) {
|
10707
|
+
var _searchFormRef$curren3, _searchFormRef$curren4;
|
10708
|
+
|
10709
|
+
var obj = filterObj((_searchFormRef$curren3 = searchFormRef.current) === null || _searchFormRef$curren3 === void 0 ? void 0 : (_searchFormRef$curren4 = _searchFormRef$curren3.form) === null || _searchFormRef$curren4 === void 0 ? void 0 : _searchFormRef$curren4.getFieldsValue()) || {};
|
10710
|
+
(columns || []).filter(function (c) {
|
10711
|
+
return c.notInitialValueInSearch;
|
10712
|
+
}).forEach(function (item) {
|
10713
|
+
delete obj[item.dataIndex];
|
10714
|
+
});
|
10715
|
+
setFormSearch(obj);
|
10716
|
+
}
|
10717
|
+
}, [columns]);
|
10697
10718
|
var formSearchColumn = columns || [];
|
10698
10719
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
|
10699
10720
|
ref: modalFormRef,
|
@@ -10827,7 +10848,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10827
10848
|
return obj;
|
10828
10849
|
}),
|
10829
10850
|
search: false,
|
10830
|
-
pagination: pagination
|
10851
|
+
pagination: pagination !== null && pagination !== void 0 ? pagination : {
|
10831
10852
|
pageSize: 20
|
10832
10853
|
}
|
10833
10854
|
}, extraProps)));
|
@@ -10997,6 +11018,256 @@ var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
|
|
10997
11018
|
this.heartCheck = null;
|
10998
11019
|
});
|
10999
11020
|
|
11021
|
+
function Xgplay(_ref, fRef) {
|
11022
|
+
var config = _ref.config,
|
11023
|
+
type = _ref.type,
|
11024
|
+
setRef = _ref.setRef;
|
11025
|
+
var ref = React.useRef(null);
|
11026
|
+
var playerRef = React.useRef(null);
|
11027
|
+
|
11028
|
+
var _useState = React.useState(null),
|
11029
|
+
_useState2 = _slicedToArray(_useState, 2),
|
11030
|
+
player = _useState2[0],
|
11031
|
+
setPlayer = _useState2[1];
|
11032
|
+
|
11033
|
+
React.useEffect(function () {
|
11034
|
+
if (ref.current) {
|
11035
|
+
if (type.indexOf('hls') !== -1) {
|
11036
|
+
playerRef.current = new HlsJsPlayer__default['default'](_objectSpread2({
|
11037
|
+
el: ref.current,
|
11038
|
+
width: '100%',
|
11039
|
+
height: '100%',
|
11040
|
+
autoplay: true,
|
11041
|
+
isLive: true,
|
11042
|
+
autoplayMuted: true
|
11043
|
+
}, config));
|
11044
|
+
} else if (type.indexOf('flv') !== -1) {
|
11045
|
+
playerRef.current = new FlvPlayer__default['default'](_objectSpread2({
|
11046
|
+
el: ref.current,
|
11047
|
+
width: '100%',
|
11048
|
+
height: '100%',
|
11049
|
+
autoplay: true,
|
11050
|
+
isLive: true,
|
11051
|
+
autoplayMuted: true
|
11052
|
+
}, config));
|
11053
|
+
} else if (type.indexOf('mp4') !== -1) {
|
11054
|
+
playerRef.current = new Player__default['default'](_objectSpread2({
|
11055
|
+
el: ref.current,
|
11056
|
+
width: '100%',
|
11057
|
+
height: '100%',
|
11058
|
+
autoplay: true,
|
11059
|
+
isLive: true,
|
11060
|
+
autoplayMuted: true
|
11061
|
+
}, config));
|
11062
|
+
}
|
11063
|
+
}
|
11064
|
+
|
11065
|
+
return function () {
|
11066
|
+
playerRef.current = null;
|
11067
|
+
};
|
11068
|
+
}, []);
|
11069
|
+
React.useEffect(function () {
|
11070
|
+
if (playerRef.current) {
|
11071
|
+
setRef(playerRef.current);
|
11072
|
+
}
|
11073
|
+
});
|
11074
|
+
React.useImperativeHandle(fRef, function () {
|
11075
|
+
return {
|
11076
|
+
player: playerRef.current
|
11077
|
+
};
|
11078
|
+
});
|
11079
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
11080
|
+
ref: ref,
|
11081
|
+
style: {
|
11082
|
+
overflow: 'hidden'
|
11083
|
+
}
|
11084
|
+
});
|
11085
|
+
}
|
11086
|
+
|
11087
|
+
var Xgplay$1 = /*#__PURE__*/React.forwardRef(Xgplay);
|
11088
|
+
|
11089
|
+
/*
|
11090
|
+
* @Author: lijin
|
11091
|
+
* @Date: 2021-08-04 16:24:47
|
11092
|
+
* @LastEditTime: 2022-06-08 11:02:39
|
11093
|
+
* @LastEditors: cadelle 793238465@qq.com
|
11094
|
+
* @Description:
|
11095
|
+
* @FilePath: \wargerm\src\IconFont\index.tsx
|
11096
|
+
* 可以输入预定的版权声明、个性签名、空行等
|
11097
|
+
*/
|
11098
|
+
// iconFontScriptUrl 修改成自己的iconfont图标项目地址
|
11099
|
+
// 注意:如果需要图标多色,Iconfont图标项目里要进行批量去色处理
|
11100
|
+
// 使用:
|
11101
|
+
// import IconFont from '@/components/IconFont';
|
11102
|
+
// <IconFont type='icon-demo' className='xxx-xxx' />
|
11103
|
+
|
11104
|
+
var IconFont = icons.createFromIconfontCN({
|
11105
|
+
scriptUrl: '//at.alicdn.com/t/font_3425259_s93peuz62an.js'
|
11106
|
+
});
|
11107
|
+
|
11108
|
+
function VideoPlayer(_ref, ref) {
|
11109
|
+
var _ref$footer = _ref.footer,
|
11110
|
+
footer = _ref$footer === void 0 ? true : _ref$footer,
|
11111
|
+
_ref$style = _ref.style,
|
11112
|
+
style = _ref$style === void 0 ? {
|
11113
|
+
width: 400,
|
11114
|
+
height: 400
|
11115
|
+
} : _ref$style,
|
11116
|
+
_ref$config = _ref.config,
|
11117
|
+
config = _ref$config === void 0 ? {} : _ref$config,
|
11118
|
+
layoutIndex = _ref.layoutIndex,
|
11119
|
+
_ref$url = _ref.url,
|
11120
|
+
url = _ref$url === void 0 ? [] : _ref$url;
|
11121
|
+
var layouts = [{
|
11122
|
+
title: '1x1布局',
|
11123
|
+
style: {
|
11124
|
+
gridTemplateColumns: '1fr',
|
11125
|
+
gridTemplateRows: '1fr'
|
11126
|
+
},
|
11127
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
11128
|
+
type: "icon-dantupailie"
|
11129
|
+
}),
|
11130
|
+
span: 1
|
11131
|
+
}, {
|
11132
|
+
title: '2x2布局',
|
11133
|
+
style: {
|
11134
|
+
gridTemplateColumns: '1fr 1fr',
|
11135
|
+
gridTemplateRows: '1fr 1fr'
|
11136
|
+
},
|
11137
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
11138
|
+
type: "icon-split-screen-compare-full"
|
11139
|
+
}),
|
11140
|
+
span: 4
|
11141
|
+
}, {
|
11142
|
+
title: '3x3布局',
|
11143
|
+
style: {
|
11144
|
+
gridTemplateColumns: '1fr 1fr 1fr',
|
11145
|
+
gridTemplateRows: '1fr 1fr 1fr'
|
11146
|
+
},
|
11147
|
+
icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
11148
|
+
type: "icon-all-full",
|
11149
|
+
className: "f21"
|
11150
|
+
}),
|
11151
|
+
span: 9
|
11152
|
+
}];
|
11153
|
+
|
11154
|
+
var _useState = React.useState(layoutIndex || 0),
|
11155
|
+
_useState2 = _slicedToArray(_useState, 2),
|
11156
|
+
currentLayoutIndex = _useState2[0],
|
11157
|
+
setCurrentLayoutIndex = _useState2[1];
|
11158
|
+
|
11159
|
+
var initPlayerIndex = layouts[layoutIndex || 0].span >= url.length ? url.length - 1 >= 0 ? url.length - 1 : 0 : layouts[layoutIndex || 0].span - 1;
|
11160
|
+
|
11161
|
+
var _useState3 = React.useState(initPlayerIndex),
|
11162
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
11163
|
+
currentPlayerIndex = _useState4[0],
|
11164
|
+
setCurrentPlayerIndex = _useState4[1];
|
11165
|
+
|
11166
|
+
var domRef = React.useRef(null);
|
11167
|
+
var playerRef = React.useRef({});
|
11168
|
+
|
11169
|
+
var _useState5 = React.useState([]),
|
11170
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
11171
|
+
players = _useState6[0],
|
11172
|
+
setPlayers = _useState6[1];
|
11173
|
+
|
11174
|
+
var renderDom = React.useMemo(function () {
|
11175
|
+
var arr = new Array(layouts[currentLayoutIndex].span).fill(0);
|
11176
|
+
return arr.map(function (item, index) {
|
11177
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
11178
|
+
key: index,
|
11179
|
+
className: "camera ".concat(currentPlayerIndex == index ? 'activeCamera' : ''),
|
11180
|
+
onClickCapture: function onClickCapture() {
|
11181
|
+
setCurrentPlayerIndex(index);
|
11182
|
+
}
|
11183
|
+
}, url[index] ? /*#__PURE__*/React__default['default'].createElement(Xgplay$1, {
|
11184
|
+
setRef: function setRef(ref) {
|
11185
|
+
return setPlayers(function (players) {
|
11186
|
+
players[index] = ref;
|
11187
|
+
return players;
|
11188
|
+
});
|
11189
|
+
},
|
11190
|
+
type: url[index],
|
11191
|
+
config: _objectSpread2({
|
11192
|
+
url: url[index],
|
11193
|
+
fluid: true
|
11194
|
+
}, config)
|
11195
|
+
}) : /*#__PURE__*/React__default['default'].createElement("div", {
|
11196
|
+
className: "empty",
|
11197
|
+
onDoubleClick: function onDoubleClick() {
|
11198
|
+
var _domRef$current;
|
11199
|
+
|
11200
|
+
var fullscreenElement = document.fullscreenElement;
|
11201
|
+
fullscreenElement ? exitFullscreen() : requestFullScreen(domRef === null || domRef === void 0 ? void 0 : (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.childNodes[index]);
|
11202
|
+
}
|
11203
|
+
}));
|
11204
|
+
});
|
11205
|
+
}, [currentLayoutIndex, currentPlayerIndex, playerRef, url]);
|
11206
|
+
|
11207
|
+
function exitFullscreen() {
|
11208
|
+
if (document.exitFullscreen) {
|
11209
|
+
document.exitFullscreen();
|
11210
|
+
}
|
11211
|
+
}
|
11212
|
+
|
11213
|
+
function requestFullScreen(element) {
|
11214
|
+
if (element.requestFullscreen) {
|
11215
|
+
element.requestFullscreen();
|
11216
|
+
} //FireFox
|
11217
|
+
else if (element.mozRequestFullScreen) {
|
11218
|
+
element.mozRequestFullScreen();
|
11219
|
+
} //Chrome等
|
11220
|
+
else if (element.webkitRequestFullScreen) {
|
11221
|
+
element.webkitRequestFullScreen();
|
11222
|
+
} //IE11
|
11223
|
+
else if (element.msRequestFullscreen) {
|
11224
|
+
element.msRequestFullscreen();
|
11225
|
+
}
|
11226
|
+
}
|
11227
|
+
|
11228
|
+
var loadCamera = function loadCamera(url) {
|
11229
|
+
var currentPlayer = players[currentPlayerIndex];
|
11230
|
+
|
11231
|
+
if (currentPlayer) {
|
11232
|
+
debugger;
|
11233
|
+
currentPlayer.src = url;
|
11234
|
+
}
|
11235
|
+
};
|
11236
|
+
|
11237
|
+
React.useImperativeHandle(ref, function () {
|
11238
|
+
return {
|
11239
|
+
players: players,
|
11240
|
+
currentLayoutIndex: currentLayoutIndex,
|
11241
|
+
currentPlayerIndex: currentPlayerIndex,
|
11242
|
+
loadCamera: loadCamera
|
11243
|
+
};
|
11244
|
+
});
|
11245
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
11246
|
+
style: style
|
11247
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
11248
|
+
ref: domRef,
|
11249
|
+
className: "videoContainer",
|
11250
|
+
style: layouts[currentLayoutIndex].style
|
11251
|
+
}, renderDom), footer ? /*#__PURE__*/React__default['default'].createElement("div", {
|
11252
|
+
className: "tools"
|
11253
|
+
}, layouts.map(function (item, index) {
|
11254
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
11255
|
+
key: index,
|
11256
|
+
className: "btnbox",
|
11257
|
+
onClick: function onClick() {
|
11258
|
+
var playerIndex = layouts[index || 0].span > url.length ? url.length - 1 >= 0 ? url.length : 0 : layouts[index || 0].span - 1;
|
11259
|
+
setCurrentPlayerIndex(playerIndex);
|
11260
|
+
setCurrentLayoutIndex(index);
|
11261
|
+
}
|
11262
|
+
}, /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
|
11263
|
+
placement: "top",
|
11264
|
+
title: item.title
|
11265
|
+
}, item.icon));
|
11266
|
+
})) : null));
|
11267
|
+
}
|
11268
|
+
|
11269
|
+
var index$3 = /*#__PURE__*/React.forwardRef(VideoPlayer);
|
11270
|
+
|
11000
11271
|
exports.AutoScroll = Index$9;
|
11001
11272
|
exports.Breadcrumb = Index$b;
|
11002
11273
|
exports.Button = WButton;
|
@@ -11020,6 +11291,7 @@ exports.Switch = WSwitch;
|
|
11020
11291
|
exports.TabelCard = index$2;
|
11021
11292
|
exports.Table = Table;
|
11022
11293
|
exports.TreeSelect = Index$6;
|
11294
|
+
exports.VideoPlayer = index$3;
|
11023
11295
|
exports.WDatePicker = Index$5;
|
11024
11296
|
exports.WForm = WForm$1;
|
11025
11297
|
exports.WebsocketHeart = WebsocketHeart;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"private": false,
|
3
3
|
"name": "wargerm",
|
4
|
-
"version": "0.4.
|
4
|
+
"version": "0.4.13",
|
5
5
|
"scripts": {
|
6
6
|
"dev": "dumi dev",
|
7
7
|
"docs:build": "dumi build",
|
@@ -51,7 +51,12 @@
|
|
51
51
|
"animate.css": "^4.1.1",
|
52
52
|
"react-countup": "^6.0.0",
|
53
53
|
"react-dom": "^17.0.2",
|
54
|
-
"swiper": "^6.7.0"
|
54
|
+
"swiper": "^6.7.0",
|
55
|
+
"xgplayer": "^2.31.6",
|
56
|
+
"xgplayer-flv": "^2.5.1",
|
57
|
+
"xgplayer-flv.js": "^2.3.0",
|
58
|
+
"xgplayer-hls": "^2.5.2",
|
59
|
+
"xgplayer-hls.js": "^2.6.1"
|
55
60
|
},
|
56
61
|
"peerDependencies": {
|
57
62
|
"@ant-design/icons": ">=4.2.0",
|