fix: 优化上传图片对话提示
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
wangdan-fit2cloud 2024-12-10 11:01:35 +08:00
parent aa94f66492
commit cacdfbcb62
2 changed files with 20 additions and 6 deletions

View File

@ -6,7 +6,12 @@
<div
class="p-8-12"
v-loading="localLoading"
v-if="uploadDocumentList.length || uploadImageList.length || uploadAudioList.length || uploadVideoList.length"
v-if="
uploadDocumentList.length ||
uploadImageList.length ||
uploadAudioList.length ||
uploadVideoList.length
"
>
<el-space wrap>
<template v-for="(item, index) in uploadDocumentList" :key="index">
@ -248,14 +253,21 @@ const getAcceptList = () => {
const checkMaxFilesLimit = () => {
return (
props.applicationDetails.file_upload_setting.maxFiles <=
uploadImageList.value.length + uploadDocumentList.value.length + uploadAudioList.value.length + uploadVideoList.value.length
uploadImageList.value.length +
uploadDocumentList.value.length +
uploadAudioList.value.length +
uploadVideoList.value.length
)
}
const uploadFile = async (file: any, fileList: any) => {
const { maxFiles, fileLimit } = props.applicationDetails.file_upload_setting
//
const file_limit_once = uploadImageList.value.length + uploadDocumentList.value.length + uploadAudioList.value.length + uploadVideoList.value.length
const file_limit_once =
uploadImageList.value.length +
uploadDocumentList.value.length +
uploadAudioList.value.length +
uploadVideoList.value.length
if (file_limit_once >= maxFiles) {
MsgWarning('最多上传' + maxFiles + '个文件')
fileList.splice(0, fileList.length)
@ -283,7 +295,6 @@ const uploadFile = async (file: any, fileList: any) => {
uploadAudioList.value.push(file)
}
if (!chatId_context.value) {
const res = await props.openChatId()
chatId_context.value = res
@ -332,6 +343,9 @@ const uploadFile = async (file: any, fileList: any) => {
file.file_id = f[0].file_id
}
})
if (!inputValue.value && uploadImageList.value.length > 0) {
inputValue.value = '请解析图片内容'
}
})
}
const recorderTime = ref(0)
@ -471,7 +485,7 @@ function sendChatHandle(event: any) {
image_list: uploadImageList.value,
document_list: uploadDocumentList.value,
audio_list: uploadAudioList.value,
video_list: uploadVideoList.value,
video_list: uploadVideoList.value
})
inputValue.value = ''
uploadImageList.value = []

View File

@ -171,7 +171,7 @@ const applicationList = ref<any[]>([])
const paginationConfig = reactive({
current_page: 1,
page_size: 20,
page_size: 30,
total: 0
})
interface UserOption {