From 708a24a165a961dd4c12f0280e335bf78346c76c Mon Sep 17 00:00:00 2001 From: Joe <1712833832@qq.com> Date: Tue, 23 Jan 2024 16:38:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=8C=E8=BD=A6=E8=AF=B1=E5=AF=BC=20?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=93=8D=E4=BD=9C=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/FormConfig/index.vue | 25 +++++++++--- .../JiHeExpressway/components/Video/Video.vue | 6 ++- .../JiHeExpressway/components/Video/index.vue | 6 ++- .../components/Video/videoStream.js | 27 ++++++++----- .../components/DeviceControlDialog.vue | 40 ++++++++++++------- .../Dialogs/DrivingGuidance/index.vue | 2 +- .../RoadAndEvents/utils/httpList.js | 15 +++++++ 7 files changed, 88 insertions(+), 33 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue index 5f3ea299..66ea1700 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue @@ -3,8 +3,8 @@ @@ -29,6 +29,10 @@ export default { type: String, default: null }, + pileNum: { + type: String, + default: null + }, url: { type: String, default: null diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js b/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js index 34860792..d417f583 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js +++ b/ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js @@ -1,5 +1,8 @@ import flvJs from "flv.js"; -import { getCameraStream } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; +import { + getCameraStream, + getNearCamera, +} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; /** * @@ -56,28 +59,32 @@ export class HttpLivePlayer { constructor(container, options) { this.container = container; - console.log("--- 视频 1 ---"); this.getUrl(options).then(() => { - console.log("--- 视频 3 ---"); this.initLiveVideo(); }); } - async getUrl({ camId, url } = {}) { - console.log("--- 视频 2 ---"); + async getUrl({ camId, url, pileNum } = {}) { + this.url = url; + + if (pileNum) { + const { code, data } = await getNearCamera(pileNum).catch(() => ({})); + if (code != 200 || !data?.length) return; + + camId = data[0].camId; + } + if (camId) { const { code, data } = await getCameraStream(camId).catch(() => ({})); - console.log("--- 视频 2.4 ---"); if (code != 200) return; url = data.liveUrl; } - console.log("--- 视频 2.7 ---"); if (!url) return Promise.reject("获取 url 失败!"); - return (this.url = url); + return; } destroy() { @@ -91,12 +98,12 @@ export class HttpLivePlayer { } initLiveVideo() { - console.log("--- 视频 4 ---"); - this.destroy(); this.lastDecodedFrames = null; + if (!this.url) return; + this.player = flvJs.createPlayer( { type: "flv", diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue index 18a0ae66..878dcada 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue @@ -1,17 +1,26 @@ @@ -70,6 +79,7 @@ export default { data() { return { submitting: false, + formData: {}, formList: [ { label: "类型:", @@ -236,6 +246,11 @@ export default { if (!formData.onWorkStatus || !formData.inWorkStatus) return Message.error(`工作状态不能为空!`); + if (["01", "02"].includes(result.mode)) { + if (["04", "00"].includes(formData.onWorkStatus)) return Message.error(`上行工作状态不能选择当前类型!`); + if (["04", "00"].includes(formData.inWorkStatus)) return Message.error(`下行工作状态不能选择当前类型!`); + } + result.onWorkStatus = formData.onWorkStatus; result.inWorkStatus = formData.inWorkStatus; @@ -298,11 +313,8 @@ export default { flex-direction: column; gap: 15px; - .footer { - display: flex; - align-items: center; - justify-content: flex-end; - gap: 9px; + .tips { + font-size: 12px; } } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue index 8b80d616..3951e7f7 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue @@ -1,7 +1,7 @@