|
@@ -6,10 +6,11 @@
|
|
|
<div class="dialog_header_box">
|
|
|
<div class="dialog_header_close" @click="handleClose"></div>
|
|
|
</div>
|
|
|
- <div class="dialog_content_box">
|
|
|
+ <div class="dialog_content_box" :key="refreshKey">
|
|
|
<template v-if="alarmType === 'perimeter'">
|
|
|
<div class="warn-title">
|
|
|
- {{ dialogConfig.dialogMsg.data.name }}
|
|
|
+ {{ dialogConfig.dialogMsg.data.code }}
|
|
|
+ <!-- {{ dialogConfig.dialogMsg.data.segmentName }} -->
|
|
|
</div>
|
|
|
<div>
|
|
|
当前状态:<span
|
|
@@ -37,14 +38,21 @@
|
|
|
</div>
|
|
|
<div class="perimeter-btn">
|
|
|
<el-button class="handle-btn" @click="handleChangeDefense">
|
|
|
- {{ dialogConfig.dialogMsg.data.defense ? "撤防" : "布防" }}
|
|
|
+ {{ dialogConfig.dialogMsg.data.withdrawn ? "布防" : "撤防" }}
|
|
|
</el-button>
|
|
|
- <el-button class="handle-btn" @click="handleCancelPerimeterAlarm">
|
|
|
+ <el-button
|
|
|
+ class="handle-btn"
|
|
|
+ @click="handleCancelPerimeterAlarm"
|
|
|
+ v-if="dialogConfig.dialogMsg.data.alarmStatus"
|
|
|
+ >
|
|
|
报警消除
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-if="alarmType === 'fire'">
|
|
|
+ <div class="warn-title">
|
|
|
+ 编号:{{ dialogConfig.dialogMsg.data.code }}
|
|
|
+ </div>
|
|
|
<div class="warn-title">
|
|
|
{{ dialogConfig.dialogMsg.data.name }}
|
|
|
</div>
|
|
@@ -55,7 +63,7 @@
|
|
|
color: perimeterAlarmTypeColor,
|
|
|
}"
|
|
|
>
|
|
|
- {{ perimeterAlarmType }}
|
|
|
+ {{ fireAlarmType }}
|
|
|
</span>
|
|
|
</div>
|
|
|
<div>
|
|
@@ -69,7 +77,10 @@
|
|
|
</div>
|
|
|
<div
|
|
|
class="perimeter-btn"
|
|
|
- v-if="dialogConfig.dialogMsg.data.alarmType > 0"
|
|
|
+ v-if="
|
|
|
+ dialogConfig.dialogMsg.data.alarmType > 0 &&
|
|
|
+ dialogConfig.dialogMsg.data.alarmType !== 4
|
|
|
+ "
|
|
|
>
|
|
|
<el-button class="handle-btn" @click="handleCancelFireAlarm">
|
|
|
报警消除
|
|
@@ -77,8 +88,18 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-if="alarmType === 'jgyt'">
|
|
|
- <div class="warn-title">激光云台气体泄漏检测</div>
|
|
|
+ <div class="warn-title">{{ dialogConfig.dialogMsg.data.name }}</div>
|
|
|
<div>
|
|
|
+ 当前状态:<span
|
|
|
+ class="warn-type"
|
|
|
+ :style="{
|
|
|
+ color: perimeterAlarmTypeColor,
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ {{ jgytAlarmType }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <!-- <div>
|
|
|
<span class="warn-label">当前状态:</span>
|
|
|
<span
|
|
|
class="warn-type"
|
|
@@ -93,31 +114,32 @@
|
|
|
dialogConfig.dialogMsg.data.alarmState === 1 ? "异常" : "正常"
|
|
|
}}
|
|
|
</span>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div v-if="dialogConfig.dialogMsg.data.alarmState === 1">
|
|
|
<span class="warn-label">报警时间:</span>
|
|
|
<span class="warn-time">
|
|
|
{{ dialogConfig.dialogMsg.data.alarmTime }}
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <div v-else>
|
|
|
<span class="warn-label">时间:</span>
|
|
|
<span class="warn-time">
|
|
|
{{ dialogConfig.dialogMsg.data.dateTime }}
|
|
|
</span>
|
|
|
</div>
|
|
|
<el-row class="jgyt-row-box">
|
|
|
- <el-col
|
|
|
- v-for="item in dialogConfig.dialogMsg.data.JGYTData"
|
|
|
- :key="item.dataTag"
|
|
|
- :span="12"
|
|
|
- >
|
|
|
+ <el-col v-for="item in tags" :key="item.dataTag" :span="12">
|
|
|
<span class="warn-label">{{ item.name }}:</span>
|
|
|
<span class="warn-type">
|
|
|
- {{ `${item.value} ${item.unit}` }}
|
|
|
+ {{ getTagsValue(item.dataTag) }}{{ item.unit }}
|
|
|
</span>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <div class="jgyt-btn" v-if="dialogConfig.dialogMsg.data.alarmStatus">
|
|
|
+ <el-button class="handle-btn" @click="handleCancelJGYTAlarm">
|
|
|
+ 报警消除
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<template v-if="alarmType === 'rail'">
|
|
|
<div class="warn-title">
|
|
@@ -152,7 +174,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
- <div
|
|
|
+ <!-- <div
|
|
|
class="handle-btn-box"
|
|
|
v-if="
|
|
|
dialogConfig.dialogMsg.data.alarmState === 1 ||
|
|
@@ -160,7 +182,7 @@
|
|
|
"
|
|
|
>
|
|
|
<el-button class="handle-btn" @click="handleAlarm">立即处理</el-button>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<!-- <audio id="mapAlarmAudio" src="/audio/onekeyalarm.mp3" loop></audio> -->
|
|
|
</div>
|
|
@@ -168,6 +190,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { dealAlarm } from "@/API/common";
|
|
|
+import { setWithdrawn } from "@/API/perimeter";
|
|
|
import Dayjs from "dayjs";
|
|
|
import { mapGetters } from "vuex";
|
|
|
export default {
|
|
@@ -190,32 +213,38 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ refreshKey: 0,
|
|
|
+ tags: [
|
|
|
+ { name: "浓度值", dataTag: "ndTag", value: "0", unit: "ppm·m" },
|
|
|
+ { name: "光强度", dataTag: "gqTag", value: "0", unit: "" },
|
|
|
+ { name: "垂直角度", dataTag: "czTag", value: "0", unit: "" },
|
|
|
+ { name: "水平角度", dataTag: "spTag", value: "0", unit: "" },
|
|
|
+ ],
|
|
|
+ };
|
|
|
},
|
|
|
watch: {
|
|
|
alarmType: {
|
|
|
handler(val) {
|
|
|
- if (val !== "jgyt") return;
|
|
|
- let tags = [
|
|
|
- { name: "浓度值", dataTag: "ndTag", value: "0", unit: "ppm·m" },
|
|
|
- { name: "光强度", dataTag: "gqTag", value: "0", unit: "" },
|
|
|
- { name: "垂直角度", dataTag: "czTag", value: "0", unit: "" },
|
|
|
- { name: "水平角度", dataTag: "spTag", value: "0", unit: "" },
|
|
|
- ];
|
|
|
- for (let i = 0; i < tags.length; i++) {
|
|
|
- let tag = tags[i];
|
|
|
- let keys = Object.keys(this.rtData);
|
|
|
- let tagValue = this.dialogConfig.dialogMsg.data.tags[tag.dataTag];
|
|
|
- if (!!keys.length && !!tagValue) {
|
|
|
- for (let j = 0; j < keys.length; j++) {
|
|
|
- let key = keys[j];
|
|
|
- if (tagValue === key) {
|
|
|
- tag.value = this.rtData[key].Value;
|
|
|
+ console.log("页面数据:", this.dialogConfig);
|
|
|
+ this.refresh();
|
|
|
+ if (val == "jgyt") {
|
|
|
+ for (let i = 0; i < this.tags.length; i++) {
|
|
|
+ let tag = this.tags[i];
|
|
|
+ let keys = Object.keys(this.rtData);
|
|
|
+ let tagValue = this.dialogConfig.dialogMsg.data.tags[tag.dataTag];
|
|
|
+ if (!!keys.length && !!tagValue) {
|
|
|
+ for (let j = 0; j < keys.length; j++) {
|
|
|
+ let key = keys[j];
|
|
|
+ if (tagValue === key) {
|
|
|
+ tag.value = this.rtData[key].Value;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ this.dialogConfig.dialogMsg.data["JGYTData"] = this.tags;
|
|
|
+ this.refresh();
|
|
|
}
|
|
|
- this.dialogConfig.dialogMsg.data["JGYTData"] = tags;
|
|
|
},
|
|
|
immediate: true,
|
|
|
},
|
|
@@ -231,6 +260,44 @@ export default {
|
|
|
return "警告";
|
|
|
case 3:
|
|
|
return "报警";
|
|
|
+ case 4:
|
|
|
+ return "撤防";
|
|
|
+ case 5:
|
|
|
+ return "故障";
|
|
|
+ default:
|
|
|
+ return "正常";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fireAlarmType() {
|
|
|
+ let alarmType = this.dialogConfig.dialogMsg.data.alarmType;
|
|
|
+ switch (alarmType) {
|
|
|
+ case 1:
|
|
|
+ return "离线";
|
|
|
+ case 2:
|
|
|
+ return "警告";
|
|
|
+ case 3:
|
|
|
+ return "报警";
|
|
|
+ case 4:
|
|
|
+ return "屏蔽";
|
|
|
+ case 5:
|
|
|
+ return "故障";
|
|
|
+ default:
|
|
|
+ return "正常";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ jgytAlarmType() {
|
|
|
+ let alarmType = this.dialogConfig.dialogMsg.data.alarmType;
|
|
|
+ switch (alarmType) {
|
|
|
+ case 1:
|
|
|
+ return "离线";
|
|
|
+ case 2:
|
|
|
+ return "警告";
|
|
|
+ case 3:
|
|
|
+ return "报警";
|
|
|
+ case 4:
|
|
|
+ return "屏蔽";
|
|
|
+ case 5:
|
|
|
+ return "故障";
|
|
|
default:
|
|
|
return "正常";
|
|
|
}
|
|
@@ -244,6 +311,10 @@ export default {
|
|
|
return "#FFA500";
|
|
|
case 3:
|
|
|
return "#FF0000";
|
|
|
+ case 4:
|
|
|
+ return "#DCDCDC";
|
|
|
+ case 5:
|
|
|
+ return "#FFF100";
|
|
|
default:
|
|
|
return "#00FF00";
|
|
|
}
|
|
@@ -252,23 +323,27 @@ export default {
|
|
|
mounted() {
|
|
|
// this.alarmType === "perimeter" &&
|
|
|
// document.getElementById("mapAlarmAudio").play();
|
|
|
- // console.log(this.dialogConfig);
|
|
|
},
|
|
|
methods: {
|
|
|
+ refresh() {
|
|
|
+ this.refreshKey++;
|
|
|
+ },
|
|
|
Dayjs,
|
|
|
handleClose() {
|
|
|
this.$emit("handleClose");
|
|
|
},
|
|
|
handleAlarm() {
|
|
|
- this.handleClose();
|
|
|
const id = this.dialogConfig.dialogMsg.data.alarmId;
|
|
|
- console.log("立即处理事件信息", this.dialogConfig.dialogMsg);
|
|
|
- dealAlarm({ id }).then(res => {
|
|
|
+ console.log("立即处理事件信息", this.dialogConfig);
|
|
|
+ dealAlarm({ id }).then((res) => {
|
|
|
// 关闭摄像头弹窗,后续再优化
|
|
|
if (!!this.dialogConfig.dialogMsg.data.cameraId) {
|
|
|
- this.$store.dispatch('dialog/closeVideoDialog', this.dialogConfig.dialogMsg.data.cameraId)
|
|
|
+ this.$store.dispatch(
|
|
|
+ "dialog/closeVideoDialog",
|
|
|
+ this.dialogConfig.dialogMsg.data.cameraId
|
|
|
+ );
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
if (!!this.dialogConfig.dialogMsg.data.cameraId) {
|
|
|
this.$store.dispatch(
|
|
|
"dialog/closeVideoDialog",
|
|
@@ -288,14 +363,37 @@ export default {
|
|
|
this.handleCancelFireAlarm();
|
|
|
console.log("Fire");
|
|
|
}
|
|
|
+ this.handleClose();
|
|
|
},
|
|
|
handleChangeDefense() {
|
|
|
- this.dialogConfig.dialogMsg.data.defense =
|
|
|
- !this.dialogConfig.dialogMsg.data.defense;
|
|
|
+ //按钮切换
|
|
|
+ this.dialogConfig.dialogMsg.data.withdrawn =
|
|
|
+ !this.dialogConfig.dialogMsg.data.withdrawn;
|
|
|
+ if (this.dialogConfig.dialogMsg.data.withdrawn) {
|
|
|
+ console.log("即将撤防完成");
|
|
|
+ } else {
|
|
|
+ console.log("即将布防完成");
|
|
|
+ }
|
|
|
+ const p = {
|
|
|
+ perimeterId: this.dialogConfig.dialogMsg.data.perimeterId,
|
|
|
+ segmentId: this.dialogConfig.dialogMsg.data.id,
|
|
|
+ withdrawn: this.dialogConfig.dialogMsg.data.withdrawn,
|
|
|
+ // perimeterId: this.dialogConfig.dialogMsg.data.id,
|
|
|
+ // segmentId: this.dialogConfig.dialogMsg.data.segmentId,
|
|
|
+ // withdrawn: this.dialogConfig.dialogMsg.data.withdrawn,
|
|
|
+ };
|
|
|
+ //布防撤防
|
|
|
+ setWithdrawn(p).then((res) => {
|
|
|
+ if (res.code === 20000) {
|
|
|
+ console.log("操作完成");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.refresh();
|
|
|
+ // this.$emit("handleClose");
|
|
|
},
|
|
|
handleCancelPerimeterAlarm() {
|
|
|
- console.log(this.dialogConfig.dialogMsg.data);
|
|
|
- console.log(this.$parent.perimeterTagsData);
|
|
|
+ // console.log(this.dialogConfig.dialogMsg.data);
|
|
|
+ // console.log(this.$parent.perimeterTagsData);
|
|
|
this.$emit("handleClose");
|
|
|
this.$parent.pushPerimeterStatus({
|
|
|
alarmPoint: null,
|
|
@@ -303,12 +401,14 @@ export default {
|
|
|
buildId: this.buildInfo.positioningBuildId,
|
|
|
camera: null,
|
|
|
floorNo: 2,
|
|
|
- segmentId: this.dialogConfig.dialogMsg.data.segmentId,
|
|
|
+ segmentId: this.dialogConfig.dialogMsg.data.id,
|
|
|
+ // segmentId: this.dialogConfig.dialogMsg.data.segmentId,
|
|
|
});
|
|
|
+ this.refresh();
|
|
|
},
|
|
|
handleCancelFireAlarm() {
|
|
|
- console.log(this.dialogConfig.dialogMsg.data);
|
|
|
- console.log(this.$parent.fireTagsData);
|
|
|
+ // console.log(this.dialogConfig.dialogMsg.data);
|
|
|
+ // console.log(this.$parent.fireTagsData);
|
|
|
this.$emit("handleClose");
|
|
|
this.$parent.pushFireStatus({
|
|
|
alarmPoint: null,
|
|
@@ -318,10 +418,12 @@ export default {
|
|
|
floorNo: 2,
|
|
|
id: this.dialogConfig.dialogMsg.data.id,
|
|
|
});
|
|
|
+ this.refresh();
|
|
|
},
|
|
|
handleCancelJGYTAlarm() {
|
|
|
- console.log(this.dialogConfig.dialogMsg.data);
|
|
|
- console.log(this.$parent.jgytTagsData);
|
|
|
+ // console.log(this.dialogConfig.dialogMsg.data);
|
|
|
+ // console.log(this.$parent.jgytTagsData);
|
|
|
+ this.$emit("handleClose");
|
|
|
this.$parent.pushJGYTStatus({
|
|
|
alarmPoint: null,
|
|
|
alarmType: -1,
|
|
@@ -330,6 +432,17 @@ export default {
|
|
|
buildId: this.buildInfo.positioningBuildId,
|
|
|
id: this.dialogConfig.dialogMsg.data.id,
|
|
|
});
|
|
|
+ this.refresh();
|
|
|
+ },
|
|
|
+ getTagsValue(tag) {
|
|
|
+ if (this.dialogConfig.dialogMsg) {
|
|
|
+ let tagValue = this.dialogConfig.dialogMsg.data.tags[tag];
|
|
|
+ return this.rtData[tagValue] && this.rtData[tagValue].Value
|
|
|
+ ? this.rtData[tagValue].Value
|
|
|
+ : "";
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -417,6 +530,11 @@ export default {
|
|
|
.perimeter-btn {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+ .jgyt-btn {
|
|
|
+ margin-top: 10px;
|
|
|
+ text-align: right;
|
|
|
+ padding-right: 10px;
|
|
|
+ }
|
|
|
.handle-btn-box {
|
|
|
// width: calc(100% - ) ;
|
|
|
position: absolute;
|