From 4c3f12ae9b91901931a83cf8b5cf79682e79e0a9 Mon Sep 17 00:00:00 2001 From: danshihao Date: Fri, 9 Aug 2024 11:26:57 +0800 Subject: [PATCH] =?UTF-8?q?[update=20=E8=A7=A3=E8=AF=BB=E6=B5=81=E7=A8=8B]?= =?UTF-8?q?=20=E5=A4=9A=E8=A1=8C=E6=8A=A5=E9=94=99=EF=BC=8Cbr=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardInterpretationProcess.vue | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue b/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue index f2fb451..1c7a190 100644 --- a/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue +++ b/src/views/workCenter/standardInterpretationProcess/StandardInterpretationProcess.vue @@ -659,7 +659,12 @@ export default { this.$message.success(res.message) this.goBack() } else { - this.$message.warn(res.message) + // 多行报错 + if (res.code === 500) { + this.messageLineFeedByBr(this.$t('operationFailed'), res.message) + } else { + this.$message.warn(res.message) + } } }).catch((err) => { if (err && err.message && tabList.includes(err.message)) { @@ -770,6 +775,34 @@ export default { return Promise.all(promiseList).catch(() => { throw new Error('base') }) + }, + /** + * 对包含
的后端错误信息进行处理 + * @param title + * @param content + */ + messageLineFeedByBr (title, content) { + // 可以用分号和


换行 + content = content.replace(/
|<\/br>|/g, ';') + const messageArr = content.split(';') + const htmlDom = [] + messageArr.map(tt => { + if (tt) { + htmlDom.push((
{tt}
)) + } + }) + this.$warning({ + title: title, + closable: true, + width: 800, + content: () =>
+ {htmlDom} +
+ }) + 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;' + }) } } }