);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [action, opened, close, renderComfirm]);
- const actionDataMemo = useMemo(() => {
- const newActions = actions?.reduce((prev, cur) => {
- prev.push({ value: String(cur.key), label: cur.title, disabled: cur?.disabled ? cur.disabled(chooses || []) : false });
- return prev;
- }, [] as { value: string; label: string; disabled: boolean }[]);
+ useEffect(() => {
+ if (!initFilter) return;
- return newActions;
- }, [actions, chooses]);
+ const params = initFilter.reduce((prev, cur) => {
+ if (cur.key === searchKey) {
+ prev[cur.key] = cur.type;
+ }
+ return prev;
+ }, {} as Record