|
|
|
@ -2,15 +2,16 @@ import { useRootStore } from '@/store/root' |
|
|
|
import { storeToRefs } from 'pinia' |
|
|
|
import { getMapData } from '@/http/api/base' |
|
|
|
import Message from '@/base/Message/Message' |
|
|
|
import { PREFIX } from '@/enums' |
|
|
|
|
|
|
|
export const useInitMap = async function () { |
|
|
|
const store = useRootStore() |
|
|
|
const { device, facilityList, shopList, config } = storeToRefs(store) |
|
|
|
const { device, facilityList, shopList } = storeToRefs(store) |
|
|
|
try { |
|
|
|
const { data } = await getMapData() |
|
|
|
const delPrefixOfFacilityList = facilityList.value.slice().map(item => ({ |
|
|
|
...item, |
|
|
|
filePath: item.filePath.replace(config.value.sourceUrl, '') |
|
|
|
filePath: item.filePath.replace(PREFIX.STATIC_URL, '') |
|
|
|
})) |
|
|
|
|
|
|
|
//初始化地图
|
|
|
|
|