update
This commit is contained in:
parent
c28eba6e1f
commit
3550242cc9
@ -10,11 +10,17 @@ export function getNoiseData(query) {
|
||||
})
|
||||
}
|
||||
// 查询公区传感器数据
|
||||
export function getTopData(query) {
|
||||
export function getTopData(deptId) {
|
||||
return request({
|
||||
url: '/screen/goaSensor/getTopData?depts=100',
|
||||
url: '/screen/goaSensor/getTopData?depts=' + deptId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 查询公区传感器数据
|
||||
export function getSensorByDept(deptIds) {
|
||||
return request({
|
||||
url: '/screen/goaSensor/getSensorByDept?depts=' + deptIds,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -77,12 +77,12 @@ export const constantRoutes = [
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
// {
|
||||
// path: "/screen/R_D_Environment",
|
||||
// name: "R_D_Environment",
|
||||
// component: () => import("../views/screen/R_D_Environment/index.vue"),
|
||||
// hidden: true
|
||||
// },
|
||||
{
|
||||
path: "/screen/R_D_Environment",
|
||||
name: "R_D_Environment",
|
||||
component: () => import("../views/screen/R_D_Environment/index.vue"),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "/screen/R_D_Environment1",
|
||||
name: "R_D_Environment1",
|
||||
|
185
src/store/modules/r_d_environment.js
Normal file
185
src/store/modules/r_d_environment.js
Normal file
@ -0,0 +1,185 @@
|
||||
const useR_D_EnvironmentStore = defineStore(
|
||||
'r_d_environment',
|
||||
{
|
||||
state: () => ({
|
||||
sensorData: {
|
||||
"noise": [
|
||||
{
|
||||
"deviceId": "41210bb0-1591-11ee-b4df-a9653aef169c",
|
||||
"data": "16",
|
||||
"field": null,
|
||||
"name": "噪声监测1",
|
||||
"typeId": "noise",
|
||||
"label": "noise-1",
|
||||
"deptId": "113",
|
||||
"type": "Noise_Reg",
|
||||
"x": null,
|
||||
"y": null,
|
||||
"deptName": "4楼",
|
||||
"status": false
|
||||
}
|
||||
],
|
||||
"Smoke": [
|
||||
{
|
||||
"deviceId": "14927870-969d-11ef-91f3-abd609c7e488",
|
||||
"data": "0",
|
||||
"field": null,
|
||||
"name": "烟雾传感器10",
|
||||
"typeId": "Smoke",
|
||||
"label": "Smoke-10",
|
||||
"deptId": "113",
|
||||
"type": null,
|
||||
"x": null,
|
||||
"y": null,
|
||||
"deptName": "4楼",
|
||||
"status": false
|
||||
}
|
||||
],
|
||||
"dust": [
|
||||
{
|
||||
"deviceId": "25c78580-1594-11ee-b4df-a9653aef1699",
|
||||
"data": "0",
|
||||
"field": null,
|
||||
"name": "粉尘监测传感器",
|
||||
"typeId": "dust",
|
||||
"label": "Dust_02",
|
||||
"deptId": "113",
|
||||
"type": "HIGH_PM25_Reg",
|
||||
"x": null,
|
||||
"y": null,
|
||||
"deptName": "4楼",
|
||||
"status": false
|
||||
}, {
|
||||
"deviceId": "25c78580-1594-11ee-b4df-a9653aef169c",
|
||||
"data": "25",
|
||||
"field": null,
|
||||
"name": "粉尘监测传感器",
|
||||
"typeId": "dust",
|
||||
"label": "Dust_01",
|
||||
"deptId": "114",
|
||||
"type": "HIGH_PM10_Reg",
|
||||
"x": null,
|
||||
"y": null,
|
||||
"deptName": "5楼",
|
||||
"status": false
|
||||
}
|
||||
],
|
||||
"temp_humi": [
|
||||
{
|
||||
"deviceId": "1",
|
||||
"humidity": "0",
|
||||
"name": "温湿度监测1",
|
||||
"label": "temp_humi_1",
|
||||
"temp": "0",
|
||||
"deptId": "113",
|
||||
"deptName": "4楼",
|
||||
"status": false
|
||||
}
|
||||
],
|
||||
"TVOC_CH2O": [
|
||||
{
|
||||
"deviceId": "c65d80e0-158e-11ee-b4df-a9653aef1191",
|
||||
"data": "0",
|
||||
"field": null,
|
||||
"name": "TVOC/甲醛监测传感器",
|
||||
"typeId": "TVOC_CH2O",
|
||||
"label": "TVOC_CH2O_01",
|
||||
"deptId": "113",
|
||||
"type": "CH2O",
|
||||
"x": null,
|
||||
"y": null,
|
||||
"deptName": "4楼",
|
||||
"status": false
|
||||
},
|
||||
{
|
||||
"deviceId": "c65d80e0-158e-11ee-b4df-a9653aef169c",
|
||||
"data": "0.41",
|
||||
"field": null,
|
||||
"name": "TVOC/甲醛监测传感器",
|
||||
"typeId": "TVOC_CH2O",
|
||||
"label": "TVOC_CH2O_02",
|
||||
"deptId": "114",
|
||||
"type": "TVOC",
|
||||
"x": null,
|
||||
"y": null,
|
||||
"deptName": "5楼",
|
||||
"status": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}),
|
||||
actions: {},
|
||||
getters: {
|
||||
//获取四层,五层的平均温湿度
|
||||
getLayerData: (state) => {
|
||||
|
||||
let layerData = {
|
||||
four: {
|
||||
title: '研发中心四楼',
|
||||
temp: 0,
|
||||
humi: 0
|
||||
},
|
||||
five: {
|
||||
title: '研发中心五楼',
|
||||
temp: 0,
|
||||
humi: 0
|
||||
},
|
||||
}
|
||||
let sensorData = state.sensorData
|
||||
console.log(sensorData, '123');
|
||||
|
||||
if (sensorData['temp_humi'] && sensorData['temp_humi'].length > 0) {
|
||||
console.log(sensorData['temp_humi'], '12113');
|
||||
let fourTemp = 0
|
||||
let fourHumi = 0
|
||||
let fourCount = 0
|
||||
let fiveTemp = 0
|
||||
let fiveHumi = 0
|
||||
let fiveCount = 0
|
||||
sensorData['temp_humi'].forEach(item => {
|
||||
if (item.deptId === '113') {
|
||||
fourTemp += +item.temp
|
||||
fourHumi += +item.humidity
|
||||
fourCount++
|
||||
} else if (item.deptId === '114') {
|
||||
fiveTemp += +item.temp
|
||||
fiveHumi += +item.humidity
|
||||
fiveCount++
|
||||
}
|
||||
})
|
||||
layerData.four.temp = (fourTemp / fourCount).toFixed(1)
|
||||
layerData.four.humi = (fourHumi / fourCount).toFixed(1)
|
||||
layerData.five.temp = (fiveTemp / fiveCount).toFixed(1)
|
||||
layerData.five.humi = (fiveHumi / fiveCount).toFixed(1)
|
||||
}
|
||||
return layerData
|
||||
},
|
||||
//获取四层,五层的噪声传感器数据
|
||||
getNoiseData: (state) => {
|
||||
let resNoiseData = {
|
||||
four: {
|
||||
public_noise: {},
|
||||
office_noise: []
|
||||
},
|
||||
five: {
|
||||
public_noise: {},
|
||||
office_noise: []
|
||||
}
|
||||
}
|
||||
let noiseData = state.sensorData['noise'] || []
|
||||
let fourNoiseData = noiseData.filter(item => item.deptId === '113')
|
||||
let fiveNoiseData = noiseData.filter(item => item.deptId === '114')
|
||||
resNoiseData.four.public_noise = fourNoiseData.find(item => item.name === '噪声监测1')
|
||||
resNoiseData.four.office_noise = fourNoiseData.filter(item => item.name !== '噪声监测1')
|
||||
|
||||
resNoiseData.five.public_noise = fiveNoiseData.find(item => item.name === '噪声监测10')
|
||||
resNoiseData.five.office_noise = fiveNoiseData.filter(item => item.name !== '噪声监测10')
|
||||
return resNoiseData
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
export default useR_D_EnvironmentStore
|
@ -174,7 +174,7 @@ const initModel = () => {
|
||||
};
|
||||
|
||||
const planeAnimate = (texture: any): Animate => {
|
||||
console.log(texture, 'texture');
|
||||
// console.log(texture, 'texture');
|
||||
texture.wrapS = THREE.RepeatWrapping;
|
||||
texture.wrapT = THREE.RepeatWrapping;
|
||||
const animateFn = {
|
||||
|
@ -273,7 +273,7 @@ function getNoiseDataList() {
|
||||
}
|
||||
// 获取顶部数据
|
||||
function getTopDataList() {
|
||||
getTopData().then(res => {
|
||||
getTopData(113).then(res => {
|
||||
if (res.code === 200) {
|
||||
res.data.forEach(item => {
|
||||
let index = sensor_list.findIndex(sensor => sensor.type === item.type)
|
||||
|
@ -14,39 +14,34 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import u918 from './../image/u918.png';
|
||||
|
||||
import useR_D_EnvironmentStore from '@/store/modules/r_d_environment'
|
||||
let R_D_EnvironmentStore = useR_D_EnvironmentStore()
|
||||
const prop = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
Humiture: [],
|
||||
bottom: {
|
||||
"temp": -15,
|
||||
"humidity": 15,
|
||||
"name": "温湿度下限值"
|
||||
},
|
||||
top: {
|
||||
"temp": 45,
|
||||
"humidity": 75,
|
||||
"name": "温湿度上限值"
|
||||
}
|
||||
}
|
||||
}
|
||||
deptId: {
|
||||
type: String,
|
||||
default: '113'
|
||||
}
|
||||
});
|
||||
|
||||
const options = computed(() => {
|
||||
|
||||
let Humiture = R_D_EnvironmentStore.sensorData['temp_humi']?.filter(sensor => sensor.deptId === prop.deptId)||[]
|
||||
let obj = {
|
||||
bottom: prop.data.bottom,
|
||||
top: prop.data.top
|
||||
bottom: {
|
||||
"temp": -15,
|
||||
"humidity": 15,
|
||||
"name": "温湿度下限值"
|
||||
},
|
||||
top: {
|
||||
"temp": 45,
|
||||
"humidity": 75,
|
||||
"name": "温湿度上限值"
|
||||
}
|
||||
}
|
||||
//x轴数据
|
||||
let x = [];
|
||||
//y轴数据
|
||||
let y = { temp: [], humidity: [] };
|
||||
prop.data.Humiture.forEach((res) => {
|
||||
Humiture.forEach((res) => {
|
||||
x.push(res.name);
|
||||
y.temp.push(res.temp);
|
||||
y.humidity.push(res.humidity);
|
||||
@ -84,7 +79,7 @@ const options = computed(() => {
|
||||
yAxis: {
|
||||
type: "value",
|
||||
boundaryGap: [0, 0.01],
|
||||
name:'(°C/%RH)',
|
||||
name: '(°C/%RH)',
|
||||
axisLabel: {
|
||||
formatter: "{value}",
|
||||
},
|
||||
@ -232,6 +227,7 @@ const options = computed(() => {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 237px;
|
||||
|
@ -13,7 +13,7 @@
|
||||
fill="#2affff" p-id="1942"></path>
|
||||
</svg>
|
||||
<div class="text-label">
|
||||
<div class="label-left">{{ prop.public_list.devName }}</div>
|
||||
<div class="label-left">{{ prop.public_list.name }}</div>
|
||||
<div class="label-right"><i class="value" :style="{ color: checkCb(prop.public_list) }">{{
|
||||
prop.public_list.data }}</i> dB</div>
|
||||
</div>
|
||||
@ -33,7 +33,7 @@ const prop = defineProps({
|
||||
default: () => {
|
||||
return {
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e488",
|
||||
"devName": "公共区域1",
|
||||
"name": "公共区域1",
|
||||
"label": "noise-7",
|
||||
"place": null,
|
||||
"data": 0,
|
||||
@ -47,7 +47,7 @@ const prop = defineProps({
|
||||
return [
|
||||
{
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e488",
|
||||
"devName": "办公区2",
|
||||
"name": "办公区2",
|
||||
"label": "noise-7",
|
||||
"place": null,
|
||||
"data": 0,
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="progress-container">
|
||||
<div class="text-label">
|
||||
<div class="label-left">{{ prop.mdoelValue1.devName }}</div>
|
||||
<div class="label-left">{{ prop.mdoelValue1.name }}</div>
|
||||
<div class="label-right"><i class="value">{{ prop.mdoelValue1.data }}</i> dB</div>
|
||||
</div>
|
||||
<div class="progress">
|
||||
@ -18,7 +18,7 @@ const prop = defineProps({
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
devName: '办公区1噪音',
|
||||
name: '办公区1噪音',
|
||||
data: 10,
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,8 @@ const init = () => {
|
||||
boxHelperWrap = new BoxHelperWrap(viewer);
|
||||
|
||||
viewer.emitter.on(Event.dblclick.raycaster, (list: THREE.Intersection[]) => {
|
||||
console.log(list, 'list');
|
||||
|
||||
onMouseClick(list);
|
||||
});
|
||||
|
||||
@ -174,7 +176,6 @@ const initModel = () => {
|
||||
};
|
||||
|
||||
const planeAnimate = (texture: any): Animate => {
|
||||
console.log(texture, 'texture');
|
||||
texture.wrapS = THREE.RepeatWrapping;
|
||||
texture.wrapT = THREE.RepeatWrapping;
|
||||
const animateFn = {
|
||||
@ -272,9 +273,9 @@ const onMouseMove = (intersects: THREE.Intersection[]) => {
|
||||
// };
|
||||
findClickModel(selectedObject);
|
||||
|
||||
console.log(selectedObjectName,selectedObject, '--selectedObjectName---');
|
||||
// console.log(selectedObjectName,selectedObject, '--selectedObjectName---');
|
||||
const rack = findParent(selectedObject, checkIsRack);
|
||||
console.log(rack, '-------rack---------');
|
||||
// console.log(rack, '-------rack---------');
|
||||
if (rack) {
|
||||
|
||||
boxHelperWrap.attach(rack);
|
||||
|
@ -6,7 +6,7 @@
|
||||
<!-- prop.sensorData.status == 'true'?'#469DE9':'gray' -->
|
||||
|
||||
<div style="margin: 10px 0">{{prop.sensorData.list[i].status=== 'false' ? '——' :prop.sensorData.list[i].value + prop.sensorData.unit }}</div>
|
||||
<div>{{ prop.sensorData.list[i].name }}</div>
|
||||
<div style="text-align: center;">{{ prop.sensorData.list[i].name }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -10,27 +10,33 @@
|
||||
</div>
|
||||
<div class="left-content left-right" ref="leftContentRef">
|
||||
<Lr1 :data="avg_temp_humi.four" />
|
||||
<Lr2 :data="humi" />
|
||||
<Lr3 :public_list="public_noise" :office_list="office_noise" />
|
||||
<Lr2 :deptId="'113'" />
|
||||
<Lr3 :public_list="noiseDataList.four.public_noise" :office_list="noiseDataList.four.office_noise" />
|
||||
<Lr4 />
|
||||
</div>
|
||||
<div class="right-content left-right" ref="rightContentRef">
|
||||
<div class="right-content left-right" ref="rightContentRef">
|
||||
<Lr1 :data="avg_temp_humi.five" />
|
||||
<Lr2 :data="humi" />
|
||||
<Lr3 :public_list="public_noise" :office_list="office_noise" />
|
||||
<Lr2 :deptId="'114'" />
|
||||
<Lr3 :public_list="noiseDataList.five.public_noise" :office_list="noiseDataList.five.office_noise" />
|
||||
<Lr4 />
|
||||
</div>
|
||||
<div class="bottom-content" ref="bottomContentRef">
|
||||
|
||||
<ZdScrollBoard ref="devList" :config="zd_config" class="zd-scroll-board"/>
|
||||
</div>
|
||||
|
||||
<Sence />
|
||||
<ZdScrollBoard ref="devList" :config="zd_config" class="zd-scroll-board" />
|
||||
</div>
|
||||
<div class="checkboxlist">
|
||||
<el-radio-group v-model="radioGroup1" :fill="'#105F88'" size="large">
|
||||
<el-radio-button label="四层" value="四层"></el-radio-button>
|
||||
|
||||
<el-radio-button label="五层" value="五层"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<!-- <Sence /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ref, reactive, onMounted, computed, watch } from 'vue';
|
||||
import Sence from './component/Sence.vue';
|
||||
import Lr1 from './component/Lr1.vue';
|
||||
import Lr2 from './component/Lr2.vue';
|
||||
@ -38,25 +44,18 @@ import Lr3 from './component/Lr3.vue';
|
||||
import Lr4 from './component/Lr4.vue';
|
||||
import ZdScrollBoard from "@/components/ZdScrollBoard/index.vue";
|
||||
import SensorNumLoop from './component/SensorNumLoop.vue';
|
||||
import { getNoiseData, getTopData, getSensorDateHourByType } from '@/api/screen/R_D_Environment';
|
||||
import useR_D_EnvironmentStore from '@/store/modules/r_d_environment'
|
||||
import { getSensorByDept } from '@/api/screen/R_D_Environment';
|
||||
|
||||
|
||||
let R_D_EnvironmentStore = useR_D_EnvironmentStore()
|
||||
let deltaY = ref(0)
|
||||
let avg_temp_humi = reactive({
|
||||
four: {
|
||||
title: '研发中心四楼',
|
||||
temp: 25.5,
|
||||
humi: 60
|
||||
},
|
||||
five: {
|
||||
title: '研发中心五楼',
|
||||
temp: 25.5,
|
||||
humi: 60
|
||||
}
|
||||
let avg_temp_humi = computed(() => {
|
||||
return R_D_EnvironmentStore.getLayerData
|
||||
})
|
||||
let noiseDataList = computed(()=>{
|
||||
return R_D_EnvironmentStore.getNoiseData
|
||||
})
|
||||
let noiseDataList = ref()
|
||||
let public_noise = ref({})
|
||||
let office_noise = ref([])
|
||||
let humi = ref({
|
||||
"Humiture": [
|
||||
{
|
||||
@ -134,283 +133,279 @@ let humi = ref({
|
||||
"name": "温湿度下限值"
|
||||
}
|
||||
})
|
||||
let sensor_list = reactive([
|
||||
let sensor_list = computed(()=>{
|
||||
let sensorData = R_D_EnvironmentStore.sensorData
|
||||
return [
|
||||
{
|
||||
|
||||
component: 'SvgWendu',
|
||||
unit: '℃',
|
||||
type: 'AirTemp_Reg',
|
||||
limit: 40,
|
||||
list: [
|
||||
{
|
||||
|
||||
id: '',
|
||||
name: '温度1',
|
||||
value: 20,
|
||||
status: "true"
|
||||
},
|
||||
{
|
||||
id: '',
|
||||
name: '温度2',
|
||||
value: 20,
|
||||
status: "true"
|
||||
list: sensorData['temp_humi']?.map(sensor => {
|
||||
return {
|
||||
id: sensor.deviceId,
|
||||
name: sensor.name,
|
||||
value: sensor.temp,
|
||||
status: sensor.status
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
component: 'SvgShidu',
|
||||
unit: '%RH',
|
||||
type: 'AirHumi_Reg',
|
||||
limit: 90,
|
||||
list: [
|
||||
{
|
||||
|
||||
id: '',
|
||||
name: '湿度1',
|
||||
value: 20,
|
||||
status: "true"
|
||||
},
|
||||
{
|
||||
id: '',
|
||||
name: '湿度2',
|
||||
value: 100,
|
||||
status: "true"
|
||||
list: sensorData['temp_humi']?.map(sensor => {
|
||||
return {
|
||||
id: sensor.deviceId,
|
||||
name: sensor.name,
|
||||
value: sensor.humidity,
|
||||
status: sensor.status
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
component: 'SvgJiaquan',
|
||||
unit: 'mg/m³',
|
||||
type: 'CH2O',
|
||||
limit: 0.08,
|
||||
list: [
|
||||
{
|
||||
|
||||
id: '',
|
||||
name: '甲醛1',
|
||||
value: 20,
|
||||
status: "true"
|
||||
},
|
||||
{
|
||||
id: '',
|
||||
name: '甲醛2',
|
||||
value: 20,
|
||||
status: "true"
|
||||
list: sensorData['TVOC_CH2O']?.filter(sensor => sensor.type === 'CH2O').map(sensor => {
|
||||
return {
|
||||
id: sensor.deviceId,
|
||||
name: sensor.name,
|
||||
value: sensor.data,
|
||||
status: sensor.status
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
component: 'SvgTVOC',
|
||||
unit: 'mg/m³',
|
||||
type: 'TVOC',
|
||||
limit: 0.5,
|
||||
list: [
|
||||
{
|
||||
|
||||
id: '',
|
||||
name: 'TVOC1',
|
||||
value: 20,
|
||||
status: "true"
|
||||
},
|
||||
{
|
||||
id: '',
|
||||
name: 'TVOC2',
|
||||
value: 20,
|
||||
status: "true"
|
||||
list: sensorData['TVOC_CH2O']?.filter(sensor => sensor.type === 'TVOC').map(sensor => {
|
||||
return {
|
||||
id: sensor.deviceId,
|
||||
name: sensor.name,
|
||||
value: sensor.data,
|
||||
status: sensor.status
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
component: 'SvgPm25',
|
||||
unit: 'mg/m³',
|
||||
type: 'HIGH_PM25_Reg',
|
||||
limit: 30,
|
||||
list: [
|
||||
{
|
||||
|
||||
id: '',
|
||||
name: 'PM2.51',
|
||||
value: 20,
|
||||
status: "false"
|
||||
},
|
||||
{
|
||||
id: '',
|
||||
name: 'PM2.52',
|
||||
value: 20,
|
||||
status: "true"
|
||||
list: sensorData['dust']?.filter(sensor => sensor.type === 'HIGH_PM25_Reg').map(sensor => {
|
||||
return {
|
||||
id: sensor.deviceId,
|
||||
name: sensor.name,
|
||||
value: sensor.data,
|
||||
status: sensor.status
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
component: 'SvgPm10',
|
||||
unit: 'mg/m³',
|
||||
type: 'HIGH_PM10_Reg',
|
||||
limit: 30,
|
||||
list: [
|
||||
{
|
||||
|
||||
id: '',
|
||||
name: 'PM101',
|
||||
value: 20,
|
||||
status: "true"
|
||||
},
|
||||
{
|
||||
id: '',
|
||||
name: 'PM102',
|
||||
value: 20,
|
||||
status: "true"
|
||||
list: sensorData['dust']?.filter(sensor => sensor.type === 'HIGH_PM10_Reg').map(sensor => {
|
||||
return {
|
||||
id: sensor.deviceId,
|
||||
name: sensor.name,
|
||||
value: sensor.data,
|
||||
status: sensor.status
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
component: 'SvgZaosheng',
|
||||
unit: 'dB',
|
||||
type: 'Noise_Reg',
|
||||
limit: 85,
|
||||
list: [
|
||||
{
|
||||
|
||||
id: '',
|
||||
name: '噪音1',
|
||||
value: 20,
|
||||
status: "true"
|
||||
},
|
||||
{
|
||||
id: '',
|
||||
name: '噪音2',
|
||||
value: 20,
|
||||
status: "true"
|
||||
list: sensorData['noise']?.map(sensor => {
|
||||
return {
|
||||
id: sensor.deviceId,
|
||||
name: sensor.name,
|
||||
value: sensor.data,
|
||||
status: sensor.status
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
component: 'SvgYanwu',
|
||||
unit: 'mg/m³',
|
||||
type: 'Smoke_Reg',
|
||||
limit: 100,
|
||||
list: [
|
||||
{
|
||||
|
||||
id: '',
|
||||
name: '烟雾1',
|
||||
value: 20,
|
||||
status: "true"
|
||||
},
|
||||
{
|
||||
id: '',
|
||||
name: '烟雾2',
|
||||
value: 20,
|
||||
status: "true"
|
||||
list: sensorData['Smoke']?.map(sensor => {
|
||||
return {
|
||||
id: sensor.deviceId,
|
||||
name: sensor.name,
|
||||
value: sensor.data,
|
||||
status: sensor.status
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
])
|
||||
|
||||
]
|
||||
})
|
||||
const radioGroup1 = ref('四层')
|
||||
let zd_config = ref({
|
||||
header: ['报警时间', '报警内容', '持续时长','报警次数'],
|
||||
rowNum: 2,
|
||||
headerHeight: 50,
|
||||
headerBGC: 'transparent',
|
||||
oddRowBGC: 'transparent',
|
||||
header: ['报警时间', '报警内容', '持续时长', '报警设备'],
|
||||
rowNum: 2,
|
||||
headerHeight: 50,
|
||||
headerBGC: 'transparent',
|
||||
oddRowBGC: 'transparent',
|
||||
evenRowBGC: 'transparent',
|
||||
columnWidth: [179, 179, 179, 179],
|
||||
data: [
|
||||
['行1列1', '行1列2', '行1列3','行1列4'],
|
||||
['行2列1', '行2列2', '行2列3','行2列4'],
|
||||
['行3列1', '行3列2', '行3列3','行3列4'],
|
||||
['行4列1', '行4列2', '行4列3','行4列4'],
|
||||
]
|
||||
})
|
||||
function getNoiseDataList() {
|
||||
noiseDataList.value = [
|
||||
{
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e488",
|
||||
"devName": "公共区域",
|
||||
"label": "noise-7",
|
||||
"place": null,
|
||||
"data": 19,
|
||||
"status": 0
|
||||
},
|
||||
{
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e489",
|
||||
"devName": "办公区6",
|
||||
"label": "noise-6",
|
||||
"place": null,
|
||||
"data": 90,
|
||||
"status": 0
|
||||
},
|
||||
{
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e490",
|
||||
"devName": "办公区5",
|
||||
"label": "noise-5",
|
||||
"place": null,
|
||||
"data": 22,
|
||||
"status": 0
|
||||
},
|
||||
{
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e491",
|
||||
"devName": "办公区4",
|
||||
"label": "noise-4",
|
||||
"place": null,
|
||||
"data": 22,
|
||||
"status": 0
|
||||
},
|
||||
{
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e491",
|
||||
"devName": "办公区3",
|
||||
"label": "noise-3",
|
||||
"place": null,
|
||||
"data": 21,
|
||||
"status": 0
|
||||
},
|
||||
{
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e492",
|
||||
"devName": "办公区2",
|
||||
"label": "noise-2",
|
||||
"place": null,
|
||||
"data": 24,
|
||||
"status": 0
|
||||
},
|
||||
{
|
||||
"devId": "48a2ec70-a60c-11ef-91f3-abd609c7e493",
|
||||
"devName": "办公区1",
|
||||
"label": "noise-1",
|
||||
"place": null,
|
||||
"data": 25,
|
||||
"status": 0
|
||||
},
|
||||
data: [
|
||||
['行1列1', '行1列2', '行1列3', '行1列4'],
|
||||
['行2列1', '行2列2', '行2列3', '行2列4'],
|
||||
['行3列1', '行3列2', '行3列3', '行3列4'],
|
||||
['行4列1', '行4列2', '行4列3', '行4列4'],
|
||||
]
|
||||
public_noise.value = noiseDataList.value.find(item => item.devName === '公共区域')
|
||||
office_noise.value = noiseDataList.value.filter(item => item.devName !== '公共区域')
|
||||
})
|
||||
function reqSensorByDept() {
|
||||
getSensorByDept('113,114').then(res => {
|
||||
if (res.code === 200) {
|
||||
let sensorData = res.data
|
||||
let temp_humi = sensorData.temp_humi
|
||||
let temp = []
|
||||
temp_humi.map(item => {
|
||||
let index = temp.find(item2 => { return item2.deviceId == item.deviceId })
|
||||
if (!index) {
|
||||
if (item.type === 'AirHumi_Reg') {
|
||||
temp.push({
|
||||
deviceId: item.deviceId,
|
||||
humidity: item.data,
|
||||
name: item.name,
|
||||
label: item.label,
|
||||
temp: '',
|
||||
deptId: item.deptId,
|
||||
deptName: item.deptName,
|
||||
status: item.status
|
||||
})
|
||||
|
||||
} else if (item.type === 'AirTemp_Reg') {
|
||||
temp.push({
|
||||
deviceId: item.deviceId,
|
||||
humidity: '',
|
||||
name: item.name,
|
||||
label: item.label,
|
||||
temp: item.data,
|
||||
deptId: item.deptId,
|
||||
deptName: item.deptName,
|
||||
status: item.status
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if (item.type === 'AirHumi_Reg') {
|
||||
index.humidity = item.data
|
||||
} else if (item.type === 'AirTemp_Reg') {
|
||||
index.temp = item.data
|
||||
}
|
||||
}
|
||||
})
|
||||
sensorData.temp_humi = temp
|
||||
R_D_EnvironmentStore.sensorData = sensorData
|
||||
// noiseDataList.value = res.data
|
||||
// public_noise.value = noiseDataList.value.find(item => item.devName === '公共区域')
|
||||
// office_noise.value = noiseDataList.value.filter(item => item.devName !== '公共区域')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取顶部数据
|
||||
// function getTopDataList() {
|
||||
// getTopData().then(res => {
|
||||
// if (res.code === 200) {
|
||||
// res.data.forEach(item => {
|
||||
// let index = sensor_list.findIndex(sensor => sensor.type === item.type)
|
||||
// sensor_list[index].value = item.data
|
||||
// sensor_list[index].id = item.id
|
||||
// sensor_list[index].status = item.status
|
||||
// sensor_list[index].limit = item.limit
|
||||
// if (item.type === 'HIGH_PM25_Reg') {
|
||||
// dustData.pm25 = item.data
|
||||
// } else if (item.type === 'HIGH_PM10_Reg') {
|
||||
// dustData.pm10 = item.data
|
||||
|
||||
// }
|
||||
//socket
|
||||
function getWebsocket(val) {
|
||||
try {
|
||||
let data = JSON.parse(val);
|
||||
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
if (data.type == "HUMI_TEMP") {
|
||||
let obj = data.msg;
|
||||
if (obj.hasOwnProperty('temp')) {
|
||||
let index = sensor_list.findIndex(sensor => sensor.type === 'AirTemp_Reg' && sensor.id === obj.temp.devId)
|
||||
if (index !== -1) {
|
||||
sensor_list[index].value = obj.temp.value
|
||||
sensor_list[index].status = "true"
|
||||
}
|
||||
|
||||
}
|
||||
if (obj.hasOwnProperty('humi')) {
|
||||
let index = sensor_list.findIndex(sensor => sensor.type === 'AirHumi_Reg' && sensor.id === obj.humi.devId)
|
||||
if (index !== -1) {
|
||||
sensor_list[index].value = obj.humi.value
|
||||
sensor_list[index].status = "true"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (data.type == "TVOC_CH2O") {
|
||||
let obj = data.msg;
|
||||
if (obj.hasOwnProperty('CH2O')) {
|
||||
let index = sensor_list.findIndex(sensor => sensor.type === 'CH2O' && sensor.id === obj.CH2O.devId)
|
||||
if (index !== -1) {
|
||||
sensor_list[index].value = obj.CH2O.value
|
||||
sensor_list[index].status = "true"
|
||||
}
|
||||
|
||||
}
|
||||
if (obj.hasOwnProperty('TVOC')) {
|
||||
let index = sensor_list.findIndex(sensor => sensor.type === 'TVOC' && sensor.id === obj.TVOC.devId)
|
||||
if (index !== -1) {
|
||||
sensor_list[index].value = obj.TVOC.value
|
||||
sensor_list[index].status = "true"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//粉尘
|
||||
if (data.type == "dust") {
|
||||
let obj = data.msg;
|
||||
|
||||
|
||||
let index_pm25 = sensor_list.findIndex(sensor => sensor.type === 'HIGH_PM25_Reg' && sensor.id === obj.devId)
|
||||
let index_pm10 = sensor_list.findIndex(sensor => sensor.type === 'HIGH_PM10_Reg' && sensor.id === obj.devId)
|
||||
if (index_pm25 !== -1) {
|
||||
sensor_list[index_pm25].value = obj.pm25
|
||||
sensor_list[index_pm25].status = "true"
|
||||
dustData.pm25 = obj.pm25
|
||||
}
|
||||
if (index_pm10 !== -1) {
|
||||
sensor_list[index_pm10].value = obj.pm10
|
||||
sensor_list[index_pm10].status = "true"
|
||||
dustData.pm10 = obj.pm10
|
||||
}
|
||||
}
|
||||
//噪音
|
||||
if (data.type === "NOISE") {
|
||||
let obj = data.msg;
|
||||
let list_index = noiseDataList.value.findIndex(item => item.devId === obj.noise.devId)
|
||||
if (list_index !== -1) {
|
||||
noiseDataList.value[list_index].data = obj.noise.value
|
||||
} else {
|
||||
let index = sensor_list.findIndex(sensor => sensor.type === 'Noise_Reg' && sensor.id === obj.noise.devId)
|
||||
if (index !== -1) {
|
||||
sensor_list[index].value = obj.noise.value
|
||||
sensor_list[index].status = "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
function errWebsocket(val) {
|
||||
// console.log(val);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getNoiseDataList()
|
||||
reqSensorByDept()
|
||||
window.addEventListener('wheel', function (event) {
|
||||
deltaY.value += event.deltaY
|
||||
if (deltaY.value <= -500 && deltaY.value >= -1000) {
|
||||
@ -540,15 +535,27 @@ onMounted(() => {
|
||||
background-position: bottom, 50% 100%;
|
||||
background-repeat: no-repeat, no-repeat;
|
||||
transition: transform 1s;
|
||||
|
||||
.zd-scroll-board {
|
||||
width: 716px;
|
||||
height: 120px,;
|
||||
height: 120px, ;
|
||||
position: absolute;
|
||||
top: 28px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.checkboxlist {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 60px;
|
||||
z-index: 999;
|
||||
|
||||
:deep(.el-checkbox-button__inner) {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user