zy-react-library 1.0.132 → 1.0.134
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.
|
@@ -12,6 +12,7 @@ import HeaderBack from "../../HeaderBack";
|
|
|
12
12
|
import VideoIcon from "../../Icon/VideoIcon";
|
|
13
13
|
import PreviewImg from "../../PreviewImg";
|
|
14
14
|
import PreviewPdf from "../../PreviewPdf";
|
|
15
|
+
import Video from "../../Video";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* 隐患查看组件(港务局版本)
|
|
@@ -42,6 +43,7 @@ function HiddenInfo(props) {
|
|
|
42
43
|
const [acceptImageFiles, setAcceptImageFiles] = useState([]);
|
|
43
44
|
const [inspectionAcceptImageFiles, setInspectionAcceptImageFiles] = useState([]);
|
|
44
45
|
const [loading, setLoading] = useState(true);
|
|
46
|
+
const [videoModalOpen, setVideoModalOpen] = useState(true);
|
|
45
47
|
|
|
46
48
|
const { getFile } = useGetFile();
|
|
47
49
|
const query = useGetUrlQuery();
|
|
@@ -146,7 +148,14 @@ function HiddenInfo(props) {
|
|
|
146
148
|
}),
|
|
147
149
|
},
|
|
148
150
|
{ label: "隐患图片", children: <PreviewImg files={hiddenImageFiles} /> },
|
|
149
|
-
...(hiddenVideoFiles.length > 0
|
|
151
|
+
...(hiddenVideoFiles.length > 0
|
|
152
|
+
? [{ label: "隐患视频", children: (
|
|
153
|
+
<VideoIcon onClick={() => {
|
|
154
|
+
setVideoModalOpen(true);
|
|
155
|
+
}}
|
|
156
|
+
/>
|
|
157
|
+
) }]
|
|
158
|
+
: []),
|
|
150
159
|
]}
|
|
151
160
|
/>
|
|
152
161
|
{
|
|
@@ -420,6 +429,16 @@ function HiddenInfo(props) {
|
|
|
420
429
|
}
|
|
421
430
|
</div>
|
|
422
431
|
</Spin>
|
|
432
|
+
{
|
|
433
|
+
videoModalOpen && (
|
|
434
|
+
<Video
|
|
435
|
+
visible={videoModalOpen}
|
|
436
|
+
source={hiddenVideoFiles[0].url}
|
|
437
|
+
onCancel={() => setVideoModalOpen(false)}
|
|
438
|
+
title="隐患视频"
|
|
439
|
+
/>
|
|
440
|
+
)
|
|
441
|
+
}
|
|
423
442
|
</div>
|
|
424
443
|
);
|
|
425
444
|
}
|
|
@@ -2,6 +2,8 @@ import type { ForwardRefExoticComponent, RefAttributes } from "react";
|
|
|
2
2
|
import type { AliPlayerProps, AliPlayerRef } from "./AliPlayer";
|
|
3
3
|
|
|
4
4
|
export interface VideoProps extends Omit<AliPlayerProps, "onEnded" | "onTimeupdate"> {
|
|
5
|
+
/** 弹窗标题,默认 “视频” */
|
|
6
|
+
title?: string;
|
|
5
7
|
/** 是否显示弹窗 */
|
|
6
8
|
visible?: boolean;
|
|
7
9
|
/** 是否内联模式 */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Modal } from "antd";
|
|
1
|
+
import { Button, Modal } from "antd";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { getFileUrl } from "../../utils";
|
|
4
4
|
import AliPlayer from "./AliPlayer";
|
|
@@ -21,7 +21,6 @@ const Video = ({
|
|
|
21
21
|
title = "视频",
|
|
22
22
|
visible: externalVisible = false,
|
|
23
23
|
onCancel,
|
|
24
|
-
...restProps
|
|
25
24
|
}) => {
|
|
26
25
|
const [internalVisible, setInternalVisible] = useState(false);
|
|
27
26
|
const playerRef = useRef(null);
|
|
@@ -68,15 +67,15 @@ const Video = ({
|
|
|
68
67
|
return (
|
|
69
68
|
<Modal
|
|
70
69
|
open={visible}
|
|
70
|
+
width={800}
|
|
71
71
|
title={title}
|
|
72
72
|
footer={[
|
|
73
|
-
<
|
|
73
|
+
<Button key="cancel" onClick={() => setVisible(false)}>
|
|
74
74
|
取消
|
|
75
|
-
</
|
|
75
|
+
</Button>,
|
|
76
76
|
]}
|
|
77
77
|
maskClosable={false}
|
|
78
78
|
onCancel={() => setVisible(false)}
|
|
79
|
-
{...restProps}
|
|
80
79
|
>
|
|
81
80
|
{playerElement}
|
|
82
81
|
</Modal>
|