update
This commit is contained in:
parent
3550242cc9
commit
56b07ac5ed
@ -74,6 +74,16 @@ const useR_D_EnvironmentStore = defineStore(
|
|||||||
"deptId": "113",
|
"deptId": "113",
|
||||||
"deptName": "4楼",
|
"deptName": "4楼",
|
||||||
"status": false
|
"status": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"deviceId": "1111",
|
||||||
|
"humidity": "0",
|
||||||
|
"name": "温湿度监测2",
|
||||||
|
"label": "temp_humi_2",
|
||||||
|
"temp": "0",
|
||||||
|
"deptId": "114",
|
||||||
|
"deptName": "5楼",
|
||||||
|
"status": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"TVOC_CH2O": [
|
"TVOC_CH2O": [
|
||||||
@ -126,10 +136,8 @@ const useR_D_EnvironmentStore = defineStore(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
let sensorData = state.sensorData
|
let sensorData = state.sensorData
|
||||||
console.log(sensorData, '123');
|
|
||||||
|
|
||||||
if (sensorData['temp_humi'] && sensorData['temp_humi'].length > 0) {
|
if (sensorData['temp_humi'] && sensorData['temp_humi'].length > 0) {
|
||||||
console.log(sensorData['temp_humi'], '12113');
|
|
||||||
let fourTemp = 0
|
let fourTemp = 0
|
||||||
let fourHumi = 0
|
let fourHumi = 0
|
||||||
let fourCount = 0
|
let fourCount = 0
|
||||||
|
@ -27,14 +27,14 @@ export const connectWebsocket = (url = null, agentData, successCallback, errCall
|
|||||||
if (import.meta.env.VITE_APP_ENV == "production") {
|
if (import.meta.env.VITE_APP_ENV == "production") {
|
||||||
wsUrl = `ws://${window.document.location.hostname}:9018/`
|
wsUrl = `ws://${window.document.location.hostname}:9018/`
|
||||||
} else {
|
} else {
|
||||||
console.log(import.meta.env,'11111111');
|
//console.log(import.meta.env,'11111111');
|
||||||
wsUrl = import.meta.env.VITE_APP_WS_API
|
wsUrl = import.meta.env.VITE_APP_WS_API
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
wsUrl = url
|
wsUrl = url
|
||||||
}
|
}
|
||||||
console.log('socket地址:',wsUrl);
|
//console.log('socket地址:',wsUrl);
|
||||||
createWebSoket()
|
createWebSoket()
|
||||||
messageCallback = successCallback
|
messageCallback = successCallback
|
||||||
errorCallback = errCallback
|
errorCallback = errCallback
|
||||||
|
@ -15,12 +15,12 @@ import u918 from './../image/u918.png';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const prop = defineProps({
|
const prop = defineProps({
|
||||||
option: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return {
|
return {
|
||||||
xData: [],
|
ch2o: [],
|
||||||
seriesData: [],
|
tvoc: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -31,9 +31,9 @@ const options = computed(() => {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
legend: {
|
// legend: {
|
||||||
data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
|
// data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
|
||||||
},
|
// },
|
||||||
grid: {
|
grid: {
|
||||||
left: '3%',
|
left: '3%',
|
||||||
right: '4%',
|
right: '4%',
|
||||||
@ -42,9 +42,8 @@ const options = computed(() => {
|
|||||||
},
|
},
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'time',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value'
|
type: 'value'
|
||||||
@ -56,7 +55,7 @@ const options = computed(() => {
|
|||||||
areaStyle: {
|
areaStyle: {
|
||||||
opacity: 0.3
|
opacity: 0.3
|
||||||
},
|
},
|
||||||
data: [120, 132, 101, 134, 90, 230, 210]
|
data: prop.data.ch2o
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'TVOC',
|
name: 'TVOC',
|
||||||
@ -64,7 +63,7 @@ const options = computed(() => {
|
|||||||
areaStyle: {
|
areaStyle: {
|
||||||
opacity: 0.3
|
opacity: 0.3
|
||||||
},
|
},
|
||||||
data: [220, 182, 191, 234, 290, 330, 310]
|
data: prop.data.tvoc
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -12,13 +12,13 @@
|
|||||||
<Lr1 :data="avg_temp_humi.four" />
|
<Lr1 :data="avg_temp_humi.four" />
|
||||||
<Lr2 :deptId="'113'" />
|
<Lr2 :deptId="'113'" />
|
||||||
<Lr3 :public_list="noiseDataList.four.public_noise" :office_list="noiseDataList.four.office_noise" />
|
<Lr3 :public_list="noiseDataList.four.public_noise" :office_list="noiseDataList.four.office_noise" />
|
||||||
<Lr4 />
|
<Lr4 :data="TVOC_CH2O['4f']" />
|
||||||
</div>
|
</div>
|
||||||
<div class="right-content left-right" ref="rightContentRef">
|
<div class="right-content left-right" ref="rightContentRef">
|
||||||
<Lr1 :data="avg_temp_humi.five" />
|
<Lr1 :data="avg_temp_humi.five" />
|
||||||
<Lr2 :deptId="'114'" />
|
<Lr2 :deptId="'114'" />
|
||||||
<Lr3 :public_list="noiseDataList.five.public_noise" :office_list="noiseDataList.five.office_noise" />
|
<Lr3 :public_list="noiseDataList.five.public_noise" :office_list="noiseDataList.five.office_noise" />
|
||||||
<Lr4 />
|
<Lr4 :data="TVOC_CH2O['5f']" />
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-content" ref="bottomContentRef">
|
<div class="bottom-content" ref="bottomContentRef">
|
||||||
|
|
||||||
@ -45,6 +45,7 @@ import Lr4 from './component/Lr4.vue';
|
|||||||
import ZdScrollBoard from "@/components/ZdScrollBoard/index.vue";
|
import ZdScrollBoard from "@/components/ZdScrollBoard/index.vue";
|
||||||
import SensorNumLoop from './component/SensorNumLoop.vue';
|
import SensorNumLoop from './component/SensorNumLoop.vue';
|
||||||
import useR_D_EnvironmentStore from '@/store/modules/r_d_environment'
|
import useR_D_EnvironmentStore from '@/store/modules/r_d_environment'
|
||||||
|
import { connectWebsocket, closeWebsocket} from "@/utils/websocket";
|
||||||
import { getSensorByDept } from '@/api/screen/R_D_Environment';
|
import { getSensorByDept } from '@/api/screen/R_D_Environment';
|
||||||
|
|
||||||
|
|
||||||
@ -53,203 +54,136 @@ let deltaY = ref(0)
|
|||||||
let avg_temp_humi = computed(() => {
|
let avg_temp_humi = computed(() => {
|
||||||
return R_D_EnvironmentStore.getLayerData
|
return R_D_EnvironmentStore.getLayerData
|
||||||
})
|
})
|
||||||
let noiseDataList = computed(()=>{
|
let noiseDataList = computed(() => {
|
||||||
return R_D_EnvironmentStore.getNoiseData
|
return R_D_EnvironmentStore.getNoiseData
|
||||||
})
|
})
|
||||||
let humi = ref({
|
let TVOC_CH2O = reactive({
|
||||||
"Humiture": [
|
'4f': {
|
||||||
{
|
ch2o: [],
|
||||||
"devId": "eb98cb70-158f-11ee-b4df-a9653aef169c",
|
tvoc: []
|
||||||
"name": "服装军团",
|
|
||||||
"temp": "15.4",
|
|
||||||
"humidity": "14.6",
|
|
||||||
"status": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"devId": "50633690-158f-11ee-b4df-a9653aef169c",
|
|
||||||
"name": "家纺军团",
|
|
||||||
"temp": "16.3",
|
|
||||||
"humidity": "54.1",
|
|
||||||
"status": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"devId": "e07dee00-158f-11ee-b4df-a9653aef169c",
|
|
||||||
"name": "医防军团",
|
|
||||||
"temp": "15.2",
|
|
||||||
"humidity": "12.3",
|
|
||||||
"status": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"devId": "5b01df20-158f-11ee-b4df-a9653aef169c",
|
|
||||||
"name": "配套中心",
|
|
||||||
"temp": "11.4",
|
|
||||||
"humidity": "20",
|
|
||||||
"status": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"devId": "c524cfd0-4bb2-11ee-864d-e941de71fb47",
|
|
||||||
"name": "东气泵房",
|
|
||||||
"temp": "26.9",
|
|
||||||
"humidity": "10",
|
|
||||||
"status": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"devId": "e7868a00-4bb2-11ee-864d-e941de71fb47",
|
|
||||||
"name": "西气泵房",
|
|
||||||
"temp": "34.4",
|
|
||||||
"humidity": "6",
|
|
||||||
"status": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"devId": "7cd36740-158f-11ee-b4df-a9653aef169c",
|
|
||||||
"name": "东莞分公司",
|
|
||||||
"temp": "27.7",
|
|
||||||
"humidity": "38.9",
|
|
||||||
"status": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"devId": "c502b660-158f-11ee-b4df-a9653aef169c",
|
|
||||||
"name": "东莞分公司",
|
|
||||||
"temp": "29.5",
|
|
||||||
"humidity": "56.3",
|
|
||||||
"status": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"devId": "57d4bbc0-1bc9-11ee-93b4-8d0afc6a8fe9",
|
|
||||||
"name": "微工厂",
|
|
||||||
"temp": "14.7",
|
|
||||||
"humidity": "17.1",
|
|
||||||
"status": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"top": {
|
|
||||||
"temp": 45,
|
|
||||||
"humidity": 75,
|
|
||||||
"name": "温湿度上限值"
|
|
||||||
},
|
},
|
||||||
"bottom": {
|
'5f': {
|
||||||
"temp": -15,
|
ch2o: [],
|
||||||
"humidity": 15,
|
tvoc: []
|
||||||
"name": "温湿度下限值"
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
let sensor_list = computed(()=>{
|
let sensor_list = computed(() => {
|
||||||
let sensorData = R_D_EnvironmentStore.sensorData
|
let sensorData = R_D_EnvironmentStore.sensorData
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|
||||||
component: 'SvgWendu',
|
component: 'SvgWendu',
|
||||||
unit: '℃',
|
unit: '℃',
|
||||||
type: 'AirTemp_Reg',
|
type: 'AirTemp_Reg',
|
||||||
limit: 40,
|
limit: 40,
|
||||||
list: sensorData['temp_humi']?.map(sensor => {
|
list: sensorData['temp_humi']?.map(sensor => {
|
||||||
return {
|
return {
|
||||||
id: sensor.deviceId,
|
id: sensor.deviceId,
|
||||||
name: sensor.name,
|
name: sensor.name,
|
||||||
value: sensor.temp,
|
value: sensor.temp,
|
||||||
status: sensor.status
|
status: sensor.status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'SvgShidu',
|
component: 'SvgShidu',
|
||||||
unit: '%RH',
|
unit: '%RH',
|
||||||
type: 'AirHumi_Reg',
|
type: 'AirHumi_Reg',
|
||||||
limit: 90,
|
limit: 90,
|
||||||
list: sensorData['temp_humi']?.map(sensor => {
|
list: sensorData['temp_humi']?.map(sensor => {
|
||||||
return {
|
return {
|
||||||
id: sensor.deviceId,
|
id: sensor.deviceId,
|
||||||
name: sensor.name,
|
name: sensor.name,
|
||||||
value: sensor.humidity,
|
value: sensor.humidity,
|
||||||
status: sensor.status
|
status: sensor.status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'SvgJiaquan',
|
component: 'SvgJiaquan',
|
||||||
unit: 'mg/m³',
|
unit: 'mg/m³',
|
||||||
type: 'CH2O',
|
type: 'CH2O',
|
||||||
limit: 0.08,
|
limit: 0.08,
|
||||||
list: sensorData['TVOC_CH2O']?.filter(sensor => sensor.type === 'CH2O').map(sensor => {
|
list: sensorData['TVOC_CH2O']?.filter(sensor => sensor.type === 'CH2O').map(sensor => {
|
||||||
return {
|
return {
|
||||||
id: sensor.deviceId,
|
id: sensor.deviceId,
|
||||||
name: sensor.name,
|
name: sensor.name,
|
||||||
value: sensor.data,
|
value: sensor.data,
|
||||||
status: sensor.status
|
status: sensor.status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'SvgTVOC',
|
component: 'SvgTVOC',
|
||||||
unit: 'mg/m³',
|
unit: 'mg/m³',
|
||||||
type: 'TVOC',
|
type: 'TVOC',
|
||||||
limit: 0.5,
|
limit: 0.5,
|
||||||
list: sensorData['TVOC_CH2O']?.filter(sensor => sensor.type === 'TVOC').map(sensor => {
|
list: sensorData['TVOC_CH2O']?.filter(sensor => sensor.type === 'TVOC').map(sensor => {
|
||||||
return {
|
return {
|
||||||
id: sensor.deviceId,
|
id: sensor.deviceId,
|
||||||
name: sensor.name,
|
name: sensor.name,
|
||||||
value: sensor.data,
|
value: sensor.data,
|
||||||
status: sensor.status
|
status: sensor.status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'SvgPm25',
|
component: 'SvgPm25',
|
||||||
unit: 'mg/m³',
|
unit: 'mg/m³',
|
||||||
type: 'HIGH_PM25_Reg',
|
type: 'HIGH_PM25_Reg',
|
||||||
limit: 30,
|
limit: 30,
|
||||||
list: sensorData['dust']?.filter(sensor => sensor.type === 'HIGH_PM25_Reg').map(sensor => {
|
list: sensorData['dust']?.filter(sensor => sensor.type === 'HIGH_PM25_Reg').map(sensor => {
|
||||||
return {
|
return {
|
||||||
id: sensor.deviceId,
|
id: sensor.deviceId,
|
||||||
name: sensor.name,
|
name: sensor.name,
|
||||||
value: sensor.data,
|
value: sensor.data,
|
||||||
status: sensor.status
|
status: sensor.status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'SvgPm10',
|
component: 'SvgPm10',
|
||||||
unit: 'mg/m³',
|
unit: 'mg/m³',
|
||||||
type: 'HIGH_PM10_Reg',
|
type: 'HIGH_PM10_Reg',
|
||||||
limit: 30,
|
limit: 30,
|
||||||
list: sensorData['dust']?.filter(sensor => sensor.type === 'HIGH_PM10_Reg').map(sensor => {
|
list: sensorData['dust']?.filter(sensor => sensor.type === 'HIGH_PM10_Reg').map(sensor => {
|
||||||
return {
|
return {
|
||||||
id: sensor.deviceId,
|
id: sensor.deviceId,
|
||||||
name: sensor.name,
|
name: sensor.name,
|
||||||
value: sensor.data,
|
value: sensor.data,
|
||||||
status: sensor.status
|
status: sensor.status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'SvgZaosheng',
|
component: 'SvgZaosheng',
|
||||||
unit: 'dB',
|
unit: 'dB',
|
||||||
type: 'Noise_Reg',
|
type: 'Noise_Reg',
|
||||||
limit: 85,
|
limit: 85,
|
||||||
list: sensorData['noise']?.map(sensor => {
|
list: sensorData['noise']?.map(sensor => {
|
||||||
return {
|
return {
|
||||||
id: sensor.deviceId,
|
id: sensor.deviceId,
|
||||||
name: sensor.name,
|
name: sensor.name,
|
||||||
value: sensor.data,
|
value: sensor.data,
|
||||||
status: sensor.status
|
status: sensor.status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'SvgYanwu',
|
component: 'SvgYanwu',
|
||||||
unit: 'mg/m³',
|
unit: 'mg/m³',
|
||||||
type: 'Smoke_Reg',
|
type: 'Smoke_Reg',
|
||||||
limit: 100,
|
limit: 100,
|
||||||
list: sensorData['Smoke']?.map(sensor => {
|
list: sensorData['Smoke']?.map(sensor => {
|
||||||
return {
|
return {
|
||||||
id: sensor.deviceId,
|
id: sensor.deviceId,
|
||||||
name: sensor.name,
|
name: sensor.name,
|
||||||
value: sensor.data,
|
value: sensor.data,
|
||||||
status: sensor.status
|
status: sensor.status
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
const radioGroup1 = ref('四层')
|
const radioGroup1 = ref('四层')
|
||||||
let zd_config = ref({
|
let zd_config = ref({
|
||||||
@ -272,6 +206,7 @@ function reqSensorByDept() {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
let sensorData = res.data
|
let sensorData = res.data
|
||||||
let temp_humi = sensorData.temp_humi
|
let temp_humi = sensorData.temp_humi
|
||||||
|
let TVOC_CH2O = sensorData.TVOC_CH2O
|
||||||
let temp = []
|
let temp = []
|
||||||
temp_humi.map(item => {
|
temp_humi.map(item => {
|
||||||
let index = temp.find(item2 => { return item2.deviceId == item.deviceId })
|
let index = temp.find(item2 => { return item2.deviceId == item.deviceId })
|
||||||
@ -308,6 +243,23 @@ function reqSensorByDept() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
let now = +new Date()
|
||||||
|
TVOC_CH2O.map(item => {
|
||||||
|
if (item.deptId == '113') {
|
||||||
|
if (item.type === 'CH2O') {
|
||||||
|
TVOC_CH2O['4f'].ch2o.push([now,item.data])
|
||||||
|
} else if (item.type === 'TVOC') {
|
||||||
|
TVOC_CH2O['4f'].tvoc.push([now,item.data])
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if(item.deptId == '114') {
|
||||||
|
if (item.type === 'CH2O') {
|
||||||
|
TVOC_CH2O['5f'].ch2o.push([now,item.data])
|
||||||
|
} else if (item.type === 'TVOC') {
|
||||||
|
TVOC_CH2O['5f'].tvoc.push([now,item.data])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
sensorData.temp_humi = temp
|
sensorData.temp_humi = temp
|
||||||
R_D_EnvironmentStore.sensorData = sensorData
|
R_D_EnvironmentStore.sensorData = sensorData
|
||||||
// noiseDataList.value = res.data
|
// noiseDataList.value = res.data
|
||||||
@ -426,6 +378,7 @@ onMounted(() => {
|
|||||||
// deltaY.value = 0
|
// deltaY.value = 0
|
||||||
// }
|
// }
|
||||||
}, { passive: false });
|
}, { passive: false });
|
||||||
|
//connectWebsocket('','',getWebsocket, errWebsocket)
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user