wargerm 0.4.9 → 0.4.12

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.
@@ -1,12 +1,22 @@
1
- import { FC } from 'react';
1
+ import React from 'react';
2
2
  import { ReactNode } from 'react';
3
+ interface IsliderTabs {
4
+ tabs: Array<string>;
5
+ direction: 'left' | 'right';
6
+ defaultValue?: number;
7
+ className?: string;
8
+ tabClassName?: string;
9
+ activeTabClassName?: string;
10
+ components: Array<ReactNode>;
11
+ }
3
12
  declare type Props = {
4
13
  title: ReactNode;
5
14
  className: string;
6
15
  headerTail?: ReactNode;
7
16
  headerCenter?: ReactNode;
8
17
  children?: ReactNode;
18
+ sliderTabs?: IsliderTabs;
9
19
  style?: Record<string, string>;
10
20
  };
11
- declare const Index: FC<Props>;
12
- export default Index;
21
+ declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<any>>;
22
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ declare type propsType = {
3
+ footer?: boolean;
4
+ style?: {
5
+ height: number | string;
6
+ width: number | string;
7
+ };
8
+ config?: Object;
9
+ url?: string[];
10
+ };
11
+ export default function VideoPlayer({ footer, style, config, url, }: propsType): JSX.Element;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function Xgplay({ config, type }: any): JSX.Element;
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';
@@ -1058,6 +1058,45 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
1058
1058
  transform: translate(-124px, -63px);
1059
1059
  padding: 12px 6px;
1060
1060
  }
1061
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs {
1062
+ position: absolute;
1063
+ }
1064
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.left {
1065
+ right: -22px;
1066
+ top: 80px;
1067
+ }
1068
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.right {
1069
+ left: -22px;
1070
+ top: 80px;
1071
+ }
1072
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.right .tab::before {
1073
+ transform: skewy(-45deg);
1074
+ }
1075
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab {
1076
+ -ms-writing-mode: tb-lr;
1077
+ writing-mode: vertical-lr;
1078
+ position: relative;
1079
+ margin-bottom: 2px;
1080
+ cursor: pointer;
1081
+ padding: 10px 2px;
1082
+ }
1083
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab::before {
1084
+ content: '';
1085
+ position: absolute;
1086
+ width: 100%;
1087
+ height: 100%;
1088
+ transform: skewy(45deg);
1089
+ left: 0;
1090
+ top: 0;
1091
+ background: rgba(81, 190, 246, 0.28);
1092
+ border: 2px solid #51bef6;
1093
+ transition: background 0.3s ease;
1094
+ z-index: -1;
1095
+ }
1096
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab.active::before {
1097
+ background: #51bef6;
1098
+ border: none;
1099
+ }
1061
1100
  [data-prefers-color='dark'] .card-container .container-in::before {
1062
1101
  content: '';
1063
1102
  position: absolute;
@@ -1315,6 +1354,70 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
1315
1354
  [data-prefers-color='dark'] .ant-modal-confirm-btns {
1316
1355
  display: flex;
1317
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'] .row {
1376
+ height: calc(100% -30px);
1377
+ }
1378
+ [data-prefers-color='dark'] .camera {
1379
+ border: 1px solid #216fa3;
1380
+ }
1381
+ [data-prefers-color='dark'] .camera:hover {
1382
+ border: 1px solid red;
1383
+ }
1384
+ [data-prefers-color='dark'] .xgplayer-live {
1385
+ display: none !important;
1386
+ }
1387
+ [data-prefers-color='dark'] .xgplayer-fullscreen {
1388
+ display: none !important;
1389
+ }
1390
+ [data-prefers-color='dark'] .tools {
1391
+ background: #484d53;
1392
+ height: 30px;
1393
+ width: 100%;
1394
+ display: flex;
1395
+ justify-content: flex-end;
1396
+ }
1397
+ [data-prefers-color='dark'] .btnbox {
1398
+ background: #333333;
1399
+ border-radius: 5px;
1400
+ color: #fff;
1401
+ margin: 1px 5px;
1402
+ width: 26px;
1403
+ height: 26px;
1404
+ font-size: 18px;
1405
+ line-height: 26px;
1406
+ cursor: pointer;
1407
+ text-align: center;
1408
+ }
1409
+ [data-prefers-color='dark'] .btnbox:hover {
1410
+ background: #0f6ab7;
1411
+ }
1412
+ [data-prefers-color='dark'] .videoContainer {
1413
+ width: 100%;
1414
+ height: 100%;
1415
+ display: grid;
1416
+ grid-template-columns: 1fr;
1417
+ grid-template-rows: 1fr;
1418
+ grid-gap: 1px 1px;
1419
+ background: #0f6ab7;
1420
+ }
1318
1421
 
1319
1422
  /* Color
1320
1423
  ----------------------- */
@@ -1782,7 +1885,7 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
1782
1885
  }
1783
1886
  [data-prefers-color='light'] .autoScroll-outer {
1784
1887
  overflow: auto;
1785
- height: 100px;
1888
+ min-height: 100px;
1786
1889
  }
