riku
2024-12-27 1c31659852f8360cc0fdfac26aff51e54b8b8b67
src/views/satellitetelemetry/SatelliteTelemetry.vue
@@ -11,7 +11,7 @@
    </el-button> -->
    <SatelliteManage
      class="satellite-manage"
      :gridDataList="gridDataList"
      :gridDataList="satelliteGridStore.gridDataList"
      :loading="loading"
      @search="onSearch"
      @row-click="handleRowClick"
@@ -36,13 +36,12 @@
import SatelliteManage from './component/SatelliteManage.vue';
import SatelliteProxy from './SatelliteProxy';
import { useFetchData } from '@/composables/fetchData';
import { useSatelliteGridStore } from '@/stores/satellite-grid';
const satelliteGridStore = useSatelliteGridStore();
const { loading, fetchData } = useFetchData(10000);
const animaLoading = ref(true);
// 网格信息
let gridInfo = [];
// 网格数据组
const gridDataList = ref([]);
let count = 0,
  max = 0;
// 网格数据详情
@@ -53,28 +52,10 @@
// 查询网格信息和遥感数据组
function onSearch(options) {
  fetchGridCell(options.id);
  fetchGridData(options.id);
}
// 获取网格信息
function fetchGridCell(groupId) {
  return fetchData(() => {
    return gridApi.fetchGridCell(groupId).then((res) => {
      gridInfo = res.data;
      drawGrid(gridInfo);
    });
  satelliteGridStore.fetchGridCell(options.id).then(() => {
    drawGrid(satelliteGridStore.gridInfo);
  });
}
// 获取遥感数据组
function fetchGridData(groupId) {
  return gridApi.fetchGridData(groupId).then((res) => {
    gridDataList.value = res.data;
    count = 0;
    max = res.data.length;
    fetchGridDataDetail(res.data);
  });
  satelliteGridStore.fetchGridData(options.id);
}
function fetchGridDataDetail(dataList) {
@@ -113,11 +94,14 @@
function drawTextAndColor(gridData) {
  // SatelliteProxy.clearText(mapViews);
  // 文本标记
  mapViews.textViews = SatelliteProxy.drawDataText(
    mapViews.points,
    gridData,
    mapViews.textViews
  );
  const { textViews: dataTxt, labelsLayer: dataLayer } =
    SatelliteProxy.drawDataText(mapViews.points, gridData, mapViews.dataTxt);
  mapViews.dataTxt = dataTxt;
  mapViews.dataLayer = dataLayer;
  const { textViews: rankTxt, labelsLayer: rankLayer } =
    SatelliteProxy.drawRankText(mapViews.points, gridData, mapViews.rankTxt);
  mapViews.rankTxt = rankTxt;
  mapViews.rankLayer = rankLayer;
  SatelliteProxy.drawColor(mapViews.gridViews, gridData);
}