Skip to content

Commit cacdfbc

Browse files
fix: 优化上传图片对话提示
1 parent aa94f66 commit cacdfbc

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
<div
77
class="p-8-12"
88
v-loading="localLoading"
9-
v-if="uploadDocumentList.length || uploadImageList.length || uploadAudioList.length || uploadVideoList.length"
9+
v-if="
10+
uploadDocumentList.length ||
11+
uploadImageList.length ||
12+
uploadAudioList.length ||
13+
uploadVideoList.length
14+
"
1015
>
1116
<el-space wrap>
1217
<template v-for="(item, index) in uploadDocumentList" :key="index">
@@ -248,14 +253,21 @@ const getAcceptList = () => {
248253
const checkMaxFilesLimit = () => {
249254
return (
250255
props.applicationDetails.file_upload_setting.maxFiles <=
251-
uploadImageList.value.length + uploadDocumentList.value.length + uploadAudioList.value.length + uploadVideoList.value.length
256+
uploadImageList.value.length +
257+
uploadDocumentList.value.length +
258+
uploadAudioList.value.length +
259+
uploadVideoList.value.length
252260
)
253261
}
254262
255263
const uploadFile = async (file: any, fileList: any) => {
256264
const { maxFiles, fileLimit } = props.applicationDetails.file_upload_setting
257265
// 单次上传文件数量限制
258-
const file_limit_once = uploadImageList.value.length + uploadDocumentList.value.length + uploadAudioList.value.length + uploadVideoList.value.length
266+
const file_limit_once =
267+
uploadImageList.value.length +
268+
uploadDocumentList.value.length +
269+
uploadAudioList.value.length +
270+
uploadVideoList.value.length
259271
if (file_limit_once >= maxFiles) {
260272
MsgWarning('最多上传' + maxFiles + '个文件')
261273
fileList.splice(0, fileList.length)
@@ -283,7 +295,6 @@ const uploadFile = async (file: any, fileList: any) => {
283295
uploadAudioList.value.push(file)
284296
}
285297
286-
287298
if (!chatId_context.value) {
288299
const res = await props.openChatId()
289300
chatId_context.value = res
@@ -332,6 +343,9 @@ const uploadFile = async (file: any, fileList: any) => {
332343
file.file_id = f[0].file_id
333344
}
334345
})
346+
if (!inputValue.value && uploadImageList.value.length > 0) {
347+
inputValue.value = '请解析图片内容'
348+
}
335349
})
336350
}
337351
const recorderTime = ref(0)
@@ -471,7 +485,7 @@ function sendChatHandle(event: any) {
471485
image_list: uploadImageList.value,
472486
document_list: uploadDocumentList.value,
473487
audio_list: uploadAudioList.value,
474-
video_list: uploadVideoList.value,
488+
video_list: uploadVideoList.value
475489
})
476490
inputValue.value = ''
477491
uploadImageList.value = []

ui/src/views/application/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const applicationList = ref<any[]>([])
171171
172172
const paginationConfig = reactive({
173173
current_page: 1,
174-
page_size: 20,
174+
page_size: 30,
175175
total: 0
176176
})
177177
interface UserOption {

0 commit comments

Comments
 (0)