1787
1890
  @font-face {
1788
1891
  font-family: 'swiper-icons';
@@ -2632,6 +2735,70 @@ button[data-prefers-color='light'] .swiper-pagination-bullet {
2632
2735
  [data-prefers-color='light'] .ant-input-number-handler-down-inner {
2633
2736
  color: #708191;
2634
2737
  }
2738
+ [data-prefers-color='light'] .empty {
2739
+ background: #16191e;
2740
+ width: 100%;
2741
+ height: 100%;
2742
+ position: relative;
2743
+ }
2744
+ [data-prefers-color='light'] .empty .none {
2745
+ width: 100%;
2746
+ height: 100%;
2747
+ position: absolute;
2748
+ top: 50%;
2749
+ left: 50%;
2750
+ transform: translate(-50%, -50%);
2751
+ -webkit-user-select: none;
2752
+ -moz-user-select: none;
2753
+ -ms-user-select: none;
2754
+ user-select: none;
2755
+ }
2756
+ [data-prefers-color='light'] .row {
2757
+ height: calc(100% -30px);
2758
+ }
2759
+ [data-prefers-color='light'] .camera {
2760
+ border: 1px solid #216fa3;
2761
+ }
2762
+ [data-prefers-color='light'] .camera:hover {
2763
+ border: 1px solid red;
2764
+ }
2765
+ [data-prefers-color='light'] .xgplayer-live {
2766
+ display: none !important;
2767
+ }
2768
+ [data-prefers-color='light'] .xgplayer-fullscreen {
2769
+ display: none !important;
2770
+ }
2771
+ [data-prefers-color='light'] .tools {
2772
+ background: #484d53;
2773
+ height: 30px;
2774
+ width: 100%;
2775
+ display: flex;
2776
+ justify-content: flex-end;
2777
+ }
2778
+ [data-prefers-color='light'] .btnbox {
2779
+ background: #333333;
2780
+ border-radius: 5px;
2781
+ color: #fff;
2782
+ margin: 1px 5px;
2783
+ width: 26px;
2784
+ height: 26px;
2785
+ font-size: 18px;
2786
+ line-height: 26px;
2787
+ cursor: pointer;
2788
+ text-align: center;
2789
+ }
2790
+ [data-prefers-color='light'] .btnbox:hover {
2791
+ background: #0f6ab7;
2792
+ }
2793
+ [data-prefers-color='light'] .videoContainer {
2794
+ width: 100%;
2795
+ height: 100%;
2796
+ display: grid;
2797
+ grid-template-columns: 1fr;
2798
+ grid-template-rows: 1fr;
2799
+ grid-gap: 1px 1px;
2800
+ background: #0f6ab7;
2801
+ }
2635
2802
 
2636
2803
  .frame {
2637
2804
  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';
@@ -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';
@@ -1058,6 +1058,45 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
1058
1058
  transform: translate(-124px, -63px);
1059
1059
  padding: 12px 6px;
1060
1060
  }
1061
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs {
1062
+ position: absolute;
1063
+ }
1064
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.left {
1065
+ right: -22px;
1066
+ top: 80px;
1067
+ }
1068
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.right {
1069
+ left: -22px;
1070
+ top: 80px;
1071
+ }
1072
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.right .tab::before {
1073
+ transform: skewy(-45deg);
1074
+ }
1075
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab {
1076
+ -ms-writing-mode: tb-lr;
1077
+ writing-mode: vertical-lr;
1078
+ position: relative;
1079
+ margin-bottom: 2px;
1080
+ cursor: pointer;
1081
+ padding: 10px 2px;
1082
+ }
1083
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab::before {
1084
+ content: '';
1085
+ position: absolute;
1086
+ width: 100%;
1087
+ height: 100%;
1088
+ transform: skewy(45deg);
1089
+ left: 0;
1090
+ top: 0;
1091
+ background: rgba(81, 190, 246, 0.28);
1092
+ border: 2px solid #51bef6;
1093
+ transition: background 0.3s ease;
1094
+ z-index: -1;
1095
+ }
1096
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab.active::before {
1097
+ background: #51bef6;
1098
+ border: none;
1099
+ }
1061
1100
  [data-prefers-color='dark'] .card-container .container-in::before {
1062
1101
  content: '';
1063
1102
  position: absolute;
@@ -1315,6 +1354,70 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
1315
1354
  [data-prefers-color='dark'] .ant-modal-confirm-btns {
1316
1355
  display: flex;
1317
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'] .row {
1376
+ height: calc(100% -30px);
1377
+ }
1378
+ [data-prefers-color='dark'] .camera {
1379
+ border: 1px solid #216fa3;
1380
+ }
1381
+ [data-prefers-color='dark'] .camera:hover {
1382
+ border: 1px solid red;
1383
+ }
1384
+ [data-prefers-color='dark'] .xgplayer-live {
1385
+ display: none !important;
1386
+ }
1387
+ [data-prefers-color='dark'] .xgplayer-fullscreen {
1388
+ display: none !important;
1389
+ }
1390
+ [data-prefers-color='dark'] .tools {
1391
+ background: #484d53;
1392
+ height: 30px;
1393
+ width: 100%;
1394
+ display: flex;
1395
+ justify-content: flex-end;
1396
+ }
1397
+ [data-prefers-color='dark'] .btnbox {
1398
+ background: #333333;
1399
+ border-radius: 5px;
1400
+ color: #fff;
1401
+ margin: 1px 5px;
1402
+ width: 26px;
1403
+ height: 26px;
1404
+ font-size: 18px;
1405
+ line-height: 26px;
1406
+ cursor: pointer;
1407
+ text-align: center;
1408
+ }
1409
+ [data-prefers-color='dark'] .btnbox:hover {
1410
+ background: #0f6ab7;
1411
+ }
1412
+ [data-prefers-color='dark'] .videoContainer {
1413
+ width: 100%;
1414
+ height: 100%;
1415
+ display: grid;
1416
+ grid-template-columns: 1fr;
1417
+ grid-template-rows: 1fr;
1418
+ grid-gap: 1px 1px;
1419
+ background: #0f6ab7;
1420
+ }
1318
1421
 
1319
1422
  /* Color
1320
1423
  ----------------------- */
@@ -1782,7 +1885,7 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
1782
1885
  }
1783
1886
  [data-prefers-color='light'] .autoScroll-outer {
1784
1887
  overflow: auto;
1785
- height: 100px;
1888
+ min-height: 100px;
1786
1889
  }
1787
1890
  @font-face {
1788
1891
  font-family: 'swiper-icons';
@@ -2632,6 +2735,70 @@ button[data-prefers-color='light'] .swiper-pagination-bullet {
2632
2735
  [data-prefers-color='light'] .ant-input-number-handler-down-inner {
2633
2736
  color: #708191;
2634
2737
  }
2738
+ [data-prefers-color='light'] .empty {
2739
+ background: #16191e;
2740
+ width: 100%;
2741
+ height: 100%;
2742
+ position: relative;
2743
+ }
2744
+ [data-prefers-color='light'] .empty .none {
2745
+ width: 100%;
2746
+ height: 100%;
2747
+ position: absolute;
2748
+ top: 50%;
2749
+ left: 50%;
2750
+ transform: translate(-50%, -50%);
2751
+ -webkit-user-select: none;
2752
+ -moz-user-select: none;
2753
+ -ms-user-select: none;
2754
+ user-select: none;
2755
+ }
2756
+ [data-prefers-color='light'] .row {
2757
+ height: calc(100% -30px);
2758
+ }
2759
+ [data-prefers-color='light'] .camera {
2760
+ border: 1px solid #216fa3;
2761
+ }
2762
+ [data-prefers-color='light'] .camera:hover {
2763
+ border: 1px solid red;
2764
+ }
2765
+ [data-prefers-color='light'] .xgplayer-live {
2766
+ display: none !important;
2767
+ }
2768
+ [data-prefers-color='light'] .xgplayer-fullscreen {
2769
+ display: none !important;
2770
+ }
2771
+ [data-prefers-color='light'] .tools {
2772
+ background: #484d53;
2773
+ height: 30px;
2774
+ width: 100%;
2775
+ display: flex;
2776
+ justify-content: flex-end;
2777
+ }
2778
+ [data-prefers-color='light'] .btnbox {
2779
+ background: #333333;
2780
+ border-radius: 5px;
2781
+ color: #fff;
2782
+ margin: 1px 5px;
2783
+ width: 26px;
2784
+ height: 26px;
2785
+ font-size: 18px;
2786
+ line-height: 26px;
2787
+ cursor: pointer;
2788
+ text-align: center;
2789
+ }
2790
+ [data-prefers-color='light'] .btnbox:hover {
2791
+ background: #0f6ab7;
2792
+ }
2793
+ [data-prefers-color='light'] .videoContainer {
2794
+ width: 100%;
2795
+ height: 100%;
2796
+ display: grid;
2797
+ grid-template-columns: 1fr;
2798
+ grid-template-rows: 1fr;
2799
+ grid-gap: 1px 1px;
2800
+ background: #0f6ab7;
2801
+ }
2635
2802
 
2636
2803
  .frame {
2637
2804
  width: 40px;
package/dist/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import 'antd/es/dropdown/style';
4
4
  import _Dropdown from 'antd/es/dropdown';
5
5
  import 'antd/es/menu/style';
6
6
  import _Menu from 'antd/es/menu';
7
- import React, { memo, useState, useEffect, useMemo, useImperativeHandle, useRef } from 'react';
7
+ import React, { memo, useState, useEffect, useMemo, useImperativeHandle, useRef, forwardRef } from 'react';
8
8
  import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
9
9
  import 'antd/es/input/style';
10
10
  import _Input from 'antd/es/input';
@@ -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: 2021-09-09 15:57:23
464
- * @LastEditors: lijin
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/font_2720974_ec0fzxnc7ul.js'
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,
@@ -9575,9 +9578,9 @@ var Index$b = function Index(_ref) {
9575
9578
  }, props));
9576
9579
  };
9577
9580
 
9578
- var _excluded$d = ["title", "className", "headerTail", "headerCenter"];
9581
+ var _excluded$d = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
9579
9582
 
9580
- var Index$c = function Index(_ref) {
9583
+ var Index$c = function Index(_ref, ref) {
9581
9584
  var _classNames;
9582
9585
 
9583
9586
  var title = _ref.title,
@@ -9585,8 +9588,20 @@ var Index$c = function Index(_ref) {
9585
9588
  className = _ref$className === void 0 ? 'default' : _ref$className,
9586
9589
  headerTail = _ref.headerTail,
9587
9590
  headerCenter = _ref.headerCenter,
9591
+ sliderTabs = _ref.sliderTabs,
9588
9592
  props = _objectWithoutProperties(_ref, _excluded$d);
9589
9593
 
9594
+ useImperativeHandle(ref, function () {
9595
+ return {
9596
+ activeTab: activeTab
9597
+ };
9598
+ });
9599
+
9600
+ var _useState = useState((sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.defaultValue) || 0),
9601
+ _useState2 = _slicedToArray(_useState, 2),
9602
+ activeTab = _useState2[0],
9603
+ setActiveTab = _useState2[1];
9604
+
9590
9605
  return /*#__PURE__*/React.createElement("div", _objectSpread2({
9591
9606
  className: classnames((_classNames = {}, _defineProperty(_classNames, 'card-container', true), _defineProperty(_classNames, className, true), _classNames))
9592
9607
  }, props), /*#__PURE__*/React.createElement("div", {
@@ -9601,10 +9616,20 @@ var Index$c = function Index(_ref) {
9601
9616
  className: "dot"
9602
9617
  }), title), headerCenter, headerTail), /*#__PURE__*/React.createElement("div", {
9603
9618
  className: "body"
9604
- }, props.children))));
9619
+ }, sliderTabs ? sliderTabs.components[activeTab] : props.children)), sliderTabs && /*#__PURE__*/React.createElement("div", {
9620
+ className: "sliderTabs ".concat(sliderTabs.direction == 'left' ? "left ".concat(sliderTabs.className || '') : "right ".concat(sliderTabs.className || ''))
9621
+ }, sliderTabs.tabs.map(function (item, index) {
9622
+ return /*#__PURE__*/React.createElement("div", {
9623
+ className: "tab ".concat(index == activeTab ? 'active' : '', " ").concat(sliderTabs.tabClassName || '', " ").concat(sliderTabs.activeTabClassName || '')
9624
+ }, /*#__PURE__*/React.createElement("span", {
9625
+ onClick: function onClick() {
9626
+ return setActiveTab(index);
9627
+ }
9628
+ }, item));
9629
+ }))));
9605
9630
  };
