diff --git a/resources/assets/js/components/AIAssistant/index.vue b/resources/assets/js/components/AIAssistant/index.vue index 08433fc96..7fb0a971e 100644 --- a/resources/assets/js/components/AIAssistant/index.vue +++ b/resources/assets/js/components/AIAssistant/index.vue @@ -47,7 +47,20 @@ -
+
+ +
+
+ + {{ $L('松开以上传图片') }} +
+
+ @compositionend.native="isComposing = false" + @paste.native="onPaste" /> 0) { + const imageFiles = Array.from(files).filter(f => f.type.startsWith('image/')); + await this.handleImageFiles(imageFiles); + } + }, + + /** + * 处理粘贴图片 + */ + async onPaste(event) { + const items = event.clipboardData?.items; + if (!items) { + return; + } + const imageFiles = []; + for (const item of items) { + if (item.type.startsWith('image/')) { + const file = item.getAsFile(); + if (file) { + imageFiles.push(file); + } + } + } + if (imageFiles.length > 0) { + event.preventDefault(); + await this.handleImageFiles(imageFiles); + } }, /** @@ -2098,6 +2177,46 @@ export default { .ai-assistant-content { display: flex; flex-direction: column; + position: relative; + + &.ai-assistant-content-dragging { + &::before { + content: ''; + position: absolute; + inset: 8px; + border: 2px dashed #2d8cf0; + border-radius: 8px; + background-color: rgba(45, 140, 240, 0.05); + pointer-events: none; + z-index: 10; + } + } + + .ai-assistant-drop-overlay { + position: absolute; + inset: 8px; + display: flex; + align-items: center; + justify-content: center; + background-color: rgba(255, 255, 255, 0.9); + border-radius: 8px; + z-index: 11; + pointer-events: none; + } + + .ai-assistant-drop-hint { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + color: #2d8cf0; + .taskfont { + font-size: 32px; + } + span { + font-size: 14px; + } + } .ai-assistant-welcome, .ai-assistant-output {