diff --git a/CHANGELOG.md b/CHANGELOG.md index a977e597cf6ff18be7fad3baf7ec2cf7d8a38d6f..cc753d0708c83e00c84c097083acfb510bd8509d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ ## [Unreleased] +### Added + +- drbar、drtab事件参数调整 + +### Fixed + +- 修复地图自定义样式初次绘制数据异常 + ## [0.7.41-alpha.14] - 2025-07-23 ### Added diff --git a/src/common/map-chart/map-chart.tsx b/src/common/map-chart/map-chart.tsx index 258f902021a8d435c1574bb7e51eee273b392fe3..f9e09ccae878dc26736a8a629347e8f24f8f9b51 100644 --- a/src/common/map-chart/map-chart.tsx +++ b/src/common/map-chart/map-chart.tsx @@ -1,12 +1,5 @@ /* eslint-disable eqeqeq */ -import { - defineComponent, - onMounted, - PropType, - computed, - toRefs, - watch, -} from 'vue'; +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'; @@ -50,7 +43,7 @@ export const IBizMapChart = defineComponent({ } }; - const { chartRef, historyNames, changeMap, getCityName, goBack, refresh } = + const { chartRef, historyNames, changeMap, getCityName, goBack } = useMapManager( options, mapName => { @@ -207,11 +200,6 @@ export const IBizMapChart = defineComponent({ changeMap(options.value.defaultAreaCode, true); }); - const { areaData, pointData } = toRefs(props); - watch([areaData, pointData], () => { - refresh(); - }); - return { ns, chartRef, historyNames, goBack }; }, render() { diff --git a/src/control/drbar/drbar.tsx b/src/control/drbar/drbar.tsx index 4e57ba42589d677b4b5a55d14b72343fe20081be..4a987dc641d698f1e57e18f86716d6dca43321be 100644 --- a/src/control/drbar/drbar.tsx +++ b/src/control/drbar/drbar.tsx @@ -12,7 +12,7 @@ import { VNode, watch, } from 'vue'; -import { IDEDRBar, IDEDRCtrlItem } from '@ibiz/model-core'; +import { IDEDRBar } from '@ibiz/model-core'; import { useRoute, useRouter } from 'vue-router'; import { IControlProvider, IDRBarItemsState } from '@ibiz-template/runtime'; import { DRBarController } from './drbar.controller'; @@ -53,7 +53,9 @@ export const DRBarControl = defineComponent({ hideEditItem: { type: Boolean, default: undefined }, }, setup(props) { - const c = useControlController((...args) => new DRBarController(...args)); + const c: DRBarController = useControlController( + (...args) => new DRBarController(...args), + ); const ns = useNamespace(`control-${c.model.controlType!.toLowerCase()}`); const router = useRouter(); @@ -75,13 +77,12 @@ export const DRBarControl = defineComponent({ const handleSelect = (key: string): void => { c.handleSelectChange(key); - const drBarItem = c.model.dedrctrlItems?.find( - (item: IDEDRCtrlItem) => item.id === key, - ); - c.evt.emit('onTabChange', { - name: key, - item: drBarItem || c.state.drBarItems[0], - }); + const drBarItem = c.state.drBarItems.find(item => item.tag === key); + if (drBarItem) { + c.evt.emit('onTabChange', { + data: drBarItem, + }); + } }; const route = useRoute(); diff --git a/src/control/drtab/drtab.tsx b/src/control/drtab/drtab.tsx index ba231b474c4fe8aad4fe6b4c8f31191017c428dc..67cd241f65f621ac12b46d1ee0d691cafff6ce14 100644 --- a/src/control/drtab/drtab.tsx +++ b/src/control/drtab/drtab.tsx @@ -90,13 +90,14 @@ export const DRTabControl = defineComponent({ const emitChange = () => { const { activeName } = c.state; - const drBarItem = c.model.dedrtabPages?.find( - item => item.id === activeName, + const drTabItem = c.state.drTabPages.find( + item => item.tag === activeName, ); - c.evt.emit('onTabChange', { - name: activeName, - item: drBarItem || c.state.drTabPages[0], - }); + if (drTabItem) { + c.evt.emit('onTabChange', { + data: drTabItem, + }); + } }; const handleTabChange = (): void => { diff --git a/src/control/map/map.tsx b/src/control/map/map.tsx index 96dc5cc45fc704b0abe3783da498a506c622d49f..78e4566c4987816113e6f2219d9b9ad258a42e76 100644 --- a/src/control/map/map.tsx +++ b/src/control/map/map.tsx @@ -69,7 +69,7 @@ const MapControl = defineComponent({ }, render() { const { state } = this.c; - if (!state.isCreated) return; + if (!state.isCreated || !state.isLoaded) return; return (