|
@ -84,11 +84,11 @@ let debounceNoneLngLatMessage = debounce(() => { |
|
|
Message.warning("部分设备经纬度为空"); |
|
|
Message.warning("部分设备经纬度为空"); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function resolveDataOptions(data, config, component) { |
|
|
function resolveDataOptions(data, config, component, isDefault) { |
|
|
let lnglat = |
|
|
let lnglat = |
|
|
data.longitude && data.latitude ? [data.longitude, data.latitude] : null; |
|
|
data.longitude && data.latitude ? [data.longitude, data.latitude] : null; |
|
|
|
|
|
|
|
|
if (!lnglat) debounceNoneLngLatMessage(); |
|
|
if (!lnglat && !isDefault) debounceNoneLngLatMessage(); |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
weight: 1, |
|
|
weight: 1, |
|
@ -113,15 +113,17 @@ function resolveDataOptions(data, config, component) { |
|
|
|
|
|
|
|
|
export const eventMap = { |
|
|
export const eventMap = { |
|
|
// 设备 需要在地图显示的
|
|
|
// 设备 需要在地图显示的
|
|
|
async "地图路测设备/map"(item, filterData) { |
|
|
async "地图路测设备/map"(item, filterData, isDefault) { |
|
|
const config = DeviceForMap[item.title]; |
|
|
const config = DeviceForMap[item.title]; |
|
|
|
|
|
let loadingMessage; |
|
|
const loadingMessage = Message.info({ |
|
|
if (!isDefault) { |
|
|
|
|
|
loadingMessage = Message.info({ |
|
|
message: `${item.title}设备加载中...`, |
|
|
message: `${item.title}设备加载中...`, |
|
|
duration: 0, |
|
|
duration: 0, |
|
|
customClass: "loading-message", |
|
|
customClass: "loading-message", |
|
|
iconClass: "el-icon-loading", |
|
|
iconClass: "el-icon-loading", |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const data = await getDeviceList(config.deviceType, filterData) |
|
|
const data = await getDeviceList(config.deviceType, filterData) |
|
|
.then(async (data) => { |
|
|
.then(async (data) => { |
|
@ -130,10 +132,11 @@ export const eventMap = { |
|
|
}) |
|
|
}) |
|
|
.catch(() => {}); |
|
|
.catch(() => {}); |
|
|
|
|
|
|
|
|
loadingMessage.close(); |
|
|
loadingMessage?.close(); |
|
|
|
|
|
|
|
|
if (!data) return; |
|
|
if (!data) return; |
|
|
if (!data.length) return Message.warning(`没有${item.title}事件数据!`); |
|
|
if (!data.length && !isDefault) |
|
|
|
|
|
return Message.warning(`没有${item.title}事件数据!`); |
|
|
|
|
|
|
|
|
eventMap[`地图路测设备/map_close`](item); |
|
|
eventMap[`地图路测设备/map_close`](item); |
|
|
|
|
|
|
|
@ -143,7 +146,7 @@ export const eventMap = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
let removeData = data.map((item) => |
|
|
let removeData = data.map((item) => |
|
|
resolveDataOptions.call(this, item, options, config.dialog) |
|
|
resolveDataOptions.call(this, item, options, config.dialog, isDefault) |
|
|
); |
|
|
); |
|
|
console.log( |
|
|
console.log( |
|
|
"%c [ removeData ]-112-「buttonEvent.js」", |
|
|
"%c [ removeData ]-112-「buttonEvent.js」", |
|
@ -161,14 +164,16 @@ export const eventMap = { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 事件 需要在地图显示的
|
|
|
// 事件 需要在地图显示的
|
|
|
async "地图事件专题/map"(item) { |
|
|
async "地图事件专题/map"(item, filterData, isDefault) { |
|
|
const loadingMessage = Message.info({ |
|
|
let loadingMessage; |
|
|
|
|
|
if (!isDefault) { |
|
|
|
|
|
loadingMessage = Message.info({ |
|
|
message: `${item.title}事件位置加载中...`, |
|
|
message: `${item.title}事件位置加载中...`, |
|
|
duration: 0, |
|
|
duration: 0, |
|
|
customClass: "loading-message", |
|
|
customClass: "loading-message", |
|
|
iconClass: "el-icon-loading", |
|
|
iconClass: "el-icon-loading", |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
const data = await getEventTopicList(EventTopics[item.title]) |
|
|
const data = await getEventTopicList(EventTopics[item.title]) |
|
|
.then(async (data) => { |
|
|
.then(async (data) => { |
|
|
await delay(600); |
|
|
await delay(600); |
|
@ -176,11 +181,12 @@ export const eventMap = { |
|
|
}) |
|
|
}) |
|
|
.catch(() => {}); |
|
|
.catch(() => {}); |
|
|
|
|
|
|
|
|
loadingMessage.close(); |
|
|
loadingMessage?.close(); |
|
|
|
|
|
|
|
|
if (!data) return; |
|
|
if (!data) return; |
|
|
|
|
|
|
|
|
if (!data.length) return Message.warning(`没有${item.title}事件数据!`); |
|
|
if (!data.length && !isDefault) |
|
|
|
|
|
return Message.warning(`没有${item.title}事件数据!`); |
|
|
|
|
|
|
|
|
eventMap[`地图事件专题/map_close`](item); |
|
|
eventMap[`地图事件专题/map_close`](item); |
|
|
|
|
|
|
|
@ -190,7 +196,13 @@ export const eventMap = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
let removeData = data.map((item) => |
|
|
let removeData = data.map((item) => |
|
|
resolveDataOptions.call(this, item, options, "TrafficIncidents") |
|
|
resolveDataOptions.call( |
|
|
|
|
|
this, |
|
|
|
|
|
item, |
|
|
|
|
|
options, |
|
|
|
|
|
"TrafficIncidents", |
|
|
|
|
|
isDefault |
|
|
|
|
|
) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
markerClusterIns.addData(removeData); |
|
|
markerClusterIns.addData(removeData); |
|
@ -203,14 +215,16 @@ export const eventMap = { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 感知事件
|
|
|
// 感知事件
|
|
|
async "事件专题/感知事件"(item) { |
|
|
async "事件专题/感知事件"(item, filterData, isDefault) { |
|
|
const loadingMessage = Message.info({ |
|
|
let loadingMessage; |
|
|
|
|
|
if (!isDefault) { |
|
|
|
|
|
loadingMessage = Message.info({ |
|
|
message: `${item.title}位置加载中...`, |
|
|
message: `${item.title}位置加载中...`, |
|
|
duration: 0, |
|
|
duration: 0, |
|
|
customClass: "loading-message", |
|
|
customClass: "loading-message", |
|
|
iconClass: "el-icon-loading", |
|
|
iconClass: "el-icon-loading", |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
const data = await getPerceiveEventList() |
|
|
const data = await getPerceiveEventList() |
|
|
.then(async (data) => { |
|
|
.then(async (data) => { |
|
|
await delay(600); |
|
|
await delay(600); |
|
@ -218,11 +232,12 @@ export const eventMap = { |
|
|
}) |
|
|
}) |
|
|
.catch(() => {}); |
|
|
.catch(() => {}); |
|
|
|
|
|
|
|
|
loadingMessage.close(); |
|
|
loadingMessage?.close(); |
|
|
|
|
|
|
|
|
if (!data) return; |
|
|
if (!data) return; |
|
|
|
|
|
|
|
|
if (!data?.length) return Message.warning(`没有${item.title}数据!`); |
|
|
if (!data?.length && !isDefault) |
|
|
|
|
|
return Message.warning(`没有${item.title}数据!`); |
|
|
|
|
|
|
|
|
eventMap[`事件专题/感知事件_close`](item); |
|
|
eventMap[`事件专题/感知事件_close`](item); |
|
|
|
|
|
|
|
@ -232,12 +247,12 @@ export const eventMap = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
let removeData = data.map((item) => |
|
|
let removeData = data.map((item) => |
|
|
resolveDataOptions.call(this, item, options, "PerceiveEvent") |
|
|
resolveDataOptions.call(this, item, options, "PerceiveEvent", isDefault) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
markerClusterIns.addData(removeData); |
|
|
markerClusterIns.addData(removeData); |
|
|
|
|
|
|
|
|
loadingMessage.close(); |
|
|
loadingMessage?.close(); |
|
|
|
|
|
|
|
|
cacheRemoveFunc[`事件专题/${item.title}`] = () => |
|
|
cacheRemoveFunc[`事件专题/${item.title}`] = () => |
|
|
markerClusterIns.removeData(removeData); |
|
|
markerClusterIns.removeData(removeData); |
|
|