From 254a6ad8f000a45f1dafc24a0159dd332de26f9a Mon Sep 17 00:00:00 2001 From: yxh01132861 Date: Fri, 20 Oct 2023 18:11:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=84=E5=AE=A1=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ScaleSelector/CustomMaPpingColor/index.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/li-p2/src/LayerAttribute/components/ScaleSelector/CustomMaPpingColor/index.tsx b/packages/li-p2/src/LayerAttribute/components/ScaleSelector/CustomMaPpingColor/index.tsx index c7432323..07ec63c6 100644 --- a/packages/li-p2/src/LayerAttribute/components/ScaleSelector/CustomMaPpingColor/index.tsx +++ b/packages/li-p2/src/LayerAttribute/components/ScaleSelector/CustomMaPpingColor/index.tsx @@ -86,11 +86,11 @@ const CustomMappingColor = (props: CustomMappingColorProps) => { const deletePaletteRangeItem = (index: number, position: string | null) => { if (dataType === 'number') { const _value = customRanges[index]; - // @ts-ignore + const list: CustomMappingColorItem[] = customRanges .map((item, _index) => { if (index === _index) { - return undefined; + return item; } if (position !== 'last') { @@ -115,7 +115,7 @@ const CustomMappingColor = (props: CustomMappingColorProps) => { return item; } }) - .filter((item) => !isEmpty(item)); + .filter((item, _index) => _index !== index); setCustomRanges(list); } else { @@ -125,7 +125,6 @@ const CustomMappingColor = (props: CustomMappingColorProps) => { const onChangePaletteRangeItem = (value: (string | number | null)[], color: string, index: number) => { if (dataType === 'number') { - // @ts-ignore const list: CustomMappingColorItem[] = customRanges.map((item, _index) => { if (index === _index) { return { @@ -154,7 +153,6 @@ const CustomMappingColor = (props: CustomMappingColorProps) => { setCustomRanges(list); } else { - // @ts-ignore const list: CustomMappingColorItem[] = customRanges.map((item, _index) => { if (index === _index) { return {