diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js index f8a053fc..e7b4812f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js @@ -69,6 +69,7 @@ export const eventMap = { .finally(() => loadingMessage.close()); if (!data) return; + if (!data.length) return Message.warning(`没有${item.title}设备数据!`); eventMap[`地图路测设备/map_close`](item); @@ -110,6 +111,8 @@ export const eventMap = { if (!data) return; + if (!data.length) return Message.warning(`没有${item.title}事件数据!`); + eventMap[`地图事件专题/map_close`](item); cacheRemoveFunc[`地图事件专题/${item.title}`] = await setMarkToMap.call( diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js index 5c44c837..2786c2f1 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js @@ -25,7 +25,8 @@ export async function setMarkerCluster(map, points, markerFun) { let hasClick = false; - if (!points.length) Message.warning("未能匹配到对应坐标点"); + // if (!points.length) return Message.warning("未能匹配到对应坐标点"); + if (!points.length) return []; const markerCluster = new AMap.MarkerCluster(map, points, { // gridSize: 15,