[update] 修改UAT问题:上传文件,文件名限制最多30位
This commit is contained in:
@@ -646,7 +646,8 @@ module.exports = {
|
|||||||
fileFormatIncorrect: '文件格式不正确',
|
fileFormatIncorrect: '文件格式不正确',
|
||||||
uploadSuccessful: '上传成功',
|
uploadSuccessful: '上传成功',
|
||||||
uploadMaximumATime: '一次最多上传二十张图片',
|
uploadMaximumATime: '一次最多上传二十张图片',
|
||||||
deletedSuccessfully: '删除成功'
|
deletedSuccessfully: '删除成功',
|
||||||
|
fileNameOverlong: '文件名长度不可超过30,请修改后重试'
|
||||||
},
|
},
|
||||||
importWithTemplate: {
|
importWithTemplate: {
|
||||||
chooseFile: '选择文件',
|
chooseFile: '选择文件',
|
||||||
|
|||||||
@@ -345,6 +345,12 @@ export default {
|
|||||||
doBeforeUpload (file) {
|
doBeforeUpload (file) {
|
||||||
this.uploadGoOn = true
|
this.uploadGoOn = true
|
||||||
file.uploadGoOn = true
|
file.uploadGoOn = true
|
||||||
|
if (file.name.split('.')[0].length > 30) {
|
||||||
|
this.$message.warning(this.$t('uploadFile.fileNameOverlong'))
|
||||||
|
this.uploadGoOn = false
|
||||||
|
file.uploadGoOn = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
const fileSize = file.size // 上传的文件大小
|
const fileSize = file.size // 上传的文件大小
|
||||||
if (fileSize === 0) {
|
if (fileSize === 0) {
|
||||||
this.$message.warning(this.$t('uploadFile.cannotUploadEmpty'))
|
this.$message.warning(this.$t('uploadFile.cannotUploadEmpty'))
|
||||||
|
|||||||
@@ -310,8 +310,15 @@ export default {
|
|||||||
this.$emit('change', path)
|
this.$emit('change', path)
|
||||||
},
|
},
|
||||||
doBeforeUpload (file) {
|
doBeforeUpload (file) {
|
||||||
|
console.log('--------file', file)
|
||||||
this.uploadGoOn = true
|
this.uploadGoOn = true
|
||||||
file.uploadGoOn = true
|
file.uploadGoOn = true
|
||||||
|
if (file.name.split('.')[0].length > 30) {
|
||||||
|
this.$message.warning(this.$t('uploadFile.fileNameOverlong'))
|
||||||
|
this.uploadGoOn = false
|
||||||
|
file.uploadGoOn = false
|
||||||
|
return false
|
||||||
|
}
|
||||||
const fileSize = file.size // 上传的文件大小
|
const fileSize = file.size // 上传的文件大小
|
||||||
if (fileSize === 0) {
|
if (fileSize === 0) {
|
||||||
this.$message.warning(this.$t('uploadFile.cannotUploadEmpty'))
|
this.$message.warning(this.$t('uploadFile.cannotUploadEmpty'))
|
||||||
@@ -395,6 +402,10 @@ export default {
|
|||||||
} else if (info.file.status === 'removed') {
|
} else if (info.file.status === 'removed') {
|
||||||
this.handleDelete(info.file)
|
this.handleDelete(info.file)
|
||||||
}
|
}
|
||||||
|
fileList = fileList.filter(tt => !!tt)
|
||||||
|
console.log(fileList)
|
||||||
|
// 二次过滤不符合要求的(uploadGoOn为false的),否则只上传多个不符合要求的只会有一个不出现在列表中
|
||||||
|
fileList = fileList.filter(tt => tt.uploadGoOn === undefined || tt.uploadGoOn === null || tt.uploadGoOn === true)
|
||||||
this.fileList = fileList
|
this.fileList = fileList
|
||||||
if (info.file.status === 'done' || info.file.status === 'removed') {
|
if (info.file.status === 'done' || info.file.status === 'removed') {
|
||||||
// returnUrl为true时仅返回文件路径
|
// returnUrl为true时仅返回文件路径
|
||||||
|
|||||||
Reference in New Issue
Block a user