[update] 修改法规符合性排查流程生成错误提示修改
This commit is contained in:
@@ -246,6 +246,7 @@ module.exports = {
|
|||||||
autoTakeout: 'Automatic takeout',
|
autoTakeout: 'Automatic takeout',
|
||||||
goHandle: 'To deal with',
|
goHandle: 'To deal with',
|
||||||
disableInput: 'Inhibit input',
|
disableInput: 'Inhibit input',
|
||||||
|
fileUploadError: 'File upload error',
|
||||||
// 标准字段
|
// 标准字段
|
||||||
standardField: {
|
standardField: {
|
||||||
standardEnglishName: 'Regulation English Name',
|
standardEnglishName: 'Regulation English Name',
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ module.exports = {
|
|||||||
autoTakeout: '自动带出',
|
autoTakeout: '自动带出',
|
||||||
goHandle: '去处理',
|
goHandle: '去处理',
|
||||||
disableInput: '禁止输入',
|
disableInput: '禁止输入',
|
||||||
|
fileUploadError: '文件上传错误',
|
||||||
// 标准字段
|
// 标准字段
|
||||||
standardField: {
|
standardField: {
|
||||||
standardEnglishName: '标准英文名称',
|
standardEnglishName: '标准英文名称',
|
||||||
|
|||||||
+60
-1
@@ -700,7 +700,13 @@ export default {
|
|||||||
this.dataSource = JSON.parse(JSON.stringify(dataSource))
|
this.dataSource = JSON.parse(JSON.stringify(dataSource))
|
||||||
this.dataList = JSON.parse(JSON.stringify(dataSource))
|
this.dataList = JSON.parse(JSON.stringify(dataSource))
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
if (Array.isArray(res.message) && res.message.length > 0) {
|
||||||
|
this.messageLineFeed(this.$t('fileUploadError'), res.message)
|
||||||
|
} else if (/<br>|<\/br>|<br\/>/.test(res.message)) {
|
||||||
|
this.messageLineFeedByBr(this.$t('fileUploadError'), res.messagee)
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.$emit('loading', false)
|
this.$emit('loading', false)
|
||||||
@@ -854,6 +860,59 @@ export default {
|
|||||||
handleDownload (id, name) {
|
handleDownload (id, name) {
|
||||||
// 下载文件
|
// 下载文件
|
||||||
downloadFile(`/sys/common/download/${id}`, name)
|
downloadFile(`/sys/common/download/${id}`, name)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 对数组形式后端错误信息进行处理
|
||||||
|
* @param title
|
||||||
|
* @param content
|
||||||
|
*/
|
||||||
|
messageLineFeed (title, content) {
|
||||||
|
const htmlDom = []
|
||||||
|
content.map(tt => {
|
||||||
|
if (tt) {
|
||||||
|
htmlDom.push((<div>{tt}</div>))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$warning({
|
||||||
|
title: title,
|
||||||
|
closable: true,
|
||||||
|
width: 800,
|
||||||
|
content: () => <div>
|
||||||
|
{htmlDom}
|
||||||
|
</div>
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display: inline-block'
|
||||||
|
document.getElementsByClassName('ant-modal-confirm-content')[0].style = 'max-height: calc(100vh - 300px);overflow-y: auto;'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 对包含<br/>的后端错误信息进行处理
|
||||||
|
* @param title
|
||||||
|
* @param content
|
||||||
|
*/
|
||||||
|
messageLineFeedByBr (title, content) {
|
||||||
|
// 可以用分号和<br> </br> <br/>换行
|
||||||
|
content = content.replace(/<br>|<\/br>|<br\/>/g, ';')
|
||||||
|
const messageArr = content.split(';')
|
||||||
|
const htmlDom = []
|
||||||
|
messageArr.map(tt => {
|
||||||
|
if (tt) {
|
||||||
|
htmlDom.push((<div>{tt}</div>))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$warning({
|
||||||
|
title: title,
|
||||||
|
closable: true,
|
||||||
|
width: 800,
|
||||||
|
content: () => <div>
|
||||||
|
{htmlDom}
|
||||||
|
</div>
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display: inline-block'
|
||||||
|
document.getElementsByClassName('ant-modal-confirm-content')[0].style = 'max-height: calc(100vh - 300px);overflow-y: auto;'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user