This commit is contained in:
duanliang
2025-04-02 19:47:19 +08:00
parent 3b3d243d27
commit e4f3e67f4b
2 changed files with 10 additions and 3 deletions

View File

@@ -119,9 +119,10 @@
props.isCollect = 1 props.isCollect = 1
} else { } else {
props.isCollect = 0 props.isCollect = 0
modelValue.value = false
} }
pubSub.publish('videoCollect', props.cameraIndexCode) pubSub.publish('videoCollect', props.cameraIndexCode)
modelValue.value = false
} }
const handleAction = async (e) => { const handleAction = async (e) => {
if (e == STOP) { if (e == STOP) {

View File

@@ -87,7 +87,7 @@
import trafficJam from './traffic-jam' import trafficJam from './traffic-jam'
import { getPreviewUrlApi } from '@/api/home' import { getPreviewUrlApi } from '@/api/home'
import { useMap } from '@/hooks/map' import { useMap } from '@/hooks/map'
import pubSub from 'pubsub-js'
import { getRouterListApi, getRoutersApi,getRoutersMapApi } from '@/api/traffic' import { getRouterListApi, getRoutersApi,getRoutersMapApi } from '@/api/traffic'
import mapIcon from '@/assets/images/map-video.png' import mapIcon from '@/assets/images/map-video.png'
const { map, initMap,addMarker,marker } = useMap() const { map, initMap,addMarker,marker } = useMap()
@@ -145,7 +145,12 @@
immediate: true immediate: true
} }
) )
const onVideoCollect = () => {
pubSub.subscribe('videoCollect', () => {
// clearHlsRefs()
getRoutersMap()
})
}
const getPreviewUrl = async (code) => { const getPreviewUrl = async (code) => {
let res = await getPreviewUrlApi({ let res = await getPreviewUrlApi({
cameraIndexCode: code, cameraIndexCode: code,
@@ -184,6 +189,7 @@
getRouterList() getRouterList()
getRouters() getRouters()
getRoutersMap() getRoutersMap()
onVideoCollect()
}) })
</script> </script>