9606
9631
 
9607
- Index$c.defaultProps = {};
9632
+ var index$1 = /*#__PURE__*/forwardRef(Index$c);
9608
9633
 
9609
9634
  var controlShow = function controlShow(f1, f2, value, timer) {
9610
9635
  f1(value);
@@ -10637,6 +10662,21 @@ var TabelCard = function TabelCard(props, ref) {
10637
10662
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
10638
10663
  };
10639
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]);
10640
10680
  var formSearchColumn = columns || [];
10641
10681
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
10642
10682
  ref: modalFormRef,
@@ -10770,13 +10810,13 @@ var TabelCard = function TabelCard(props, ref) {
10770
10810
  return obj;
10771
10811
  }),
10772
10812
  search: false,
10773
- pagination: pagination != undefined ? pagination : {
10813
+ pagination: pagination !== null && pagination !== void 0 ? pagination : {
10774
10814
  pageSize: 20
10775
10815
  }
10776
10816
  }, extraProps)));
10777
10817
  };
10778
10818
 
10779
- var index$1 = /*#__PURE__*/React.forwardRef(TabelCard);
10819
+ var index$2 = /*#__PURE__*/React.forwardRef(TabelCard);
10780
10820
 
10781
10821
  var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10782
10822
  var _this = this;
@@ -10940,4 +10980,189 @@ var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10940
10980
  this.heartCheck = null;
