From d83a3ab6e99e364d45cf85a5c00367c583ef4e31 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期一, 24 二月 2025 17:15:22 +0800 Subject: [PATCH] Merge branch 'master-temp' of ssh://114.215.109.124:29418/satellite-vue into master-temp --- src/stores/satellite-grid.js | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/stores/satellite-grid.js b/src/stores/satellite-grid.js index 02e0494..526ac9a 100644 --- a/src/stores/satellite-grid.js +++ b/src/stores/satellite-grid.js @@ -1,14 +1,27 @@ -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', () => { +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 -- Gitblit v1.9.3