Riku
2025-01-01 bb9fcf136d23b8624e44ed6458caaa605f72af91
开始添加数据融合功能
已修改4个文件
已添加1个文件
127 ■■■■■ 文件已修改
src/components.d.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/satellitetelemetry/SatelliteProxy.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/satellitetelemetry/SatelliteTelemetry.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/satellitetelemetry/component/SatelliteDataMix.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/satellitetelemetry/component/SatelliteManage.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts
@@ -40,7 +40,6 @@
    ElTable: typeof import('element-plus/es')['ElTable']
    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
    ElText: typeof import('element-plus/es')['ElText']
    ElUpload: typeof import('element-plus/es')['ElUpload']
    FactorCheckbox: typeof import('./components/monitor/FactorCheckbox.vue')['default']
    FactorLegend: typeof import('./components/monitor/FactorLegend.vue')['default']
    FactorRadio: typeof import('./components/monitor/FactorRadio.vue')['default']
src/views/satellitetelemetry/SatelliteProxy.js
@@ -35,7 +35,7 @@
  const data = gridData.map((v, i) => {
    return {
      lnglat_GD: points[i],
      data: v.pm25
      data: v.pm25 ? (v.pm25 + 'μg/m³') : ''
    };
  });
  return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'bottom');
@@ -46,7 +46,7 @@
  const data = gridData.map((v, i) => {
    return {
      lnglat_GD: points[i],
      data: v.rank
      data: v.pm25 ? ('排名: ' + v.rank) : ''
    };
  });
  return gridMapUtil.drawGridTextLabel(data, textViews, labelsLayer, 'top');
src/views/satellitetelemetry/SatelliteTelemetry.vue
@@ -1,5 +1,6 @@
<template>
  <div>
  <el-row class="wrap">
    <el-col span="2">
    <!-- <el-button
      class="p-events-auto"
      type="info"
@@ -9,21 +10,36 @@
    >
      ç»˜åˆ¶ç½‘æ ¼
    </el-button> -->
      <el-row>
    <SatelliteManage
          v-show="show"
      class="satellite-manage"
      :gridDataList="satelliteGridStore.gridDataList"
      :loading="loading"
      @search="onSearch"
      @row-click="handleRowClick"
          @show-rank="handleRankClick"
          @show-data="handleDataClick"
    ></SatelliteManage>
    <el-row class="historical" justify="center">
      </el-row>
    </el-col>
    <el-col span="2">
      <el-row>
        <CardButton
          name="卫星遥测数据"
          direction="right"
          @click="() => (show = !show)"
        ></CardButton>
      </el-row>
    </el-col>
    <!-- <el-row class="historical" justify="center">
      <SatelliteAnimation
        :loading="animaLoading"
        :grid-data="gridDataDetailList"
        :mapViews="mapViews"
      ></SatelliteAnimation>
    </el-row> -->
    </el-row>
  </div>
</template>
<script setup>
import { map } from '@/utils/map/index_old';
@@ -38,9 +54,11 @@
import { useFetchData } from '@/composables/fetchData';
import { useSatelliteGridStore } from '@/stores/satellite-grid';
const satelliteGridStore = useSatelliteGridStore();
const { loading, fetchData } = useFetchData(10000);
const animaLoading = ref(true);
const show = ref(true);
let count = 0,
  max = 0;
@@ -95,11 +113,11 @@
  // SatelliteProxy.clearText(mapViews);
  // æ–‡æœ¬æ ‡è®°
  const { textViews: dataTxt, labelsLayer: dataLayer } =
    SatelliteProxy.drawDataText(mapViews.points, gridData, mapViews.dataTxt);
    SatelliteProxy.drawDataText(mapViews.points, gridData, mapViews.dataTxt, mapViews.dataLayer);
  mapViews.dataTxt = dataTxt;
  mapViews.dataLayer = dataLayer;
  const { textViews: rankTxt, labelsLayer: rankLayer } =
    SatelliteProxy.drawRankText(mapViews.points, gridData, mapViews.rankTxt);
    SatelliteProxy.drawRankText(mapViews.points, gridData, mapViews.rankTxt, mapViews.rankLayer);
  mapViews.rankTxt = rankTxt;
  mapViews.rankLayer = rankLayer;
  SatelliteProxy.drawColor(mapViews.gridViews, gridData);