10941
10981
  });
10942
10982
 
10943
- export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, Index$c 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$1 as TabelCard, Table, Index$6 as TreeSelect, Index$5 as WDatePicker, WForm$1 as WForm, WebsocketHeart };
10983
+ var player = null;
10984
+ function Xgplay(_ref) {
10985
+ var config = _ref.config,
10986
+ type = _ref.type;
10987
+ var ref = useRef(null);
10988
+ useEffect(function () {
10989
+ if (type.indexOf('hls') !== -1) {
10990
+ player = new HlsJsPlayer(_objectSpread2({
10991
+ el: ref.current,
10992
+ width: '100%',
10993
+ height: '100%',
10994
+ autoplay: true,
10995
+ isLive: true,
10996
+ autoplayMuted: true
10997
+ }, config));
10998
+ } else if (type.indexOf('flv') !== -1) {
10999
+ player = new FlvPlayer(_objectSpread2({
11000
+ el: ref.current,
11001
+ width: '100%',
11002
+ height: '100%',
11003
+ autoplay: true,
11004
+ isLive: true,
11005
+ autoplayMuted: true
11006
+ }, config));
11007
+ } else if (type.indexOf('mp4') !== -1) {
11008
+ player = new Player(_objectSpread2({
11009
+ el: ref.current,
11010
+ width: '100%',
11011
+ height: '100%',
11012
+ autoplay: true,
11013
+ isLive: true,
11014
+ autoplayMuted: true
11015
+ }, config));
11016
+ }
11017
+
11018
+ return function () {
11019
+ player = null;
11020
+ };
11021
+ }, []);
11022
+ return /*#__PURE__*/React.createElement("div", {
11023
+ ref: ref,
11024
+ style: {
11025
+ overflow: 'hidden'
11026
+ }
11027
+ });
11028
+ }
11029
+
11030
+ /*
11031
+ * @Author: lijin
11032
+ * @Date: 2021-08-04 16:24:47
11033
+ * @LastEditTime: 2022-06-08 11:02:39
11034
+ * @LastEditors: cadelle 793238465@qq.com
11035
+ * @Description:
11036
+ * @FilePath: \wargerm\src\IconFont\index.tsx
11037
+ * 可以输入预定的版权声明、个性签名、空行等
11038
+ */
11039
+ // iconFontScriptUrl 修改成自己的iconfont图标项目地址
11040
+ // 注意:如果需要图标多色,Iconfont图标项目里要进行批量去色处理
11041
+ // 使用:
11042
+ // import IconFont from '@/components/IconFont';
11043
+ // <IconFont type='icon-demo' className='xxx-xxx' />
11044
+
11045
+ var IconFont = createFromIconfontCN({
11046
+ scriptUrl: '//at.alicdn.com/t/font_3425259_s93peuz62an.js'
11047
+ });
11048
+
11049
+ function VideoPlayer(_ref) {
11050
+ var _ref$footer = _ref.footer,
11051
+ footer = _ref$footer === void 0 ? true : _ref$footer,
11052
+ _ref$style = _ref.style,
11053
+ style = _ref$style === void 0 ? {
11054
+ width: 400,
11055
+ height: 400
11056
+ } : _ref$style,
11057
+ _ref$config = _ref.config,
11058
+ config = _ref$config === void 0 ? {} : _ref$config,
11059
+ _ref$url = _ref.url,
11060
+ url = _ref$url === void 0 ? [] : _ref$url;
11061
+ var layouts = [{
11062
+ title: '1x1布局',
11063
+ style: {
11064
+ gridTemplateColumns: '1fr',
11065
+ gridTemplateRows: '1fr'
11066
+ },
11067
+ icon: /*#__PURE__*/React.createElement(IconFont, {
11068
+ type: "icon-dantupailie"
11069
+ }),
11070
+ span: 1
11071
+ }, {
11072
+ title: '2x2布局',
11073
+ style: {
11074
+ gridTemplateColumns: '1fr 1fr',
11075
+ gridTemplateRows: '1fr 1fr'
11076
+ },
11077
+ icon: /*#__PURE__*/React.createElement(IconFont, {
11078
+ type: "icon-split-screen-compare-full"
11079
+ }),
11080
+ span: 4
11081
+ }, {
11082
+ title: '3x3布局',
11083
+ style: {
11084
+ gridTemplateColumns: '1fr 1fr 1fr',
11085
+ gridTemplateRows: '1fr 1fr 1fr'
11086
+ },
11087
+ icon: /*#__PURE__*/React.createElement(IconFont, {
11088
+ type: "icon-all-full",
11089
+ className: "f21"
11090
+ }),
11091
+ span: 9
11092
+ }];
11093
+
11094
+ var _useState = useState(0),
11095
+ _useState2 = _slicedToArray(_useState, 2),
11096
+ currentLayoutIndex = _useState2[0],
11097
+ setCurrentLayoutIndex = _useState2[1];
11098
+
11099
+ var domRef = useRef(null);
11100
+ var contentRef = useRef(null);
11101
+ var renderDom = useMemo(function () {
11102
+ var arr = new Array(layouts[currentLayoutIndex].span).fill(0);
11103
+ return arr.map(function (item, index) {
11104
+ return /*#__PURE__*/React.createElement("div", {
11105
+ key: index,
11106
+ className: "camera"
11107
+ }, url[index] ? /*#__PURE__*/React.createElement(Xgplay, {
11108
+ type: url[index],
11109
+ config: _objectSpread2({
11110
+ url: url[index]
11111
+ }, config)
11112
+ }) : /*#__PURE__*/React.createElement("div", {
11113
+ className: "empty",
11114
+ onDoubleClick: function onDoubleClick() {
11115
+ var _domRef$current;
11116
+
11117
+ var fullscreenElement = document.fullscreenElement;
11118
+ 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]);
11119
+ }
11120
+ }));
11121
+ });
11122
+ }, [currentLayoutIndex]);
11123
+
11124
+ function exitFullscreen() {
11125
+ if (document.exitFullscreen) {
11126
+ document.exitFullscreen();
11127
+ }
11128
+ }
11129
+
11130
+ function requestFullScreen(element) {
11131
+ if (element.requestFullscreen) {
11132
+ element.requestFullscreen();
11133
+ } //FireFox
11134
+ else if (element.mozRequestFullScreen) {
11135
+ element.mozRequestFullScreen();
11136
+ } //Chrome等
11137
+ else if (element.webkitRequestFullScreen) {
11138
+ element.webkitRequestFullScreen();
11139
+ } //IE11
11140
+ else if (element.msRequestFullscreen) {
11141
+ element.msRequestFullscreen();
11142
+ }
11143
+ }
11144
+
11145
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
11146
+ style: style,
11147
+ ref: contentRef
11148
+ }, /*#__PURE__*/React.createElement("div", {
11149
+ ref: domRef,
11150
+ className: "videoContainer",
11151
+ style: layouts[currentLayoutIndex].style
11152
+ }, renderDom), footer ? /*#__PURE__*/React.createElement("div", {
11153
+ className: "tools"
11154
+ }, layouts.map(function (item, index) {
11155
+ return /*#__PURE__*/React.createElement("div", {
11156
+ key: index,
11157
+ className: "btnbox",
11158
+ onClick: function onClick() {
11159
+ return setCurrentLayoutIndex(index);
11160
+ }
11161
+ }, /*#__PURE__*/React.createElement(_Tooltip, {
11162
+ placement: "top",
11163
+ title: item.title
11164
+ }, item.icon));
11165
+ })) : null));
11166
+ }
11167
+
11168
+ 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, 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: 2021-09-09 15:57:23
499
- * @LastEditors: lijin
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/font_2720974_ec0fzxnc7ul.js'
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,
@@ -9610,9 +9616,9 @@ var Index$b = function Index(_ref) {
9610
9616
  }, props));
