From 93f83084b2ac8992c88619aa1dc1c2d03bba05d1 Mon Sep 17 00:00:00 2001 From: hzz Date: Thu, 14 Dec 2023 16:48:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E5=B7=A5=E5=8E=82=E5=A4=A7=E5=B1=8Fup?= =?UTF-8?q?date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 39 ++++++++++++------- .../component/BottomBorder.vue | 4 +- src/views/MicroExhibition/index.vue | 33 +++++++++++----- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/public/index.html b/public/index.html index be4fbb0..0c18fcb 100644 --- a/public/index.html +++ b/public/index.html @@ -1,17 +1,26 @@ - - - - - - <%= htmlWebpackPlugin.options.title %> - - - -
- - - + + + + + + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + +
+ + + + \ No newline at end of file diff --git a/src/views/MicroExhibition/component/BottomBorder.vue b/src/views/MicroExhibition/component/BottomBorder.vue index 2b9e010..782f198 100644 --- a/src/views/MicroExhibition/component/BottomBorder.vue +++ b/src/views/MicroExhibition/component/BottomBorder.vue @@ -28,9 +28,7 @@
diff --git a/src/views/MicroExhibition/index.vue b/src/views/MicroExhibition/index.vue index 551e5d1..905f2b3 100644 --- a/src/views/MicroExhibition/index.vue +++ b/src/views/MicroExhibition/index.vue @@ -158,7 +158,7 @@ function getmDevList() { if (devObj.hasOwnProperty(key)) { let online = 0; devObj[key].list = data[key].map((item: any, i: number) => { - if (item.status != 'false' || item.status != '0') { + if (item.status != 'false' && item.status != '0') { online++ } let temp = item.status @@ -175,7 +175,7 @@ function getmDevList() { if (key == '后整设备') { let online = 0; hzdata.value = data[key].map((item: any, i: number) => { - if (item.status != 'false' || item.status != '0') { + if (item.status != 'false' && item.status != '0') { online++ } let temp = item.status @@ -225,12 +225,12 @@ function changestatus(val) { return item.num == val.num }) if (hzdataIndex !== -1 && hzdata.value[hzdataIndex].status != val.status) { - hzdata.value[hzdataIndex].status = val.status - if (val.status == '0') { + if (hzdata.value[hzdataIndex].status != 0 && val.status == '0') { stepList[3].online -= 1 - } else { + } else if (hzdata.value[hzdataIndex].status == 0 && val.status != '0') { stepList[3].online += 1 } + hzdata.value[hzdataIndex].status = val.status } } else { @@ -238,12 +238,13 @@ function changestatus(val) { return item[2] == val.num }) if (dataIndex !== -1 && devObj[val.step].list[dataIndex][3] != val.status) { - devObj[val.step].list[dataIndex][3] = val.status - if (val.status == '0') { + if (devObj[val.step].list[dataIndex][3] != 0 && val.status == '0') { stepList[statusObj[val.step]].online -= 1 - } else { + } else if (devObj[val.step].list[dataIndex][3] == 0 && val.status != '0') { stepList[statusObj[val.step]].online += 1 } + devObj[val.step].list[dataIndex][3] = val.status + } } } @@ -275,12 +276,26 @@ function errWebsocket(val) { onMounted(() => { + + getDeviceProduction() getmDevList() timer = setInterval(() => { getDeviceProduction() getmDevList() - }, 60*1000) + }, 60 * 1000) + + + // setInterval(() => { + // let status = Math.round(Math.random() * 3) + // let val = { + // step: '缝前设备', + // num: 31, + // status: status + // } + + // changestatus(val) + // }, 5000) connectWebsocket(null, null, getWebsocket, errWebsocket) document.getElementById('app').style.backgroundColor = 'rgba(0, 11, 18, 1)' })