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 { floor, node } = window.Map_QM.pathIcon({ type: abbreviation }) const floorName = store.currentBuildingFloorsList.find(_floor => _floor.floorOrder === floor)?.floor const shop = new Brand({ shopName: customFacilityName, floorOrder: floor, floor: floorName as string, logoUrl: filePath, yaxis: node, shopCode: code }) store.SET_SHOP(shop) router.push('/nav') } return { handleFacility } }