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 @@