import { useStore } from '@/store/root' import Brand from '@/utils/Class/Brand' import { useRouter } from 'vue-router' export const useFacilityNav = () => { const store = useStore() const router = useRouter() function handleFacility({ abbreviation, customFacilityName, filePath, code }: Facility) { const facility = window.Map_QM.pathIcon({ type: abbreviation }) const floorName = store.currentBuildingFloorsList.find(floor => floor.floorOrder === facility.floor)?.floor const shop = new Brand({ shopName: customFacilityName, floorOrder: facility.floor, floor: floorName as string, logoUrl: filePath, yaxis: facility.node, shopCode: code }) store.SET_SHOP(shop) router.push('/nav') } return { handleFacility } }