zhoushihao
2 天以前 4e3b8155722b66e25df3c6fd42cc586b68dea391
UI-Project/src/views/largescreendisplay/timeaxis.vue
@@ -97,11 +97,6 @@
  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,
@@ -110,11 +105,6 @@
          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,
@@ -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;