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' default: 'flv'
}, },
rangeIndex: { rangeIndex: {
type: Number,
default: 0 default: 0
} }
}, },
async mounted() { async mounted() {
// setTimeout(() => { // setTimeout(() => {
// this.$nextTick(() => { // this.$nextTick(() => {
if (this.videoType == 'flv') { if (this.videoType == 'flv') {
// 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, rangeIndex: this.rangeIndex }); 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 { import {
getCameraStream, getCameraStream,
getNearCamera, getNearCamera,
getNearCameraNew,
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; } 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 (url) return url;
if (pileNum) { 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) { if (code != 200 || !data?.length) {
Message.warning("未获取到附近的相机信息"); Message.warning("未获取到附近的相机信息");
return; return;
} }
camId = data[rangeIndex || 0]?.camId; 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"> <Dialog v-model="obverseVisible" :title="dialogData._itemData && dialogData._itemData.title">
<div class="TrafficIncidents"> <div class="TrafficIncidents">
<div class="header"> <div class="header">
<Video class="video-stream" :pileNum="dialogData.stakeMark" /> <Video class="video-stream" :pileNum="dialogData.stakeMark" rangeIndex="upCamera" :showHeader="false" />
<Video class="video-stream" :pileNum="dialogData.stakeMark" :rangeIndex="1" /> <Video class="video-stream" :pileNum="dialogData.stakeMark" rangeIndex="downCamera" :showHeader="false" />
</div> </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" />

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) { function padZero(num) {
num = num.toString(); num = num.toString();
while (num.length < 3) { while (num.length < 3) {

Loading…
Cancel
Save