fix(UI): 使聊天记录中的 AI小班长 名称支持点击以快速回复

This commit is contained in:
2026-03-26 09:45:03 +08:00
parent ed04b2d4b9
commit c13bb5f35c

View File

@@ -521,6 +521,9 @@
// 用户名(单击切换发言对象,双击查看资料;系统用户或游戏标签仅显示文本) // 用户名(单击切换发言对象,双击查看资料;系统用户或游戏标签仅显示文本)
const clickableUser = (uName, color) => { const clickableUser = (uName, color) => {
if (uName === 'AI小班长') {
return `<span class="msg-user" data-u="${uName}" style="color: ${color}; cursor: pointer;" onclick="switchTarget('${uName}')">${uName}</span>`;
}
if (systemUsers.includes(uName) || isGameLabel(uName)) { if (systemUsers.includes(uName) || isGameLabel(uName)) {
return `<span class="msg-user" style="color: ${color};">${uName}</span>`; return `<span class="msg-user" style="color: ${color};">${uName}</span>`;
} }
@@ -617,7 +620,7 @@
}); });
html = html =
`${headImg}<span class="msg-user" style="color: ${fontColor}; font-weight: bold;">${msg.from_user}</span><span class="msg-content" style="color: ${fontColor}">${parsedContent}</span>${giftHtml}`; `${headImg}<span style="font-weight: bold;">${clickableUser(msg.from_user, fontColor)}</span><span class="msg-content" style="color: ${fontColor}">${parsedContent}</span>${giftHtml}`;
} }
} else if (msg.is_secret) { } else if (msg.is_secret) {
if (msg.from_user === '系统') { if (msg.from_user === '系统') {