From a2ed12930fbd98d8aac410663e4e8d01ee7660b5 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Tue, 17 Mar 2026 18:31:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9C=B0=E5=9B=BE):=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=85=BE=E8=AE=AF=E5=9C=B0=E5=9B=BE=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=BB=91=E5=8A=A8=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BB=A5=E5=8F=8A=E6=8F=90=E5=8D=87?= =?UTF-8?q?tooltip=E5=B1=82=E7=BA=A7=E4=BB=A5=E9=81=BF=E5=85=8D=E8=A2=AB?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/panel/charts/map/symbolic-map.ts | 5 +++++ .../components/js/panel/common/common_antv.ts | 17 +++++++++++------ .../views/components/ChartComponentG2Plot.vue | 17 ++++++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts index 83d0514859..fc5b2fa21f 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts @@ -155,6 +155,11 @@ export class SymbolicMap extends L7ChartView { chart.container = container configCarouselTooltip(chart, symbolicLayer, symbolicLayer.sourceOption.data, scene) qqMapRendered(scene) + // 提高tooltip层级,避免被地图覆盖 + const containerElement = document.getElementById(container) + containerElement + ?.querySelectorAll('.l7-marker-container') + .forEach(el => (el.style.zIndex = '3')) }) symbolicLayer.on('click', ev => { const data = ev.feature diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index f6d039bfb0..37320037c3 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -1261,14 +1261,14 @@ export function configL7Zoom( // 当地图未加载完成时,无法配置控制项,需要监听loaded事件 if (!scene.loaded) { scene.once('loaded', () => { - updateMapStatusOption(mapKey.mapType, scene, false) + updateMapStatusOption(chart, mapKey.mapType, scene, false) }) } else { - updateMapStatusOption(mapKey.mapType, scene, false) + updateMapStatusOption(chart, mapKey.mapType, scene, false) } return } - updateMapStatusOption(mapKey.mapType, scene, true) + updateMapStatusOption(chart, mapKey.mapType, scene, true) if (!scene?.getControlByName('zoom')) { if (!scene.map) { scene.once('loaded', () => { @@ -2519,7 +2519,7 @@ export const configRoundAngle = (chart: Chart, styleName: string, callBack?: (da * @param scene * @param enable */ -function updateMapStatusOption(mapType: string, scene: Scene, enable = false) { +function updateMapStatusOption(chart: Chart, mapType: string, scene: Scene, enable = false) { switch (mapType) { case 'tianditu': if (enable) { @@ -2557,9 +2557,14 @@ function updateMapStatusOption(mapType: string, scene: Scene, enable = false) { } // 当交互关闭时,画布容器不响应事件,避免与地图交互冲突 if (!enable && isMobile()) { - const sceneEl = scene + let sceneEl = scene .getServiceContainer?.() .sceneService?.getSceneContainer() as HTMLElement | null - sceneEl && (sceneEl.style.pointerEvents = 'auto') + if (mapType === 'qq') { + sceneEl = document.getElementById(chart.container) + sceneEl && (sceneEl.style.pointerEvents = 'none') + } else { + sceneEl && (sceneEl.style.pointerEvents = 'auto') + } } } diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue index f2cd2a63ed..a3d5ca68f6 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue @@ -422,6 +422,7 @@ let mapL7Timer: number const renderL7 = async (chart: ChartObj, chartView: L7ChartView, callback) => { mapL7Timer && clearTimeout(mapL7Timer) mapL7Timer = setTimeout(async () => { + chart.container = containerId myChart = await chartView.drawChart({ chartObj: myChart, container: containerId, @@ -846,9 +847,19 @@ watch( newVal => { if (ONLINE_CHARTS.includes(view.value.type) && isMobile() && shouldHideZoom()) { const containerDiv = document.getElementById(containerId) - containerDiv?.querySelectorAll('.l7-scene').forEach(el => { - el.style.pointerEvents = newVal ? 'none' : 'auto' - }) + if (!containerDiv) return + // 仅有腾讯地图配置该参数 + const isQQMap = !!containerDiv.style.pointerEvents + const containerEvents = newVal ? 'auto' : 'none' + const sceneEvents = isQQMap ? containerEvents : newVal ? 'none' : 'auto' + + if (isQQMap) { + containerDiv.style.pointerEvents = containerEvents + } + + containerDiv + .querySelectorAll('.l7-scene') + .forEach(el => (el.style.pointerEvents = sceneEvents)) } } )