riku
2024-12-24 105119f987e6e16d3a152649394f6052e5936b8f
src/stores/satellite-grid.js
@@ -5,14 +5,39 @@
// 卫星遥测网格
export const usesatelliteGridStore = defineStore('satelliteGrid', () => {
  const gridGropiList = ref([]);
  const { loading, fetchData } = useFetchData();
  // 网格信息
  const gridInfo = ref([]);
  // 网格数据组
  const gridDataList = ref([]);
  function fetchGridGroup(area) {
    return fetchData((page, pageSize) => {
      return gridApi.fetchGridGroup(area, page, pageSize).then((res) => {
        return res;
      });
  // 获取网格信息
  function fetchGridCell(groupId) {
    return gridApi.fetchGridCell(groupId).then((res) => {
      gridInfo.value = res.data;
    });
  }
  // 获取遥测单日数据信息
  function fetchGridData(groupId) {
    return gridApi.fetchGridData(groupId).then((res) => {
      gridDataList.value = res.data;
    });
  }
  // 获取遥测单日具体网格监测数据
  function fetchGridDataDetail(gridData) {
    return gridApi
      .fetchGridDataDetail(gridData.id, gridData.groupId)
      .then((res) => {
        gridData.dataDetail = res.data;
      });
  }
  return {
    gridInfo,
    gridDataList,
    fetchGridCell,
    fetchGridData,
    fetchGridDataDetail
  };
});