2026-02-25 18:21:25 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<transition name="history-slide">
|
|
|
|
|
|
<div v-if="visible" class="history-panel">
|
|
|
|
|
|
<!-- Header -->
|
|
|
|
|
|
<header class="panel-header">
|
|
|
|
|
|
<div class="header-left">
|
|
|
|
|
|
<button v-if="selectedConversation" class="back-btn" @click="backToList">
|
|
|
|
|
|
<LeftOutlined />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<h3 class="header-title">{{ selectedConversation ? '对话详情' : '历史记录' }}</h3>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<button class="close-btn" @click="handleClose">
|
|
|
|
|
|
<CloseOutlined />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Content -->
|
|
|
|
|
|
<div class="panel-content">
|
|
|
|
|
|
<!-- Conversation List -->
|
|
|
|
|
|
<div v-if="!selectedConversation" class="conversation-view">
|
|
|
|
|
|
<a-spin :spinning="loading">
|
|
|
|
|
|
<!-- Empty State -->
|
|
|
|
|
|
<div v-if="groupedConversations.length === 0 && !loading" class="empty-state">
|
|
|
|
|
|
<div class="empty-visual">
|
|
|
|
|
|
<div class="visual-ring"></div>
|
|
|
|
|
|
<HistoryOutlined class="empty-icon" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p class="empty-text">暂无历史记录</p>
|
|
|
|
|
|
<p class="empty-hint">开始对话后,记录将保存在这里</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Grouped List -->
|
|
|
|
|
|
<div v-else class="conversation-groups">
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="group in groupedConversations"
|
|
|
|
|
|
:key="group.label"
|
|
|
|
|
|
class="conversation-group"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="group-header">
|
|
|
|
|
|
<span class="group-label">{{ group.label }}</span>
|
|
|
|
|
|
<span class="group-count">{{ group.items.length }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="group-list">
|
|
|
|
|
|
<button
|
|
|
|
|
|
v-for="item in group.items"
|
|
|
|
|
|
:key="item.id"
|
|
|
|
|
|
class="conversation-card"
|
|
|
|
|
|
@click="selectConversation(item)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="card-main">
|
|
|
|
|
|
<h4 class="card-title">{{ item.name || '未命名会话' }}</h4>
|
|
|
|
|
|
<p class="card-preview">{{ item.preview || '暂无预览' }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="card-meta">
|
|
|
|
|
|
<span class="meta-time">
|
|
|
|
|
|
<ClockCircleOutlined />
|
|
|
|
|
|
{{ formatTime(item.updatedAt || item.createdAt) }}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<RightOutlined class="meta-arrow" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-spin>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Message Detail -->
|
|
|
|
|
|
<div v-else class="message-view">
|
|
|
|
|
|
<a-spin :spinning="messageLoading">
|
|
|
|
|
|
<div v-if="messageList.length === 0 && !messageLoading" class="empty-state">
|
|
|
|
|
|
<CommentOutlined class="empty-icon" />
|
|
|
|
|
|
<p>暂无消息</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else class="message-list">
|
|
|
|
|
|
<div v-for="(msg, index) in messageList" :key="msg.id" class="message-item">
|
|
|
|
|
|
<div class="message-bubble message-bubble--user">
|
|
|
|
|
|
<div class="bubble-header">
|
|
|
|
|
|
<UserOutlined class="bubble-avatar" />
|
|
|
|
|
|
<span class="bubble-label">你的问题</span>
|
|
|
|
|
|
<span class="bubble-time">{{ formatTime(msg.createdAt) }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p class="bubble-content">{{ msg.query }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="message-bubble message-bubble--ai">
|
|
|
|
|
|
<div class="bubble-header">
|
|
|
|
|
|
<RobotOutlined class="bubble-avatar" />
|
|
|
|
|
|
<span class="bubble-label">AI 回答</span>
|
|
|
|
|
|
<button class="bubble-copy" @click="copyContent(msg.answer)">
|
|
|
|
|
|
<CopyOutlined />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p class="bubble-content">{{ msg.answer }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-spin>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</transition>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { ref, computed, watch } from 'vue'
|
|
|
|
|
|
import {
|
|
|
|
|
|
CloseOutlined,
|
|
|
|
|
|
LeftOutlined,
|
|
|
|
|
|
RightOutlined,
|
|
|
|
|
|
HistoryOutlined,
|
|
|
|
|
|
ClockCircleOutlined,
|
|
|
|
|
|
CopyOutlined,
|
|
|
|
|
|
UserOutlined,
|
|
|
|
|
|
RobotOutlined,
|
|
|
|
|
|
CommentOutlined
|
|
|
|
|
|
} from '@ant-design/icons-vue'
|
|
|
|
|
|
import { message } from 'ant-design-vue'
|
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
|
import { getConversations, getMessages } from '@/api/agent'
|
|
|
|
|
|
import { copyToClipboard } from '@/utils/clipboard'
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
visible: { type: Boolean, default: false },
|
|
|
|
|
|
agentId: { type: [String, Number], default: null }
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['close'])
|
|
|
|
|
|
|
|
|
|
|
|
// State
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
const conversationList = ref([])
|
|
|
|
|
|
const selectedConversation = ref(null)
|
|
|
|
|
|
const messageList = ref([])
|
|
|
|
|
|
const messageLoading = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
// 按日期分组
|
|
|
|
|
|
const groupedConversations = computed(() => {
|
|
|
|
|
|
const today = dayjs().startOf('day')
|
|
|
|
|
|
const yesterday = dayjs().subtract(1, 'day').startOf('day')
|
|
|
|
|
|
const week = dayjs().subtract(7, 'day').startOf('day')
|
|
|
|
|
|
|
|
|
|
|
|
const groups = {
|
|
|
|
|
|
today: { label: '今天', items: [] },
|
|
|
|
|
|
yesterday: { label: '昨天', items: [] },
|
|
|
|
|
|
week: { label: '近7天', items: [] },
|
|
|
|
|
|
older: { label: '更早', items: [] }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
conversationList.value.forEach(item => {
|
|
|
|
|
|
const date = dayjs((item.updatedAt || item.createdAt) * 1000)
|
|
|
|
|
|
if (date.isAfter(today)) {
|
|
|
|
|
|
groups.today.items.push(item)
|
|
|
|
|
|
} else if (date.isAfter(yesterday)) {
|
|
|
|
|
|
groups.yesterday.items.push(item)
|
|
|
|
|
|
} else if (date.isAfter(week)) {
|
|
|
|
|
|
groups.week.items.push(item)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
groups.older.items.push(item)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
return Object.values(groups).filter(g => g.items.length > 0)
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
|
|
const loadConversations = async () => {
|
|
|
|
|
|
if (!props.agentId) return
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
const res = await getConversations({ agentId: props.agentId, limit: 50 })
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
|
conversationList.value = res.data?.data || []
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error('加载会话列表失败:', e)
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const selectConversation = async (conversation) => {
|
|
|
|
|
|
selectedConversation.value = conversation
|
|
|
|
|
|
messageLoading.value = true
|
|
|
|
|
|
messageList.value = []
|
|
|
|
|
|
try {
|
|
|
|
|
|
const res = await getMessages({
|
|
|
|
|
|
agentId: props.agentId,
|
|
|
|
|
|
conversationId: conversation.id,
|
|
|
|
|
|
limit: 50
|
|
|
|
|
|
})
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
|
messageList.value = (res.data?.data || []).reverse()
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error('加载消息详情失败:', e)
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
messageLoading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const backToList = () => {
|
|
|
|
|
|
selectedConversation.value = null
|
|
|
|
|
|
messageList.value = []
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleClose = () => {
|
|
|
|
|
|
emit('close')
|
|
|
|
|
|
backToList()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const copyContent = async (content) => {
|
|
|
|
|
|
const success = await copyToClipboard(content)
|
|
|
|
|
|
success ? message.success('已复制') : message.error('复制失败')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const formatTime = (timestamp) => {
|
|
|
|
|
|
if (!timestamp) return ''
|
|
|
|
|
|
const date = dayjs(timestamp * 1000)
|
|
|
|
|
|
const now = dayjs()
|
|
|
|
|
|
|
|
|
|
|
|
if (date.isSame(now, 'day')) {
|
|
|
|
|
|
return date.format('HH:mm')
|
|
|
|
|
|
} else if (date.isSame(now.subtract(1, 'day'), 'day')) {
|
|
|
|
|
|
return '昨天 ' + date.format('HH:mm')
|
|
|
|
|
|
} else if (date.isAfter(now.subtract(7, 'day'))) {
|
|
|
|
|
|
return date.format('dddd HH:mm')
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return date.format('MM-DD HH:mm')
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Watch
|
|
|
|
|
|
watch(() => props.visible, (val) => {
|
|
|
|
|
|
if (val) {
|
|
|
|
|
|
backToList()
|
|
|
|
|
|
loadConversations()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
2026-02-25 23:44:01 +08:00
|
|
|
|
// 使用设计系统变量
|
2026-02-25 18:21:25 +08:00
|
|
|
|
|
|
|
|
|
|
.history-panel {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
inset: 0;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
background: var(--color-bg-page);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
z-index: 20;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Header
|
|
|
|
|
|
.panel-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
padding: 16px 20px;
|
|
|
|
|
|
background: rgba(255, 255, 255, 0.95);
|
|
|
|
|
|
backdrop-filter: blur(12px);
|
2026-02-25 23:44:01 +08:00
|
|
|
|
border-bottom: 1px solid var(--color-gray-200);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-left {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.back-btn {
|
|
|
|
|
|
width: 32px;
|
|
|
|
|
|
height: 32px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
border-radius: var(--radius-sm);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
border: none;
|
|
|
|
|
|
background: transparent;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-600);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
transition: all var(--duration-fast);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
background: var(--color-gray-100);
|
|
|
|
|
|
color: var(--color-gray-900);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.header-title {
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
font-weight: 600;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-900);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
margin: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.close-btn {
|
|
|
|
|
|
width: 32px;
|
|
|
|
|
|
height: 32px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
border-radius: var(--radius-sm);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
border: none;
|
|
|
|
|
|
background: transparent;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-600);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
transition: all var(--duration-fast);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
background: var(--color-error-100);
|
|
|
|
|
|
color: var(--color-error-500);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Content
|
|
|
|
|
|
.panel-content {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
padding: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Empty State
|
|
|
|
|
|
.empty-state {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
padding: 80px 20px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.empty-visual {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
width: 80px;
|
|
|
|
|
|
height: 80px;
|
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.visual-ring {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
inset: 0;
|
|
|
|
|
|
border-radius: 50%;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
border: 2px dashed var(--color-gray-300);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
animation: ringRotate 20s linear infinite;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@keyframes ringRotate {
|
|
|
|
|
|
to { transform: rotate(360deg); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.empty-icon {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
|
font-size: 32px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-500);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.empty-text {
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
font-weight: 500;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-900);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
margin: 0 0 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.empty-hint {
|
|
|
|
|
|
font-size: 13px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-500);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
margin: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Conversation Groups
|
|
|
|
|
|
.conversation-groups {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.conversation-group {
|
|
|
|
|
|
// Group styling
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.group-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
padding: 0 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.group-label {
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
font-weight: 600;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-600);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
|
letter-spacing: 0.5px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.group-count {
|
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
|
font-weight: 500;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-500);
|
|
|
|
|
|
background: var(--color-gray-100);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
padding: 2px 8px;
|
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.group-list {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Conversation Card
|
|
|
|
|
|
.conversation-card {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
padding: 14px 16px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
background: var(--color-bg-card);
|
|
|
|
|
|
border: 1px solid var(--color-gray-200);
|
|
|
|
|
|
border-radius: var(--radius-lg);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
cursor: pointer;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
transition: all var(--duration-fast);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
text-align: left;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
border-color: var(--color-primary-500);
|
|
|
|
|
|
box-shadow: var(--shadow-primary);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
transform: translateY(-1px);
|
|
|
|
|
|
|
|
|
|
|
|
.meta-arrow {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-primary-500);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
transform: translateX(2px);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.card-main {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.card-title {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
font-weight: 600;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-900);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
margin: 0 0 4px;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.card-preview {
|
|
|
|
|
|
font-size: 12px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-500);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
margin: 0;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.card-meta {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: flex-end;
|
|
|
|
|
|
gap: 4px;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
margin-left: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.meta-time {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 4px;
|
|
|
|
|
|
font-size: 11px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-500);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.meta-arrow {
|
|
|
|
|
|
font-size: 10px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-500);
|
|
|
|
|
|
transition: all var(--duration-fast);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Message View
|
|
|
|
|
|
.message-view {
|
|
|
|
|
|
// Message view container
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.message-list {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.message-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.message-bubble {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
border-radius: var(--radius-lg);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
&--user {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
background: linear-gradient(135deg, var(--color-bg-page), var(--color-gray-100));
|
|
|
|
|
|
border: 1px solid var(--color-gray-200);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&--ai {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.04));
|
|
|
|
|
|
border: 1px solid rgba(59, 130, 246, 0.2);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bubble-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
padding: 10px 14px;
|
|
|
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bubble-avatar {
|
|
|
|
|
|
font-size: 14px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-600);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bubble-label {
|
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
|
font-weight: 600;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-600);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
|
letter-spacing: 0.3px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bubble-time {
|
|
|
|
|
|
font-size: 10px;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-500);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
margin-left: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bubble-copy {
|
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
|
width: 24px;
|
|
|
|
|
|
height: 24px;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
background: transparent;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-500);
|
|
|
|
|
|
border-radius: var(--radius-sm);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
transition: all var(--duration-fast);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
background: rgba(59, 130, 246, 0.1);
|
|
|
|
|
|
color: var(--color-primary-500);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bubble-content {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 12px 14px;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
line-height: 1.7;
|
2026-02-25 23:44:01 +08:00
|
|
|
|
color: var(--color-gray-900);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
white-space: pre-wrap;
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Transition
|
|
|
|
|
|
.history-slide-enter-active,
|
|
|
|
|
|
.history-slide-leave-active {
|
2026-02-25 23:44:01 +08:00
|
|
|
|
transition: transform var(--duration-base) cubic-bezier(0.32, 0.72, 0, 1);
|
2026-02-25 18:21:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.history-slide-enter-from,
|
|
|
|
|
|
.history-slide-leave-to {
|
|
|
|
|
|
transform: translateX(100%);
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|