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 | 26 | muted: true, |
27 | 27 | liveui: true, |
28 | 28 | controls: true, |
29 | - fluid: true, | |
30 | 29 | }; |
31 | 30 | return { ...defaultOptions, ...options }; |
32 | 31 | }); |
... | ... | @@ -65,4 +64,12 @@ |
65 | 64 | |
66 | 65 | <style lang="less"> |
67 | 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 | 75 | </style> | ... | ... |
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | import { buildUUID } from '/@/utils/uuid'; |
16 | 16 | import { BasicVideoPlay, getVideoTypeByUrl } from '/@/components/Video'; |
17 | 17 | import { VideoJsPlayerOptions } from 'video.js'; |
18 | + import { getBoundingClientRect } from '/@/utils/domUtils'; | |
18 | 19 | |
19 | 20 | type CameraRecordItem = CameraRecord & { |
20 | 21 | canPlay?: boolean; |
... | ... | @@ -159,6 +160,19 @@ |
159 | 160 | onMounted(() => { |
160 | 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 | 176 | </script> |
163 | 177 | |
164 | 178 | <template> |
... | ... | @@ -221,6 +235,7 @@ |
221 | 235 | </div> |
222 | 236 | <section ref="videoContainer" class="flex-auto"> |
223 | 237 | <List |
238 | + ref="listEl" | |
224 | 239 | :loading="loading" |
225 | 240 | :data-source="cameraList" |
226 | 241 | class="bg-light-50 w-full h-full dark:bg-dark-900 split-mode-list" |
... | ... | @@ -275,24 +290,6 @@ |
275 | 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 | 293 | .video-container { |
297 | 294 | .video-container-mask { |
298 | 295 | opacity: 0; |
... | ... | @@ -306,8 +303,6 @@ |
306 | 303 | } |
307 | 304 | |
308 | 305 | .video-container-error-msk { |
309 | - // opacity: 0; | |
310 | - // visibility: hidden; | |
311 | 306 | color: #000; |
312 | 307 | } |
313 | 308 | } |
... | ... | @@ -325,7 +320,6 @@ |
325 | 320 | |
326 | 321 | .split-mode-list:deep(.ant-col) { |
327 | 322 | width: 100%; |
328 | - // height: var(--height); | |
329 | 323 | height: 100%; |
330 | 324 | } |
331 | 325 | </style> | ... | ... |