From b4d47f170582fba4781223b9e9c49094e46d94fc Mon Sep 17 00:00:00 2001 From: gggpound Date: Sat, 23 Mar 2024 16:33:54 +0800 Subject: [PATCH] fix(cf): different styles of icon set render different results (#485) --- .../src/services/calculate-unit/icon-set.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/sheets-conditional-format/src/services/calculate-unit/icon-set.ts b/packages/sheets-conditional-format/src/services/calculate-unit/icon-set.ts index 0d507b700c..7a8f9d4aaf 100644 --- a/packages/sheets-conditional-format/src/services/calculate-unit/icon-set.ts +++ b/packages/sheets-conditional-format/src/services/calculate-unit/icon-set.ts @@ -73,14 +73,17 @@ export const iconSetCalculateUnit: ICalculateUnit = { computeResult.setValue(row, col, { iconId, iconType, isShowValue }); return; } + } else if (index === splitValue.length - 1) { + computeResult.setValue(row, col, { iconId, iconType, isShowValue }); + return; } else { const pre = splitValue[index - 1]; end.operator = getOppositeOperator(pre.operator); end.value = pre.value; - } - if (compareWithNumber(start, value) && compareWithNumber(end, value)) { - computeResult.setValue(row, col, { iconId, iconType, isShowValue }); - return; + if (compareWithNumber(start, value) && compareWithNumber(end, value)) { + computeResult.setValue(row, col, { iconId, iconType, isShowValue }); + return; + } } } });