|
|
@ -1,17 +1,17 @@ |
|
|
import { useRouter } from 'vue-router' |
|
|
import { useRouter } from 'vue-router' |
|
|
import { useStore } from '@/store/root' |
|
|
import { useStore } from '@/store/root' |
|
|
import { uniqBy } from '@/utils/utils' |
|
|
import { uniqBy } from '@/utils/utils' |
|
|
import { getMap } from '@/http/api' |
|
|
|
|
|
|
|
|
import { getMap, getFacilityList } from '@/http/api' |
|
|
import Message from '@/base/Message/Message' |
|
|
import Message from '@/base/Message/Message' |
|
|
|
|
|
|
|
|
export const useInitMap = function () { |
|
|
export const useInitMap = function () { |
|
|
const store = useStore() |
|
|
const store = useStore() |
|
|
|
|
|
|
|
|
getMap() |
|
|
|
|
|
.then(({ data }) => { |
|
|
|
|
|
|
|
|
Promise.all([getMap(), getFacilityList()]) |
|
|
|
|
|
.then(([{ data }, { data: facs }]) => { |
|
|
store.SET_MAP_DATA(JSON.parse(data.mapData)) |
|
|
store.SET_MAP_DATA(JSON.parse(data.mapData)) |
|
|
//初始化地图
|
|
|
//初始化地图
|
|
|
onReady(store.currentFloor, data, store.shopList, () => { |
|
|
|
|
|
|
|
|
onReady(store.currentFloor, data, store.shopList, facs, () => { |
|
|
store.SET_MAP_STATUS(true) |
|
|
store.SET_MAP_STATUS(true) |
|
|
const facilityList = window.Map_QM.getAllIcon().flat(Infinity) |
|
|
const facilityList = window.Map_QM.getAllIcon().flat(Infinity) |
|
|
|
|
|
|
|
|
@ -73,7 +73,7 @@ export const showFacility = fac => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//地图初始化
|
|
|
//地图初始化
|
|
|
function onReady({ floorOrder, location, angle }, map, shop, callback) { |
|
|
|
|
|
|
|
|
function onReady({ floorOrder, location, angle }, map, shop, facs, callback) { |
|
|
//设备楼栋, 设备楼层, 点位(机器点位直连主干道而不在主干道上), 方向 84 85
|
|
|
//设备楼栋, 设备楼层, 点位(机器点位直连主干道而不在主干道上), 方向 84 85
|
|
|
window.MainMap_QM.init(callback, { |
|
|
window.MainMap_QM.init(callback, { |
|
|
build: 0, |
|
|
build: 0, |
|
|
@ -85,7 +85,8 @@ function onReady({ floorOrder, location, angle }, map, shop, callback) { |
|
|
containerId: 'mapContainer', |
|
|
containerId: 'mapContainer', |
|
|
mapData: map, |
|
|
mapData: map, |
|
|
shadow: false, |
|
|
shadow: false, |
|
|
shopData: shop |
|
|
|
|
|
|
|
|
shopData: shop, |
|
|
|
|
|
iconUrl: facs |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|