diff --git a/frontend/src/components/Input-field.vue b/frontend/src/components/Input-field.vue index 697db63..20feaf3 100644 --- a/frontend/src/components/Input-field.vue +++ b/frontend/src/components/Input-field.vue @@ -101,6 +101,28 @@ const inputPlaceholder = computed(() => { } return t('input.placeholder'); }); +// SIP translator: a ready workbook auto-fills the default prompt so the +// send button activates immediately — one click starts the translation. +// The fill happens once per attachment set; clearing the input afterwards +// is respected until the attachment set changes again. +const sipAutoFilled = ref(false); +watch( + () => uploadedAttachments.value.map(a => `${a.name}:${a.documentId ?? a.status}`).join('|'), + signature => { + if (selectedAgentId.value !== SIP_TRANSLATOR_AGENT_ID) return; + const items = uploadedAttachments.value; + if (items.length === 0) { + sipAutoFilled.value = false; + return; + } + const ready = items.every(a => a.documentId && a.status !== 'failed'); + if (ready && !sipAutoFilled.value && !query.value.trim()) { + query.value = '翻译'; + sipAutoFilled.value = true; + } + }, +); + const CHAT_FILE_DROP_EVENT = 'academy:chat-file-drop'; const isImageFile = (file: File) => { diff --git a/frontend/src/components/document-preview.vue b/frontend/src/components/document-preview.vue index 6dc79e6..3ce9c1c 100644 --- a/frontend/src/components/document-preview.vue +++ b/frontend/src/components/document-preview.vue @@ -1686,7 +1686,13 @@ onUnmounted(() => { } :deep(.excel-sheet) { + position: relative; padding: 0; + .excel-preview-image { + position: absolute; + border: 1px solid rgba(0, 0, 0, 0.08); + z-index: 5; + } .excel-sheet-name { position: sticky; top: 0;