管理员可以看到所有会话了

This commit is contained in:
yml
2026-06-05 19:43:55 +08:00
parent 59093f8fd5
commit 92c603794a
5 changed files with 236 additions and 31 deletions
@@ -276,12 +276,17 @@ function roleLabel(role: string) {
support: '客服',
customer: '咨询',
system: '系统',
admin: '管理员',
}
return map[role] || '成员'
}
function senderLabel(item: ChatMessage) {
if (item.sender_type === 'system') return '系统'
// 管理员消息特殊标识
if (item.sender_role === 'admin') {
return `管理员 · ${item.sender_name}`
}
return `${roleLabel(item.sender_role)} · ${item.sender_name}`
}
@@ -374,13 +379,19 @@ function getSupportName(item: ChatConversation) {
v-for="item in messages"
:key="item.id"
class="message-row"
:class="{ self: item.is_self, system: item.sender_type === 'system' }"
:class="{
self: item.is_self,
system: item.sender_type === 'system',
admin: item.sender_role === 'admin'
}"
>
<template v-if="item.sender_type === 'system'">
<span>{{ item.content }}</span>
</template>
<template v-else>
<small>{{ senderLabel(item) }} · {{ formatDateMinute(item.created_at) }}</small>
<small :class="{ 'admin-label': item.sender_role === 'admin' }">
{{ senderLabel(item) }} · {{ formatDateMinute(item.created_at) }}
</small>
<p v-if="item.content">{{ item.content }}</p>
<div v-if="item.attachment_urls.length > 0" class="message-attachments">
<ChatAttachmentImage
@@ -678,6 +689,16 @@ function getSupportName(item: ChatConversation) {
background: #dff5eb;
}
.message-row.admin p {
background: #fff4e6;
border-left: 3px solid #ff9800;
}
.admin-label {
color: #ff9800 !important;
font-weight: 600;
}
.message-attachments {
display: grid;
justify-items: start;