[bug] 删除时的提示语有多余的<br/>

This commit is contained in:
zhaoxiao
2021-10-27 11:53:54 +08:00
parent e5ef08fcbc
commit 237690c38e
2 changed files with 41 additions and 17 deletions
+31 -15
View File
@@ -197,7 +197,11 @@ export const JeroListMixin = {
that.loadData()
that.onClearSelected()
} else {
that.$message.warning(res.message)
if (res.message.indexOf('<br/>') > -1) {
that.messageLineFeed('删除失败', res.message)
} else {
that.$message.warning(res.message)
}
}
}).finally(() => {
that.loading = false
@@ -225,7 +229,11 @@ export const JeroListMixin = {
}
that.loadData()
} else {
that.$message.warning(res.message)
if (res.message.indexOf('<br/>') > -1) {
that.messageLineFeed('删除失败', res.message)
} else {
that.$message.warning(res.message)
}
}
})
}
@@ -322,19 +330,7 @@ export const JeroListMixin = {
}
this.loadData()
} else {
const messageArr = info.file.response.message.split('<br/>')
let htmlDom = []
messageArr.map(tt => {
if (tt) {
htmlDom.push((<div>{tt}</div>))
}
})
this.$warning({
title: '文件导入错误',
content: (h) => <div>
{htmlDom}
</div>
})
this.messageLineFeed('文件导入错误', info.file.response.message)
// this.$message.error(`${info.file.name} ${info.file.response.message}.`);
}
} else if (info.file.status === 'error') {
@@ -386,6 +382,26 @@ export const JeroListMixin = {
let url = getFileAccessHttpUrl(text)
window.open(url)
},
/**
* 对包含<br/>的后端错误信息进行处理
* @param title
* @param content
*/
messageLineFeed(title, content) {
const messageArr = content.split('<br/>')
let htmlDom = []
messageArr.map(tt => {
if (tt) {
htmlDom.push((<div>{tt}</div>))
}
})
this.$warning({
title: title,
content: (h) => <div>
{htmlDom}
</div>
})
}
}
}
@@ -220,7 +220,11 @@ export default {
}
that.loadData()
} else {
that.$message.warning(res.message)
if (res.message.indexOf('<br/>') > -1) {
that.messageLineFeed('删除失败', res.message)
} else {
that.$message.warning(res.message)
}
}
})
}
@@ -267,7 +271,11 @@ export default {
that.loadData()
that.onClearSelected()
} else {
that.$message.warning(res.message)
if (res.message.indexOf('<br/>') > -1) {
that.messageLineFeed('删除失败', res.message)
} else {
that.$message.warning(res.message)
}
}
}).finally(() => {
that.loading = false