From b4e2cb5f0ffa0c2e373444df8678fe785f6c20a0 Mon Sep 17 00:00:00 2001 From: syb01094648 Date: Thu, 7 Mar 2024 17:08:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9ts=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../official-layer-control/index.tsx | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/components/map-control-group/official-layer-control/index.tsx b/src/components/map-control-group/official-layer-control/index.tsx index 25893c1..9dcfd5a 100644 --- a/src/components/map-control-group/official-layer-control/index.tsx +++ b/src/components/map-control-group/official-layer-control/index.tsx @@ -31,6 +31,13 @@ const enLayout = { wrapperCol: { span: 15 }, }; +type customTilesItemProps = { + id: string; + image?: string; + title?: string; + layers?: string[]; +}; + export function OfficialLayerControl() { const [form] = Form.useForm(); const styles = useStyle(); @@ -91,12 +98,7 @@ export function OfficialLayerControl() { return false; // 阻止antd组件自动上传 }; - const onItemClick = (item: { - id: any; - image: string; - title: string; - layers: string[]; - }) => { + const onItemClick = (item: customTilesItemProps) => { setRadioValue(item.id); setLayerType( item.id === OfficeLayerEnum.VectorMap ? [] : ([item.id] as string[]), @@ -142,12 +144,7 @@ export function OfficialLayerControl() { const onConfirm = ( e: React.MouseEvent | undefined, - item: { - id: string; - image?: string; - title?: string; - layers?: string[]; - }, + item: customTilesItemProps, ) => { e?.stopPropagation(); const newCustomTiles = customTiles.filter((val) => {