From e6bee4e42eacb2daa204a2e57474f956e0b4eb48 Mon Sep 17 00:00:00 2001 From: danshihao Date: Tue, 23 Jul 2024 11:25:44 +0800 Subject: [PATCH] =?UTF-8?q?[fix=2087267]=20=E6=8B=86=E5=88=86-=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=8B=86=E5=88=86=E7=BB=93=E6=9E=9C-=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=8F=90=E7=A4=BA=E6=94=B9=E4=B8=BAbr=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/ImportSplitResultModal.vue | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/views/documentTool/documentSplit/modules/ImportSplitResultModal.vue b/src/views/documentTool/documentSplit/modules/ImportSplitResultModal.vue index 64c316e..78f9cfa 100644 --- a/src/views/documentTool/documentSplit/modules/ImportSplitResultModal.vue +++ b/src/views/documentTool/documentSplit/modules/ImportSplitResultModal.vue @@ -133,7 +133,8 @@ export default { this.$emit('ok') this.close() } else { - this.$message.warning(res.message) + this.messageLineFeedByBr(this.$t('fileImportError'), res.message) + // this.$message.warning(res.message) } }).finally(() => { this.confirmLoading = false @@ -141,6 +142,34 @@ export default { } }) }, + /** + * 对包含
的后端错误信息进行处理 + * @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;' + }) + }, handleCancel () { this.close() },