|
6 | 6 | <div |
7 | 7 | class="p-8-12" |
8 | 8 | 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 | + " |
10 | 15 | > |
11 | 16 | <el-space wrap> |
12 | 17 | <template v-for="(item, index) in uploadDocumentList" :key="index"> |
@@ -248,14 +253,21 @@ const getAcceptList = () => { |
248 | 253 | const checkMaxFilesLimit = () => { |
249 | 254 | return ( |
250 | 255 | 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 |
252 | 260 | ) |
253 | 261 | } |
254 | 262 |
|
255 | 263 | const uploadFile = async (file: any, fileList: any) => { |
256 | 264 | const { maxFiles, fileLimit } = props.applicationDetails.file_upload_setting |
257 | 265 | // 单次上传文件数量限制 |
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 |
259 | 271 | if (file_limit_once >= maxFiles) { |
260 | 272 | MsgWarning('最多上传' + maxFiles + '个文件') |
261 | 273 | fileList.splice(0, fileList.length) |
@@ -283,7 +295,6 @@ const uploadFile = async (file: any, fileList: any) => { |
283 | 295 | uploadAudioList.value.push(file) |
284 | 296 | } |
285 | 297 |
|
286 | | -
|
287 | 298 | if (!chatId_context.value) { |
288 | 299 | const res = await props.openChatId() |
289 | 300 | chatId_context.value = res |
@@ -332,6 +343,9 @@ const uploadFile = async (file: any, fileList: any) => { |
332 | 343 | file.file_id = f[0].file_id |
333 | 344 | } |
334 | 345 | }) |
| 346 | + if (!inputValue.value && uploadImageList.value.length > 0) { |
| 347 | + inputValue.value = '请解析图片内容' |
| 348 | + } |
335 | 349 | }) |
336 | 350 | } |
337 | 351 | const recorderTime = ref(0) |
@@ -471,7 +485,7 @@ function sendChatHandle(event: any) { |
471 | 485 | image_list: uploadImageList.value, |
472 | 486 | document_list: uploadDocumentList.value, |
473 | 487 | audio_list: uploadAudioList.value, |
474 | | - video_list: uploadVideoList.value, |
| 488 | + video_list: uploadVideoList.value |
475 | 489 | }) |
476 | 490 | inputValue.value = '' |
477 | 491 | uploadImageList.value = [] |
|
0 commit comments