update $message.error全局改成$message.warning

This commit is contained in:
赵霄
2023-10-25 17:32:18 +08:00
parent 0bee8465c2
commit 8d5c6b9380
45 changed files with 119 additions and 87 deletions
+8 -8
View File
@@ -257,11 +257,11 @@ export default {
return file
})
} else {
this.$message.error(info.file.response.message)
this.$message.warning(info.file.response.message)
}
// this.$message.success(`${info.file.name} 上传成功!`);
} else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} ${this.$t('uploadFile.uploadFailed')}.`)
this.$message.warning(`${info.file.name} ${this.$t('uploadFile.uploadFailed')}.`)
} else if (info.file.status === 'removed') {
this.handleDelete(info.file)
}
@@ -342,19 +342,19 @@ export default {
file.uploadGoOn = true
const fileSize = file.size // 上传的文件大小
if (fileSize === 0) {
this.$message.error(this.$t('uploadFile.cannotUploadEmpty'))
this.$message.warning(this.$t('uploadFile.cannotUploadEmpty'))
this.uploadGoOn = false
file.uploadGoOn = false
return false
}
if (this.fileMaxSize && fileSize > 1024 * 1024 * this.fileMaxSize) {
this.$message.error(this.$t('uploadFile.pleaseUpload') + this.fileMaxSize + this.$t('uploadFile.theFollowingDocuments'))
this.$message.warning(this.$t('uploadFile.pleaseUpload') + this.fileMaxSize + this.$t('uploadFile.theFollowingDocuments'))
this.uploadGoOn = false
file.uploadGoOn = false
return false
}
if (fileSize > 1024 * 1024 * 500) {
this.$message.error(this.$t('uploadFile.maxSize'))
this.$message.warning(this.$t('uploadFile.maxSize'))
this.uploadGoOn = false
file.uploadGoOn = false
return false
@@ -369,7 +369,7 @@ export default {
// 截取文件后缀名
const fileSuffix = (file.name ? file.name.split('.')[file.name.split('.').length - 1] : '').toLowerCase()
if (this.fileType === FILE_TYPE_IMG && fileType.indexOf('image') < 0) {
this.$message.error(this.$t('uploadFile.onlyUploadPic'))
this.$message.warning(this.$t('uploadFile.onlyUploadPic'))
this.uploadGoOn = false
file.uploadGoOn = false
return false
@@ -378,13 +378,13 @@ export default {
return true
}
if (this.fileType === FILE_TYPE_IMG && fileSuffix !== 'png' && fileSuffix !== 'jpg') {
this.$message.error(this.$t('uploadFile.pleaseUpload') + 'png、jpg' + this.$t('uploadFile.file'))
this.$message.warning(this.$t('uploadFile.pleaseUpload') + 'png、jpg' + this.$t('uploadFile.file'))
this.uploadGoOn = false
file.uploadGoOn = false
return false
}
if (this.fileType.indexOf(fileSuffix) === -1) {
this.$message.error(this.$t('uploadFile.pleaseUpload') + `${this.fileType}` + this.$t('uploadFile.file'))
this.$message.warning(this.$t('uploadFile.pleaseUpload') + `${this.fileType}` + this.$t('uploadFile.file'))
this.uploadGoOn = false
file.uploadGoOn = false
return false
+2 -2
View File
@@ -246,11 +246,11 @@ export default {
if (typeof test === 'object' && test) {
resolve()
} else {
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
this.$message.warning('组件JTreeSelect-condition传值有误,需要一个json字符串!')
reject()
}
} catch (e) {
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
this.$message.warning('组件JTreeSelect-condition传值有误,需要一个json字符串!')
reject()
}
}
+1 -1
View File
@@ -175,7 +175,7 @@ export default {
}
// this.$message.success(`${info.file.name} 上传成功!`);
} else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`)
this.$message.warning(`${info.file.name} 上传失败.`)
} else if (info.file.status === 'removed') {
this.handleDelete(info.file)
}
+2 -2
View File
@@ -129,11 +129,11 @@ export default {
},
mounted () {
if (!this.orgFields || !this.destFields || !this.code) {
this.$message.error('popup参数未正确配置!')
this.$message.warning('popup参数未正确配置!')
this.avalid = false
}
if (this.destFields.split(',').length !== this.orgFields.split(',').length) {
this.$message.error('popup参数未正确配置,原始值和目标值数量不一致!')
this.$message.warning('popup参数未正确配置,原始值和目标值数量不一致!')
this.avalid = false
}
},
+1 -1
View File
@@ -138,7 +138,7 @@ export default {
this.handleTreeNodeValue(res.result)
this.treeData = [...res.result]
} else {
this.$message.error(res.message)
this.$message.warning(res.message)
}
})
},
+2 -2
View File
@@ -299,11 +299,11 @@ export default {
if (typeof test === 'object' && test) {
resolve()
} else {
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
this.$message.warning('组件JTreeSelect-condition传值有误,需要一个json字符串!')
reject()
}
} catch (e) {
this.$message.error('组件JTreeSelect-condition传值有误,需要一个json字符串!')
this.$message.warning('组件JTreeSelect-condition传值有误,需要一个json字符串!')
reject()
}
}
+1 -1
View File
@@ -361,7 +361,7 @@ export default {
}
// this.$message.success(`${info.file.name} 上传成功!`);
} else if (info.file.status === 'error') {
this.$message.error(`${info.file.name} 上传失败.`)
this.$message.warning(`${info.file.name} 上传失败.`)
} else if (info.file.status === 'removed') {
this.handleDelete(info.file)
}
+1 -1
View File
@@ -467,7 +467,7 @@ this.$refs.editableTable.getValues((error, values) => {
// 将通过后的数组提交到后台或自行进行其他处理
console.log(deleteIds, values)
} else {
this.$message.error('验证未通过')
this.$message.warning('验证未通过')
}
})
```
+1 -1
View File
@@ -90,7 +90,7 @@ export default {
},
ok () {
if (!this.filePath) {
this.$message.error('未上传任何文件')
this.$message.warning('未上传任何文件')
return false
}
const arr = this.filePath.split(',')
@@ -102,19 +102,19 @@ export default {
const status = info.file.status
info.fileList.forEach((val, index) => {
if (val.response && !val.response.result) {
this.$message.error(val.response.message)
this.$message.warning(val.response.message)
info.fileList.splice(index, 1)
}
})
if (this.fileTypeSatus) {
if (file.size > 1000000000) {
this.$message.error(this.errorMessage)
this.$message.warning(this.errorMessage)
} else {
if (status === 'error') {
this.uploadFileFlag--
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error(`${info.file.name} ` + this.$t('fileUploadFailed'))
this.$message.warning(`${info.file.name} ` + this.$t('fileUploadFailed'))
} else if (status === 'removed') {
this.uploadFileFlag--
this.myFileList = info.fileList
@@ -141,7 +141,7 @@ export default {
console.log('listLength11111', info.fileList.length)
if (info.fileList.length > 20) {
this.$message.destroy()
this.$message.error(this.$t('uploadMaximumATime'))
this.$message.warning(this.$t('uploadMaximumATime'))
info.fileList.splice(20)
this.myFileList = info.fileList
this.myFileList.forEach((res) => {
+3 -3
View File
@@ -69,18 +69,18 @@ export default {
const status = info.file.status
info.fileList.forEach((val, index) => {
if (val.response && !val.response.result) {
this.$message.error(val.response.message)
this.$message.warning(val.response.message)
info.fileList.splice(index, 1)
}
})
if (this.fileTypeSatus) {
if (file.size > 100000000) {
this.$message.error(this.errorMessage)
this.$message.warning(this.errorMessage)
} else {
if (status === 'error') {
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error(`${info.file.name}` + this.$t('fileUploadFailed'))
this.$message.warning(`${info.file.name}` + this.$t('fileUploadFailed'))
} else if (status === 'removed') {
this.myFileList = info.fileList
this.fileList = []
+1 -1
View File
@@ -217,7 +217,7 @@ export default {
return that.Logout({}).then(() => {
window.location.replace('/user/login')
}).catch(err => {
that.$message.error({
that.$message.warning({
title: '错误',
description: err.message
})