Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(conditional-formatting): aligning Excel Effects with 'No Interfer… (#4584)
Gpound.liuce0b939b9948
diff --git a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/highlight-cell-calculate-unit.ts b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/highlight-cell-calculate-unit.tsindex 2963224a23..c19b360e7c 100644--- a/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/highlight-cell-calculate-unit.ts+++ b/packages/sheets-conditional-formatting/src/models/calculate-unit-v2/highlight-cell-calculate-unit.ts@@ -218,10 +218,19 @@ export class HighlightCellCalculateUnit extends BaseCalculateUnit<Nullable<IConfswitch (ruleConfig.subType) {case CFSubRuleType.number: {const v = cellValue && Number(cellValue.v);- if (isNullable(v) || Number.isNaN(v) || cellValue?.t !== CellValueType.NUMBER) {+ const isNumber = cellValue?.t === CellValueType.NUMBER;+ const subRuleConfig = ruleConfig as INumberHighlightCell;+ if (!isNumber) {+ if ([CFNumberOperator.notEqual, CFNumberOperator.notBetween].includes(subRuleConfig.operator)) {+ return true;+ }+ return false;+ }++ if (isNullable(v) || Number.isNaN(v)) {return;}- const subRuleConfig = ruleConfig as INumberHighlightCell;+return compareWithNumber({ operator: subRuleConfig.operator, value: subRuleConfig.value || 0 }, v || 0);}case CFSubRuleType.text: {@@ -277,10 +286,20 @@ export class HighlightCellCalculateUnit extends BaseCalculateUnit<Nullable<IConfcase CFSubRuleType.average: {const value = cellValue && cellValue.v;const v = Number(value);- if (isNullable(value) || Number.isNaN(v) || cellValue?.t !== CellValueType.NUMBER || !preComputingResult) {+ const isNumber = cellValue?.t === CellValueType.NUMBER;+ const subRuleConfig = ruleConfig as IAverageHighlightCell;++ if (!isNumber) {+ if (CFNumberOperator.notEqual === subRuleConfig.operator) {+ return true;+ }return false;}- const subRuleConfig = ruleConfig as IAverageHighlightCell;++ if (isNullable(value) || Number.isNaN(v) || !preComputingResult) {+ return false;+ }+const average = preComputingResult.value;switch (subRuleConfig.operator) {