应征入伍保留学籍申请表-附件上传
This commit is contained in:
@@ -132,14 +132,23 @@ export default {
|
||||
console.log(res.savePath)
|
||||
if(item.name == res.trueName && item.status == 1){
|
||||
|
||||
this.fileList[i].id = res.id
|
||||
this.fileList[i].status = 2
|
||||
this.fileList[i].savePath = this.baseurl + res.savePath
|
||||
if(this.isImageURL(res.savePath)){
|
||||
this.previewList.push( this.fileList[i].savePath)
|
||||
}
|
||||
this.fileList[i].id = res.id
|
||||
this.fileList[i].status = 2
|
||||
this.fileList[i].savePath = this.baseurl + res.savePath
|
||||
if(this.isImageURL(res.savePath)){
|
||||
this.previewList.push( this.fileList[i].savePath)
|
||||
}
|
||||
// this.fileList[i].savePaths =[this.baseurl + res.savePath];
|
||||
|
||||
|
||||
// 上传成功后,向外传递当前文件的完整信息(包含后端返回的res数据)
|
||||
this.$emit('fileUploaded', {
|
||||
fileId: res.id, // 文件ID
|
||||
fileName: res.trueName, // 文件名
|
||||
filePath: res.savePath, // 文件相对路径(不含baseurl)
|
||||
fullPath: this.fileList[i].savePath, // 完整路径(含baseurl)
|
||||
fileType: this.getFileType(res.trueName), // 文件类型
|
||||
originalFile: file.file // 原始文件对象(可选)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -153,6 +162,12 @@ export default {
|
||||
this.uploadCnt--
|
||||
})
|
||||
},
|
||||
// 获取文件类型的方法(Affix组件中新增)
|
||||
getFileType(fileName) {
|
||||
if (!fileName) return '';
|
||||
const lastDotIndex = fileName.lastIndexOf('.');
|
||||
return lastDotIndex > -1 ? fileName.substring(lastDotIndex + 1).toLowerCase() : '';
|
||||
},
|
||||
handleBeforeUpload(file) {
|
||||
|
||||
if (this.affixId == null || this.affixId === '') {
|
||||
|
||||
Reference in New Issue
Block a user