4.2
This commit is contained in:
@@ -31,3 +31,10 @@ export function getRoutersApi() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
export function getRoutersMapApi() {
|
||||||
|
return request({
|
||||||
|
url: '/fjtcc-api/api/largeScreen/router/videoMap',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
BIN
src/assets/images/map-video.png
Normal file
BIN
src/assets/images/map-video.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -109,7 +109,9 @@
|
|||||||
import { getHotelListApi } from '@/api/hotel'
|
import { getHotelListApi } from '@/api/hotel'
|
||||||
|
|
||||||
import pubSub from 'pubsub-js'
|
import pubSub from 'pubsub-js'
|
||||||
|
import { useScenicStore } from '@/stores/scenic'
|
||||||
|
|
||||||
|
const scenicStore = useScenicStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
let currentDate = ref('')
|
let currentDate = ref('')
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
scenicStore.setScenicBearData(val)
|
scenicStore.setScenicBearData(val)
|
||||||
break
|
break
|
||||||
case 'stopCarData':
|
case 'stopCarData':
|
||||||
|
console.log(val,'valvalvalvalvalvalval')
|
||||||
scenicStore.setStopCarData(val)
|
scenicStore.setStopCarData(val)
|
||||||
break
|
break
|
||||||
case 'secureData':
|
case 'secureData':
|
||||||
|
|||||||
@@ -78,18 +78,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<video-dialog v-model="videoShow" src="" />
|
<!-- <video-dialog v-model="videoShow" src="" /> -->
|
||||||
|
<video-dialog v-model="videoShow" :src="src" :isCollect="isCollect" :cameraIndexCode="cameraIndexCode" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import countup from 'vue-countup-v3'
|
import countup from 'vue-countup-v3'
|
||||||
import trafficJam from './traffic-jam'
|
import trafficJam from './traffic-jam'
|
||||||
|
import { getPreviewUrlApi } from '@/api/home'
|
||||||
import { useMap } from '@/hooks/map'
|
import { useMap } from '@/hooks/map'
|
||||||
|
|
||||||
import { getRouterListApi, getRoutersApi } from '@/api/traffic'
|
import { getRouterListApi, getRoutersApi,getRoutersMapApi } from '@/api/traffic'
|
||||||
|
import mapIcon from '@/assets/images/map-video.png'
|
||||||
const { map, initMap } = useMap()
|
const { map, initMap,addMarker,marker } = useMap()
|
||||||
|
|
||||||
let props = defineProps({
|
let props = defineProps({
|
||||||
list: {
|
list: {
|
||||||
@@ -97,19 +98,21 @@
|
|||||||
default: () => []
|
default: () => []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
let src = ref('')
|
||||||
|
let cameraIndexCode = ref('')
|
||||||
let current = ref(0)
|
let current = ref(0)
|
||||||
let routerList = ref([])
|
let routerList = ref([])
|
||||||
let routers = ref([])
|
let routers = ref([])
|
||||||
let videoShow = ref(false)
|
let videoShow = ref(false)
|
||||||
|
let markerList = ref([])
|
||||||
|
let isCollect = ref(0)
|
||||||
watch(
|
watch(
|
||||||
() => [routerList.value, routers.value],
|
() => [routerList.value, routers.value],
|
||||||
(val) => {
|
(val) => {
|
||||||
if (val[0].length > 0) {
|
if (val[0].length > 0) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
let { longitude, latitude, level } = val[0][0]
|
let { longitude, latitude, level } = val[0][0]
|
||||||
console.log(longitude, latitude, level,'longitude, latitude, level')
|
// console.log(longitude, latitude, level,'longitude, latitude, level')
|
||||||
initMap('traffic-map', longitude, latitude, level)
|
initMap('traffic-map', longitude, latitude, level)
|
||||||
map.value.setTrafficOn()
|
map.value.setTrafficOn()
|
||||||
})
|
})
|
||||||
@@ -119,7 +122,41 @@
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
watch(
|
||||||
|
() => [markerList.value,map.value],
|
||||||
|
(val) => {
|
||||||
|
|
||||||
|
if(val[0].length&&val[1]){
|
||||||
|
nextTick(()=>{
|
||||||
|
val[0].forEach((item,index)=>{
|
||||||
|
addMarker(mapIcon,[item.longitude,item.latitude],[40, 60])
|
||||||
|
marker.value.addEventListener('click', (e) => {
|
||||||
|
console.log(item,'111111111111')
|
||||||
|
cameraIndexCode.value = item.cameraIndexCode
|
||||||
|
isCollect.value = item.isCollect
|
||||||
|
getPreviewUrl(item.cameraIndexCode)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
const getPreviewUrl = async (code) => {
|
||||||
|
let res = await getPreviewUrlApi({
|
||||||
|
cameraIndexCode: code,
|
||||||
|
type: 'hls'
|
||||||
|
})
|
||||||
|
src.value = res.data.url
|
||||||
|
videoShow.value = true
|
||||||
|
}
|
||||||
|
const getRoutersMap = async()=>{
|
||||||
|
let res = await getRoutersMapApi();
|
||||||
|
markerList.value = res.data
|
||||||
|
}
|
||||||
const handleNav = (e, index) => {
|
const handleNav = (e, index) => {
|
||||||
current.value = index
|
current.value = index
|
||||||
map.value.centerAndZoom(new BMapGL.Point(e.longitude, e.latitude), e.level)
|
map.value.centerAndZoom(new BMapGL.Point(e.longitude, e.latitude), e.level)
|
||||||
@@ -145,6 +182,7 @@
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getRouterList()
|
getRouterList()
|
||||||
getRouters()
|
getRouters()
|
||||||
|
getRoutersMap()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user