From f6abca3abae3e7819da1b0e0274210d906aa2428 Mon Sep 17 00:00:00 2001 From: jiangx Date: Fri, 31 Oct 2025 13:51:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E6=A5=BC=E5=B1=82?= =?UTF-8?q?=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/root/getters.ts | 10 +++++++--- src/types/building.d.ts | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/stores/root/getters.ts b/src/stores/root/getters.ts index b8bb24d..98bc7dd 100644 --- a/src/stores/root/getters.ts +++ b/src/stores/root/getters.ts @@ -27,7 +27,11 @@ export const getters: GenGetters = { return this.buildingList.find(building => building.buildingCode === this.device.buildingCode) ?? ({} as Building) }, currentBuildingFloorsList() { - return this.currentBuilding.floorList ?? [] + const floors = this.currentBuilding.floorList ?? [] + if (!floors?.length) { + return [] + } + return floors.filter(floor => floor.status === 0) }, recommendList() { return this.BrandInfo?.recommendList ?? [] @@ -35,8 +39,8 @@ export const getters: GenGetters = { brandFloorList() { const brandBuilding = this.BrandInfo.buildingList?.find(item => item.buildingCode === this.device.buildingCode) const mergeFloorList = [ - { floorCode: 'ALL', floor: 'ALL', floorOrder: -1, floorMapUrl: '', floorMapCode: 'ALL' }, - ...(brandBuilding?.floorList ?? []) + { floorCode: 'ALL', floor: 'ALL', floorOrder: -1, floorMapUrl: '', floorMapCode: 'ALL', status: 0 as const }, + ...(brandBuilding?.floorList?.filter(floor => floor.status === 0) ?? []) ] return mergeFloorList }, diff --git a/src/types/building.d.ts b/src/types/building.d.ts index 4b46d0f..05fc551 100644 --- a/src/types/building.d.ts +++ b/src/types/building.d.ts @@ -4,6 +4,7 @@ declare interface Floor { floorOrder: number floorMapUrl: string floorMapCode: string + status: 0 | 1 // 0: 正常 1: 停用 } declare interface Building { -- 2.30.2