Skip to content

Commit

Permalink
fix(state): the in and nin filter logic of rate fied does not take ef…
Browse files Browse the repository at this point in the history
…fect (#193)
  • Loading branch information
minlovehua authored Dec 18, 2024
1 parent 9863899 commit 2f0a8e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/state/src/utils/field/model/rate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export class RateField extends Field {
case AITableFilterOperation.exists:
return !isEmpty(cellValue);
case AITableFilterOperation.in:
return !isEmpty(cellValue) && condition.value.includes(cellValue.toString());
const isContain = condition.value.some((item) => String(item) === String(cellValue));
return !isEmpty(cellValue) && isContain;
case AITableFilterOperation.nin:
return isEmpty(cellValue) || !condition.value.includes(cellValue.toString());
const noContain = condition.value.every((item) => String(item) !== String(cellValue));
return isEmpty(cellValue) || noContain;
default:
return super.isMeetFilter(condition, cellValue);
}
Expand Down

0 comments on commit 2f0a8e0

Please sign in to comment.