| | |
| | | try { |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | let response; |
| | | if (key == "1" || key == "2") { |
| | | 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]) |
| | |
| | | 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, |
| | | diffMinutes: item.diffMinutes, |
| | | startTimestamp: item.startTimestamp, |
| | | endTimestamp: item.endTimestamp, |
| | | state: 1 |
| | | }); |
| | | console.log("间隔超过60秒", diffInSeconds, time1, time2); |
| | | } else { |
| | | console.log("间隔不超过60秒", diffInSeconds, time1, time2); |
| | | } |
| | | |
| | | tableData.push({ |
| | | firstTimestamp: index == 0 ? item.startTimestamp : tableDatax.value[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, |
| | |
| | | let page = window.localStorage.getItem('pagenumber') |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | let response; |
| | | if (key == "1" || key == "2") { |
| | | 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]) |
| | |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | let page = window.localStorage.getItem('pagenumber') |
| | | let response; |
| | | if (key == "1" || key == "2") { |
| | | 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]) |
| | |
| | | backgroundColor: 'rgba(50,50,50,0.7)', |
| | | textStyle: { color: '#fff' }, |
| | | formatter: (params) => { |
| | | const seen = new Set(); |
| | | const items = params |
| | | .filter(p => { |
| | | const key = p.data?.extra?.start + '|' + p.data?.extra?.end; |
| | | if (seen.has(key)) return false; |
| | | seen.add(key); |
| | | return true; |
| | | }) |
| | | .map(p => { |
| | | const start = p.data?.extra?.start; |
| | | const end = p.data?.extra?.end; |