riku
2025-02-24 0b700614e2f3e41df4655ba5469217e009c246ac
src/stores/satellite-grid.js
@@ -1,4 +1,4 @@
import { ref } from 'vue';
import { ref, computed } from 'vue';
import { defineStore } from 'pinia';
import gridApi from '@/api/gridApi';
import { useFetchData } from '@/composables/fetchData';
@@ -7,8 +7,21 @@
export const useSatelliteGridStore = defineStore('satelliteGrid', () => {
  // 网格信息
  const gridInfo = ref([]);
  // 网格数据组
  const gridDataList = ref([]);
  // 所有网格数据组
  const allGridDataList = ref([]);
  // 原始网格数据组
  const gridDataList = computed(() => {
    // return allGridDataList.value.filter((v) => {
    //   return v.type == 0;
    // });
    return allGridDataList.value;
  });
  // 融合网格数据组
  const mixGridDataList = computed(() => {
    return allGridDataList.value.filter((v) => {
      return v.type == 1;
    });
  });
  // 获取网格信息
  function fetchGridCell(groupId) {
@@ -20,7 +33,7 @@
  // 获取遥测单日数据信息
  function fetchGridData(groupId) {
    return gridApi.fetchGridData(groupId).then((res) => {
      gridDataList.value = res.data;
      allGridDataList.value = res.data;
    });
  }
@@ -35,7 +48,9 @@
  return {
    gridInfo,
    allGridDataList,
    gridDataList,
    mixGridDataList,
    fetchGridCell,
    fetchGridData,
    fetchGridDataDetail