From 56a8795b33578aec514b7850e894022713406d22 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 20 Nov 2025 10:23:20 +0800 Subject: [PATCH] feat: add local and URL upload options with validation messages --- ui/src/api/image.ts | 8 +- .../component/chat-input-operate/index.vue | 492 ++++++++++++++---- ui/src/locales/lang/en-US/ai-chat.ts | 5 + ui/src/locales/lang/en-US/common.ts | 2 + ui/src/locales/lang/zh-CN/ai-chat.ts | 5 + ui/src/locales/lang/zh-CN/common.ts | 2 + ui/src/locales/lang/zh-Hant/ai-chat.ts | 5 + ui/src/locales/lang/zh-Hant/common.ts | 2 + .../component/StatisticsCharts.vue | 2 +- .../component/FileUploadSettingDialog.vue | 47 +- ui/vite.config.ts | 14 +- 11 files changed, 474 insertions(+), 110 deletions(-) diff --git a/ui/src/api/image.ts b/ui/src/api/image.ts index e4800216d..6bfacd248 100644 --- a/ui/src/api/image.ts +++ b/ui/src/api/image.ts @@ -1,5 +1,5 @@ -import { Result } from '@/request/Result' -import { get, post, del, put } from '@/request/index' +import {Result} from '@/request/Result' +import {get, post, del, put} from '@/request/index' const prefix = '/oss/file' /** @@ -10,6 +10,10 @@ const postImage: (data: any) => Promise> = (data) => { return post(`${prefix}`, data) } +const getFile: (params: any) => Promise> = (params) => { + return get(`/oss/get_url` , params) +} export default { postImage, + getFile } 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 31a4b3aa1..098f39189 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 @@ -42,7 +42,7 @@ @mouseleave.stop="mouseleave()" >
- +
{{ item && item?.name }}
@@ -53,7 +53,7 @@ v-if="showDelete === item.url" > - +
@@ -80,7 +80,7 @@ @mouseleave.stop="mouseleave()" >
- +
{{ item && item?.name }}
@@ -91,7 +91,7 @@ v-if="showDelete === item.url" > - +
@@ -115,7 +115,7 @@ @mouseleave.stop="mouseleave()" >
- +
{{ item && item?.name }}
@@ -126,7 +126,7 @@ v-if="showDelete === item.url" > - +
@@ -146,7 +146,7 @@ v-if="showDelete === item.url" > - + - +