|
|
@ -6,6 +6,7 @@ import { |
|
|
|
import { delay } from "@screen/utils/common"; |
|
|
|
import { Message } from "element-ui"; |
|
|
|
import { EventTopics } from "@screen/utils/enum.js"; |
|
|
|
import { debounce } from "lodash"; |
|
|
|
|
|
|
|
import { markerClusterIns } from "./map"; |
|
|
|
|
|
|
@ -55,10 +56,19 @@ export function getHandleDeviceType(item) { |
|
|
|
if (EventTopics[item.title]) return "地图事件专题/map"; |
|
|
|
} |
|
|
|
|
|
|
|
let debounceNoneLngLatMessage = debounce(() => { |
|
|
|
Message.warning("部分设备经纬度为空"); |
|
|
|
}); |
|
|
|
|
|
|
|
function resolveDataOptions(data, config, component) { |
|
|
|
let lnglat = |
|
|
|
data.longitude && data.latitude ? [data.longitude, data.latitude] : null; |
|
|
|
|
|
|
|
if (!lnglat) debounceNoneLngLatMessage(); |
|
|
|
|
|
|
|
return { |
|
|
|
weight: 1, |
|
|
|
lnglat: [data.longitude, data.latitude], |
|
|
|
lnglat, |
|
|
|
name: "", |
|
|
|
config: { |
|
|
|
markerClick: (extData, item) => { |
|
|
@ -79,7 +89,7 @@ function resolveDataOptions(data, config, component) { |
|
|
|
|
|
|
|
export const eventMap = { |
|
|
|
// 设备 需要在地图显示的
|
|
|
|
async "地图路测设备/map"(item) { |
|
|
|
async "地图路测设备/map"(item, filterData) { |
|
|
|
const config = DeviceForMap[item.title]; |
|
|
|
|
|
|
|
const loadingMessage = Message.info({ |
|
|
@ -89,7 +99,7 @@ export const eventMap = { |
|
|
|
iconClass: "el-icon-loading", |
|
|
|
}); |
|
|
|
|
|
|
|
const data = await getDeviceList(config.deviceType) |
|
|
|
const data = await getDeviceList(config.deviceType, filterData) |
|
|
|
.then(async (data) => { |
|
|
|
await delay(600); |
|
|
|
return data; |
|
|
@ -111,6 +121,11 @@ export const eventMap = { |
|
|
|
let removeData = data.map((item) => |
|
|
|
resolveDataOptions.call(this, item, options, config.dialog) |
|
|
|
); |
|
|
|
console.log( |
|
|
|
"%c [ removeData ]-112-「buttonEvent.js」", |
|
|
|
"font-size:15px; background:#83c806; color:#c7ff4a;", |
|
|
|
removeData |
|
|
|
); |
|
|
|
|
|
|
|
markerClusterIns.addData(removeData); |
|
|
|
|
|
|
|