<template>
|
<div class="sidebar">
|
<div class="sidebar-header">
|
<n-button class="new-chat-btn" block @click="handleNewChat">
|
<template #icon>
|
<span class="plus-icon">+</span>
|
</template>
|
新对话
|
</n-button>
|
</div>
|
|
<div class="sidebar-search">
|
<n-input
|
v-model:value="keyword"
|
size="small"
|
clearable
|
placeholder="搜索历史对话"
|
@input="handleSearchInput"
|
@keyup.esc="handleClearSearch"
|
>
|
<template #prefix>
|
<span class="search-icon">⌕</span>
|
</template>
|
</n-input>
|
</div>
|
|
<div class="sidebar-list">
|
<!-- 搜索态:跨全部会话搜(含分组里的),命中内容时给出上下文片段 -->
|
<template v-if="isSearching">
|
<n-spin v-if="chatStore.searching" size="small" class="sidebar-loading" />
|
|
<div v-else-if="chatStore.searchResults.length === 0" class="empty-hint sidebar-empty">
|
没有找到匹配「{{ chatStore.searchKeyword }}」的对话<br />
|
试试其他关键词
|
</div>
|
|
<ChatListItem
|
v-for="chat in chatStore.searchResults"
|
v-else
|
:key="chat.id"
|
:chat="chat"
|
:active="chat.id === activeChatId"
|
:options="menuFor(chat)"
|
@select="(id) => $emit('select', id)"
|
@menu="handleMenu"
|
/>
|
</template>
|
|
<!-- 普通态 -->
|
<template v-else>
|
<n-spin v-if="loading" size="small" class="sidebar-loading" />
|
|
<!-- ============ 分组区块 ============ -->
|
<div class="section">
|
<div class="section-head" @click="toggleGroupSection()">
|
<span class="chevron" :class="{ collapsed: groupSectionCollapsed }">▾</span>
|
<span class="section-title">分组</span>
|
<span class="section-count">{{ sections.groups.length || '' }}</span>
|
<n-button
|
text
|
class="section-add"
|
title="新建分组"
|
@click.stop="openCreateGroup"
|
>
|
+
|
</n-button>
|
</div>
|
|
<template v-if="!groupSectionCollapsed">
|
<div v-if="sections.groups.length === 0" class="section-empty">
|
还没有分组,点右上角「+」新建
|
</div>
|
|
<div v-for="group in sections.groups" :key="group.id" class="group-block">
|
<div class="group-head" @click="toggleGroup(group.id)">
|
<span class="chevron small" :class="{ collapsed: isGroupCollapsed(group.id) }">▾</span>
|
<span class="group-name" :title="group.name">{{ group.name }}</span>
|
<span class="group-count">{{ group.chats.length }}</span>
|
|
<n-dropdown
|
trigger="click"
|
:options="groupMenuOptions"
|
placement="bottom-end"
|
@select="(key) => handleGroupMenu(key, group)"
|
>
|
<n-button text class="group-more" @click.stop>⋯</n-button>
|
</n-dropdown>
|
</div>
|
|
<template v-if="!isGroupCollapsed(group.id)">
|
<div v-if="group.chats.length === 0" class="group-empty">
|
空分组 —— 用对话右上角的「⋯ → 移动到分组」放进来
|
</div>
|
<ChatListItem
|
v-for="chat in group.chats"
|
v-else
|
:key="chat.id"
|
:chat="chat"
|
:active="chat.id === activeChatId"
|
indented
|
:options="menuFor(chat)"
|
@select="(id) => $emit('select', id)"
|
@menu="handleMenu"
|
/>
|
</template>
|
</div>
|
</template>
|
</div>
|
|
<!-- ============ 置顶(未分组的置顶会话)============ -->
|
<div v-if="sections.pinned.length" class="section">
|
<div class="section-head static">
|
<span class="chevron">▾</span>
|
<span class="section-title">置顶</span>
|
</div>
|
<ChatListItem
|
v-for="chat in sections.pinned"
|
:key="chat.id"
|
:chat="chat"
|
:active="chat.id === activeChatId"
|
:options="menuFor(chat)"
|
@select="(id) => $emit('select', id)"
|
@menu="handleMenu"
|
/>
|
</div>
|
|
<!-- ============ 未分组的会话,按时间归类 ============ -->
|
<div v-if="!loading && chats.length === 0" class="empty-hint sidebar-empty">
|
还没有对话<br />点击上方「新对话」开始
|
</div>
|
|
<div v-for="group in sections.timeGroups" :key="group.key" class="chat-group">
|
<div class="chat-group-title">{{ group.label }}</div>
|
<ChatListItem
|
v-for="chat in group.chats"
|
:key="chat.id"
|
:chat="chat"
|
:active="chat.id === activeChatId"
|
:options="menuFor(chat)"
|
@select="(id) => $emit('select', id)"
|
@menu="handleMenu"
|
/>
|
</div>
|
</template>
|
</div>
|
|
<!-- 归档入口 -->
|
<div class="sidebar-archive">
|
<div class="archive-entry" @click="archiveVisible = true">
|
<span class="archive-icon">🗄</span>
|
<span class="archive-text">归档对话</span>
|
<n-badge
|
v-if="archivedCount > 0"
|
:value="archivedCount"
|
:max="99"
|
type="info"
|
class="archive-badge"
|
/>
|
</div>
|
</div>
|
|
<div class="sidebar-footer">
|
<n-dropdown trigger="click" :options="userMenuOptions" @select="handleUserMenu">
|
<div class="user-info">
|
<div class="user-avatar">{{ avatarText }}</div>
|
<div class="user-text">
|
<div class="user-name">{{ auth.displayName }}</div>
|
<div class="user-role">{{ auth.isAdmin ? '管理员' : '普通用户' }}</div>
|
</div>
|
<span class="user-more">⋯</span>
|
</div>
|
</n-dropdown>
|
</div>
|
|
<!-- 新建 / 重命名分组共用同一个弹窗 -->
|
<n-modal
|
v-model:show="groupModal.show"
|
preset="card"
|
:title="groupModal.id ? '重命名分组' : '新建分组'"
|
class="small-modal"
|
:bordered="false"
|
>
|
<n-input
|
v-model:value="groupModal.name"
|
placeholder="分组名称,例如「工作」「学习资料」"
|
maxlength="64"
|
show-count
|
@keyup.enter="confirmGroupModal"
|
/>
|
<template #footer>
|
<div class="modal-footer">
|
<n-button size="small" @click="groupModal.show = false">取消</n-button>
|
<n-button
|
size="small"
|
type="primary"
|
:loading="groupModal.saving"
|
@click="confirmGroupModal"
|
>
|
保存
|
</n-button>
|
</div>
|
</template>
|
</n-modal>
|
|
<!-- 重命名对话 -->
|
<n-modal
|
v-model:show="renameModal.show"
|
preset="card"
|
title="重命名对话"
|
class="small-modal"
|
:bordered="false"
|
>
|
<n-input
|
v-model:value="renameModal.title"
|
placeholder="输入新的对话名称"
|
maxlength="255"
|
show-count
|
@keyup.enter="confirmRenameModal"
|
/>
|
<template #footer>
|
<div class="modal-footer">
|
<n-button size="small" @click="renameModal.show = false">取消</n-button>
|
<n-button
|
size="small"
|
type="primary"
|
:loading="renameModal.saving"
|
@click="confirmRenameModal"
|
>
|
保存
|
</n-button>
|
</div>
|
</template>
|
</n-modal>
|
|
<ArchivedChatDrawer v-model:show="archiveVisible" @select="handleArchivedSelect" />
|
</div>
|
</template>
|
|
<script setup>
|
import { computed, ref } from 'vue'
|
import { NBadge, NButton, NDropdown, NInput, NModal, NSpin, useDialog, useMessage } from 'naive-ui'
|
import ArchivedChatDrawer from '@/components/ArchivedChatDrawer.vue'
|
import ChatListItem from '@/components/ChatListItem.vue'
|
import { useAuthStore } from '@/stores/authStore'
|
import { useChatStore } from '@/stores/chatStore'
|
import { buildSidebarSections } from '@/utils/sidebarGroups'
|
import { usePersistentFlag, usePersistentMap } from '@/utils/uiPrefs'
|
|
const emit = defineEmits(['select', 'created', 'deleted', 'open-files', 'open-admin-knowledge'])
|
|
const auth = useAuthStore()
|
const chatStore = useChatStore()
|
const message = useMessage()
|
const dialog = useDialog()
|
|
const loading = ref(false)
|
const archiveVisible = ref(false)
|
|
/** 搜索框的本地输入值(与 store 里的已提交关键词区分开) */
|
const keyword = ref('')
|
|
/**
|
* 折叠状态:纯视图偏好,存 localStorage,不打扰后端。
|
*
|
* 「整个分组区块」的开关解构成顶层 ref —— Vue 只会自动解包
|
* setup 顶层返回的 ref,如果把它留在对象里(flag.value),
|
* 模板里就得写 flag.value.value,极易写错。
|
*/
|
const {
|
collapsed: groupSectionCollapsed,
|
toggle: toggleGroupSection
|
} = usePersistentFlag('group_section_collapsed', false)
|
const groupCollapse = usePersistentMap('group_collapsed')
|
|
const chats = computed(() => chatStore.chats)
|
const activeChatId = computed(() => chatStore.activeChatId)
|
const archivedCount = computed(() => chatStore.archivedChats.length)
|
const isSearching = computed(() => chatStore.searchKeyword.length > 0)
|
|
/**
|
* 侧边栏结构:分组 / 置顶 / 今天 / 昨天 / 更早。
|
*
|
* 纯计算属性 —— 编排规则都在 buildSidebarSections 里,
|
* 组件只负责渲染,规则也能单独测。
|
*/
|
const sections = computed(() =>
|
buildSidebarSections(chats.value, chatStore.chatGroups)
|
)
|
|
function isGroupCollapsed(id) {
|
return groupCollapse.isCollapsed(id)
|
}
|
|
function toggleGroup(id) {
|
groupCollapse.toggle(id)
|
}
|
|
const avatarText = computed(() => (auth.displayName || '?').charAt(0).toUpperCase())
|
|
// ---------------- 弹窗状态 ----------------
|
|
const groupModal = ref({ show: false, id: null, name: '', saving: false })
|
const renameModal = ref({ show: false, id: null, title: '', saving: false })
|
|
function openCreateGroup() {
|
groupModal.value = { show: true, id: null, name: '', saving: false }
|
}
|
|
function openRenameGroup(group) {
|
groupModal.value = { show: true, id: group.id, name: group.name, saving: false }
|
}
|
|
async function confirmGroupModal() {
|
const name = groupModal.value.name.trim()
|
if (!name) {
|
message.warning('分组名不能为空')
|
return
|
}
|
groupModal.value.saving = true
|
try {
|
if (groupModal.value.id) {
|
await chatStore.renameChatGroup(groupModal.value.id, name)
|
message.success('分组已重命名')
|
} else {
|
await chatStore.createChatGroup(name)
|
message.success('分组已创建')
|
}
|
groupModal.value.show = false
|
} catch (error) {
|
// 重名等业务错误由后端给出人话提示,这里直接展示
|
message.error(error.message || '操作失败')
|
} finally {
|
groupModal.value.saving = false
|
}
|
}
|
|
// ---------------- 菜单 ----------------
|
|
/**
|
* 每条会话的菜单。
|
*
|
* 「移动到分组」的子菜单列出「未分组 + 所有分组」,当前所在的那一项打勾 ——
|
* 用户不必先记住它在哪个分组里。
|
*/
|
function menuFor(chat) {
|
const moveChildren = [
|
{
|
label: chat.groupId == null ? '✓ 未分组' : '未分组',
|
key: 'move-none'
|
},
|
...chatStore.chatGroups.map((group) => ({
|
label: (chat.groupId === group.id ? '✓ ' : '') + group.name,
|
key: 'move-' + group.id
|
}))
|
]
|
|
return [
|
{ label: chat.pinned ? '取消置顶' : '置顶', key: 'pin' },
|
{ label: '重命名', key: 'rename' },
|
{ label: '移动到分组', key: 'move', children: moveChildren },
|
{
|
label: '下载',
|
key: 'download',
|
children: [
|
{ label: 'JSON(含全部分支)', key: 'download-json' },
|
{ label: 'TXT(纯文本)', key: 'download-txt' },
|
{ label: 'PDF(带页码排版)', key: 'download-pdf' }
|
]
|
},
|
{ label: '归档', key: 'archive' },
|
{ type: 'divider', key: 'd1' },
|
{ label: '知识库设置', key: 'rag' },
|
{ label: '删除对话', key: 'delete', props: { style: 'color: #d03050;' } }
|
]
|
}
|
|
const groupMenuOptions = [
|
{ label: '重命名分组', key: 'rename' },
|
{ label: '删除分组', key: 'delete', props: { style: 'color: #d03050;' } }
|
]
|
|
const userMenuOptions = computed(() => {
|
const options = [{ label: '我的知识库', key: 'files' }]
|
// 管理员额外提供全局知识库维护入口。
|
// 后端对 /api/files/global/upload 等端点另有 403 校验,
|
// 这里的隐藏只是避免普通用户看到无权限的菜单项。
|
if (auth.isAdmin) {
|
options.push({ label: '全局知识库(管理员)', key: 'admin-knowledge' })
|
}
|
options.push({ type: 'divider', key: 'd1' })
|
options.push({ label: '退出登录', key: 'logout' })
|
return options
|
})
|
|
async function handleMenu(key, chat) {
|
if (key.startsWith('move-')) {
|
const raw = key.slice('move-'.length)
|
const groupId = raw === 'none' ? null : Number(raw)
|
await moveChat(chat, groupId)
|
return
|
}
|
|
switch (key) {
|
case 'pin':
|
await togglePin(chat)
|
break
|
case 'rename':
|
renameModal.value = { show: true, id: chat.id, title: chat.title || '', saving: false }
|
break
|
case 'download-json':
|
await download(chat, 'json')
|
break
|
case 'download-txt':
|
await download(chat, 'txt')
|
break
|
case 'download-pdf':
|
await download(chat, 'pdf')
|
break
|
case 'archive':
|
archive(chat)
|
break
|
case 'rag':
|
emit('select', chat.id)
|
emit('open-files')
|
break
|
case 'delete':
|
confirmDelete(chat)
|
break
|
default:
|
break
|
}
|
}
|
|
async function handleGroupMenu(key, group) {
|
if (key === 'rename') {
|
openRenameGroup(group)
|
return
|
}
|
if (key === 'delete') {
|
dialog.warning({
|
title: '删除分组',
|
content: `确定删除分组「${group.name}」吗?组内的 ${group.chats.length} 条对话`
|
+ '**不会被删除**,它们会回到「未分组」,继续按时间归类。',
|
positiveText: '删除分组',
|
negativeText: '取消',
|
onPositiveClick: async () => {
|
try {
|
const moved = await chatStore.deleteChatGroup(group.id)
|
message.success(moved > 0
|
? `分组已删除,${moved} 条对话已回到未分组`
|
: '分组已删除')
|
} catch (error) {
|
message.error(error.message || '删除分组失败')
|
return false
|
}
|
return true
|
}
|
})
|
}
|
}
|
|
async function moveChat(chat, groupId) {
|
if ((chat.groupId ?? null) === groupId) {
|
return
|
}
|
try {
|
await chatStore.moveChatToGroup(chat.id, groupId)
|
const name = groupId == null
|
? '未分组'
|
: chatStore.chatGroups.find((g) => g.id === groupId)?.name || '分组'
|
message.success(`已移动到「${name}」`)
|
} catch (error) {
|
message.error(error.message || '移动失败')
|
}
|
}
|
|
async function togglePin(chat) {
|
try {
|
await chatStore.setPinned(chat.id, !chat.pinned)
|
message.success(chat.pinned ? '已取消置顶' : '已置顶')
|
} catch (error) {
|
message.error(error.message || '操作失败')
|
}
|
}
|
|
const downloading = ref(false)
|
|
async function download(chat, format) {
|
if (downloading.value) return
|
downloading.value = true
|
message.loading(`正在导出 ${format.toUpperCase()}…`, { duration: 1200 })
|
try {
|
const filename = await chatStore.exportChat(chat.id, format)
|
message.success(`已导出 ${filename}`)
|
} catch (error) {
|
message.error(error.message || '导出失败')
|
} finally {
|
downloading.value = false
|
}
|
}
|
|
function archive(chat) {
|
dialog.create({
|
title: '归档对话',
|
content: `「${chat.title || '新对话'}」将从列表收起。消息与知识库绑定都会保留,`
|
+ '之后可以在「归档对话」里找到并恢复。',
|
positiveText: '归档',
|
negativeText: '取消',
|
onPositiveClick: async () => {
|
try {
|
await chatStore.setArchived(chat.id, true)
|
message.success('已归档,可在「归档对话」中查看')
|
} catch (error) {
|
message.error(error.message || '归档失败')
|
return false
|
}
|
return true
|
}
|
})
|
}
|
|
function confirmDelete(chat) {
|
dialog.warning({
|
title: '删除对话',
|
content: `确定删除「${chat.title}」吗?该会话的所有消息都会被一并删除,且无法恢复。`,
|
positiveText: '删除',
|
negativeText: '取消',
|
onPositiveClick: async () => {
|
try {
|
await chatStore.removeChat(chat.id)
|
message.success('已删除')
|
emit('deleted', chat.id)
|
} catch (error) {
|
message.error(error.message || '删除失败')
|
return false
|
}
|
return true
|
}
|
})
|
}
|
|
async function confirmRenameModal() {
|
const title = renameModal.value.title.trim()
|
if (!title) {
|
message.warning('名称不能为空')
|
return
|
}
|
renameModal.value.saving = true
|
try {
|
await chatStore.renameChat(renameModal.value.id, title)
|
message.success('已重命名')
|
renameModal.value.show = false
|
} catch (error) {
|
message.error(error.message || '重命名失败')
|
} finally {
|
renameModal.value.saving = false
|
}
|
}
|
|
// ---------------- 搜索 ----------------
|
|
let searchTimer = null
|
const SEARCH_DEBOUNCE_MS = 250
|
|
function handleSearchInput() {
|
if (searchTimer) {
|
clearTimeout(searchTimer)
|
}
|
const value = keyword.value
|
|
if (!value || !value.trim()) {
|
if (searchTimer) clearTimeout(searchTimer)
|
chatStore.clearSearch()
|
return
|
}
|
|
searchTimer = setTimeout(async () => {
|
try {
|
await chatStore.searchChats(value)
|
} catch (error) {
|
message.error(error.message || '搜索失败')
|
}
|
}, SEARCH_DEBOUNCE_MS)
|
}
|
|
function handleClearSearch() {
|
if (searchTimer) clearTimeout(searchTimer)
|
keyword.value = ''
|
chatStore.clearSearch()
|
}
|
|
function handleArchivedSelect(id) {
|
archiveVisible.value = false
|
emit('select', id)
|
}
|
|
async function handleNewChat() {
|
try {
|
const chat = await chatStore.createChat({})
|
emit('created', chat.id)
|
} catch (error) {
|
message.error(error.message || '创建会话失败')
|
}
|
}
|
|
function handleUserMenu(key) {
|
if (key === 'files') {
|
emit('open-files')
|
} else if (key === 'admin-knowledge') {
|
emit('open-admin-knowledge')
|
} else if (key === 'logout') {
|
auth.logout()
|
emit('deleted', null)
|
}
|
}
|
|
/** 由父组件在挂载时调用,避免组件自己触发请求造成时序不确定 */
|
async function refresh() {
|
loading.value = true
|
try {
|
handleClearSearch()
|
await Promise.all([
|
chatStore.loadChats(),
|
chatStore.loadArchivedChats(),
|
chatStore.loadChatGroups()
|
])
|
} catch (error) {
|
message.error(error.message || '加载会话列表失败')
|
} finally {
|
loading.value = false
|
}
|
}
|
|
defineExpose({ refresh })
|
</script>
|
|
<style scoped>
|
.sidebar {
|
width: var(--sidebar-width);
|
height: 100vh;
|
background: var(--bg-sidebar);
|
border-right: 1px solid var(--border-color);
|
display: flex;
|
flex-direction: column;
|
flex-shrink: 0;
|
}
|
|
.sidebar-header {
|
padding: 12px;
|
}
|
|
.new-chat-btn {
|
justify-content: flex-start;
|
font-weight: 500;
|
}
|
|
.plus-icon {
|
font-size: 17px;
|
line-height: 1;
|
}
|
|
.sidebar-search {
|
padding: 0 12px 8px;
|
}
|
|
.search-icon {
|
font-size: 14px;
|
color: var(--text-muted);
|
}
|
|
.sidebar-list {
|
flex: 1;
|
overflow-y: auto;
|
padding: 0 8px 8px;
|
}
|
|
/* ---------- 分组区块 ---------- */
|
|
.section {
|
margin-bottom: 6px;
|
}
|
|
.section-head {
|
display: flex;
|
align-items: center;
|
gap: 4px;
|
padding: 6px 10px;
|
border-radius: 6px;
|
cursor: pointer;
|
user-select: none;
|
}
|
|
.section-head:hover {
|
background: var(--bg-hover);
|
}
|
|
.section-head.static {
|
cursor: default;
|
}
|
|
.section-head.static:hover {
|
background: transparent;
|
}
|
|
.section-title {
|
font-size: 11.5px;
|
font-weight: 600;
|
letter-spacing: 0.3px;
|
color: var(--text-muted);
|
}
|
|
.section-count {
|
font-size: 11px;
|
color: var(--text-muted);
|
}
|
|
.section-add {
|
margin-left: auto;
|
font-size: 15px;
|
line-height: 1;
|
padding: 0 4px;
|
color: var(--text-secondary);
|
}
|
|
.section-add:hover {
|
color: #2080f0;
|
}
|
|
.section-empty,
|
.group-empty {
|
padding: 6px 10px 8px 26px;
|
font-size: 11.5px;
|
color: var(--text-muted);
|
line-height: 1.7;
|
}
|
|
/* 折叠箭头:默认朝下,折叠时转 -90 度 */
|
.chevron {
|
display: inline-block;
|
width: 12px;
|
font-size: 10px;
|
color: var(--text-muted);
|
transition: transform 0.15s ease;
|
}
|
|
.chevron.collapsed {
|
transform: rotate(-90deg);
|
}
|
|
.chevron.small {
|
font-size: 9px;
|
}
|
|
.group-block {
|
margin-bottom: 2px;
|
}
|
|
.group-head {
|
display: flex;
|
align-items: center;
|
gap: 4px;
|
padding: 6px 10px 6px 14px;
|
border-radius: 6px;
|
cursor: pointer;
|
user-select: none;
|
}
|
|
.group-head:hover {
|
background: var(--bg-hover);
|
}
|
|
.group-name {
|
font-size: 12.5px;
|
font-weight: 500;
|
color: var(--text-primary);
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
}
|
|
.group-count {
|
font-size: 11px;
|
color: var(--text-muted);
|
}
|
|
.group-more {
|
margin-left: auto;
|
font-size: 14px;
|
line-height: 1;
|
padding: 0 4px;
|
color: var(--text-secondary);
|
opacity: 0;
|
transition: opacity 0.12s ease;
|
}
|
|
.group-head:hover .group-more {
|
opacity: 1;
|
}
|
|
/* ---------- 时间分组 ---------- */
|
|
.chat-group-title {
|
position: sticky;
|
top: 0;
|
z-index: 1;
|
padding: 8px 10px 4px;
|
font-size: 11px;
|
font-weight: 600;
|
letter-spacing: 0.3px;
|
color: var(--text-muted);
|
background: var(--bg-sidebar);
|
}
|
|
.sidebar-loading {
|
display: flex;
|
justify-content: center;
|
padding: 20px 0;
|
}
|
|
.sidebar-empty {
|
padding: 28px 12px;
|
line-height: 1.9;
|
}
|
|
/* ---------- 归档入口 ---------- */
|
|
.sidebar-archive {
|
padding: 4px 8px 0;
|
}
|
|
.archive-entry {
|
display: flex;
|
align-items: center;
|
gap: 8px;
|
padding: 8px 10px;
|
border-radius: 8px;
|
cursor: pointer;
|
font-size: 12.5px;
|
color: var(--text-secondary);
|
}
|
|
.archive-entry:hover {
|
background: var(--bg-hover);
|
}
|
|
.archive-icon {
|
font-size: 13px;
|
}
|
|
.archive-text {
|
flex: 1;
|
}
|
|
/* ---------- 底部用户区 ---------- */
|
|
.sidebar-footer {
|
border-top: 1px solid var(--border-color);
|
padding: 8px;
|
}
|
|
.user-info {
|
display: flex;
|
align-items: center;
|
gap: 10px;
|
padding: 8px;
|
border-radius: 8px;
|
cursor: pointer;
|
}
|
|
.user-info:hover {
|
background: var(--bg-hover);
|
}
|
|
.user-avatar {
|
width: 30px;
|
height: 30px;
|
border-radius: 50%;
|
background: #4b5563;
|
color: #fff;
|
font-size: 13px;
|
font-weight: 600;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex-shrink: 0;
|
}
|
|
.user-text {
|
flex: 1;
|
min-width: 0;
|
}
|
|
.user-name {
|
font-size: 13px;
|
font-weight: 500;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
}
|
|
.user-role {
|
font-size: 11px;
|
color: var(--text-muted);
|
}
|
|
.user-more {
|
color: var(--text-muted);
|
}
|
|
.small-modal {
|
width: 420px;
|
}
|
|
.modal-footer {
|
display: flex;
|
justify-content: flex-end;
|
gap: 8px;
|
}
|
</style>
|