From 2600fbf3a48b0247204fa3b3c2ebf65b81152293 Mon Sep 17 00:00:00 2001 From: panyy Date: Fri, 6 Nov 2026 17:08:25 +0800 Subject: [PATCH] fix(ui): simplify document parser version and builtin labels --- apps/system_manage/parsers/catalog.py | 2 +- ui/src/views/tool/component/ParserManager.vue | 27 ++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/apps/system_manage/parsers/catalog.py b/apps/system_manage/parsers/catalog.py index f8e450ee1..44831ad5c 100644 --- a/apps/system_manage/parsers/catalog.py +++ b/apps/system_manage/parsers/catalog.py @@ -15,7 +15,7 @@ def catalogue(): {'id': '2.7.4', 'protocol': 'legacy', 'backends': BACKENDS_2}, {'id': '3.4.5', 'protocol': 'legacy', 'backends': BACKENDS_3}, {'id': '4.x', 'protocol': 'v1', 'backends': TIERS}], - 'builtin': {'id': 'builtin', 'name': 'MaxKB 内置解析', 'backend': 'builtin', + 'builtin': {'id': 'builtin', 'name': '内置解析', 'backend': 'builtin', 'formats': ['PDF', 'DOCX', 'DOC', 'XLSX', 'XLS', 'CSV', 'HTML', 'MD', 'TXT']}} diff --git a/ui/src/views/tool/component/ParserManager.vue b/ui/src/views/tool/component/ParserManager.vue index 3de2fbee9..069602873 100644 --- a/ui/src/views/tool/component/ParserManager.vue +++ b/ui/src/views/tool/component/ParserManager.vue @@ -13,7 +13,7 @@ row.options?.engine_version || (row.options?.protocol === 'v1' ? '4.x' : '2.7.4') +const versionLabel = (version: string) => `V${version.split('.')[0]}` +const versionFamilies = computed(() => { + const seen = new Set() + return catalog.value.versions + .map((version: any) => ({ id: versionLabel(version.id) })) + .filter((version: any) => { + if (seen.has(version.id)) return false + seen.add(version.id) + return true + }) +}) +const selectedVersionFamily = computed({ + get: () => versionLabel(form.value.options.engine_version || '2.7.1'), + set: (family: string) => { + if (versionLabel(form.value.options.engine_version || '2.7.1') === family) return + const version = catalog.value.versions.find((item: any) => versionLabel(item.id) === family) + if (version) form.value.options.engine_version = version.id + }, +}) const selectedVersion = computed(() => catalog.value.versions.find((v: any) => v.id === form.value.options?.engine_version), )