Fix: Bug fixes #9869 (#10600)

### What problem does this PR solve?

Fix: Bug fixes #9869
- Added the disabled attribute to control the modal confirmation button
state
- Conditionally rendered the catalog enhancement toggle component
- Replaced the selector component and removed unused imports
- Removed redundant catalog enhancement text in the Chinese language
pack

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-10-16 15:43:05 +08:00
committed by GitHub
parent 7b664b5a84
commit e76db6e222
4 changed files with 8 additions and 6 deletions

View File

@ -340,7 +340,9 @@ export function ChunkMethodDialog({
show={showAutoKeywords(selectedTag) || showExcelToHtml}
className="space-y-3"
>
{selectedTag === DocumentParserType.Naive && (
<EnableTocToggle />
)}
{showAutoKeywords(selectedTag) && (
<>
<AutoKeywordsFormField></AutoKeywordsFormField>

View File

@ -27,6 +27,7 @@ export interface ModalProps {
okText?: ReactNode | string;
onOk?: () => void;
onCancel?: () => void;
disabled?: boolean;
}
export interface ModalType extends FC<ModalProps> {
show: typeof modalIns.show;
@ -55,6 +56,7 @@ const Modal: ModalType = ({
confirmLoading,
cancelText,
okText,
disabled = false,
}) => {
const sizeClasses = {
small: 'max-w-md',
@ -86,7 +88,7 @@ const Modal: ModalType = ({
const handleChange = (open: boolean) => {
onOpenChange?.(open);
console.log('open', open, onOpenChange);
if (open) {
if (open && !disabled) {
onOk?.();
}
if (!open) {
@ -112,7 +114,7 @@ const Modal: ModalType = ({
</button>
<button
type="button"
disabled={confirmLoading}
disabled={confirmLoading || disabled}
onClick={() => handleOk()}
className="px-2 py-1 bg-primary text-primary-foreground rounded-md hover:bg-primary/90"
>

View File

@ -258,7 +258,6 @@ export default {
theDocumentBeingParsedCannotBeDeleted: '正在解析的文档不能被删除',
},
knowledgeConfiguration: {
tocExtraction: '目录增强',
tocExtractionTip:
'对于已有的chunk生成层级结构的目录信息每个文件一个目录。在查询时激活`目录增强`后系统会用大模型去判断用户问题和哪些目录项相关从而找到相关的chunk。',
deleteGenerateModalContent: `

View File

@ -7,7 +7,6 @@ import {
FormMessage,
} from '@/components/ui/form';
import { Radio } from '@/components/ui/radio';
import { RAGFlowSelect } from '@/components/ui/select';
import { Switch } from '@/components/ui/switch';
import { useTranslate } from '@/hooks/common-hooks';
import { cn } from '@/lib/utils';
@ -46,7 +45,7 @@ export function ChunkMethodItem(props: IProps) {
</FormLabel>
<div className={line === 1 ? 'w-3/4 ' : 'w-full'}>
<FormControl>
<RAGFlowSelect
<SelectWithSearch
{...field}
options={parserList}
placeholder={t('chunkMethodPlaceholder')}