zy-react-library 1.0.131 → 1.0.133
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
|
}
|
|
@@ -34,11 +34,8 @@ const MapSelector = (props) => {
|
|
|
34
34
|
|
|
35
35
|
// 初始化地图
|
|
36
36
|
const initMap = async () => {
|
|
37
|
-
await dynamicLoadJs("https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr");
|
|
38
|
-
|
|
39
37
|
if (!window.BMapGL) {
|
|
40
|
-
|
|
41
|
-
return;
|
|
38
|
+
await dynamicLoadJs("https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr");
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
setLoading(true);
|
|
@@ -44,8 +44,11 @@ const AliPlayer = forwardRef(({
|
|
|
44
44
|
const onCreateAliPlayer = async () => {
|
|
45
45
|
if (!containerRef.current)
|
|
46
46
|
return;
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
if (!window.Aliplayer) {
|
|
48
|
+
await dynamicLoadJs("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/aliplayer-min.js");
|
|
49
|
+
await dynamicLoadCss("https://g.alicdn.com/apsara-media-box/imp-web-player/2.16.3/skins/default/aliplayer-min.css");
|
|
50
|
+
}
|
|
51
|
+
|
|
49
52
|
onDisposeAliPlayer();
|
|
50
53
|
|
|
51
54
|
const skinLayout = [
|
|
@@ -79,51 +82,49 @@ const AliPlayer = forwardRef(({
|
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
player.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
);
|
|
126
|
-
}
|
|
85
|
+
playerRef.current = new window.Aliplayer(
|
|
86
|
+
{
|
|
87
|
+
id: className,
|
|
88
|
+
...(source
|
|
89
|
+
? { source }
|
|
90
|
+
: {
|
|
91
|
+
vid,
|
|
92
|
+
playauth: playAuth,
|
|
93
|
+
qualitySort: "asc",
|
|
94
|
+
format: "m3u8",
|
|
95
|
+
encryptType: 1,
|
|
96
|
+
mediaType: "video",
|
|
97
|
+
isLive: true,
|
|
98
|
+
rePlay: false,
|
|
99
|
+
playsinline: true,
|
|
100
|
+
controlBarVisibility: "hover",
|
|
101
|
+
}),
|
|
102
|
+
cover,
|
|
103
|
+
width,
|
|
104
|
+
height,
|
|
105
|
+
autoplay,
|
|
106
|
+
isLive,
|
|
107
|
+
useH5Prism: true,
|
|
108
|
+
skinLayout,
|
|
109
|
+
},
|
|
110
|
+
(player) => {
|
|
111
|
+
if (autoplay) {
|
|
112
|
+
player.play();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
player.on("ended", () => {
|
|
116
|
+
onEnded && onEnded();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
player.on("timeupdate", () => {
|
|
120
|
+
onTimeupdate && onTimeupdate(player.getCurrentTime());
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
if (playTime > 0) {
|
|
124
|
+
player.seek(playTime);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
);
|
|
127
128
|
};
|
|
128
129
|
|
|
129
130
|
useEffect(() => {
|
|
@@ -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
|
/** 是否内联模式 */
|