9611
9617
  };
9612
9618
 
9613
- var _excluded$d = ["title", "className", "headerTail", "headerCenter"];
9619
+ var _excluded$d = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
9614
9620
 
9615
- var Index$c = function Index(_ref) {
9621
+ var Index$c = function Index(_ref, ref) {
9616
9622
  var _classNames;
9617
9623
 
9618
9624
  var title = _ref.title,
@@ -9620,8 +9626,20 @@ var Index$c = function Index(_ref) {
9620
9626
  className = _ref$className === void 0 ? 'default' : _ref$className,
9621
9627
  headerTail = _ref.headerTail,
9622
9628
  headerCenter = _ref.headerCenter,
9629
+ sliderTabs = _ref.sliderTabs,
9623
9630
  props = _objectWithoutProperties(_ref, _excluded$d);
9624
9631
 
9632
+ React.useImperativeHandle(ref, function () {
9633
+ return {
9634
+ activeTab: activeTab
9635
+ };
9636
+ });
9637
+
9638
+ var _useState = React.useState((sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.defaultValue) || 0),
9639
+ _useState2 = _slicedToArray(_useState, 2),
9640
+ activeTab = _useState2[0],
9641
+ setActiveTab = _useState2[1];
9642
+
9625
9643
  return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2({
9626
9644
  className: classnames__default['default']((_classNames = {}, _defineProperty(_classNames, 'card-container', true), _defineProperty(_classNames, className, true), _classNames))
9627
9645
  }, props), /*#__PURE__*/React__default['default'].createElement("div", {
@@ -9636,10 +9654,20 @@ var Index$c = function Index(_ref) {
9636
9654
  className: "dot"
9637
9655
  }), title), headerCenter, headerTail), /*#__PURE__*/React__default['default'].createElement("div", {
9638
9656
  className: "body"
9639
- }, props.children))));
9657
+ }, sliderTabs ? sliderTabs.components[activeTab] : props.children)), sliderTabs && /*#__PURE__*/React__default['default'].createElement("div", {
9658
+ className: "sliderTabs ".concat(sliderTabs.direction == 'left' ? "left ".concat(sliderTabs.className || '') : "right ".concat(sliderTabs.className || ''))
9659
+ }, sliderTabs.tabs.map(function (item, index) {
9660
+ return /*#__PURE__*/React__default['default'].createElement("div", {
9661
+ className: "tab ".concat(index == activeTab ? 'active' : '', " ").concat(sliderTabs.tabClassName || '', " ").concat(sliderTabs.activeTabClassName || '')
9662
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
9663
+ onClick: function onClick() {
9664
+ return setActiveTab(index);
9665
+ }
9666
+ }, item));
9667
+ }))));
9640
9668
  };
