202 lines
5.2 KiB
Vue
Raw Normal View History

2024-04-20 17:26:03 +08:00
<template>
<div class="projectContent">
<div class="left">
2024-04-21 14:15:04 +08:00
<leftTop class="leftTop"></leftTop>
2024-05-11 02:49:17 +08:00
<leftBottom class="leftBottom" @openDialog="openPeopleCountDialog"></leftBottom>
2024-04-20 17:26:03 +08:00
</div>
<div class="center">
2024-04-27 18:46:11 +08:00
<centerTop class="centerTop" @openDialog="openPeopleCountDialog"></centerTop>
<centerBottom class="centerBottom" @openDialog="openPeopleCountDialog"></centerBottom>
2024-04-20 17:26:03 +08:00
</div>
<div class="right">
2024-05-11 11:10:48 +08:00
<rightAll class="rightAll" @openDialog="openPeopleCountDialog"></rightAll>
2024-04-20 17:26:03 +08:00
</div>
2024-04-27 18:46:11 +08:00
<dataDialog ref="partyBuildRef"></dataDialog>
2024-04-20 17:26:03 +08:00
</div>
</template>
<script setup lang="ts">
import leftTop from "@/views/commandScreen/commandCenter/leftTop.vue";
import leftBottom from "@/views/commandScreen/commandCenter/leftBottom.vue";
import centerTop from "@/views/commandScreen/commandCenter/centerTop.vue";
import centerBottom from "@/views/commandScreen/commandCenter/centerBottom.vue";
2024-04-25 09:09:34 +08:00
import rightAll from "@/views/commandScreen/commandCenter/rightAll.vue";
2024-04-20 17:26:03 +08:00
import { GlobalStore } from "@/stores";
2024-04-27 18:46:11 +08:00
import dataDialog from "../dialogCompnnents/data-dialog.vue";
2024-06-04 19:16:37 +08:00
import * as mqtt from "mqtt/dist/mqtt.min";
// import { getWorkerStatisticsCountApi, getProjectDetail } from "@/api/modules/projectOverview";
import { ref, onMounted } from "vue";
2024-04-20 17:26:03 +08:00
const store = GlobalStore();
2024-06-04 19:16:37 +08:00
// const statisticsCount = ref(null as any);
2024-04-20 17:26:03 +08:00
2024-06-04 19:16:37 +08:00
// const projectData = ref(null as any);
2024-04-27 18:46:11 +08:00
// 弹窗
const partyBuildRef = ref();
2024-06-04 19:16:37 +08:00
const openPeopleCountDialog = (index: any) => {
2024-04-27 18:46:11 +08:00
partyBuildRef.value.openDialog(index);
};
2024-06-04 19:16:37 +08:00
const options = {
connectTimeout: 40000,
clientId: "mqttjs_" + Math.random().toString(16).substr(2, 8),
username: "root",
password: "123456",
clean: true
};
// 监听mqtt下发信息然后刷新列表
const mqttMSG = () => {
// this.userId = this.$store.state.userInfo.userId;
// this.topicName = this.$store.state.userInfo.scope;
const client = mqtt.connect("ws://jxj.zhgdyun.com:8083/mqtt", options);
// mqtt连接 +"/#" +workerId
client.on("connect", () => {
// this.topicName + this.userId
client.subscribe("zjsjTopic" + store.userId + "/bigScreen/emergency/alert", { qos: 0 }, (error: any) => {
if (!error) {
} else {
}
});
});
// 接收消息处理
client.on("message", (topic: any, message: any) => {
const result = JSON.parse(message);
openPeopleCountDialog({
index: 10,
2024-06-06 17:00:17 +08:00
title: "人员呼叫",
2024-06-04 19:16:37 +08:00
timeOut: 60,
timeFlag: null,
2024-06-04 20:13:38 +08:00
show: true,
2024-06-04 19:16:37 +08:00
mapsDetail: JSON.parse(result.payload)
});
});
// 断开发起重连
// client.on("reconnect", (error) => {
// });
// 链接异常处理
client.on("error", (error: any) => {
});
};
onMounted(() => {
mqttMSG();
// setTimeout(() => {
// openPeopleCountDialog({
// index: 10,
2024-06-06 17:00:17 +08:00
// title: "人员呼叫",
2024-06-04 19:16:37 +08:00
// timeOut: 10,
// timeFlag: null,
// show: true,
// mapsDetail: {
// alarmPersonId: "1795271026055901186",
// alarmPersonName: "测试0528",
// alarmTime: "2024-06-03 19:19:23",
// departmentName: null,
// disposalReport: null,
// dispositionStatus: 1,
// emergencyDetail: null,
// emergencyTypeId: "-1",
// emergencyTypeName: "一键报警",
// enterpriseId: "1786223302337675266",
// enterpriseName: "测试企业1",
// id: "1797588887538925569",
// incidentClosedStatus: 1,
// incidentSite: "广东省深圳市宝安区福海路福永意库",
// latitude: 22.67405,
// livePicture: null,
// liveVideoSituation: null,
// longitude: 113.80984,
// projectSn: "BD3137498CB84BF0969979E0342CDBCA",
// situations: null,
// teamName: "司机-1",
// updateDate: "2024-06-03 19:19:30"
// }
// });
// }, 3000);
// setTimeout(() => {
// openPeopleCountDialog({
// index: 10,
// title: "查看1",
// timeOut: 10,
// timeFlag: null,
// show: true,
// mapsDetail: {
// alarmPersonId: "1795271026055901186",
// alarmPersonName: "测试0528",
// alarmTime: "2024-06-03 19:19:23",
// departmentName: null,
// disposalReport: null,
// dispositionStatus: 1,
// emergencyDetail: null,
// emergencyTypeId: "-1",
// emergencyTypeName: "一键报警",
// enterpriseId: "1786223302337675266",
// enterpriseName: "测试企业1",
// id: "1797588887538925568",
// incidentClosedStatus: 1,
// incidentSite: "广东省深圳市宝安区福海路福永意库",
// latitude: 22.67405,
// livePicture: null,
// liveVideoSituation: null,
// longitude: 113.80984,
// projectSn: "BD3137498CB84BF0969979E0342CDBCA",
// situations: null,
// teamName: "司机-1",
// updateDate: "2024-06-03 19:19:30"
// }
// });
// }, 6000);
});
2024-04-20 17:26:03 +08:00
</script>
<style lang="scss" scoped>
.projectContent {
width: 100%;
height: 100%;
display: flex;
2024-06-04 19:16:37 +08:00
2024-04-20 17:26:03 +08:00
.left {
2024-06-03 13:45:16 +08:00
height: 109.5%;
2024-04-20 17:26:03 +08:00
width: 26%;
2024-06-03 13:45:16 +08:00
transform: translateY(-70px);
2024-06-04 19:16:37 +08:00
2024-04-20 17:26:03 +08:00
.leftTop {
2024-06-03 13:45:16 +08:00
height: 24.5%;
2024-04-20 17:26:03 +08:00
}
2024-06-04 19:16:37 +08:00
2024-04-21 14:15:04 +08:00
.leftBottom {
2024-06-03 14:17:09 +08:00
height: 75.5%;
2024-04-20 17:26:03 +08:00
margin: 3% 0 3% 0;
}
}
2024-06-04 19:16:37 +08:00
2024-04-20 17:26:03 +08:00
.center {
width: 46%;
margin: 0 1%;
.centerTop {
2024-04-26 18:06:30 +08:00
height: 53.8%;
2024-04-21 14:15:04 +08:00
// margin-bottom: 3%;
2024-04-20 17:26:03 +08:00
}
2024-06-04 19:16:37 +08:00
2024-04-20 17:26:03 +08:00
.centerBottom {
height: 46.85%;
margin: 1% 0 0 0;
2024-04-20 17:26:03 +08:00
}
}
2024-06-04 19:16:37 +08:00
2024-04-20 17:26:03 +08:00
.right {
width: 26%;
2024-06-03 14:17:09 +08:00
height: 109.2%;
transform: translateY(-70px);
2024-04-25 09:09:34 +08:00
// .rightAll {
// height: 32%;
// }
// .rightCenter {
// height: 33%;
// margin: 3% 0 3% 0;
// }
// .rightBottom {
// height: 32%;
// }
2024-04-20 17:26:03 +08:00
}
}
</style>