diff --git a/app/components/rules/new/ExtractionSettings.tsx b/app/components/rules/new/ExtractionSettings.tsx index dd954f1..6c1a48f 100644 --- a/app/components/rules/new/ExtractionSettings.tsx +++ b/app/components/rules/new/ExtractionSettings.tsx @@ -232,12 +232,14 @@ export function ExtractionSettings({ newFields.push({ name: input, type: selectedVlmFieldType as VLMFieldType, - template: customVlmPrompt + template: customVlmPrompt, + multi_entity: false, }); } else { newFields.push({ name: input, - type: selectedVlmFieldType as VLMFieldType + type: selectedVlmFieldType as VLMFieldType, + multi_entity: false, }); } } @@ -289,6 +291,18 @@ export function ExtractionSettings({ setHasPendingChanges(true); }; + // 切换 VLM 字段的多实体状态 + const toggleVLMFieldMultiEntity = (index: number) => { + if (!multiEntityEnabled) return; // 多实体未开启时不允许切换 + const newFields = [...fields.vlm]; + const field = newFields[index]; + if (typeof field === 'object') { + newFields[index] = { ...field, multi_entity: !field.multi_entity }; + setFields({ ...fields, vlm: newFields }); + setHasPendingChanges(true); + } + }; + // 获取VLM字段信息 const getFieldInfo = (field: string | { name: string, type: string, template?: string }) => { let fieldName, fieldType, typeName, badgeClass; @@ -885,18 +899,27 @@ export function ExtractionSettings({