Commit ced6ead659a9a04324940cd830fa30afa8a55bd5
1 parent
41f78aba
perf: fix camera manage mode split container has some problem
Showing
2 changed files
with
23 additions
and
22 deletions
@@ -26,7 +26,6 @@ | @@ -26,7 +26,6 @@ | ||
26 | muted: true, | 26 | muted: true, |
27 | liveui: true, | 27 | liveui: true, |
28 | controls: true, | 28 | controls: true, |
29 | - fluid: true, | ||
30 | }; | 29 | }; |
31 | return { ...defaultOptions, ...options }; | 30 | return { ...defaultOptions, ...options }; |
32 | }); | 31 | }); |
@@ -65,4 +64,12 @@ | @@ -65,4 +64,12 @@ | ||
65 | 64 | ||
66 | <style lang="less"> | 65 | <style lang="less"> |
67 | @prefix-cls: ~'@{namespace}-basic-video-play'; | 66 | @prefix-cls: ~'@{namespace}-basic-video-play'; |
67 | + | ||
68 | + .@{prefix-cls} { | ||
69 | + .vjs-error-display { | ||
70 | + .vjs-modal-dialog-content::after { | ||
71 | + content: '无法加载视频,原因可能是服务器或网络故障,也可能是格式不支持.'; | ||
72 | + } | ||
73 | + } | ||
74 | + } | ||
68 | </style> | 75 | </style> |
@@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
15 | import { buildUUID } from '/@/utils/uuid'; | 15 | import { buildUUID } from '/@/utils/uuid'; |
16 | import { BasicVideoPlay, getVideoTypeByUrl } from '/@/components/Video'; | 16 | import { BasicVideoPlay, getVideoTypeByUrl } from '/@/components/Video'; |
17 | import { VideoJsPlayerOptions } from 'video.js'; | 17 | import { VideoJsPlayerOptions } from 'video.js'; |
18 | + import { getBoundingClientRect } from '/@/utils/domUtils'; | ||
18 | 19 | ||
19 | type CameraRecordItem = CameraRecord & { | 20 | type CameraRecordItem = CameraRecord & { |
20 | canPlay?: boolean; | 21 | canPlay?: boolean; |
@@ -159,6 +160,19 @@ | @@ -159,6 +160,19 @@ | ||
159 | onMounted(() => { | 160 | onMounted(() => { |
160 | getCameraList(); | 161 | getCameraList(); |
161 | }); | 162 | }); |
163 | + | ||
164 | + const listEl = ref(); | ||
165 | + onMounted(() => { | ||
166 | + const clientHeight = document.documentElement.clientHeight; | ||
167 | + const rect = getBoundingClientRect(unref(listEl)!.$el!) as DOMRect; | ||
168 | + // list pading top 8 maring-top 8 extra slot 56 | ||
169 | + const listContainerMarginBottom = 16; | ||
170 | + const listContainerHeight = clientHeight - rect.top - listContainerMarginBottom; | ||
171 | + const listContainerEl = (unref(listEl)!.$el as HTMLElement).querySelector( | ||
172 | + '.ant-spin-container' | ||
173 | + ) as HTMLElement; | ||
174 | + listContainerEl && (listContainerEl.style.height = listContainerHeight + 'px'); | ||
175 | + }); | ||
162 | </script> | 176 | </script> |
163 | 177 | ||
164 | <template> | 178 | <template> |
@@ -221,6 +235,7 @@ | @@ -221,6 +235,7 @@ | ||
221 | </div> | 235 | </div> |
222 | <section ref="videoContainer" class="flex-auto"> | 236 | <section ref="videoContainer" class="flex-auto"> |
223 | <List | 237 | <List |
238 | + ref="listEl" | ||
224 | :loading="loading" | 239 | :loading="loading" |
225 | :data-source="cameraList" | 240 | :data-source="cameraList" |
226 | class="bg-light-50 w-full h-full dark:bg-dark-900 split-mode-list" | 241 | class="bg-light-50 w-full h-full dark:bg-dark-900 split-mode-list" |
@@ -275,24 +290,6 @@ | @@ -275,24 +290,6 @@ | ||
275 | height: 100%; | 290 | height: 100%; |
276 | } | 291 | } |
277 | 292 | ||
278 | - .split-screen-mode:deep(.d-player-wrap) { | ||
279 | - width: 100%; | ||
280 | - height: 100%; | ||
281 | - } | ||
282 | - | ||
283 | - .split-screen-mode:deep(.ant-tabs-tab-active) { | ||
284 | - border-bottom: 1px solid #eee; | ||
285 | - } | ||
286 | - | ||
287 | - .split-screen-mode:deep(video) { | ||
288 | - position: absolute; | ||
289 | - height: calc(100%) !important; | ||
290 | - } | ||
291 | - | ||
292 | - .split-screen-mode:deep(.d-player-control) { | ||
293 | - z-index: 99; | ||
294 | - } | ||
295 | - | ||
296 | .video-container { | 293 | .video-container { |
297 | .video-container-mask { | 294 | .video-container-mask { |
298 | opacity: 0; | 295 | opacity: 0; |
@@ -306,8 +303,6 @@ | @@ -306,8 +303,6 @@ | ||
306 | } | 303 | } |
307 | 304 | ||
308 | .video-container-error-msk { | 305 | .video-container-error-msk { |
309 | - // opacity: 0; | ||
310 | - // visibility: hidden; | ||
311 | color: #000; | 306 | color: #000; |
312 | } | 307 | } |
313 | } | 308 | } |
@@ -325,7 +320,6 @@ | @@ -325,7 +320,6 @@ | ||
325 | 320 | ||
326 | .split-mode-list:deep(.ant-col) { | 321 | .split-mode-list:deep(.ant-col) { |
327 | width: 100%; | 322 | width: 100%; |
328 | - // height: var(--height); | ||
329 | height: 100%; | 323 | height: 100%; |
330 | } | 324 | } |
331 | </style> | 325 | </style> |