From 31cc6aa8a5d0375c5dd42c7652fcac3070712e2d Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Wed, 12 Nov 2025 03:41:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BB=A5=E6=94=AF=E6=8C=81=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=92=8C=E7=8A=B6=E6=80=81=E6=8C=87=E7=A4=BA?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 `AgentChatComponent.vue` 中,替换 `AttachmentInputPanel` 为 `AttachmentOptionsComponent`,并添加图片上传功能的处理。 - 新增 `AttachmentOptionsComponent.vue` 以处理文件和图片上传选项。 - 新增 `AttachmentStatusIndicator.vue` 以显示已上传附件的状态和操作。 - 更新 `MessageInputComponent.vue` 以支持新的插槽结构,增强组件的灵活性和可扩展性。 --- web/src/components/AgentChatComponent.vue | 32 +- .../components/AttachmentOptionsComponent.vue | 133 ++++++++ .../components/AttachmentStatusIndicator.vue | 299 ++++++++++++++++++ web/src/components/MessageInputComponent.vue | 72 +++-- 4 files changed, 505 insertions(+), 31 deletions(-) create mode 100644 web/src/components/AttachmentOptionsComponent.vue create mode 100644 web/src/components/AttachmentStatusIndicator.vue diff --git a/web/src/components/AgentChatComponent.vue b/web/src/components/AgentChatComponent.vue index 90a587b6..4010e9d3 100644 --- a/web/src/components/AgentChatComponent.vue +++ b/web/src/components/AgentChatComponent.vue @@ -76,13 +76,17 @@ @keydown="handleKeyDown" > + @@ -157,13 +161,17 @@ @keydown="handleKeyDown" > + @@ -183,6 +191,8 @@ import { LoadingOutlined } from '@ant-design/icons-vue'; import { message } from 'ant-design-vue'; import MessageInputComponent from '@/components/MessageInputComponent.vue' import AttachmentInputPanel from '@/components/AttachmentInputPanel.vue' +import AttachmentOptionsComponent from '@/components/AttachmentOptionsComponent.vue' +import AttachmentStatusIndicator from '@/components/AttachmentStatusIndicator.vue' import AgentMessageComponent from '@/components/AgentMessageComponent.vue' import ChatSidebarComponent from '@/components/ChatSidebarComponent.vue' import RefsComponent from '@/components/RefsComponent.vue' @@ -715,6 +725,12 @@ const handleAttachmentRemove = async (fileId) => { } }; +// 处理图片上传(开发中功能) +const handleImageUpload = () => { + // 图片上传功能暂未实现,在 AttachmentOptionsComponent 中已经显示了提示信息 + // 这里可以预留扩展接口 +}; + // ==================== 审批功能管理 ==================== const { approvalState, handleApproval, processApprovalInStream } = useApproval({ getThreadState, diff --git a/web/src/components/AttachmentOptionsComponent.vue b/web/src/components/AttachmentOptionsComponent.vue new file mode 100644 index 00000000..c56e6f12 --- /dev/null +++ b/web/src/components/AttachmentOptionsComponent.vue @@ -0,0 +1,133 @@ + + + + + \ No newline at end of file diff --git a/web/src/components/AttachmentStatusIndicator.vue b/web/src/components/AttachmentStatusIndicator.vue new file mode 100644 index 00000000..f165eca4 --- /dev/null +++ b/web/src/components/AttachmentStatusIndicator.vue @@ -0,0 +1,299 @@ + + + + + + + \ No newline at end of file diff --git a/web/src/components/MessageInputComponent.vue b/web/src/components/MessageInputComponent.vue index 2d429e4b..eaba43bc 100644 --- a/web/src/components/MessageInputComponent.vue +++ b/web/src/components/MessageInputComponent.vue @@ -1,5 +1,6 @@