From fcb8b8cc392b146aa11bbaab9e497f7f13f29d44 Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期一, 26 五月 2025 11:38:17 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject --- UI-Project/src/views/largescreendisplay/screendisplay.vue | 49 +++++++++++++++++++++++++++++++------------------ 1 files changed, 31 insertions(+), 18 deletions(-) diff --git a/UI-Project/src/views/largescreendisplay/screendisplay.vue b/UI-Project/src/views/largescreendisplay/screendisplay.vue index 2a858e4..da5687e 100644 --- a/UI-Project/src/views/largescreendisplay/screendisplay.vue +++ b/UI-Project/src/views/largescreendisplay/screendisplay.vue @@ -38,17 +38,17 @@ let myChartHollow = null; const socketUrl1 = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/largenScreen`; const handleMessage1 = (data) => { - edgOneTasks.value = data.edgOneTasks[0]; - edgTwoTasks.value = data.edgTwoTasks[0]; + edgOneTasks.value = data.edgOneCount[0]; + edgTwoTasks.value = data.edgOneCount[0]; engineeringOne.value = data.engineeringOne[0]; engineeringTwo.value = data.engineeringTwo[0]; - if (numBoxes.value != edgOneTasks.value.length) { - numBoxes.value = edgOneTasks.value.length; + if (numBoxes.value != edgOneTasks.value) { + numBoxes.value = edgOneTasks.value; initBoxes(boxes, numBoxes, 'firstup'); } - if (numBoxes2.value != edgTwoTasks.value.length) { - numBoxes2.value = edgTwoTasks.value.length; + if (numBoxes2.value != edgTwoTasks.value) { + numBoxes2.value = edgTwoTasks.value; initBoxes(boxes2, numBoxes2, 'firstup'); } timeAxisCreate(t('large.cuttingState'), chartLoad.value, myChartLoad, tableDataTime(false, data.loadRunTimes[0])); @@ -106,15 +106,20 @@ const tableData = []; if (tableDatax.length > 0) { tableDatax.forEach((item, index) => { - tableData.push({ - firstTimestamp: index == 0 ? item.startTimestamp : tableDatax[index - 1].secondTimestamp, - secondTimestamp: index == tableDatax.length - 1 ? item.endTimestamp : item.firstTimestamp, - diffMinutes: item.diffMinutes, - startTimestamp: item.startTimestamp, - endTimestamp: item.endTimestamp, - state: 1 - }); - if (result) { + const time1 = new Date(index == 0 ? item.startTimestamp : tableDatax[index - 1].secondTimestamp); + const time2 = new Date(index == tableDatax.length - 1 ? item.endTimestamp : item.firstTimestamp); + + const diffInSeconds = Math.abs(time2 - time1) / 1000; + if (diffInSeconds > 60) { + tableData.push({ + firstTimestamp: index == 0 ? item.startTimestamp : tableDatax[index - 1].secondTimestamp, + secondTimestamp: index == tableDatax.length - 1 ? item.endTimestamp : item.firstTimestamp, + diffMinutes: item.diffMinutes, + startTimestamp: item.startTimestamp, + endTimestamp: item.endTimestamp, + state: 1 + }); + if (result) { tableData.push({ firstTimestamp: item.firstTimestamp, secondTimestamp: item.secondTimestamp, @@ -124,6 +129,14 @@ state: 2 }); } + // console.log("闂撮殧瓒呰繃60绉�", diffInSeconds, time1, time2); + } else { + if(index>0){ + // console.log(tableData,index); + } + // console.log("闂撮殧涓嶈秴杩�60绉�", diffInSeconds, time1, time2); + } + }); } @@ -270,7 +283,7 @@ ] }; - mychart.setOption(optionOne); + mychart.setOption(optionOne,true); }; let socket4 = null; @@ -347,7 +360,7 @@ ] }; - myChart.setOption(option); + myChart.setOption(option,true); const chartDom2 = chartRef2.value; @@ -393,7 +406,7 @@ ] }; - myChart2.setOption(option2); + myChart2.setOption(option2,true); }; // 灏嗗師濮嬫暟鎹浆鎹负 ECharts 鍥捐〃鎵�闇�鏍煎紡 let categories = ref([]); // 鑾峰彇鏃ユ湡浣滀负 x 杞� -- Gitblit v1.8.0