From 98db08d2638ed8c1bad84a7acc96bda38dffb2c2 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Fri, 22 Nov 2024 17:53:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/chat-input-operate/index.vue | 2 +- .../component/question-content/index.vue | 49 ++++++++++++++----- ui/src/utils/utils.ts | 11 +++++ 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/ui/src/components/ai-chat/component/chat-input-operate/index.vue b/ui/src/components/ai-chat/component/chat-input-operate/index.vue index bb29ba29f..4ca225bd9 100644 --- a/ui/src/components/ai-chat/component/chat-input-operate/index.vue +++ b/ui/src/components/ai-chat/component/chat-input-operate/index.vue @@ -24,7 +24,7 @@ -
+
{{ item && item?.name }}
diff --git a/ui/src/components/ai-chat/component/question-content/index.vue b/ui/src/components/ai-chat/component/question-content/index.vue index 6c0bd3915..28355a6e5 100644 --- a/ui/src/components/ai-chat/component/question-content/index.vue +++ b/ui/src/components/ai-chat/component/question-content/index.vue @@ -18,10 +18,13 @@
- + diff --git a/ui/src/utils/utils.ts b/ui/src/utils/utils.ts index b4a87f38c..066399032 100644 --- a/ui/src/utils/utils.ts +++ b/ui/src/utils/utils.ts @@ -88,3 +88,14 @@ export function getAttrsArray(array: Array, attr: string) { export function getSum(array: Array) { return array.reduce((total, item) => total + item, 0) } + +// 下载 +export function downloadByURL(url: string, name: string) { + const a = document.createElement('a') + a.setAttribute('href', url) + a.setAttribute('target', '_blank') + a.setAttribute('download', name) + document.body.appendChild(a) + a.click() + document.body.removeChild(a) +}