diff --git a/ui/packages/ai/AiCopilot.vue b/ui/packages/ai/AiCopilot.vue index d4dca5dd..91c665df 100644 --- a/ui/packages/ai/AiCopilot.vue +++ b/ui/packages/ai/AiCopilot.vue @@ -87,9 +87,11 @@ export default { if (++i < content.length) setTimeout(() => concatenateStr(content, i, target), 50) } this.$debounce(() => { - const {currentConversation: conversationId, app, prompt: content, latlng} = this.$data - const message = {appType: "2", userType: 0, content, conversationId, ...app, supplementContent: latlng} + const {currentConversation: conversationId, app, prompt: content, latlng, files} = this.$data + const {id: fileId, url: sdkFileUrl, name: fileName} = files[0] || {} + const message = {appType: "2", userType: 0, content, conversationId, ...app, supplementContent: latlng, fileId, sdkFileUrl, fileName} this.history.push(message) + this.$refs.uploader?.clearFiles() this.loading = true this.prompt = "" this.http.post("/app/appaicopilotinfo/add", message).then(res => { @@ -190,7 +192,7 @@ export default {
- +
@@ -202,7 +204,7 @@ export default {
- + diff --git a/ui/packages/ai/components/chatContent.vue b/ui/packages/ai/components/chatContent.vue index 6eac4440..3ba81d72 100644 --- a/ui/packages/ai/components/chatContent.vue +++ b/ui/packages/ai/components/chatContent.vue @@ -3,7 +3,10 @@
-
+
+
+
+
@@ -45,6 +48,9 @@ export default { }, markdown(v) { return this.md?.render(v) || v + }, + handleDownload(item) { + window.open(item.sdkFileUrl) } }, mounted() { @@ -100,7 +106,6 @@ export default { .content { position: relative; - max-width: max(calc(100% - 140px), 220px); padding: 8px; border-radius: 4px; background: #F3F5F7; @@ -151,6 +156,23 @@ export default { } } } + + .attachments { + font-size: 12px; + background: #F0F0F0; + border-radius: 4px; + color: #888; + padding: 3px 6px; + width: fit-content; + margin-top: 4px; + + &:hover, &:active { + color: $primaryColor; + } + &:before{ + margin-right: 2px; + } + } } .avatar { diff --git a/ui/packages/basic/AiUploader.vue b/ui/packages/basic/AiUploader.vue index f97f5a1c..f0134bc0 100644 --- a/ui/packages/basic/AiUploader.vue +++ b/ui/packages/basic/AiUploader.vue @@ -86,7 +86,6 @@
-