From 0b700614e2f3e41df4655ba5469217e009c246ac Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期一, 24 二月 2025 17:09:13 +0800 Subject: [PATCH] 1. 初步完成走航融合相关功能 --- src/stores/satellite-grid.js | 58 +++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 49 insertions(+), 9 deletions(-) diff --git a/src/stores/satellite-grid.js b/src/stores/satellite-grid.js index 2b83df2..526ac9a 100644 --- a/src/stores/satellite-grid.js +++ b/src/stores/satellite-grid.js @@ -1,18 +1,58 @@ -import { ref } from 'vue'; +import { ref, computed } from 'vue'; import { defineStore } from 'pinia'; import gridApi from '@/api/gridApi'; 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 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 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) => { + allGridDataList.value = res.data; + }); + } + + // 鑾峰彇閬ユ祴鍗曟棩鍏蜂綋缃戞牸鐩戞祴鏁版嵁 + function fetchGridDataDetail(gridData) { + return gridApi + .fetchGridDataDetail(gridData.id, gridData.groupId) + .then((res) => { + gridData.dataDetail = res.data; + }); + } + + return { + gridInfo, + allGridDataList, + gridDataList, + mixGridDataList, + fetchGridCell, + fetchGridData, + fetchGridDataDetail + }; }); -- Gitblit v1.9.3