| | |
| | | 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])); |
| | |
| | | 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, |
| | |
| | | state: 2 |
| | | }); |
| | | } |
| | | // console.log("间隔超过60秒", diffInSeconds, time1, time2); |
| | | } else { |
| | | if(index>0){ |
| | | // console.log(tableData,index); |
| | | } |
| | | // console.log("间隔不超过60秒", diffInSeconds, time1, time2); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | ] |
| | | }; |
| | | |
| | | mychart.setOption(optionOne); |
| | | mychart.setOption(optionOne,true); |
| | | }; |
| | | |
| | | let socket4 = null; |
| | |
| | | ] |
| | | }; |
| | | |
| | | myChart.setOption(option); |
| | | myChart.setOption(option,true); |
| | | |
| | | |
| | | const chartDom2 = chartRef2.value; |
| | |
| | | ] |
| | | }; |
| | | |
| | | myChart2.setOption(option2); |
| | | myChart2.setOption(option2,true); |
| | | }; |
| | | // 将原始数据转换为 ECharts 图表所需格式 |
| | | let categories = ref([]); // 获取日期作为 x 轴 |