From 2520461544aca53914b5bc143afa9f846e95241c Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 15 Jul 2025 13:46:38 +0800 Subject: [PATCH] fix: trim whitespace from document name in export functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1058737 --user=刘瑞斌 【共享资源】web知识库文档中导出excel文档,导出默认文档名称优化 https://www.tapd.cn/62980211/s/1731548 --- ui/src/api/knowledge/document.ts | 4 ++-- ui/src/api/system-resource-management/document.ts | 4 ++-- ui/src/api/system-shared/document.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/api/knowledge/document.ts b/ui/src/api/knowledge/document.ts index 806ffa0f9..54a79a44c 100644 --- a/ui/src/api/knowledge/document.ts +++ b/ui/src/api/knowledge/document.ts @@ -159,7 +159,7 @@ const exportDocument: ( loading?: Ref, ) => Promise = (document_name, knowledge_id, document_id, loading) => { return exportExcel( - document_name + '.xlsx', + document_name.trim() + '.xlsx', `${prefix.value}/${knowledge_id}/document/${document_id}/export`, {}, loading, @@ -180,7 +180,7 @@ const exportDocumentZip: ( loading?: Ref, ) => Promise = (document_name, knowledge_id, document_id, loading) => { return exportFile( - document_name + '.zip', + document_name.trim() + '.zip', `${prefix.value}/${knowledge_id}/document/${document_id}/export_zip`, {}, loading, diff --git a/ui/src/api/system-resource-management/document.ts b/ui/src/api/system-resource-management/document.ts index bc1b9a4e4..8031880e7 100644 --- a/ui/src/api/system-resource-management/document.ts +++ b/ui/src/api/system-resource-management/document.ts @@ -149,7 +149,7 @@ const exportDocument: ( loading?: Ref, ) => Promise = (document_name, knowledge_id, document_id, loading) => { return exportExcel( - document_name + '.xlsx', + document_name.trim() + '.xlsx', `${prefix}/${knowledge_id}/document/${document_id}/export`, {}, loading, @@ -170,7 +170,7 @@ const exportDocumentZip: ( loading?: Ref, ) => Promise = (document_name, knowledge_id, document_id, loading) => { return exportFile( - document_name + '.zip', + document_name.trim() + '.zip', `${prefix}/${knowledge_id}/document/${document_id}/export_zip`, {}, loading, diff --git a/ui/src/api/system-shared/document.ts b/ui/src/api/system-shared/document.ts index 2f0f60ba2..080c776da 100644 --- a/ui/src/api/system-shared/document.ts +++ b/ui/src/api/system-shared/document.ts @@ -149,7 +149,7 @@ const exportDocument: ( loading?: Ref, ) => Promise = (document_name, knowledge_id, document_id, loading) => { return exportExcel( - document_name + '.xlsx', + document_name.trim() + '.xlsx', `${prefix}/${knowledge_id}/document/${document_id}/export`, {}, loading, @@ -170,7 +170,7 @@ const exportDocumentZip: ( loading?: Ref, ) => Promise = (document_name, knowledge_id, document_id, loading) => { return exportFile( - document_name + '.zip', + document_name.trim() + '.zip', `${prefix}/${knowledge_id}/document/${document_id}/export_zip`, {}, loading,