riku
2025-05-14 a96e571b174fa30697f3aa6fdb22b3cf93d21b71
src/views/realtimemode/RealtimeMode.vue
@@ -14,7 +14,7 @@
        class="m-t-2"
        :factor="factorDatas.factor[factorType]"
      ></FactorLegend>
      <!-- <SourceTrace></SourceTrace> -->
      <SourceTrace></SourceTrace>
    </el-row>
    <DashBoard class="dash-board" :factor-datas="factorDatas"></DashBoard>
    <RealTimeTrend
@@ -43,8 +43,12 @@
  clearFetchingTask
} from '@/utils/factor/data';
import thirdPartyDataApi from '@/api/thirdPartyDataApi';
import websocket from '@/api/websocket';
// const mapAnimation = new MapAnimation();
// 调试模式
const mode = 'debug';
export default {
  components: { DashBoard, RealTimeTrend, DeviceChange, SourceTrace },
@@ -103,24 +107,29 @@
        // this.draw();
        this.factorDatas = fDatas;
      });
      if (mode == 'debug') {
        websocket.send(JSON.stringify(data));
      }
    },
    fetchRealTimeData() {
      this.fetchData((page) => {
        return fetchHistoryData(
          {
            deviceCode: this.deviceCode,
            // startTime: '2024-08-20 06:00:00',
            // endTime: '2024-08-20 06:02:00',
            page,
            perPage: 100
          },
          false
        ).then((res) => {
        const param =
          mode == 'debug'
            ? {
                deviceCode: this.deviceCode,
                startTime: '2025-01-16 11:30:00',
                endTime: '2025-01-16 11:32:00',
                page,
                perPage: 100
              }
            : {
                deviceCode: this.deviceCode,
                page,
                perPage: 100
              };
        return fetchHistoryData(param, false).then((res) => {
          this.onFetchData(res.data);
          this.onMapData(res.data);
          // if (res.data.length > 0) {
          //   this.fetchNextData(res.data[res.data.length - 1].time);
          // }
          this.fetchNextData();
          thirdPartyDataApi.fetchLatestData(this.deviceType, this.deviceCode);
        });