9641
9669
 
9642
- Index$c.defaultProps = {};
9670
+ var index$1 = /*#__PURE__*/React.forwardRef(Index$c);
9643
9671
 
9644
9672
  var controlShow = function controlShow(f1, f2, value, timer) {
9645
9673
  f1(value);
@@ -10672,6 +10700,21 @@ var TabelCard = function TabelCard(props, ref) {
10672
10700
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : _actionRef$current7.reload();
10673
10701
  };
10674
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]);
10675
10718
  var formSearchColumn = columns || [];
10676
10719
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
10677
10720
  ref: modalFormRef,
@@ -10805,13 +10848,13 @@ var TabelCard = function TabelCard(props, ref) {
10805
10848
  return obj;
10806
10849
  }),
10807
10850
  search: false,
10808
- pagination: pagination != undefined ? pagination : {
10851
+ pagination: pagination !== null && pagination !== void 0 ? pagination : {
10809
10852
  pageSize: 20
10810
10853
  }
10811
10854
  }, extraProps)));
10812
10855
  };
10813
10856
 
10814
- var index$1 = /*#__PURE__*/React__default['default'].forwardRef(TabelCard);
10857
+ var index$2 = /*#__PURE__*/React__default['default'].forwardRef(TabelCard);
10815
10858
 
