riku
2025-07-04 d6e6f8b5b31e132e4597eb531168d3e88f3bda72
src/views/realtimemode/RealtimeMode.vue
@@ -5,9 +5,9 @@
      <el-button
        type="primary"
        class="p-events-auto el-button-custom"
        @click="clearFetchingTask"
        @click="pauseTask"
      >
        停止
        {{ pause ? '继续' : '暂停' }}
      </el-button>
    </el-row>
    <el-row class="m-t-2">
@@ -19,7 +19,7 @@
      </el-col>
      <el-col span="1"> </el-col>
    </el-row>
    <DashBoard class="dash-board" :factor-datas="factorDatas"></DashBoard>
    <!-- <DashBoard class="dash-board" :factor-datas="factorDatas"></DashBoard> -->
    <RealTimeTrend
      class="real-time-trend"
      :factor-datas="factorDatas"
@@ -28,7 +28,9 @@
    <SourceTrace
      class="source-trace"
      v-model:factorType="factorType"
      :deviceCode="deviceCode"
    ></SourceTrace>
    <!-- <PollutedClueItem></PollutedClueItem> -->
  </div>
</template>
@@ -43,11 +45,14 @@
import RealTimeTrend from './component/RealTimeTrend.vue';
import DeviceChange from './component/DeviceChange.vue';
import SourceTrace from '@/views/sourcetrace/SourceTrace.vue';
import UnderwayAdvice from '@/views/sourcetrace/UnderwayAdvice.vue';
import PollutedClueItem from '@/views/sourcetrace/component/PollutedClueItem.vue';
import { realTimeMapAnimation } from '@/utils/map/animation';
import {
  fetchHistoryData,
  startLoopFetchRealTimeData,
  clearFetchingTask
  clearFetchingTask,
  pauseTask
} from '@/utils/factor/data';
import thirdPartyDataApi from '@/api/thirdPartyDataApi';
import websocket from '@/api/websocket';
@@ -59,7 +64,14 @@
// const mode = 'product';
export default {
  components: { DashBoard, RealTimeTrend, DeviceChange, SourceTrace },
  components: {
    DashBoard,
    RealTimeTrend,
    DeviceChange,
    SourceTrace,
    UnderwayAdvice,
    PollutedClueItem
  },
  setup() {
    const { loading, fetchData } = useFetchData(10000);
    return { loading, fetchData };
@@ -74,7 +86,8 @@
      // 新获取的监测数据
      factorDatas: new FactorDatas(),
      // 全部监测数据
      allFactorDatas: new FactorDatas()
      allFactorDatas: new FactorDatas(),
      pause: false
    };
  },
  watch: {
@@ -125,10 +138,18 @@
          mode == 'debug'
            ? {
                deviceCode: this.deviceCode,
                startTime: '2025-01-16 11:34:00',
                endTime: '2025-01-16 11:35:00',
                // startTime: '2025-01-16 11:34:00',
                // endTime: '2025-01-16 11:35:00',
                // startTime: '2025-01-20 12:40:00',
                // startTime: '2024-12-27 08:30:00',
                // startTime: '2024-12-13 16:35:00',
                // startTime: '2024-11-27 11:50:41', // Pm, 中距离工地
                // startTime: '2024-08-30 15:28:00', // voc 近距离汽修
                startTime: '2024-07-23 15:21:30',
                // startTime: '2024-07-23 14:39:00',
                endTime: '2025-01-16 11:51:41',
                page,
                perPage: 100
                perPage: 10
              }
            : {
                deviceCode: this.deviceCode,
@@ -142,6 +163,9 @@
          thirdPartyDataApi.fetchLatestData(this.deviceType, this.deviceCode);
        });
      });
    },
    pauseTask() {
      this.pause = pauseTask();
    },
    clearFetchingTask() {
      clearFetchingTask();
@@ -196,7 +220,7 @@
<style scoped>
.dash-board {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0px;
}
.real-time-trend {
@@ -206,7 +230,7 @@
}
.source-trace {
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0px;
}
</style>