diff --git a/frontend/src/App.vue b/frontend/src/App.vue index fb2c68c..9937f62 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -60,7 +60,7 @@ async function handleSend(content: string, messageAttachments: Attachment[]) { } // 正常发送消息(传递附件) - await chatStore.sendMessage(content, messageAttachments) + await chatStore.submitMessage(content, messageAttachments) } catch (err) { console.error('发送失败:', err) } diff --git a/frontend/src/components/input/InputArea.vue b/frontend/src/components/input/InputArea.vue index 96f745f..539a448 100644 --- a/frontend/src/components/input/InputArea.vue +++ b/frontend/src/components/input/InputArea.vue @@ -189,20 +189,41 @@ const hasAttachments = computed(() => props.attachments && props.attachments.length > 0 ) -// 是否可以发送 - 只在等待响应或上传时禁用发送 -// 例外:当有待确认工具时允许发送(用于带批注拒绝) +// 是否可以发送 +// - 上传中禁用 +// - 等待响应期间允许"发送"(会进入候补队列) +// - 例外:当有待确认工具时,发送用于带批注拒绝 const canSend = computed(() => { const hasContent = inputValue.value.trim().length > 0 || (props.attachments && props.attachments.length > 0) + if (!hasContent) return false + if (props.uploading) return false + // 如果有待确认的工具,允许发送(作为批注拒绝) - if (chatStore.hasPendingToolConfirmation && hasContent) { + if (chatStore.hasPendingToolConfirmation) { return true } - return hasContent && !chatStore.isWaitingForResponse && !props.uploading + // 等待响应期间也允许发送(会进入候补队列) + return true }) +// 格式化候补队列消息预览 +function formatQueuedPreview(item: any): string { + const text = String(item?.content || '').trim() + if (text) { + return text.length > 60 ? text.slice(0, 60) + '…' : text + } + + const count = Array.isArray(item?.attachments) ? item.attachments.length : 0 + if (count > 0) { + return `附件(${count})` + } + + return '' +} + // 处理发送 function handleSend() { if (!canSend.value) return @@ -899,6 +920,33 @@ watch(() => settingsStore.promptModesVersion, () => { + +
+