From a7e466142d2eabdc8899f19bd64dd6257db961ac Mon Sep 17 00:00:00 2001 From: chanx <1243304602@qq.com> Date: Tue, 30 Dec 2025 19:53:00 +0800 Subject: [PATCH] Fix: Dataset parse logic (#12330) ### What problem does this PR solve? Fix: Dataset logic of parser ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- .../originui/select-with-search.tsx | 15 +- web/src/locales/en.ts | 2 + web/src/locales/zh.ts | 3 +- web/src/pages/dataset/dataset/index.tsx | 3 +- .../dataset/dataset/parsing-status-cell.tsx | 2 +- .../pages/dataset/dataset/reparse-dialog.tsx | 137 ++++++++++-------- .../dataset/use-bulk-operate-dataset.tsx | 14 +- web/src/pages/dataset/process-log-modal.tsx | 25 ++-- .../memory-setting/memory-model-form.tsx | 1 + 9 files changed, 126 insertions(+), 76 deletions(-) diff --git a/web/src/components/originui/select-with-search.tsx b/web/src/components/originui/select-with-search.tsx index fbee3c95f..5990bf540 100644 --- a/web/src/components/originui/select-with-search.tsx +++ b/web/src/components/originui/select-with-search.tsx @@ -109,6 +109,19 @@ export const SelectWithSearch = forwardRef< } }, [options, value]); + const showSearch = useMemo(() => { + if (Array.isArray(options) && options.length > 5) { + return true; + } + if (Array.isArray(options)) { + const optionsNum = options.reduce((acc, option) => { + return acc + (option?.options?.length || 0); + }, 0); + return optionsNum > 5; + } + return false; + }, [options]); + const handleSelect = useCallback( (val: string) => { setValue(val); @@ -179,7 +192,7 @@ export const SelectWithSearch = forwardRef< align="start" > - {options && options.length > 5 && ( + {showSearch && (