@@ -117,6 +135,14 @@
    });
  }
}
function handleRankClick(rankVisible) {
  rankVisible ? map.add(mapViews.rankLayer) : map.remove(mapViews.rankLayer);
}
function handleDataClick(dataVisible) {
  dataVisible ? map.add(mapViews.dataLayer) : map.remove(mapViews.dataLayer);
}
</script>
<style scoped>
.satellite-manage {
src/views/satellitetelemetry/component/SatelliteDataMix.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
<template>
    <el-row class="wrap">
      <BaseCard size="medium" direction="left">
        <template #content>
        </template>
        <template #footer> </template>
      </BaseCard>
    </el-row>
  </template>
src/views/satellitetelemetry/component/SatelliteManage.vue
@@ -6,7 +6,22 @@
          :loading="loading"
          @search="onSearch"
        ></SatelliteSearchBar>
        <el-button
          type="primary"
          class="el-button-custom"
          size="small"
          @click="handleRankClick"
        >
          {{ rankVisible ? '隐藏排名' : '显示排名' }}
        </el-button>
        <el-button
          type="primary"
          class="el-button-custom"
          size="small"
          @click="handleDataClick"
        >
          {{ dataVisible ? '隐藏数据' : '显示数据' }}
        </el-button>
        <el-table
          :data="gridDataList"
          table-layout="fixed"
@@ -52,9 +67,9 @@
import { ref } from 'vue';
import moment from 'moment';
import SatelliteSearchBar from './SatelliteSearchBar.vue';
import { useFetchData } from '@/composables/fetchData';
import gridApi from '@/api/gridApi';
import SatelliteProxy from '../SatelliteProxy';
// import { useFetchData } from '@/composables/fetchData';
// import gridApi from '@/api/gridApi';
// import SatelliteProxy from '../SatelliteProxy';
// eslint-disable-next-line no-unused-vars
function timeFormatter(row, col, cellValue, index) {
@@ -81,56 +96,25 @@
  }
});
const emits = defineEmits(['search', 'rowClick']);
const rankVisible = ref(true);
const dataVisible = ref(true);
// const { loading, fetchData } = useFetchData(10000);
// // ç½‘格信息
// let gridInfo = [];
// // ç½‘格数据组
// const gridDataList = ref([]);
// // ç½‘格数据详情
// const gridDataDetailMap = new Map();
// // åœ°å›¾ç½‘格相关对象
// let mapViews;
const emits = defineEmits(['search', 'rowClick', 'showRank', 'showData']);
// æŸ¥è¯¢ç½‘格信息和遥感数据组
function onSearch(options) {
  emits('search', options);
}
// // èŽ·å–ç½‘æ ¼ä¿¡æ¯
// function fetchGridCell(groupId) {
//   return fetchData(() => {
//     return gridApi.fetchGridCell(groupId).then((res) => {
//       gridInfo = res.data;
//       drawGrid(gridInfo);
//     });
//   });
// }
function handleRankClick() {
  rankVisible.value = !rankVisible.value
  emits('showRank', rankVisible.value);
}
// // èŽ·å–é¥æ„Ÿæ•°æ®ç»„
// function fetchGridData(groupId) {
//   return gridApi.fetchGridData(groupId).then((res) => {
//     gridDataList.value = res.data;
//   });
// }
// function drawGrid(gridInfo) {
//   SatelliteProxy.clearAll(mapViews);
//   mapViews = SatelliteProxy.drawPolyline(gridInfo);
// }
// // ç»˜åˆ¶ç½‘格遥感数据值和网格颜色
// function drawTextAndColor(gridData) {
//   // SatelliteProxy.clearText(mapViews);
//   // æ–‡æœ¬æ ‡è®°
//   mapViews.textViews = SatelliteProxy.drawDataText(
//     mapViews.points,
//     gridData,
//     mapViews.textViews
//   );
//   SatelliteProxy.drawColor(mapViews.gridViews, gridData);
// }
function handleDataClick() {
  dataVisible.value = !dataVisible.value
  emits('showData', dataVisible.value);
}
function handleRowClick(row, col, event) {
  emits('rowClick', row);