fix: 高级筛选-已经删除的选项不展示
--bug=1047059 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001047059
This commit is contained in:
parent
44d968e959
commit
0f11417e75
|
@ -282,11 +282,23 @@
|
|||
const list: FilterFormItem[] = [];
|
||||
(res.conditions ?? [])?.forEach((item: ConditionsItem) => {
|
||||
const listItem = getListItemByDataIndex(item.name ?? '') as FilterFormItem;
|
||||
let { value } = item;
|
||||
// 过滤掉已经删除的选项
|
||||
if (FilterType.SELECT === listItem?.type) {
|
||||
const valueKeyList = listItem.selectProps?.options?.map(
|
||||
(option) => option[listItem.selectProps?.valueKey ?? 'value']
|
||||
);
|
||||
value = value?.filter((valueItem: string) => valueKeyList?.includes(valueItem));
|
||||
} else if (FilterType.MEMBER === listItem?.type) {
|
||||
value = value?.filter((valueItem: string) =>
|
||||
props.memberOptions?.map((option) => option.value).includes(valueItem)
|
||||
);
|
||||
}
|
||||
if (listItem) {
|
||||
list.push({
|
||||
...listItem,
|
||||
operator: item.operator,
|
||||
value: item.value,
|
||||
value,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue