成都SKP导视横版
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.
 
 
 
 

26 lines
913 B

import { useRootStore } from '@/store/root'
import Brand from '@/utils/Class/Brand'
import { useRouter } from 'vue-router'
export const useFacilityNav = () => {
const store = useRootStore()
const router = useRouter()
function handleFacility({ abbreviation, customFacilityName, customFacilityNameEn, navFilePath, code, name, nameEn }: 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 ? customFacilityName : name,
shopNameEn: customFacilityNameEn ? customFacilityNameEn : nameEn,
floorOrder: floor,
floor: floorName,
logoUrl: navFilePath,
yaxis: node,
shopCode: code
})
store.SET_SHOP(shop)
router.push('/nav')
}
return { handleFacility }
}