1211 lines
35 KiB
Vue
Raw Normal View History

2022-06-08 14:51:11 +08:00
<template>
<!-- 进度管理 -->
<div class="fullHeight">
<!-- <vue-scroll>
<img src="@/assets/images/dataBoard/6.png" style="height:auto;width:100%"/>
</vue-scroll> -->
<div class="aside fullHeight">
<div class="blockBox">
<div class="blockTitle">
<!-- 预警统计 -->
{{ $t('message.dataBoard.alarmStatistics') }}
2022-06-08 14:51:11 +08:00
</div>
<div class="blockContent flex">
<div class="companyChart" ref="echart"></div>
<div class="right-tg">
<ul>
<li v-for="(item, index) in echartData" :key="index">
<span :style="{ background: colorList[index] }"></span>
{{ item.name }}
</li>
</ul>
<ul style="margin-left: 20px">
<li v-for="(item, index) in echartData" :key="index">
{{ item.value }}
</li>
</ul>
</div>
</div>
</div>
<div class="blockBox">
<div class="blockTitle">
<!-- 设备情况 -->
{{ $t('message.dataBoard.devDetail') }}
2022-06-08 14:51:11 +08:00
</div>
<div class="blockContent dev-status">
<vue-scroll>
<ul>
<li
v-if="item"
class="flex"
v-for="(item, index) in devStatusList"
:key="index"
>
{{ item.videoName }}
<!-- 枪机''球机' -->
<span>{{
item.deviceType == 1
? $t('message.dataBoard.deviceTypeList')[0]
2022-06-08 14:51:11 +08:00
: item.deviceType == 2
? $t('message.dataBoard.deviceTypeList')[1]
2022-06-08 14:51:11 +08:00
: item.deviceType == 3
? $t('message.dataBoard.deviceTypeList')[2]
2022-06-08 14:51:11 +08:00
: item.deviceType == 4
? $t('message.dataBoard.deviceTypeList')[3]
2022-06-08 14:51:11 +08:00
: item.deviceType == 5
? $t('message.dataBoard.deviceTypeList')[4]
: $t('message.dataBoard.deviceTypeList')[5]
2022-06-08 14:51:11 +08:00
}}</span>
</li>
</ul>
2023-05-13 17:00:19 +08:00
<div
class="placeholderBox placeholderBox2"
v-if="devStatusList.length == 0"
>
<img src="@/assets/images/noData3.png" alt="" srcset="" />
<p>
<!-- 暂无数据 -->
{{$t('message.dataBoard.nodata')}}
</p>
</div>
2022-06-08 14:51:11 +08:00
</vue-scroll>
</div>
</div>
<div class="blockBox">
<div class="blockTitle">
<!-- 预警事件 -->
{{ $t('message.dataBoard.alarmEvent') }}
2022-06-08 14:51:11 +08:00
</div>
<div style="overflow: hidden" class="blockContent">
<!-- :data="10" :class-option="defaultOption"-->
<vue-seamless-scroll
:data="earlyWarning"
:class-option="defaultOption"
>
<ul class="earlyWarningList">
<li
class="earlyWarningList_item"
v-for="(item, index) in earlyWarning"
:key="index"
>
<div class="imgBox">
<img :src="fileUrl + item.imageUrl" />
</div>
<div class="content">
<div
v-if="item.hardwareName"
:title="
$t('message.dataBoard.dev') +
item.hardwareName +
$t('message.dataBoard.at') +
item.location +
$t('message.dataBoard.detected') +
alarmTypes(item.alarmType) +
$t('message.dataBoard.pleaseDealFast') +
'...'
"
class="list-title"
>
{{
$t('message.dataBoard.dev') +
2022-06-08 14:51:11 +08:00
item.hardwareName +
$t('message.dataBoard.at') +
2022-06-08 14:51:11 +08:00
item.location +
$t('message.dataBoard.detected') +
2022-06-08 14:51:11 +08:00
alarmTypes(item.alarmType) +
$t('message.dataBoard.pleaseDealFast') +
'...'
2022-06-08 14:51:11 +08:00
}}
</div>
<div class="list-time">
<!-- 识别时间 -->
{{ $t('message.dataBoard.discernTime') }}
2022-06-08 14:51:11 +08:00
{{ item.createTime }}
</div>
</div>
</li>
</ul>
2023-05-13 17:00:19 +08:00
2022-06-08 14:51:11 +08:00
</vue-seamless-scroll>
2023-05-13 17:00:19 +08:00
<div
class="placeholderBox placeholderBox2"
v-if="earlyWarning.length == 0"
>
<img src="@/assets/images/noData3.png" alt="" srcset="" />
<p>
<!-- 暂无数据 -->
{{$t('message.dataBoard.nodata')}}
</p>
</div>
2022-06-08 14:51:11 +08:00
</div>
</div>
</div>
<div class="right fullHeight">
<div class="blockBox blockBox3" style="height: calc(66.66% - 25px)">
<div class="blockTitle">
<!-- 抓拍记录 -->
{{ $t('message.dataBoard.captureRecords') }}
2022-06-08 14:51:11 +08:00
</div>
<!-- <div @click="scrollClick($event)" style="overflow:hidden;" class="blockContent">-->
<div style="overflow: hidden" class="blockContent">
<vue-seamless-scroll
:data="captureRecord"
:class-option="defaultOption2"
>
<div class="captureRecordBox">
<div
:title="item.time"
:data-name="item.id"
:data-type="'all'"
@click="selectCaptureRecord(item)"
v-for="(item, index) in captureRecord"
:key="index"
class="captureRecord_item"
>
<div class="imgBox">
<img :src="fileUrl + item.imageUrl" />
<!-- <img src="@/assets/images/bigScreen/demo.jpg"/>-->
</div>
<div class="captureRecord_itemInfo">
<div :title="item.hardwareName" class="itemInfo itemInfoId">
<!-- 设备名: -->
{{ $t('message.dataBoard.devName') + ':'
2022-06-08 14:51:11 +08:00
}}{{ item.hardwareName }}
</div>
<div :title="item.createTime" class="itemInfo itemInfoTime">
<!-- 抓拍时间: -->
{{ $t('message.dataBoard.captureTime') + ':'
2022-06-08 14:51:11 +08:00
}}{{ item.createTime }}
</div>
<div :title="item.location" class="itemInfo itemInfoPlace">
<!-- 抓拍点: -->
{{ $t('message.dataBoard.captureLocation') + ':'
2022-06-08 14:51:11 +08:00
}}{{ item.location }}
</div>
<!-- 1-安全帽报警2-明火报警3-聚众报警4-倒地报警5-越界报警6-闯入报警7反光衣报警,8-吸烟报警-->
<div
:title="alarmTypes(item.alarmType)"
class="itemInfo itemInfoType"
>
<!-- 抓拍类型: -->
{{ $t('message.dataBoard.captureType') + ':'
2022-06-08 14:51:11 +08:00
}}{{ alarmTypes(item.alarmType) }}
</div>
</div>
</div>
</div>
</vue-seamless-scroll>
2023-05-13 17:00:19 +08:00
<div
class="placeholderBox placeholderBox2"
v-if="captureRecord.length == 0"
>
<img src="@/assets/images/noData3.png" alt="" srcset="" />
<p>
<!-- 暂无数据 -->
{{$t('message.dataBoard.nodata')}}
</p>
</div>
2022-06-08 14:51:11 +08:00
</div>
</div>
2023-05-13 17:00:19 +08:00
<div class="blockBox blockBox2" style="height:calc(33.33% - 23px) !important;">
2022-06-08 14:51:11 +08:00
<div class="blockTitle">
<!-- 预警趋势 -->
{{ $t('message.dataBoard.warningTrend') }}
2022-06-08 14:51:11 +08:00
</div>
<div class="blockContent blockContent2">
<div class="optionBox">
<div
@click="changeOptionBoxListIndex(index)"
v-for="(item, index) in optionBoxList"
:key="index"
class="optionBox_item"
:class="{ selectOptionBox_item: optionBoxListIndex === index }"
>
<span>{{ item.text }}</span>
<div class="a"></div>
<div class="b"></div>
<div class="c"></div>
<div class="d"></div>
</div>
<!-- <div class="optionBox_item">-->
<!-- 近30天-->
<!-- <div class="a"></div>-->
<!-- <div class="b"></div>-->
<!-- <div class="c"></div>-->
<!-- <div class="d"></div>-->
<!-- </div>-->
</div>
<div
ref="echart2"
style="width: 100%; height: 100%"
class="stageBox"
></div>
</div>
</div>
</div>
</div>
</template>
<script>
import echarts from 'echarts4'
import mqtt from 'mqtt'
import vueSeamlessScroll from 'vue-seamless-scroll'
2022-06-08 14:51:11 +08:00
import {
getAiAnalyseHardWareAlarmTotalApi, //查询所有各预警类型预警数 (预警统计)
selectAiAnalyseHardWareAlarmTrendListApi, //查询近七天或近30天报警趋势(预计趋势)
selectAIVideoTypeCountListApi, //按照摄像头类型查询具有AI功能的摄像头数量(设备情况)
selectAiAnalyseHardWareAlarmListApi //查询设备报警记录列表(预警记录&&抓拍记录)
} from '@/assets/js/api/AI'
import { getAITypeStatistics } from '@/assets/js/api/companyBigScreen.js'
2022-06-08 14:51:11 +08:00
const options = {
connectTimeout: 40000,
clientId: 'mqttjs_' + Math.random().toString(16).substr(2, 8),
username: 'root',
password: '123456',
clean: true
}
let client = null
2022-06-08 14:51:11 +08:00
export default {
data() {
return {
optionBoxList: [
{
text: /* "近7天" */ this.$t('message.dataBoard.timeList')[0]
2022-06-08 14:51:11 +08:00
},
{
text: /* "近30天" */ this.$t('message.dataBoard.timeList')[1]
}
2022-06-08 14:51:11 +08:00
],
optionBoxListIndex: 0,
colorList: [
'#44D7B6',
'#3052B3',
'#FE6C7F',
'#FAC915',
'#91c7ae',
'#749f83',
'#ca8622',
'#bda29a'
2022-06-08 14:51:11 +08:00
],
chart1: Object,
chart2: Object,
option1: {},
option1: {},
earlyWarning: [
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// },
// {
// details:"摄像机一号在钢筋加工棚监测到有未戴安全帽,请及时处理…",
// time:"09-12 13:45:42"
// }
],
// [
// {value: 0, name: '安全帽报警'},
// {value: 0, name: '明火报警'},
// {value: 0, name: '聚众报警'},
// {value: 0, name: '倒地报警'},
// {value: 0, name: '越界报警'},
// {value: 0, name: '闯入报警'},
// {value: 0, name: '反光衣报警'},
// {value: 0, name: '吸烟报警'}
// ],
echartData: this.$t('message.dataBoard.alarmTypeList'),
2022-06-08 14:51:11 +08:00
totalNum: 0,
devStatusList: this.$t('message.dataBoard.devStatusList'),
2022-06-08 14:51:11 +08:00
captureRecord: [
// {
// id:'900',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'901',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'902',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'903',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'904',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'905',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'906',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'907',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'908',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'909',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'910',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// },
// {
// id:'911',
// time: '09-11 15:00:00',
// place:'施工通道',
// type:'违规作业'
// }
],
userId: '',
topicName: 'aiAnalyse',
2022-06-08 14:51:11 +08:00
dataTimeList: [],
alarmTypeNum1: [],
alarmTypeNum2: [],
alarmTypeNum3: [],
alarmTypeNum4: [],
alarmTypeNum5: [],
alarmTypeNum6: [],
alarmTypeNum7: [],
alarmTypeNum8: [],
alarmTotalNum: [],
fileUrl: '',
currentPersonDetail: ''
}
2022-06-08 14:51:11 +08:00
},
created() {
this.fileUrl = this.$store.state.FILEURL
console.log(this.$store.state.userInfo.scope)
this.getAiAnalyseHardWareAlarmTotal()
this.selectAiAnalyseHardWareAlarmTrendList(this.optionBoxListIndex + 1)
this.selectAIVideoTypeCountList()
this.selectAiAnalyseHardWareAlarmList()
2022-06-08 14:51:11 +08:00
},
mounted() {
2023-05-13 17:00:19 +08:00
// client = mqtt.connect("ws://182.90.224.147:8083/mqtt", options);
2022-06-08 14:51:11 +08:00
client = mqtt.connect(mqttUrl, options);
this.mqttMSG();
},
beforeDestroy() {
if (client) {
client.unsubscribe(this.topicName + this.$store.state.projectSn)
2022-06-08 14:51:11 +08:00
}
},
components: {
vueSeamlessScroll
2022-06-08 14:51:11 +08:00
},
computed: {
// 类型 1-烟感、2-明火、3-人员倒地、4-未戴安全帽、5-区域入侵、6-越界入侵、7-人员聚集衣 8-反光衣、9-裸土覆盖
alarmTypes() {
return function (type) {
let alarmType
2022-06-08 14:51:11 +08:00
if (type == 1) {
alarmType = /* '安全帽报警' */ this.$t(
'message.dataBoard.alarmTypeList'
)[0].name
2022-06-08 14:51:11 +08:00
} else if (type == 2) {
alarmType = /* '明火报警' */ this.$t(
'message.dataBoard.alarmTypeList'
)[1].name
2022-06-08 14:51:11 +08:00
} else if (type == 3) {
alarmType = /* '聚众报警' */ this.$t(
'message.dataBoard.alarmTypeList'
)[2].name
2022-06-08 14:51:11 +08:00
} else if (type == 4) {
alarmType = /* '倒地报警' */ this.$t(
'message.dataBoard.alarmTypeList'
)[3].name
2022-06-08 14:51:11 +08:00
} else if (type == 5) {
alarmType = /* '越界报警' */ this.$t(
'message.dataBoard.alarmTypeList'
)[4].name
2022-06-08 14:51:11 +08:00
} else if (type == 6) {
alarmType = /* '闯入报警' */ this.$t(
'message.dataBoard.alarmTypeList'
)[5].name
2022-06-08 14:51:11 +08:00
} else if (type == 7) {
alarmType = /* '反光衣报警' */ this.$t(
'message.dataBoard.alarmTypeList'
)[6].name
2022-06-08 14:51:11 +08:00
} else if (type == 8) {
alarmType = /* '吸烟报警' */ this.$t(
'message.dataBoard.alarmTypeList'
)[7].name
2022-06-08 14:51:11 +08:00
}
return alarmType
}
2022-06-08 14:51:11 +08:00
},
defaultOption() {
return {
step: 0.5, // 数值越大速度滚动越快
limitMoveNum: 3, // 开始无缝滚动的数据量 this.dataList.length
hoverStop: true, // 是否开启鼠标悬停stop
direction: 1, // 0向下 1向上 2向左 3向右
openWatch: true, // 开启数据实时监控刷新dom
singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
}
2022-06-08 14:51:11 +08:00
},
defaultOption2() {
return {
step: 0.5, // 数值越大速度滚动越快
limitMoveNum: 8, // 开始无缝滚动的数据量 this.dataList.length
hoverStop: true, // 是否开启鼠标悬停stop
direction: 1, // 0向下 1向上 2向左 3向右
openWatch: true, // 开启数据实时监控刷新dom
singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
}
}
2022-06-08 14:51:11 +08:00
},
methods: {
//查询所有各预警类型预警数 (预警统计)
getAiAnalyseHardWareAlarmTotal() {
getAiAnalyseHardWareAlarmTotalApi({
projectSn: this.$store.state.projectSn
}).then((res) => {
this.echartData[0].value = res.result.alarmTypeNum1
this.echartData[1].value = res.result.alarmTypeNum2
this.echartData[2].value = res.result.alarmTypeNum3
this.echartData[3].value = res.result.alarmTypeNum4
this.echartData[4].value = res.result.alarmTypeNum5
this.echartData[5].value = res.result.alarmTypeNum6
this.echartData[6].value = res.result.alarmTypeNum7
this.echartData[7].value = res.result.alarmTypeNum8
this.totalNum = res.result.totalNum
this.createdEchart1()
console.log(this.echartData)
})
2022-06-08 14:51:11 +08:00
},
changeOptionBoxListIndex(index) {
this.optionBoxListIndex = index
this.selectAiAnalyseHardWareAlarmTrendList(index + 1)
2022-06-08 14:51:11 +08:00
},
//查询近七天或近30天报警趋势(预计趋势)
selectAiAnalyseHardWareAlarmTrendList(selectType) {
selectAiAnalyseHardWareAlarmTrendListApi({
projectSn: this.$store.state.projectSn,
selectType: selectType
2022-06-08 14:51:11 +08:00
}).then((res) => {
console.log(res)
this.alarmTypeNum1 = []
this.alarmTypeNum2 = []
this.alarmTypeNum3 = []
this.alarmTypeNum4 = []
this.alarmTypeNum5 = []
this.alarmTypeNum6 = []
this.alarmTypeNum7 = []
this.alarmTypeNum8 = []
this.alarmTotalNum = []
this.dataTimeList = []
2022-06-08 14:51:11 +08:00
res.result.forEach((item) => {
this.alarmTypeNum1.push(item.alarmTypeNum1)
this.alarmTypeNum2.push(item.alarmTypeNum2)
this.alarmTypeNum3.push(item.alarmTypeNum3)
this.alarmTypeNum4.push(item.alarmTypeNum4)
this.alarmTypeNum5.push(item.alarmTypeNum5)
this.alarmTypeNum6.push(item.alarmTypeNum6)
this.alarmTypeNum7.push(item.alarmTypeNum7)
this.alarmTypeNum8.push(item.alarmTypeNum8)
this.alarmTotalNum.push(item.totalNum)
this.dataTimeList.push(item.dayTitle)
this.createdEchart2()
2022-06-08 14:51:11 +08:00
// console.log(item);
})
console.log(res)
})
2022-06-08 14:51:11 +08:00
},
//按照摄像头类型查询具有AI功能的摄像头数量(设备情况)
selectAIVideoTypeCountList() {
selectAIVideoTypeCountListApi({
projectSn: this.$store.state.projectSn
2022-06-08 14:51:11 +08:00
}).then((res) => {
// 1 枪机2球机3热成像4单兵5全景6无人机
this.devStatusList = res.result
console.log(res)
})
2022-06-08 14:51:11 +08:00
},
//查询设备报警记录列表(预警记录&&抓拍记录)
selectAiAnalyseHardWareAlarmList() {
selectAiAnalyseHardWareAlarmListApi({
projectSn: this.$store.state.projectSn,
sizeNum: 20
2022-06-08 14:51:11 +08:00
}).then((res) => {
this.earlyWarning = res.result
this.captureRecord = res.result
console.log(res)
})
2022-06-08 14:51:11 +08:00
},
// scrollClick(e) {
// //通过 e.target获取点击的dom
// //通过e.target.dataset获取vuedom中的自定义属性
// let data = e.target.dataset;
// this.$emit("supervise-detail", data.name, data.type);
// console.log(data);
// },
createdEchart1() {
// console.log(this.$refs['echart'])
let chart1 = echarts.init(this.$refs['echart'])
this.chart1 = chart1
chart1.clear()
2022-06-08 14:51:11 +08:00
this.option1 = {
grid: {
top: '0px',
left: '0px',
right: '0px',
bottom: '0px'
2022-06-08 14:51:11 +08:00
},
tooltip: {
trigger: 'item'
2022-06-08 14:51:11 +08:00
},
legend: {
show: false
2022-06-08 14:51:11 +08:00
},
graphic: [
{
type: 'text',
left: 'center',
top: '38%',
2022-06-08 14:51:11 +08:00
style: {
text: this.totalNum,
textAlign: 'center',
fill: '#fff',
fontSize: 26
}
2022-06-08 14:51:11 +08:00
},
{
type: 'text',
left: 'center',
top: '55%',
2022-06-08 14:51:11 +08:00
style: {
text: /* '问题总数', */ this.$t(
'message.dataBoard.questionAllCounts'
2022-06-08 14:51:11 +08:00
),
textAlign: 'center',
fill: '#fff',
fontSize: 14
}
}
2022-06-08 14:51:11 +08:00
],
color: this.colorList,
series: [
{
type: 'pie',
radius: ['55%', '70%'],
center: ['50%', '50%'],
2022-06-08 14:51:11 +08:00
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
2022-06-08 14:51:11 +08:00
},
emphasis: {
label: {
show: false,
fontSize: '16',
color: '#fff'
}
2022-06-08 14:51:11 +08:00
},
labelLine: {
show: false
2022-06-08 14:51:11 +08:00
},
data: this.echartData,
stillShowZeroSum: true,
minShowLabelAngle: 10
}
]
}
chart1.setOption(this.option1)
2022-06-08 14:51:11 +08:00
},
createdEchart2() {
// console.log(this.$refs['echart'])
let chart2 = echarts.init(this.$refs['echart2'])
this.chart2 = chart2
chart2.clear()
2022-06-08 14:51:11 +08:00
this.option2 = {
color: [
'#557DED',
'#44D7B6',
'#3052B3',
'#FE6C7F',
'#FAC915',
'#91c7ae',
'#749f83',
'#ca8622',
'#bda29a'
2022-06-08 14:51:11 +08:00
],
legend: {
// ['总计', '安全帽报警','明火报警','聚众报警','倒地报警','越界报警','闯入报警','反光衣报警','吸烟报警'],
data: this.$t('message.dataBoard.alarmTypeArray'),
2022-06-08 14:51:11 +08:00
textStyle: {
2023-05-13 17:00:19 +08:00
fontSize: 10,//字体大小
color: '#ccc' //字体颜色
2022-06-08 14:51:11 +08:00
},
2023-05-13 17:00:19 +08:00
left: '6%',
top: '7%',
2022-06-08 14:51:11 +08:00
},
2023-05-13 17:00:19 +08:00
grid: {
top:'20%',
left: '3%',
right: '4%',
bottom: '29%',
containLabel: true
},
2022-06-08 14:51:11 +08:00
tooltip: {
trigger: 'axis',
position: [20, 20]
2022-06-08 14:51:11 +08:00
},
xAxis: {
type: 'category',
2022-06-08 14:51:11 +08:00
data: this.dataTimeList,
axisLabel: {
formatter: '{value}',
2022-06-08 14:51:11 +08:00
textStyle: {
//改变刻度字体样式
2023-05-13 17:00:19 +08:00
color: 'RGB(254,255,255,0.5)',
fontSize: 8,
}
}
2022-06-08 14:51:11 +08:00
},
yAxis: {
type: 'value',
2022-06-08 14:51:11 +08:00
axisLabel: {
formatter: '{value}',
2022-06-08 14:51:11 +08:00
textStyle: {
//改变刻度字体样式
2023-05-13 17:00:19 +08:00
color: 'RGB(254,255,255,0.5)',
fontSize: 10,
}
2022-06-08 14:51:11 +08:00
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed',
2023-05-13 17:00:19 +08:00
color: 'RGB(236,236,236,0.5)',
}
}
2022-06-08 14:51:11 +08:00
},
series: [
{
name: /* "总计", */ this.$t('message.dataBoard.alarmTypeArray')[0],
2022-06-08 14:51:11 +08:00
data: this.alarmTotalNum,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#557DED'
}
}
}
2022-06-08 14:51:11 +08:00
},
{
name: /* "安全帽报警", */ this.$t(
'message.dataBoard.alarmTypeArray'
2022-06-08 14:51:11 +08:00
)[1],
data: this.alarmTypeNum1,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#44D7B6'
}
}
}
2022-06-08 14:51:11 +08:00
},
{
name: /* "明火报警", */ this.$t(
'message.dataBoard.alarmTypeArray'
2022-06-08 14:51:11 +08:00
)[2],
data: this.alarmTypeNum2,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#3052B3'
}
}
}
2022-06-08 14:51:11 +08:00
},
{
name: /* "聚众报警", */ this.$t(
'message.dataBoard.alarmTypeArray'
2022-06-08 14:51:11 +08:00
)[3],
data: this.alarmTypeNum3,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#FE6C7F'
}
}
}
2022-06-08 14:51:11 +08:00
},
{
name: /* "倒地报警", */ this.$t(
'message.dataBoard.alarmTypeArray'
2022-06-08 14:51:11 +08:00
)[4],
data: this.alarmTypeNum4,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#FAC915'
}
}
}
2022-06-08 14:51:11 +08:00
},
{
name: /* "越界报警", */ this.$t(
'message.dataBoard.alarmTypeArray'
2022-06-08 14:51:11 +08:00
)[5],
data: this.alarmTypeNum5,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#91c7ae'
}
}
}
2022-06-08 14:51:11 +08:00
},
{
name: /* "闯入报警", */ this.$t(
'message.dataBoard.alarmTypeArray'
2022-06-08 14:51:11 +08:00
)[6],
data: this.alarmTypeNum6,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#749f83'
}
}
}
2022-06-08 14:51:11 +08:00
},
{
name: /* "反光衣报警", */ this.$t(
'message.dataBoard.alarmTypeArray'
2022-06-08 14:51:11 +08:00
)[7],
data: this.alarmTypeNum7,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#ca8622'
}
}
}
2022-06-08 14:51:11 +08:00
},
{
name: /* "吸烟报警", */ this.$t(
'message.dataBoard.alarmTypeArray'
2022-06-08 14:51:11 +08:00
)[8],
data: this.alarmTypeNum8,
type: 'line',
2022-06-08 14:51:11 +08:00
smooth: true,
itemStyle: {
normal: {
lineStyle: {
color: '#bda29a'
}
}
}
}
]
}
chart2.setOption(this.option2)
2022-06-08 14:51:11 +08:00
},
mqttMSG() {
// mqtt连接 +"/#" +workerId
client.on('connect', (e) => {
console.log('连接成功:', this.topicName + this.$store.state.projectSn)
2022-06-08 14:51:11 +08:00
client.subscribe(
this.topicName + this.$store.state.projectSn,
{ qos: 0 },
(error) => {
if (!error) {
console.log('订阅成功')
2022-06-08 14:51:11 +08:00
} else {
console.log('订阅失败')
2022-06-08 14:51:11 +08:00
}
}
)
})
2022-06-08 14:51:11 +08:00
// 接收消息处理
client.on('message', (topic, message) => {
console.log(message)
message = JSON.parse(message)
this.currentPersonDetail = JSON.parse(message.content)
console.log(this.currentPersonDetail)
2022-06-08 14:51:11 +08:00
if (this.currentPersonDetail) {
if (this.earlyWarning.length < 20) {
let arr = [this.currentPersonDetail]
this.earlyWarning = arr.concat(this.earlyWarning)
this.captureRecord = arr.concat(this.captureRecord)
2022-06-08 14:51:11 +08:00
} else {
this.earlyWarning.pop()
this.captureRecord.pop()
this.earlyWarning.unshift(this.currentPersonDetail)
this.captureRecord.unshift(this.currentPersonDetail)
2022-06-08 14:51:11 +08:00
}
}
// if(message.content){
// if(message.content.indexOf("火点检测") > -1 || message.content.indexOf("温度报警") > -1){
// this.$emit('sendMsg')
// }
// }
// this.$notify({
// title: message.title,
// message: message.content,
// });
})
2022-06-08 14:51:11 +08:00
// 断开发起重连
// client.on("reconnect", (error) => {
// console.log("正在重连:", error);
// });
// 链接异常处理
client.on('error', (error) => {
console.log('连接失败:', error)
})
2022-06-08 14:51:11 +08:00
},
selectCaptureRecord(e) {
console.log(e)
}
}
}
2022-06-08 14:51:11 +08:00
</script>
<style lang="less" scoped>
/deep/ .stageBox {
div {
canvas {
/*left: -70px !important;*/
top: -25px !important;
/*width: 1500px !important;*/
height: 300px !important;
}
}
}
.a {
width: 5px;
height: 5px;
position: absolute;
top: 0;
left: 0;
border-left: 2px solid #ebebeb;
border-top: 2px solid #ebebeb;
}
.b {
width: 5px;
height: 5px;
position: absolute;
top: 0;
right: 0;
border-right: 2px solid #ebebeb;
border-top: 2px solid #ebebeb;
}
.c {
width: 5px;
height: 5px;
position: absolute;
bottom: 0;
left: 0;
border-bottom: 2px solid #ebebeb;
border-left: 2px solid #ebebeb;
}
.d {
width: 5px;
height: 10px;
position: absolute;
bottom: 0;
right: 0;
border-right: 2px solid #ebebeb;
border-bottom: 2px solid #ebebeb;
}
.optionBox {
position: absolute;
right: 50px;
top: 0px;
.optionBox_item {
cursor: pointer;
z-index: 100;
padding: 4px;
display: inline-block;
width: 52px;
height: 22px;
font-size: 12px;
line-height: 26px;
margin-right: 10px;
text-align: center;
background: #193b43;
position: relative;
}
.selectOptionBox_item {
background: #393204;
color: #f7d300;
}
}
.earlyWarningList {
.earlyWarningList_item {
padding: 15px;
height: 95px;
background: #0d192c;
margin-bottom: 5px;
box-sizing: border-box;
.imgBox {
display: inline-block;
box-sizing: border-box;
img {
width: 79px;
height: 67px;
}
}
.content {
height: 100%;
box-sizing: border-box;
margin-left: 17px;
width: 243px;
display: inline-block;
padding-bottom: 13px;
.list-title {
margin-bottom: 13px;
font-size: 15px;
text-overflow: ellipsis;
line-clamp: 2;
overflow: hidden;
color: #c83e50;
}
.list-time {
font-size: 13px;
}
}
}
}
.captureRecordBox {
/*display: flex;*/
.captureRecord_item {
box-sizing: border-box;
display: inline-block;
width: 305px;
height: 247px;
margin-right: 25px;
.captureRecord_itemInfo {
.itemInfo {
font-size: 12px;
display: inline-block;
width: 152px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.itemInfoId {
}
.itemInfoTime {
}
.itemInfoPlace {
}
.itemInfoType {
}
}
}
.imgBox {
width: 100%;
img {
width: 100%;
height: 190px;
}
}
}
.numContent {
display: flex;
align-items: center;
justify-content: space-around;
p {
font-size: 14px;
opacity: 0.88;
margin-top: 10px;
text-align: center;
}
}
.companyChart {
width: 50%;
height: 100%;
}
/deep/.alarmTypeBox {
position: absolute;
top: 20px;
right: 10px;
width: 66px;
opacity: 0.8;
z-index: 3;
.el-input__inner {
background-color: transparent;
color: white;
height: 24px;
line-height: 24px;
padding: 0 5px;
}
.el-input__suffix {
right: 0px;
}
.el-input__icon {
color: white;
line-height: 24px;
}
}
.right-tg {
margin-left: 20px;
display: flex;
ul {
display: flex;
height: 100%;
flex-direction: column;
//align-items: center;
justify-content: center;
li {
2023-05-13 17:00:19 +08:00
margin-bottom: 5px;
2022-06-08 14:51:11 +08:00
display: flex;
align-items: center;
span {
width: 6px;
height: 6px;
display: block;
border-radius: 50%;
margin-right: 6px;
}
}
}
}
.configBtn {
position: absolute;
right: 8px;
top: 15px;
font-size: 20px;
cursor: pointer;
z-index: 3;
}
.days {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.num {
font-size: 46px;
}
}
.daysBG {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.endDate {
position: absolute;
right: 15px;
bottom: 12px;
// font-size: 13px;
}
.Extgantt {
width: 100%;
height: 100%;
border: none;
}
.flex {
display: flex;
}
.dev-status {
ul {
li {
background: rgba(#2f4988, 0.3);
color: #fff;
justify-content: space-between;
padding-left: 32px;
height: 37px;
line-height: 37px;
margin-bottom: 6px;
span {
display: block;
width: 65px;
text-align: center;
background: rgba(#557ded, 0.6);
color: #fff;
}
}
}
}
</style>