From 34affcbb8d2f1ff4117fff0b055191626f931f19 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Tue, 10 Nov 2026 16:03:33 +0800 Subject: [PATCH] fix: delete tip --- .../document/components/DocumentImportPreview.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/src/views/knowledge-detail/library/document/components/DocumentImportPreview.vue b/ui/src/views/knowledge-detail/library/document/components/DocumentImportPreview.vue index a10397d0319..b7798ccb31f 100644 --- a/ui/src/views/knowledge-detail/library/document/components/DocumentImportPreview.vue +++ b/ui/src/views/knowledge-detail/library/document/components/DocumentImportPreview.vue @@ -3,7 +3,7 @@ import { computed, nextTick, ref } from 'vue' import type { DocumentImportParagraph, DocumentSplitResult } from '@/api/types' import { getFileIconUrl } from '@/utils/icon' import { getFileUrl } from '@/utils/common' -import { MsgWarning } from '@/utils/message' +import { MsgConfirm, MsgWarning } from '@/utils/message' import EditParagraphDialog from '../upload-document/EditParagraphDialog.vue' defineOptions({ name: 'DocumentImportPreview' }) @@ -54,7 +54,14 @@ function validate() { defineExpose({ validate }) function handleDeleteParagraph(index: number) { - selectedDocument.value?.content.splice(index, 1) + const document = selectedDocument.value + if (!document) return + const resourceName = document.source_file_id && document.resource_type === 'image' ? '图片' : '文档' + return MsgConfirm(`是否删除${resourceName}:${document.name}?`) + .then(() => { + document.content.splice(index, 1) + }) + .catch(() => {}) }