You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
730 B
24 lines
730 B
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(item: Facility) {
|
|
const facility = window.Map_QM.pathIcon({ type: item.abbreviation })
|
|
const floorName = store.currentBuildingFloorsList.find(floor => floor.floorOrder === facility.floor)?.floor
|
|
const shop = new Brand({
|
|
shopName: item.customFacilityName,
|
|
floorOrder: facility.floor,
|
|
floor: floorName as string,
|
|
logoUrl: item.filePath,
|
|
yaxis: facility.node
|
|
})
|
|
store.SET_SHOP(shop)
|
|
router.push('/nav')
|
|
}
|
|
|
|
return { handleFacility }
|
|
}
|
|
|