Skip to content

Commit 2520461

Browse files
committed
fix: trim whitespace from document name in export functions
--bug=1058737 --user=刘瑞斌 【共享资源】web知识库文档中导出excel文档,导出默认文档名称优化 https://www.tapd.cn/62980211/s/1731548
1 parent 26df300 commit 2520461

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ui/src/api/knowledge/document.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const exportDocument: (
159159
loading?: Ref<boolean>,
160160
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
161161
return exportExcel(
162-
document_name + '.xlsx',
162+
document_name.trim() + '.xlsx',
163163
`${prefix.value}/${knowledge_id}/document/${document_id}/export`,
164164
{},
165165
loading,
@@ -180,7 +180,7 @@ const exportDocumentZip: (
180180
loading?: Ref<boolean>,
181181
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
182182
return exportFile(
183-
document_name + '.zip',
183+
document_name.trim() + '.zip',
184184
`${prefix.value}/${knowledge_id}/document/${document_id}/export_zip`,
185185
{},
186186
loading,

ui/src/api/system-resource-management/document.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const exportDocument: (
149149
loading?: Ref<boolean>,
150150
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
151151
return exportExcel(
152-
document_name + '.xlsx',
152+
document_name.trim() + '.xlsx',
153153
`${prefix}/${knowledge_id}/document/${document_id}/export`,
154154
{},
155155
loading,
@@ -170,7 +170,7 @@ const exportDocumentZip: (
170170
loading?: Ref<boolean>,
171171
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
172172
return exportFile(
173-
document_name + '.zip',
173+
document_name.trim() + '.zip',
174174
`${prefix}/${knowledge_id}/document/${document_id}/export_zip`,
175175
{},
176176
loading,

ui/src/api/system-shared/document.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const exportDocument: (
149149
loading?: Ref<boolean>,
150150
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
151151
return exportExcel(
152-
document_name + '.xlsx',
152+
document_name.trim() + '.xlsx',
153153
`${prefix}/${knowledge_id}/document/${document_id}/export`,
154154
{},
155155
loading,
@@ -170,7 +170,7 @@ const exportDocumentZip: (
170170
loading?: Ref<boolean>,
171171
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
172172
return exportFile(
173-
document_name + '.zip',
173+
document_name.trim() + '.zip',
174174
`${prefix}/${knowledge_id}/document/${document_id}/export_zip`,
175175
{},
176176
loading,

0 commit comments

Comments
 (0)