[update] 修改年度制修订流程导入失败提示

This commit is contained in:
lideqin
2024-01-03 13:43:47 +08:00
parent 10e8bca673
commit 8957ea4b8c
2 changed files with 54 additions and 2 deletions
@@ -422,7 +422,11 @@ export default {
// 推入表格中
this.dataSource = info.file.response.result
} else {
this.$message.warning(`${info.file.name} ${info.file.response.message}.`)
if (Array.isArray(info.file.response.result) && info.file.response.result.length > 0) {
this.messageLineFeed(this.$t('fileImportError'), info.file.response.result)
} else {
this.$message.warning(`${info.file.name} ${info.file.response.message}`)
}
}
} else if (info.file.status === 'error') {
// 销毁这个提示
@@ -491,6 +495,28 @@ export default {
// 选人的名字获取
userSelectNameChange (value) {
this.selectNames = value
},
/**
* 对数组形式后端错误信息进行处理
* @param title
* @param content
*/
messageLineFeed (title, content) {
const htmlDom = []
content.map(tt => {
if (tt) {
htmlDom.push((<div>{tt}</div>))
}
})
this.$warning({
title: title,
content: () => <div>
{htmlDom}
</div>
})
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display: inline-block'
})
}
}
}