diff --git a/src/store/moduleSocket.ts b/src/store/moduleSocket.ts index d1f97b7..1a9d5c6 100644 --- a/src/store/moduleSocket.ts +++ b/src/store/moduleSocket.ts @@ -9,7 +9,7 @@ */ import { defineStore } from "pinia"; import { Names } from '@/store/storeName' -import {gettime,clacendTime} from "@/utils/time" +import { gettime, clacendTime } from "@/utils/time" export const useSocketStore = defineStore(Names.socket, { // 使用方式 // const Index= useIndexStore() @@ -172,16 +172,35 @@ export const useSocketStore = defineStore(Names.socket, { * @函数备注: */ changePM(val) { - if (val.enName == 'welding') { - this.pm.welding.two = val.pm25 - this.pm.welding.ten = val.pm10 - } else if (val.enName == 'stuff') { - this.pm.stuff.two = val.pm25 - this.pm.stuff.ten = val.pm10 - } else if (val.enName == 'ornaments') { - this.pm.ornaments.two = val.pm25 - this.pm.ornaments.ten = val.pm10 - } + let arr = ['083e3900-3435-11ed-a7e1-fd42bca6c8c6', 'bcbfb530-88b2-11ed-a926-570995ad0254', '01336fd0-1fa0-11ed-9223-7db1174970a8'] + + // if (arr.indexOf(val.devId) > -1) { + // console.log(val,'这三个设备'); + + // } + + if (val.devId == '083e3900-3435-11ed-a7e1-fd42bca6c8c6') { + this.pm.welding.two = val.pm25 + this.pm.welding.ten = val.pm10 + } else if (val.devId == 'bcbfb530-88b2-11ed-a926-570995ad0254') { + this.pm.ornaments.two = val.pm25 + this.pm.ornaments.ten = val.pm10 + } else if (val.devId == '01336fd0-1fa0-11ed-9223-7db1174970a8') { + this.pm.stuff.two = val.pm25 + this.pm.stuff.ten = val.pm10 + } + + + // if (val.enName == 'welding') { + // this.pm.welding.two = val.pm25 + // this.pm.welding.ten = val.pm10 + // } else if (val.enName == 'stuff') { + // this.pm.stuff.two = val.pm25 + // this.pm.stuff.ten = val.pm10 + // } else if (val.enName == 'ornaments') { + // this.pm.ornaments.two = val.pm25 + // this.pm.ornaments.ten = val.pm10 + // } }, /** @@ -325,17 +344,17 @@ export const useSocketStore = defineStore(Names.socket, { cIndex = this.newVerticalNum[pIndex].value.findIndex(item => item.name == val.data.name) } if (cIndex != -1) { - if (val.data.val>this.newVerticalNum[pIndex].limit) { - + if (val.data.val > this.newVerticalNum[pIndex].limit) { + let now = new Date().getTime() if (this.newVerticalNum[pIndex].value[cIndex].date == null) { this.newVerticalNum[pIndex].value[cIndex].date = gettime() this.newVerticalNum[pIndex].value[cIndex].time = now } - + let time = this.newVerticalNum[pIndex].value[cIndex].time - this.newVerticalNum[pIndex].value[cIndex].continuous = clacendTime(now,time) + this.newVerticalNum[pIndex].value[cIndex].continuous = clacendTime(now, time) } else { this.newVerticalNum[pIndex].value[cIndex].date = null this.newVerticalNum[pIndex].value[cIndex].time = null diff --git a/src/store/moduleSocketjixie.ts b/src/store/moduleSocketjixie.ts index e5e9254..a16b67e 100644 --- a/src/store/moduleSocketjixie.ts +++ b/src/store/moduleSocketjixie.ts @@ -172,16 +172,16 @@ export const useSocketStore = defineStore(Names.socketjixiefenchang,{ * @函数备注: */ changePM(val){ - if(val.enName=='welding'){ - this.pm.welding.two=val.pm25 - this.pm.welding.ten=val.pm10 - }else if(val.enName=='stuff'){ - this.pm.stuff.two=val.pm25 - this.pm.stuff.ten=val.pm10 - }else if(val.enName=='ornaments'){ - this.pm.ornaments.two=val.pm25 - this.pm.ornaments.ten=val.pm10 - } + if (val.devId == '083e3900-3435-11ed-a7e1-fd42bca6c8c6') { + this.pm.welding.two = val.pm25 + this.pm.welding.ten = val.pm10 + } else if (val.devId == 'bcbfb530-88b2-11ed-a926-570995ad0254') { + this.pm.ornaments.two = val.pm25 + this.pm.ornaments.ten = val.pm10 + } else if (val.devId == '01336fd0-1fa0-11ed-9223-7db1174970a8') { + this.pm.stuff.two = val.pm25 + this.pm.stuff.ten = val.pm10 + } }, /** diff --git a/src/views/generalEnvironment/content/right.vue b/src/views/generalEnvironment/content/right.vue index 773937b..c8eb618 100644 --- a/src/views/generalEnvironment/content/right.vue +++ b/src/views/generalEnvironment/content/right.vue @@ -1,119 +1,121 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ - + - + \ No newline at end of file diff --git a/src/views/generalEnvironmentjixiefenchang/content/right.vue b/src/views/generalEnvironmentjixiefenchang/content/right.vue index eb0a4d5..f274e34 100644 --- a/src/views/generalEnvironmentjixiefenchang/content/right.vue +++ b/src/views/generalEnvironmentjixiefenchang/content/right.vue @@ -1,120 +1,123 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ - + - + \ No newline at end of file