From 18924814022597ff092f481cfb545745ed8a51fd Mon Sep 17 00:00:00 2001 From: Cano1997 <1978141412@qq.com> Date: Sat, 23 Aug 2025 09:22:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E4=B8=8B=E9=92=BB=E3=80=81=E8=BF=94=E5=9B=9E=E5=90=8E=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=9C=B0=E5=9B=BE=E6=95=B0=E6=8D=AE=E6=9C=AA=E5=9B=9E?= =?UTF-8?q?=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ src/common/map-chart-user/map-user-manager.ts | 2 +- src/common/map-chart/map-chart.tsx | 10 ++++++---- src/common/map-chart/map-manager.ts | 7 ++++--- src/control/map/map.tsx | 4 +--- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed9ab7d4..3660acc25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ - 修复表格和树表格刷新模式异常 - 修复多选视图选择数据异常 - 修复数据选择(下拉视图)和数据选择(嵌入视图)数据回显异常 +- 修复地图下钻、返回后数据地图数据未回显 + ### Changed - 补充地图初始化设置行政等级参数 diff --git a/src/common/map-chart-user/map-user-manager.ts b/src/common/map-chart-user/map-user-manager.ts index c9212a066..3269618fc 100644 --- a/src/common/map-chart-user/map-user-manager.ts +++ b/src/common/map-chart-user/map-user-manager.ts @@ -87,7 +87,7 @@ export function useMapManager( await registerMap(strName); } if (!isInit) { - controller.onMapChange(areaCode); + await controller.onMapChange(areaCode); } else { // 初次加载设置默认行政等级 const areaLevel = areaLevelMap.get(toNumber(areaCode)) || ''; diff --git a/src/common/map-chart/map-chart.tsx b/src/common/map-chart/map-chart.tsx index f9e09ccae..293156052 100644 --- a/src/common/map-chart/map-chart.tsx +++ b/src/common/map-chart/map-chart.tsx @@ -2,7 +2,7 @@ import { defineComponent, onMounted, PropType, computed } from 'vue'; import { isNil, mergeDeepWithKey } from 'ramda'; import { useNamespace } from '@ibiz-template/vue3-util'; -import { IMapData } from '@ibiz-template/runtime'; +import { IMapData, MapController } from '@ibiz-template/runtime'; import { defaultOpts, MapOptions } from './map-chart.util'; import { useMapManager } from './map-manager'; import './map-chart.scss'; @@ -20,6 +20,10 @@ export const IBizMapChart = defineComponent({ type: Object as PropType>, default: () => ({}), }, + controller: { + type: MapController, + required: true, + }, }, setup(props, { emit }) { const ns = useNamespace('map-chart'); @@ -45,6 +49,7 @@ export const IBizMapChart = defineComponent({ const { chartRef, historyNames, changeMap, getCityName, goBack } = useMapManager( + props.controller, options, mapName => { const { @@ -181,9 +186,6 @@ export const IBizMapChart = defineComponent({ }, (name, e) => { switch (name) { - case 'mapChange': - emit('mapChange', e); - break; case 'pointClick': emit('pointClick', findData(e._id, 'point')); break; diff --git a/src/common/map-chart/map-manager.ts b/src/common/map-chart/map-manager.ts index 1a2171882..521852005 100644 --- a/src/common/map-chart/map-manager.ts +++ b/src/common/map-chart/map-manager.ts @@ -1,6 +1,7 @@ /* eslint-disable no-unused-vars */ import { registerMap as register, EChartsType, init } from 'echarts'; import { ComputedRef, onMounted, onUnmounted, ref } from 'vue'; +import { MapController } from '@ibiz-template/runtime'; import { MapOptions } from './map-chart.util'; import { getJsonUrl } from './map-json'; @@ -15,6 +16,7 @@ import { getJsonUrl } from './map-json'; */ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function useMapManager( + controller: MapController, opts: ComputedRef, calcEchartsOpts: (name: string) => IData, emit: (name: string, e: IData) => void, @@ -69,9 +71,8 @@ export function useMapManager( const changeMap = async (name: string | number, isInit: boolean = false) => { if (!isInit) { - emit('mapChange', { - areaCode: opts.value.strAreaCode ? `${name}` : Number(name), - }); + const areaCode = opts.value.strAreaCode ? `${name}` : Number(name); + await controller.onMapChange(areaCode); } const strName = `${name}`; diff --git a/src/control/map/map.tsx b/src/control/map/map.tsx index 3a13070a6..873995e5f 100644 --- a/src/control/map/map.tsx +++ b/src/control/map/map.tsx @@ -83,13 +83,11 @@ const MapControl = defineComponent({ > ) : ( { - this.c.onMapChange(e.areaCode); - }} onPointClick={(e: IMapData) => { this.c.onPointClick(e); }} -- Gitee