From beeb66e74bfb883fe0b42cc71e2c58190ae6a7a6 Mon Sep 17 00:00:00 2001 From: 董国庆 <364620639@qq.com> Date: 星期五, 30 五月 2025 18:13:45 +0800 Subject: [PATCH] 修改完毕 --- src/view/home/index.vue | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/view/home/index.vue b/src/view/home/index.vue index 82cf7b2..b13d4e2 100644 --- a/src/view/home/index.vue +++ b/src/view/home/index.vue @@ -253,6 +253,8 @@ urlLink: '',//视频地址 tableData: [], //预警情况统计数据 + showFlv:false,//是否显示flv视频 + tokenID: 'shehongchuzu', plugin: true, @@ -625,6 +627,7 @@ // 添加点击事件 marker.on("click", async (e) => { + this.showFlv=false this.opencARiD = item.id; console.log("点击了车辆", item); @@ -648,7 +651,7 @@ }, 1000); }) }); - } else { + } else if(item.companyCode=='25439966') { this.IsHai = true; getRealVideo({ id: item.id }).then(res => { @@ -675,6 +678,9 @@ } }); }) + }else{ + this.showFlv=true; + this.getVideoUrl(item.id) } this.infoWindow.open(this.map, e.target.getPosition()); @@ -693,8 +699,10 @@ } }); }), - // this.getVideoUrl(item.id), + ]); + this.initVideoPlayer(); + // 更新弹窗内容 this.infoWindow.setContent( @@ -705,7 +713,7 @@ }) ); - this.initVideoPlayer(); + } catch (error) { this.infoWindow.setContent( '<div style="padding: 20px;text-align: center;color: red;">获取车辆信息失败</div>' @@ -844,9 +852,21 @@ listRender(record) { return `<div style="background: #ffffff; padding: 24px 20px;z-index: 999"> <div style="position: relative; width: 460px; height: 330px"> - <div style="position: absolute; left: 0; top: 0; width: 100%; height: 100%;"> - <div id="hstplayer" v-if="${!IsHai} style="width: 460px; height: 230px;"></div> - <div id="divPlugin" class="divPlugin" style="width: 460px; height: 230px;" ref="divPlugin" v-if="${IsHai}"> </div> + <div v-if="${this.showFlv}" style="width: 460px; height: 330px; border-radius: 9px; background: #f5f5f5; display: flex; justify-content: center; align-items: center; flex-direction: column"> + <video + ref="video" + style="width: 460px; height: 330px; border-radius: 9px; display: none" + id="monitoringCard" + ref="monitoringCard" + :controls="false" + autoPlay + width="620"> + </video> + <el-empty description="暂无视频信息" :image-size="80"></el-empty> + </div> + <div v-else style="position: absolute; left: 0; top: 0; width: 100%; height: 100%;"> + <div id="hstplayer" v-if="${!this.IsHai} style="width: 460px; height: 230px;"></div> + <div id="divPlugin" class="divPlugin" style="width: 460px; height: 230px;" ref="divPlugin" v-if="${this.IsHai}"> </div> </div> <div style="display: flex;justify-content: space-between;margin-top: 15px;margin-bottom: 12px;"> <div style="font-weight: 500;font-size: 18px;color: rgba(0, 0, 0, 0.85);line-height: 25px;">车牌号:${record.vehicleNumber || "" -- Gitblit v1.7.1