|
75 | 75 |
|
76 | 76 | <div class="operate flex align-center"> |
77 | 77 | <span v-if="props.applicationDetails.file_upload_enable" class="flex align-center"> |
78 | | - <!-- accept="image/jpeg, image/png, image/gif"--> |
79 | 78 | <el-upload |
80 | 79 | action="#" |
| 80 | + multiple |
81 | 81 | :auto-upload="false" |
82 | 82 | :show-file-list="false" |
83 | 83 | :accept="getAcceptList()" |
@@ -246,23 +246,23 @@ const uploadFile = async (file: any, fileList: any) => { |
246 | 246 | fileList.splice(0, fileList.length) |
247 | 247 | return |
248 | 248 | } |
| 249 | +
|
249 | 250 | const formData = new FormData() |
250 | | - for (const file of fileList) { |
251 | | - formData.append('file', file.raw, file.name) |
252 | | - // |
253 | | - const extension = file.name.split('.').pop().toLowerCase() // 获取文件后缀名并转为小写 |
| 251 | + formData.append('file', file.raw, file.name) |
| 252 | + // |
| 253 | + const extension = file.name.split('.').pop().toLowerCase() // 获取文件后缀名并转为小写 |
254 | 254 |
|
255 | | - if (imageExtensions.includes(extension)) { |
256 | | - uploadImageList.value.push(file) |
257 | | - } else if (documentExtensions.includes(extension)) { |
258 | | - uploadDocumentList.value.push(file) |
259 | | - } else if (videoExtensions.includes(extension)) { |
260 | | - // videos.push(file) |
261 | | - } else if (audioExtensions.includes(extension)) { |
262 | | - // audios.push(file) |
263 | | - } |
| 255 | + if (imageExtensions.includes(extension)) { |
| 256 | + uploadImageList.value.push(file) |
| 257 | + } else if (documentExtensions.includes(extension)) { |
| 258 | + uploadDocumentList.value.push(file) |
| 259 | + } else if (videoExtensions.includes(extension)) { |
| 260 | + // videos.push(file) |
| 261 | + } else if (audioExtensions.includes(extension)) { |
| 262 | + // audios.push(file) |
264 | 263 | } |
265 | 264 |
|
| 265 | +
|
266 | 266 | if (!chatId_context.value) { |
267 | 267 | const res = await props.openChatId() |
268 | 268 | chatId_context.value = res |
|
0 commit comments