Browse Source

修改首页bug

wangqin
Joe 1 year ago
parent
commit
d159d36c04
  1. 6
      ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue
  2. 7
      ruoyi-ui/src/views/JiHeExpressway/components/Video/index.vue
  3. 4
      ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js
  4. 14
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/TrafficIncidents/index.vue
  5. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

6
ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue

@ -19,11 +19,15 @@ export default {
url: { url: {
type: String, type: String,
default: null default: null
},
rangeIndex: {
type: Number,
default: 0
} }
}, },
async mounted() { async mounted() {
// const player = await openLiveVideo(this.$refs.videoContainerRef, { camId: this.camId, url: this.url, pileNum: this.pileNum }) // const player = await openLiveVideo(this.$refs.videoContainerRef, { camId: this.camId, url: this.url, pileNum: this.pileNum })
const player = new HttpLivePlayer(this.$refs.videoContainerRef, { camId: this.camId, url: this.url, pileNum: this.pileNum }); const player = new HttpLivePlayer(this.$refs.videoContainerRef, { camId: this.camId, url: this.url, pileNum: this.pileNum, rangeIndex: this.rangeIndex });
this.$once("hook:beforeDestroy", () => player?.destroy()); this.$once("hook:beforeDestroy", () => player?.destroy());
} }

7
ruoyi-ui/src/views/JiHeExpressway/components/Video/index.vue

@ -13,7 +13,8 @@
</div> </div>
</div> </div>
<Transition name="fade" mode="out-in"> <Transition name="fade" mode="out-in">
<Video v-if="active === 'video'" class="video-stream" :pileNum="pileNum" :camId="camId" :url="url" /> <Video :rangeIndex="rangeIndex" v-if="active === 'video'" class="video-stream" :pileNum="pileNum" :camId="camId"
:url="url" />
<img v-else src="./view.png" /> <img v-else src="./view.png" />
</Transition> </Transition>
</div> </div>
@ -41,6 +42,10 @@ export default {
url: { url: {
type: String, type: String,
default: null default: null
},
rangeIndex: {
type: Number,
default: 0
} }
}, },
data() { data() {

4
ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js

@ -58,7 +58,7 @@ export async function openVideoStream(container, { camId, url } = {}) {
return player; return player;
} }
async function getUrl({ camId, url, pileNum } = {}) { async function getUrl({ camId, url, pileNum, rangeIndex } = {}) {
// return testFlvUrl; // return testFlvUrl;
if (url) return url; if (url) return url;
@ -69,7 +69,7 @@ async function getUrl({ camId, url, pileNum } = {}) {
return; return;
} }
camId = data[0].camId; camId = data[rangeIndex || 0]?.camId;
} }
if (camId) { if (camId) {

14
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/TrafficIncidents/index.vue

@ -1,7 +1,10 @@
<template> <template>
<Dialog v-model="obverseVisible" :title="dialogData._itemData && dialogData._itemData.title"> <Dialog v-model="obverseVisible" :title="dialogData._itemData && dialogData._itemData.title">
<div class="TrafficIncidents"> <div class="TrafficIncidents">
<Video class="video-stream" :pileNum="dialogData.stakeMark" /> <div class="header">
<Video class="video-stream" :pileNum="dialogData.stakeMark" />
<Video class="video-stream" :pileNum="dialogData.stakeMark" :rangeIndex="1" />
</div>
<Descriptions labelWidth="72px" :list="list" :data="data" style="gap: 18px" column="7" /> <Descriptions labelWidth="72px" :list="list" :data="data" style="gap: 18px" column="7" />
</div> </div>
@ -139,6 +142,15 @@ export default {
flex: 1.5; flex: 1.5;
} }
.header {
display: flex;
gap: 9px;
>div.video-stream {
height: 210px;
}
}
.tabs { .tabs {
flex: 1; flex: 1;
display: flex; display: flex;

8
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -39,8 +39,6 @@ export class MarkerCluster {
constructor() {} constructor() {}
getMap() { getMap() {
if (this.map) return this.map;
return (this.map = Vue.prototype.mapIns); return (this.map = Vue.prototype.mapIns);
} }
@ -52,7 +50,11 @@ export class MarkerCluster {
this.data.push(...data); this.data.push(...data);
if (!this.markerCluster) await this.setMarkerCluster(); if (
!this.markerCluster ||
this.markerCluster.getMap() !== Vue.prototype.mapIns
)
await this.setMarkerCluster();
const map = this.getMap(); const map = this.getMap();

Loading…
Cancel
Save