| | |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | |
| | | // 卫星遥测网格 |
| | | export const usesatelliteGridStore = defineStore('satelliteGrid', () => { |
| | | const gridGropiList = ref([]); |
| | | const { loading, fetchData } = useFetchData(); |
| | | export const useSatelliteGridStore = defineStore('satelliteGrid', () => { |
| | | // 网格信息 |
| | | 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 |
| | | }; |
| | | }); |