|
@@ -152,7 +152,16 @@ watch(() => [
|
|
},
|
|
},
|
|
{ immediate: true },
|
|
{ immediate: true },
|
|
)
|
|
)
|
|
|
|
+watch(() => [
|
|
|
|
+ props.typevalue,
|
|
|
|
+
|
|
|
|
+], ([ type]) => {
|
|
|
|
+ typevalue.value = type
|
|
|
|
+ emit('change', { type: 'success' })
|
|
|
|
|
|
|
|
+},
|
|
|
|
+{ immediate: true },
|
|
|
|
+)
|
|
// 在watch中添加对fileList的深度监听
|
|
// 在watch中添加对fileList的深度监听
|
|
watch(() => props.fileList, (newVal) => {
|
|
watch(() => props.fileList, (newVal) => {
|
|
fileListData.value = [...newVal] // 使用新数组保证响应性
|
|
fileListData.value = [...newVal] // 使用新数组保证响应性
|
|
@@ -206,8 +215,14 @@ const handleFileChange = async (file, fileList) => {
|
|
url:'',
|
|
url:'',
|
|
}))
|
|
}))
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
- fileListData.value = fileList.filter(file => isFileSize(file?.size, 60))
|
|
|
|
|
|
+
|
|
|
|
+ fileListData.value = fileList.filter(file => {
|
|
|
|
+ // 检查 size 属性是否存在且等于 60M,或者 size 属性不存在
|
|
|
|
+ return (file.size !== undefined && isFileSize(file?.size, 60)) || file.size === undefined
|
|
|
|
+ })
|
|
|
|
+ console.log( fileListData.value, ' fileListData.value22222222')
|
|
const pdfUrLArray = await getPdfUrl(fileListData.value)
|
|
const pdfUrLArray = await getPdfUrl(fileListData.value)
|
|
fileListData.value.forEach((item, index) => {
|
|
fileListData.value.forEach((item, index) => {
|
|
if (item.raw && pdfUrLArray[index]) {
|
|
if (item.raw && pdfUrLArray[index]) {
|
|
@@ -215,7 +230,8 @@ const handleFileChange = async (file, fileList) => {
|
|
fileListData.value[index].url = pdfUrl // 更新文件列表中的 url 字段
|
|
fileListData.value[index].url = pdfUrl // 更新文件列表中的 url 字段
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ console.log( fileListData.value, ' fileListData.value333333')
|
|
|
|
+
|
|
}
|
|
}
|
|
//上传文件前预览pdf
|
|
//上传文件前预览pdf
|
|
const pdfLoading = ref(false)
|
|
const pdfLoading = ref(false)
|