update
This commit is contained in:
parent
3550242cc9
commit
56b07ac5ed
@ -74,6 +74,16 @@ const useR_D_EnvironmentStore = defineStore(
|
||||
"deptId": "113",
|
||||
"deptName": "4楼",
|
||||
"status": false
|
||||
},
|
||||
{
|
||||
"deviceId": "1111",
|
||||
"humidity": "0",
|
||||
"name": "温湿度监测2",
|
||||
"label": "temp_humi_2",
|
||||
"temp": "0",
|
||||
"deptId": "114",
|
||||
"deptName": "5楼",
|
||||
"status": false
|
||||
}
|
||||
],
|
||||
"TVOC_CH2O": [
|
||||
@ -126,10 +136,8 @@ const useR_D_EnvironmentStore = defineStore(
|
||||
},
|
||||
}
|
||||
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
|
||||
|
@ -27,14 +27,14 @@ export const connectWebsocket = (url = null, agentData, successCallback, errCall
|
||||
if (import.meta.env.VITE_APP_ENV == "production") {
|
||||
wsUrl = `ws://${window.document.location.hostname}:9018/`
|
||||
} else {
|
||||
console.log(import.meta.env,'11111111');
|
||||
//console.log(import.meta.env,'11111111');
|
||||
wsUrl = import.meta.env.VITE_APP_WS_API
|
||||
}
|
||||
|
||||
} else {
|
||||
wsUrl = url
|
||||
}
|
||||
console.log('socket地址:',wsUrl);
|
||||
//console.log('socket地址:',wsUrl);
|
||||
createWebSoket()
|
||||
messageCallback = successCallback
|
||||
errorCallback = errCallback
|
||||
|
@ -15,12 +15,12 @@ import u918 from './../image/u918.png';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const prop = defineProps({
|
||||
option: {
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
xData: [],
|
||||
seriesData: [],
|
||||
ch2o: [],
|
||||
tvoc: []
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -31,9 +31,9 @@ const options = computed(() => {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
|
||||
},
|
||||
// legend: {
|
||||
// data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
|
||||
// },
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
@ -42,9 +42,8 @@ const options = computed(() => {
|
||||
},
|
||||
backgroundColor: 'transparent',
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
type: 'time',
|
||||
boundaryGap: false,
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
@ -56,7 +55,7 @@ const options = computed(() => {
|
||||
areaStyle: {
|
||||
opacity: 0.3
|
||||
},
|
||||
data: [120, 132, 101, 134, 90, 230, 210]
|
||||
data: prop.data.ch2o
|
||||
},
|
||||
{
|
||||
name: 'TVOC',
|
||||
@ -64,7 +63,7 @@ const options = computed(() => {
|
||||
areaStyle: {
|
||||
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" />
|
||||
<Lr2 :deptId="'113'" />
|
||||
<Lr3 :public_list="noiseDataList.four.public_noise" :office_list="noiseDataList.four.office_noise" />
|
||||
<Lr4 />
|
||||
<Lr4 :data="TVOC_CH2O['4f']" />
|
||||
</div>
|
||||
<div class="right-content left-right" ref="rightContentRef">
|
||||
<Lr1 :data="avg_temp_humi.five" />
|
||||
<Lr2 :deptId="'114'" />
|
||||
<Lr3 :public_list="noiseDataList.five.public_noise" :office_list="noiseDataList.five.office_noise" />
|
||||
<Lr4 />
|
||||
<Lr4 :data="TVOC_CH2O['5f']" />
|
||||
</div>
|
||||
<div class="bottom-content" ref="bottomContentRef">
|
||||
|
||||
@ -45,6 +45,7 @@ import Lr4 from './component/Lr4.vue';
|
||||
import ZdScrollBoard from "@/components/ZdScrollBoard/index.vue";
|
||||
import SensorNumLoop from './component/SensorNumLoop.vue';
|
||||
import useR_D_EnvironmentStore from '@/store/modules/r_d_environment'
|
||||
import { connectWebsocket, closeWebsocket} from "@/utils/websocket";
|
||||
import { getSensorByDept } from '@/api/screen/R_D_Environment';
|
||||
|
||||
|
||||
@ -56,81 +57,14 @@ let avg_temp_humi = computed(() => {
|
||||
let noiseDataList = computed(() => {
|
||||
return R_D_EnvironmentStore.getNoiseData
|
||||
})
|
||||
let humi = ref({
|
||||
"Humiture": [
|
||||
{
|
||||
"devId": "eb98cb70-158f-11ee-b4df-a9653aef169c",
|
||||
"name": "服装军团",
|
||||
"temp": "15.4",
|
||||
"humidity": "14.6",
|
||||
"status": true
|
||||
let TVOC_CH2O = reactive({
|
||||
'4f': {
|
||||
ch2o: [],
|
||||
tvoc: []
|
||||
},
|
||||
{
|
||||
"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": {
|
||||
"temp": -15,
|
||||
"humidity": 15,
|
||||
"name": "温湿度下限值"
|
||||
'5f': {
|
||||
ch2o: [],
|
||||
tvoc: []
|
||||
}
|
||||
})
|
||||
let sensor_list = computed(() => {
|
||||
@ -272,6 +206,7 @@ function reqSensorByDept() {
|
||||
if (res.code === 200) {
|
||||
let sensorData = res.data
|
||||
let temp_humi = sensorData.temp_humi
|
||||
let TVOC_CH2O = sensorData.TVOC_CH2O
|
||||
let temp = []
|
||||
temp_humi.map(item => {
|
||||
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
|
||||
R_D_EnvironmentStore.sensorData = sensorData
|
||||
// noiseDataList.value = res.data
|
||||
@ -426,6 +378,7 @@ onMounted(() => {
|
||||
// deltaY.value = 0
|
||||
// }
|
||||
}, { passive: false });
|
||||
//connectWebsocket('','',getWebsocket, errWebsocket)
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user