Browse Source

feat 更新事件 摄像头上游下游各一个

wangqin
qingzhengli 8 months ago
parent
commit
24a6b7d360
  1. 11
      ruoyi-ui/src/views/JiHeExpressway/components/Video/Video.vue
  2. 13
      ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js
  3. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/TrafficIncidents/index.vue
  4. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js

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

@ -28,19 +28,18 @@ export default {
default: 'flv'
},
rangeIndex: {
type: Number,
default: 0
}
},
async mounted() {
// setTimeout(() => {
// this.$nextTick(() => {
if (this.videoType == 'flv') {
// 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, rangeIndex: this.rangeIndex });
if (this.videoType == 'flv') {
// 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, rangeIndex: this.rangeIndex });
this.$once("hook:beforeDestroy", () => player?.destroy());
}
this.$once("hook:beforeDestroy", () => player?.destroy());
}
// })
// })

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

@ -5,6 +5,7 @@ import { Message } from "element-ui";
import {
getCameraStream,
getNearCamera,
getNearCameraNew,
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
/**
@ -63,12 +64,20 @@ async function getUrl({ camId, url, pileNum, rangeIndex } = {}) {
if (url) return url;
if (pileNum) {
const { code, data } = await getNearCamera(pileNum).catch(() => ({}));
let code, data, cameraData;
if (rangeIndex) {
if (typeof rangeIndex === "string")
cameraData = await getNearCameraNew(pileNum).catch(() => ({}));
else cameraData = await getNearCamera(pileNum).catch(() => ({}));
} else {
cameraData = await getNearCamera(pileNum).catch(() => ({}));
}
code = cameraData.code;
data = cameraData.data;
if (code != 200 || !data?.length) {
Message.warning("未获取到附近的相机信息");
return;
}
camId = data[rangeIndex || 0]?.camId;
}

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

@ -2,8 +2,8 @@
<Dialog v-model="obverseVisible" :title="dialogData._itemData && dialogData._itemData.title">
<div class="TrafficIncidents">
<div class="header">
<Video class="video-stream" :pileNum="dialogData.stakeMark" />
<Video class="video-stream" :pileNum="dialogData.stakeMark" :rangeIndex="1" />
<Video class="video-stream" :pileNum="dialogData.stakeMark" rangeIndex="upCamera" :showHeader="false" />
<Video class="video-stream" :pileNum="dialogData.stakeMark" rangeIndex="downCamera" :showHeader="false" />
</div>
<Descriptions labelWidth="72px" :list="list" :data="data" style="gap: 18px" column="7" />

10
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js

@ -41,6 +41,16 @@ export function getNearCamera(pileNum) {
});
}
export function getNearCameraNew(pileNum) {
return request({
url: "/video/nearCamPileNum",
method: "get",
params: {
pileNum,
},
});
}
function padZero(num) {
num = num.toString();
while (num.length < 3) {

Loading…
Cancel
Save