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} show={showAutoKeywords(selectedTag) || showExcelToHtml}
className="space-y-3" className="space-y-3"
> >
{selectedTag === DocumentParserType.Naive && (
<EnableTocToggle /> <EnableTocToggle />
)}
{showAutoKeywords(selectedTag) && ( {showAutoKeywords(selectedTag) && (
<> <>
<AutoKeywordsFormField></AutoKeywordsFormField> <AutoKeywordsFormField></AutoKeywordsFormField>

View File

@ -27,6 +27,7 @@ export interface ModalProps {
okText?: ReactNode | string; okText?: ReactNode | string;
onOk?: () => void; onOk?: () => void;
onCancel?: () => void; onCancel?: () => void;
disabled?: boolean;
} }
export interface ModalType extends FC<ModalProps> { export interface ModalType extends FC<ModalProps> {
show: typeof modalIns.show; show: typeof modalIns.show;
@ -55,6 +56,7 @@ const Modal: ModalType = ({
confirmLoading, confirmLoading,
cancelText, cancelText,
okText, okText,
disabled = false,
}) => { }) => {
const sizeClasses = { const sizeClasses = {
small: 'max-w-md', small: 'max-w-md',
@ -86,7 +88,7 @@ const Modal: ModalType = ({
const handleChange = (open: boolean) => { const handleChange = (open: boolean) => {
onOpenChange?.(open); onOpenChange?.(open);
console.log('open', open, onOpenChange); console.log('open', open, onOpenChange);
if (open) { if (open && !disabled) {
onOk?.(); onOk?.();
} }
if (!open) { if (!open) {
@ -112,7 +114,7 @@ const Modal: ModalType = ({
</button> </button>
<button <button
type="button" type="button"
disabled={confirmLoading} disabled={confirmLoading || disabled}
onClick={() => handleOk()} onClick={() => handleOk()}
className="px-2 py-1 bg-primary text-primary-foreground rounded-md hover:bg-primary/90" 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: '正在解析的文档不能被删除', theDocumentBeingParsedCannotBeDeleted: '正在解析的文档不能被删除',
}, },
knowledgeConfiguration: { knowledgeConfiguration: {
tocExtraction: '目录增强',
tocExtractionTip: tocExtractionTip:
'对于已有的chunk生成层级结构的目录信息每个文件一个目录。在查询时激活`目录增强`后系统会用大模型去判断用户问题和哪些目录项相关从而找到相关的chunk。', '对于已有的chunk生成层级结构的目录信息每个文件一个目录。在查询时激活`目录增强`后系统会用大模型去判断用户问题和哪些目录项相关从而找到相关的chunk。',
deleteGenerateModalContent: ` deleteGenerateModalContent: `

View File

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