From 4adc9a45613006551118c72bcc41ef8dd6e23630 Mon Sep 17 00:00:00 2001 From: huxuejian Date: Fri, 4 Sep 2026 09:55:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=B9=E6=8E=A5=E5=90=88=E7=90=86?= =?UTF-8?q?=E7=94=A8=E8=8D=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custome-message-custom/index.vue | 13 +++++++++++++ .../chat-home/diagnosis-drawer/advice-modal.vue | 11 ++++------- .../chat-home/diagnosis-drawer/diagnosis-drawer.vue | 7 +++++++ src/views/login/index.vue | 8 ++++---- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/TUIKit/customComponents/custome-message-custom/index.vue b/src/TUIKit/customComponents/custome-message-custom/index.vue index c45d868..5bc1739 100644 --- a/src/TUIKit/customComponents/custome-message-custom/index.vue +++ b/src/TUIKit/customComponents/custome-message-custom/index.vue @@ -56,6 +56,17 @@ function parseVideoRecordExtension(ext) { } } +function parseSystemReason(ext) { + try { + const message = JSON.parse(ext); + return message && typeof message === "object" && typeof message.reason === "string" + ? message.reason + : null; + } catch { + return null; + } +} + // 解析并格式化系统提示消息的 extension 字段 const formattedExtension = computed(() => { const pl = payload.value || {}; @@ -68,6 +79,8 @@ const formattedExtension = computed(() => { if (record && (record.doctorText || record.patientText)) { return flow === "in" ? record.patientText : record.doctorText; } + const reason = parseSystemReason(ext); + if (reason !== null) return reason; // 不是JSON或解析失败,直接返回原文本 return ext; }); diff --git a/src/views/hlw-hospital/chat-home/diagnosis-drawer/advice-modal.vue b/src/views/hlw-hospital/chat-home/diagnosis-drawer/advice-modal.vue index 6861ee5..9334595 100644 --- a/src/views/hlw-hospital/chat-home/diagnosis-drawer/advice-modal.vue +++ b/src/views/hlw-hospital/chat-home/diagnosis-drawer/advice-modal.vue @@ -1,21 +1,18 @@