diff --git a/src/api/home.js b/src/api/home.js index edaed22..1747058 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -50,6 +50,9 @@ export function getRegionsListApi(data){ // 获取视频播放地址 export function getPreviewUrlApi(data) { + if(data.cameraIndexCode==undefined || !data.cameraIndexCode){ + return null; + } return request({ url: '/fjtcc-api/api/largeScreen/video/getPreviewUrl', method: 'post', diff --git a/src/views/monitor/components/box-1.vue b/src/views/monitor/components/box-1.vue index 434a562..ec30f68 100644 --- a/src/views/monitor/components/box-1.vue +++ b/src/views/monitor/components/box-1.vue @@ -253,17 +253,17 @@ const showTrafficEvent = function(){ trafficEventShow.value = true; } - window.addEventListener("message", async(e) => { - let {code,data} = await getPreviewUrlApi({ - type: 'hls', - cameraIndexCode:e.data.cameraIndexCode - }) - if(code===200){ - src.value = data.url - cameraIndexCode.value = e.data.cameraIndexCode - videoShow.value = true - } - }); + // window.addEventListener("message", async(e) => { + // let {code,data} = await getPreviewUrlApi({ + // type: 'hls', + // cameraIndexCode:e.data.cameraIndexCode + // }) + // if(code===200){ + // src.value = data.url + // cameraIndexCode.value = e.data.cameraIndexCode + // videoShow.value = true + // } + // }); // 异常告警 let abnormalAlarm = computed(() => { return [{ data: abnormalData.value.abnormalAlarm.map((item) => item.value) }] @@ -502,7 +502,7 @@ display: flex; align-items: center; justify-content: space-evenly; - + &-item { width: vw(339); height: vw(102); @@ -620,7 +620,7 @@ margin-bottom: vh(4); } .other-box{ - + height: vh(350) !important; } .box { diff --git a/src/views/scenic/components/box-1.vue b/src/views/scenic/components/box-1.vue index 08508fd..af3f29c 100644 --- a/src/views/scenic/components/box-1.vue +++ b/src/views/scenic/components/box-1.vue @@ -29,7 +29,7 @@ - +