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 {