张延森 3 years ago
parent
commit
359db9bd24
2 changed files with 34 additions and 17 deletions
  1. 32
    0
      src/components/GeoMap/VideoModel.jsx
  2. 2
    17
      src/components/GeoMap/index.jsx

+ 32
- 0
src/components/GeoMap/VideoModel.jsx View File

@@ -0,0 +1,32 @@
1
+import { Modal, Button } from 'antd';
2
+import React from 'react';
3
+
4
+export default (props) => {
5
+  const { width = 600, height = 480, machineryRef, visible, toggleVisible } = props;
6
+
7
+  const handleCancel = () => {
8
+    toggleVisible(false);
9
+  };
10
+
11
+  return (
12
+    <Modal
13
+      width={width}
14
+      footer={null}
15
+      visible={visible}
16
+      onCancel={handleCancel}
17
+      bodyStyle={{ padding: 0 }}
18
+    >
19
+      <video
20
+        style={{ display: 'block' }}
21
+        width={width}
22
+        height={height}
23
+        controls
24
+        src="https://yz-offical.oss-cn-shanghai.aliyuncs.com/%E7%9C%81%E5%8F%98%E7%94%B5%E5%9F%B9%E8%AE%AD%E5%9F%BA%E5%9C%B0%E8%A7%86%E9%A2%91%20A%20copy.mov"
25
+      >
26
+        <source src="movie.mp4" type="video/mp4" />
27
+        <source src="movie.ogg" type="video/ogg" />
28
+        您的浏览器不支持 video 。
29
+      </video>
30
+    </Modal>
31
+  );
32
+};

+ 2
- 17
src/components/GeoMap/index.jsx View File

@@ -4,6 +4,7 @@ import useMap from './map';
4 4
 import { useMarker, useMarkerVisible } from './marker';
5 5
 import Styles from './style.less';
6 6
 import RadioGroup from '../ScreenBox/Radio/RadioGroup';
7
+import VideoModel from './VideoModel';
7 8
 
8 9
 export default (props) => {
9 10
   const { machineTypeList, orgList, machineList } = props;
@@ -80,23 +81,7 @@ export default (props) => {
80 81
         <div />
81 82
         <div />
82 83
       </div>
83
-      <Modal
84
-        title="农机监控"
85
-        footer={null}
86
-        visible={isModalVisible}
87
-        onCancel={() => setIsModalVisible(false)}
88
-      >
89
-        <video
90
-          width="320"
91
-          height="240"
92
-          controls
93
-          src="https://www.runoob.com/try/demo_source/movie.mp4"
94
-        >
95
-          <source src="movie.mp4" type="video/mp4" />
96
-          <source src="movie.ogg" type="video/ogg" />
97
-          您的浏览器不支持 video 。
98
-        </video>
99
-      </Modal>
84
+      <VideoModel visible={isModalVisible} toggleVisible={setIsModalVisible} />
100 85
     </div>
101 86
   );
102 87
 };