|
|
@ -73,22 +73,22 @@ export async function validateCondition(filters: Filter[], data: any) { |
|
|
|
res = data[field] !== null; |
|
|
|
res = data[field] !== null; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'allof': |
|
|
|
case 'allof': |
|
|
|
res = (filter.value?.split(',') ?? []).every((item) => |
|
|
|
res = (filter.value?.split(',').map((item) => item.trim()) ?? []).every((item) => |
|
|
|
(data[field]?.split(',') ?? []).includes(item) |
|
|
|
(data[field]?.split(',') ?? []).includes(item) |
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'anyof': |
|
|
|
case 'anyof': |
|
|
|
res = (filter.value?.split(',') ?? []).some((item) => |
|
|
|
res = (filter.value?.split(',').map((item) => item.trim()) ?? []).some((item) => |
|
|
|
(data[field]?.split(',') ?? []).includes(item) |
|
|
|
(data[field]?.split(',') ?? []).includes(item) |
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'nallof': |
|
|
|
case 'nallof': |
|
|
|
res = !(filter.value?.split(',') ?? []).every((item) => |
|
|
|
res = !(filter.value?.split(',').map((item) => item.trim()) ?? []).every((item) => |
|
|
|
(data[field]?.split(',') ?? []).includes(item) |
|
|
|
(data[field]?.split(',') ?? []).includes(item) |
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'nanyof': |
|
|
|
case 'nanyof': |
|
|
|
res = !(filter.value?.split(',') ?? []).some((item) => |
|
|
|
res = !(filter.value?.split(',').map((item) => item.trim()) ?? []).some((item) => |
|
|
|
(data[field]?.split(',') ?? []).includes(item) |
|
|
|
(data[field]?.split(',') ?? []).includes(item) |
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|