From 6aca5dcdb6a5810dbb57ae90c5e58eefc6b2769d Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期二, 15 四月 2025 13:28:31 +0800 Subject: [PATCH] 桌标判断空值 --- src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/BasicMap.vue | 44 ++++++++++++++++++++++++++++++-------------- 1 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/BasicMap.vue b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/BasicMap.vue index 5d42cb7..7fa4871 100644 --- a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/BasicMap.vue +++ b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/BasicMap.vue @@ -48,7 +48,12 @@ @toggleFullScreen="toggleFullScreen" ></PanelTool> - <Search class="absolute top-0 left-2 z-14 w-fit" :olMap="olMap" :propertyMap="propertyMap" :propertyConfigMap="propertyConfigMap"/> + <Search + class="absolute top-0 left-2 z-14 w-fit" + :olMap="olMap" + :propertyMap="propertyMap" + :propertyConfigMap="propertyConfigMap" + /> </div> </template> @@ -152,20 +157,31 @@ }; const addMarkerLayer = () => { const map = props.data.map; - if (map.pos_x == null && map.pos_y == null) return; - const dataList = (props.data?.values ?? []).map((item) => { - const x = item[map.pos_x]; - const y = item[map.pos_y]; + if (map.pos_x == null || map.pos_y == null) return; + const dataList = (props.data?.values ?? []) + .filter((item) => { + const x = item[map.pos_x]; + const y = item[map.pos_y]; + if (x === null || y == null) { + return false; + } else { + return true; + } + }) + .map((item) => { + const x = item[map.pos_x]; + const y = item[map.pos_y]; - return { - position: [x, y], - // textColor: item.color, - extData: { - value: item, - recordSetTable: props.data, - }, - }; - }); + return { + position: [x, y], + // textColor: item.color, + extData: { + value: item, + recordSetTable: props.data, + }, + }; + }); + olMap.value.addMarkerLayer(dataList, { markerOpt: { icon: { -- Gitblit v1.9.3