Browse Source

完成事件解除按钮功能

wangqin
王钦 7 months ago
parent
commit
f81f9a52c2
  1. 2
      ruoyi-ui/src/plugins/modal.js
  2. 4
      ruoyi-ui/src/views/JiHeExpressway/components/Video/videoStream.js
  3. 9
      ruoyi-ui/src/views/JiHeExpressway/components/VideoMulti/videoStream.js
  4. 28
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/TrafficIncidents/index.vue
  5. 15
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  6. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js

2
ruoyi-ui/src/plugins/modal.js

@ -9,7 +9,7 @@ export default {
}, },
// 错误消息 // 错误消息
msgError(content) { msgError(content) {
Message.error(content) Message.error('commerror:'+content)
}, },
// 成功消息 // 成功消息
msgSuccess(content) { msgSuccess(content) {

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

@ -93,7 +93,7 @@ async function getUrl({ camId, url, pileNum, rangeIndex } = {}) {
if (camId) { if (camId) {
const { code, data } = await getCameraStream(camId).catch(() => ({})); const { code, data } = await getCameraStream(camId).catch(() => ({}));
if (code != 200) { if (code != 200) {
Message.warning("未获取到当前相机的播放地址"); // Message.warning("未获取到当前相机的播放地址");
return; return;
} }
@ -101,7 +101,7 @@ async function getUrl({ camId, url, pileNum, rangeIndex } = {}) {
} }
if (!url) { if (!url) {
Message.warning("未获取到当前相机的播放地址"); // Message.warning("未获取到当前相机的播放地址");
return Promise.reject("获取 url 失败!"); return Promise.reject("获取 url 失败!");
} }

9
ruoyi-ui/src/views/JiHeExpressway/components/VideoMulti/videoStream.js

@ -34,6 +34,7 @@ const testFlvUrl =
* @returns * @returns
*/ */
export async function openVideoStream(container, { camId, url } = {}) { export async function openVideoStream(container, { camId, url } = {}) {
console.log(camId,333)
if (camId) { if (camId) {
const { code, data } = await getCameraStream(camId).catch(() => ({})); const { code, data } = await getCameraStream(camId).catch(() => ({}));
@ -65,16 +66,18 @@ export async function openVideoStream(container, { camId, url } = {}) {
} }
async function getUrl({ camId} = {}) { async function getUrl({ camId} = {}) {
if(!camId){
return
}
const { code, data } = await getCameraStream(camId).catch(() => ({})); const { code, data } = await getCameraStream(camId).catch(() => ({}));
if (code != 200) { if (code != 200) {
Message.warning("未获取到当前相机的播放地址"); // Message.warning("未获取到当前相机的播放地址");
return; return;
} }
let url = data.liveUrl; let url = data.liveUrl;
if (!url) { if (!url) {
Message.warning("未获取到当前相机的播放地址"); // Message.warning("未获取到当前相机的播放地址");
return Promise.reject("获取 url 失败!"); return Promise.reject("获取 url 失败!");
} }

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

@ -8,7 +8,7 @@
<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>
<div class="foote"> <div class="foote">
<Button @click.native="submitClick" :loading="submitting" style="width: 100px;"> <Button @click.native="handleEventRelieve" style="width: 100px;">
事件解除 事件解除
</Button> </Button>
<Button @click.native="goStrategy" style="width: 100px;"> <Button @click.native="goStrategy" style="width: 100px;">
@ -30,7 +30,9 @@ import Video from "@screen/components/VideoMulti";
import request from "@/utils/request"; import request from "@/utils/request";
import { dialogDelayVisible } from "./../mixin"; import { dialogDelayVisible } from "./../mixin";
import {
postCompleteEvent,
} from "@/api/commandDispatch";
// //
export default { export default {
name: "TrafficIncidents", name: "TrafficIncidents",
@ -131,7 +133,6 @@ export default {
if (code != 200) return; if (code != 200) return;
this.data = { ...data, ...this.data }; this.data = { ...data, ...this.data };
console.log("trafficIncidents", data);
}) })
.catch((err) => { }); .catch((err) => { });
}, },
@ -142,7 +143,26 @@ export default {
}, },
goStrategy(){ goStrategy(){
this.$router.push(`/control/device/strategy`); this.$router.push(`/control/device/strategy`);
} },
handleEventRelieve() {
this.$confirm("确定解除事件吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let data = new FormData();
data.append("eventId", this.dialogData.id);
postCompleteEvent(data).then((result) => {
console.log('--------',result)
if (result.code != 200) return [];
this.$message.success("事件解除成功");
this.$emit('traffic-relieve',this.data);
});
})
.catch(() => {});
},
}, },
}; };
</script> </script>

15
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -28,7 +28,7 @@
<!-- 摄像机 G35 K094+079 下行可控 枪机 可打开--> <!-- 摄像机 G35 K094+079 下行可控 枪机 可打开-->
<!-- <Camera :data="dialogConfig.data" :visible="dialogConfig.visibleType === 1" /> --> <!-- <Camera :data="dialogConfig.data" :visible="dialogConfig.visibleType === 1" /> -->
<component :dialogData="dialogConfig.data" visible :selectedDevice="dialogConfig.data" :is="dialogConfig.component" <component :dialogData="dialogConfig.data" visible :selectedDevice="dialogConfig.data" :is="dialogConfig.component"
@change="handleCameraChange" @update:visible="handleCameraChange" /> @change="handleCameraChange" @update:visible="handleCameraChange" @traffic-relieve="handleTrafficRelieve" />
</Bg1> </Bg1>
</template> </template>
@ -272,7 +272,7 @@ export default {
window.infoWindow.close(); window.infoWindow.close();
}, },
// // traffic-relieve
handleCameraChange() { handleCameraChange() {
this.dialogConfig = { this.dialogConfig = {
// 0 ControlCamera | 1 Camera // 0 ControlCamera | 1 Camera
@ -287,6 +287,17 @@ export default {
gridRowStart: Math.floor(index / columns) + 1, gridRowStart: Math.floor(index / columns) + 1,
gridColumnStart: (index % columns) + 1, gridColumnStart: (index % columns) + 1,
} }
},
async handleTrafficRelieve(e){
await this.handleDeviceImmediate(e._itemData)
setTimeout(async () => {
await this.handleDeviceImmediate(e._itemData)
}, 500);
this.dialogConfig = {
// 0 ControlCamera | 1 Camera
component: null,
data: null
}
} }
} }
} }

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

@ -30,7 +30,6 @@ export async function getCameraStream(camId, media = 1) {
data.data.liveUrl = data.data.liveUrl =
"https://10.0.81.202/camera?target=" + data.data.liveUrl.substring(7); "https://10.0.81.202/camera?target=" + data.data.liveUrl.substring(7);
}*/ }*/
return data; return data;
} }

Loading…
Cancel
Save