import { findOnMap } from "../api/map"
|
|
export default class MapData {
|
public deviceList: Array<object> = [];
|
public onMapDeviceList: Array<object> = [];
|
public currentFloor: Number = 0;
|
|
public currentMarker: Object = {};
|
|
constructor() {
|
this.deviceList = []
|
this.onMapDeviceList = []
|
this.currentFloor = 0
|
this.currentMarker = {}
|
}
|
|
async findOnMap(floor, isOnMap) {
|
const res: any = await findOnMap({
|
floor: floor,
|
isOnMap: isOnMap
|
})
|
if (res && res.success) {
|
// console.log(res,'查找所有未标记的设备')
|
if (isOnMap) {
|
this.onMapDeviceList = res.data.map(i => {
|
i.isLock = true
|
return i
|
})
|
} else {
|
this.deviceList = res.data
|
}
|
}
|
}
|
|
refreshDeviceList() {
|
this.findOnMap(-9999, true)
|
this.findOnMap(-9999, false)
|
}
|
}
|