10816
10859
  var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10817
10860
  var _this = this;
@@ -10975,10 +11018,195 @@ var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10975
11018
  this.heartCheck = null;
10976
11019
  });
10977
11020
 
11021
+ var player = null;
11022
+ function Xgplay(_ref) {
11023
+ var config = _ref.config,
11024
+ type = _ref.type;
11025
+ var ref = React.useRef(null);
11026
+ React.useEffect(function () {
11027
+ if (type.indexOf('hls') !== -1) {
11028
+ player = new HlsJsPlayer__default['default'](_objectSpread2({
11029
+ el: ref.current,
11030
+ width: '100%',
11031
+ height: '100%',
11032
+ autoplay: true,
11033
+ isLive: true,
11034
+ autoplayMuted: true
11035
+ }, config));
11036
+ } else if (type.indexOf('flv') !== -1) {
11037
+ player = new FlvPlayer__default['default'](_objectSpread2({
11038
+ el: ref.current,
11039
+ width: '100%',
11040
+ height: '100%',
11041
+ autoplay: true,
11042
+ isLive: true,
11043
+ autoplayMuted: true
11044
+ }, config));
11045
+ } else if (type.indexOf('mp4') !== -1) {
11046
+ player = new Player__default['default'](_objectSpread2({
11047
+ el: ref.current,
11048
+ width: '100%',
11049
+ height: '100%',
11050
+ autoplay: true,
11051
+ isLive: true,
11052
+ autoplayMuted: true
11053
+ }, config));
11054
+ }
11055
+
11056
+ return function () {
11057
+ player = null;
11058
+ };
11059
+ }, []);
11060
+ return /*#__PURE__*/React__default['default'].createElement("div", {
11061
+ ref: ref,
11062
+ style: {
11063
+ overflow: 'hidden'
11064
+ }
11065
+ });
11066
+ }
11067
+
11068
+ /*
11069
+ * @Author: lijin
11070
+ * @Date: 2021-08-04 16:24:47
11071
+ * @LastEditTime: 2022-06-08 11:02:39
11072
+ * @LastEditors: cadelle 793238465@qq.com
11073
+ * @Description:
11074
+ * @FilePath: \wargerm\src\IconFont\index.tsx
11075
+ * 可以输入预定的版权声明、个性签名、空行等
11076
+ */
11077
+ // iconFontScriptUrl 修改成自己的iconfont图标项目地址
11078
+ // 注意:如果需要图标多色,Iconfont图标项目里要进行批量去色处理
11079
+ // 使用:
11080
+ // import IconFont from '@/components/IconFont';
11081
+ // <IconFont type='icon-demo' className='xxx-xxx' />
11082
+
11083
+ var IconFont = icons.createFromIconfontCN({
11084
+ scriptUrl: '//at.alicdn.com/t/font_3425259_s93peuz62an.js'
11085
+ });
11086
+
11087
+ function VideoPlayer(_ref) {
11088
+ var _ref$footer = _ref.footer,
11089
+ footer = _ref$footer === void 0 ? true : _ref$footer,
11090
+ _ref$style = _ref.style,
11091
+ style = _ref$style === void 0 ? {
11092
+ width: 400,
11093
+ height: 400
11094
+ } : _ref$style,
11095
+ _ref$config = _ref.config,
11096
+ config = _ref$config === void 0 ? {} : _ref$config,
11097
+ _ref$url = _ref.url,
11098
+ url = _ref$url === void 0 ? [] : _ref$url;
11099
+ var layouts = [{
11100
+ title: '1x1布局',
11101
+ style: {
11102
+ gridTemplateColumns: '1fr',
11103
+ gridTemplateRows: '1fr'
11104
+ },
11105
+ icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
11106
+ type: "icon-dantupailie"
11107
+ }),
11108
+ span: 1
11109
+ }, {
11110
+ title: '2x2布局',
11111
+ style: {
11112
+ gridTemplateColumns: '1fr 1fr',
11113
+ gridTemplateRows: '1fr 1fr'
11114
+ },
11115
+ icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
11116
+ type: "icon-split-screen-compare-full"
11117
+ }),
11118
+ span: 4
11119
+ }, {
11120
+ title: '3x3布局',
11121
+ style: {
11122
+ gridTemplateColumns: '1fr 1fr 1fr',
11123
+ gridTemplateRows: '1fr 1fr 1fr'
11124
+ },
11125
+ icon: /*#__PURE__*/React__default['default'].createElement(IconFont, {
11126
+ type: "icon-all-full",
11127
+ className: "f21"
11128
+ }),
11129
+ span: 9
11130
+ }];
11131
+
11132
+ var _useState = React.useState(0),
11133
+ _useState2 = _slicedToArray(_useState, 2),
11134
+ currentLayoutIndex = _useState2[0],
11135
+ setCurrentLayoutIndex = _useState2[1];
11136
+
11137
+ var domRef = React.useRef(null);
11138
+ var contentRef = React.useRef(null);
11139
+ var renderDom = React.useMemo(function () {
11140
+ var arr = new Array(layouts[currentLayoutIndex].span).fill(0);
11141
+ return arr.map(function (item, index) {
11142
+ return /*#__PURE__*/React__default['default'].createElement("div", {
11143
+ key: index,
11144
+ className: "camera"
11145
+ }, url[index] ? /*#__PURE__*/React__default['default'].createElement(Xgplay, {
11146
+ type: url[index],
11147
+ config: _objectSpread2({
11148
+ url: url[index]
11149
+ }, config)
11150
+ }) : /*#__PURE__*/React__default['default'].createElement("div", {
11151
+ className: "empty",
11152
+ onDoubleClick: function onDoubleClick() {
11153
+ var _domRef$current;
11154
+
11155
+ var fullscreenElement = document.fullscreenElement;
11156
+ 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]);
11157
+ }
11158
+ }));
11159
+ });
11160
+ }, [currentLayoutIndex]);
11161
+
11162
+ function exitFullscreen() {
11163
+ if (document.exitFullscreen) {
11164
+ document.exitFullscreen();
11165
+ }
11166
+ }
11167
+
11168
+ function requestFullScreen(element) {
11169
+ if (element.requestFullscreen) {
11170
+ element.requestFullscreen();
11171
+ } //FireFox
11172
+ else if (element.mozRequestFullScreen) {
11173
+ element.mozRequestFullScreen();
11174
+ } //Chrome等
11175
+ else if (element.webkitRequestFullScreen) {
11176
+ element.webkitRequestFullScreen();
11177
+ } //IE11
11178
+ else if (element.msRequestFullscreen) {
11179
+ element.msRequestFullscreen();
11180
+ }
11181
+ }
11182
+
11183
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
11184
+ style: style,
11185
+ ref: contentRef
11186
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
11187
+ ref: domRef,
11188
+ className: "videoContainer",
11189
+ style: layouts[currentLayoutIndex].style
11190
+ }, renderDom), footer ? /*#__PURE__*/React__default['default'].createElement("div", {
11191
+ className: "tools"
11192
+ }, layouts.map(function (item, index) {
11193
+ return /*#__PURE__*/React__default['default'].createElement("div", {
11194
+ key: index,
11195
+ className: "btnbox",
11196
+ onClick: function onClick() {
11197
+ return setCurrentLayoutIndex(index);
11198
+ }
11199
+ }, /*#__PURE__*/React__default['default'].createElement(_Tooltip__default['default'], {
11200
+ placement: "top",
11201
+ title: item.title
11202
+ }, item.icon));
11203
+ })) : null));
11204
+ }
11205
+
10978
11206
  exports.AutoScroll = Index$9;
10979
11207
  exports.Breadcrumb = Index$b;
10980
11208
  exports.Button = WButton;
10981
- exports.Card = Index$c;
11209
+ exports.Card = index$1;
10982
11210
  exports.Cascader = WCascader;
10983
11211
  exports.Checkbox = Index$3;
10984
11212
  exports.CountUp = Index$8;
@@ -10995,9 +11223,10 @@ exports.Radio = Index$2;
10995
11223
  exports.Select = Select;
10996
11224
  exports.Swiper = Index$a;
10997
11225
  exports.Switch = WSwitch;
10998
- exports.TabelCard = index$1;
11226
+ exports.TabelCard = index$2;
10999
11227
  exports.Table = Table;
11000
11228
  exports.TreeSelect = Index$6;
11229
+ exports.VideoPlayer = VideoPlayer;
11001
11230
  exports.WDatePicker = Index$5;
11002
11231
  exports.WForm = WForm$1;
11003
11232
  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.9",
4
+ "version": "0.4.12",
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",