zhoushihao
1 天以前 4e3b8155722b66e25df3c6fd42cc586b68dea391
UI-Project/src/views/largescreendisplay/timeaxis.vue
@@ -61,7 +61,7 @@
  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])
@@ -97,24 +97,14 @@
  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,
@@ -148,7 +138,7 @@
    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])
@@ -192,7 +182,7 @@
    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])
@@ -388,7 +378,14 @@
      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;