fix: 高级筛选-已经删除的选项不展示

--bug=1047059 --user=吕梦园
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001047059
This commit is contained in:
teukkk 2024-09-25 16:41:26 +08:00 committed by Craftsman
parent 44d968e959
commit 0f11417e75
1 changed files with 13 additions and 1 deletions

View File

@ -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,
});
}
});