| | |
| | | const historical = async () => { |
| | | try { |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | const response = await request.get("/cacheGlass/edgStorageDeviceTaskHistory/queryRunTimes?days=" + timeRange.value[1]) |
| | | let response; |
| | | if (key == "1" || key == "2") { |
| | | response = await request.get("/cacheGlass/edgStorageDeviceTaskHistory/queryRunTimes?days=" + timeRange.value[1]) |
| | | } else if (key == "3") { |
| | | response = await request.get("/cacheVerticalGlass/bigStorageCageHistoryTask/queryRunTimes?days=" + timeRange.value[1]) |
| | | } else { |
| | | response = await request.get("/hollowGlass/hollowBigStorageCageHistoryTask/queryRunTimes?days=" + timeRange.value[1]) |
| | | } |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | // const formattedData = response.data.records.map(record => ({ |
| | |
| | | const tableData = []; |
| | | if (tableDatax.value.length > 0) { |
| | | tableDatax.value.forEach((item, index) => { |
| | | const time1 = new Date(index == 0 ? item.startTimestamp : tableDatax.value[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.value[index - 1].secondTimestamp, |
| | | secondTimestamp: index == tableDatax.length - 1 ? item.endTimestamp : item.firstTimestamp, |
| | |
| | | endTimestamp: item.endTimestamp, |
| | | state: 1 |
| | | }); |
| | | console.log("间隔超过60秒", diffInSeconds, time1, time2); |
| | | } else { |
| | | console.log("间隔不超过60秒", diffInSeconds, time1, time2); |
| | | } |
| | | |
| | | if (result) { |
| | | tableData.push({ |
| | | firstTimestamp: item.firstTimestamp, |
| | |
| | | } |
| | | let page = window.localStorage.getItem('pagenumber') |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | const response = await request.get("/cacheGlass/edgStorageDeviceTaskHistory/queryRunTimes?days=" + timeRange.value[1]) |
| | | let response; |
| | | if (key == "1" || key == "2") { |
| | | response = await request.get("/cacheGlass/edgStorageDeviceTaskHistory/queryRunTimes?days=" + timeRange.value[1]) |
| | | } else if (key == "3") { |
| | | response = await request.get("/cacheVerticalGlass/bigStorageCageHistoryTask/queryRunTimes?days=" + timeRange.value[1]) |
| | | } else { |
| | | response = await request.get("/hollowGlass/hollowBigStorageCageHistoryTask/queryRunTimes?days=" + timeRange.value[1]) |
| | | } |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | // const formattedData = response.data.records.map(record => ({ |
| | |
| | | } |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | let page = window.localStorage.getItem('pagenumber') |
| | | const response = await request.get("/cacheGlass/edgStorageDeviceTaskHistory/queryRunTimes?days=" + timeRange.value[1]) |
| | | let response; |
| | | if (key == "1" || key == "2") { |
| | | response = await request.get("/cacheGlass/edgStorageDeviceTaskHistory/queryRunTimes?days=" + timeRange.value[1]) |
| | | } else if (key == "3") { |
| | | response = await request.get("/cacheVerticalGlass/bigStorageCageHistoryTask/queryRunTimes?days=" + timeRange.value[1]) |
| | | } else { |
| | | response = await request.get("/hollowGlass/hollowBigStorageCageHistoryTask/queryRunTimes?days=" + timeRange.value[1]) |
| | | } |
| | | if (response.code == 200) { |
| | | currentPage2.value = 1 |
| | | ElMessage.success(response.message); |
| | |
| | | let myChart = null; |
| | | const chart = ref(null) |
| | | const timeAxisCreate = (title, chartDom, mychart, RunTimes) => { |
| | | if (mychart) { |
| | | mychart.clear(); |
| | | // 如果需要,可以重新初始化图表 |
| | | } |
| | | if (!chartDom) { |
| | | console.error('图表容器未找到'); |
| | | return; |
| | |
| | | }, |
| | | z: 1 |
| | | })); |
| | | |
| | | |
| | | console.log("segments", RunTimes.length, segments); |
| | | const optionOne = { |
| | | title: { |
| | | text: title, |
| | |
| | | ] |
| | | }; |
| | | |
| | | mychart.setOption(optionOne); |
| | | mychart.setOption(optionOne, true); |
| | | }; |
| | | |
| | | </script> |