2025-03-25 05:40:07 +08:00
|
|
|
|
<template>
|
2025-03-31 23:02:05 +08:00
|
|
|
|
<div class="agent-view">
|
2025-05-15 22:34:32 +08:00
|
|
|
|
<div class="agent-view-body">
|
2025-08-09 23:18:19 +08:00
|
|
|
|
<!-- 智能体选择弹窗 -->
|
|
|
|
|
|
<a-modal
|
2025-11-08 13:59:56 +08:00
|
|
|
|
v-model:open="chatUIStore.agentModalOpen"
|
2025-08-09 23:18:19 +08:00
|
|
|
|
title="选择智能体"
|
|
|
|
|
|
:width="800"
|
|
|
|
|
|
:footer="null"
|
|
|
|
|
|
:maskClosable="true"
|
|
|
|
|
|
class="agent-modal"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="agent-modal-content">
|
|
|
|
|
|
<div class="agents-grid">
|
|
|
|
|
|
<div
|
2025-11-07 12:28:58 +08:00
|
|
|
|
v-for="agent in agents"
|
|
|
|
|
|
:key="agent.id"
|
2025-08-09 23:18:19 +08:00
|
|
|
|
class="agent-card"
|
2026-01-15 06:01:34 +08:00
|
|
|
|
:class="{ selected: agent.id === selectedAgentId }"
|
2025-11-07 12:28:58 +08:00
|
|
|
|
@click="selectAgentFromModal(agent.id)"
|
2025-08-09 23:18:19 +08:00
|
|
|
|
>
|
|
|
|
|
|
<div class="agent-card-header">
|
|
|
|
|
|
<div class="agent-card-title">
|
2025-11-07 12:28:58 +08:00
|
|
|
|
<span class="agent-card-name">{{ agent.name || 'Unknown' }}</span>
|
2025-08-09 23:18:19 +08:00
|
|
|
|
</div>
|
2025-12-22 04:32:45 +08:00
|
|
|
|
<StarFilled v-if="agent.id === defaultAgentId" class="default-icon" />
|
2026-01-15 06:01:34 +08:00
|
|
|
|
<StarOutlined
|
|
|
|
|
|
v-else
|
|
|
|
|
|
@click.prevent="setAsDefaultAgent(agent.id)"
|
|
|
|
|
|
class="default-icon"
|
|
|
|
|
|
/>
|
2025-08-09 23:18:19 +08:00
|
|
|
|
</div>
|
2025-11-07 12:28:58 +08:00
|
|
|
|
|
|
|
|
|
|
<div class="agent-card-description">
|
|
|
|
|
|
{{ agent.description || '' }}
|
|
|
|
|
|
</div>
|
2025-08-09 23:18:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
2026-01-22 05:57:13 +08:00
|
|
|
|
<a-modal
|
|
|
|
|
|
v-model:open="createConfigModalOpen"
|
|
|
|
|
|
title="新建配置"
|
|
|
|
|
|
:width="320"
|
|
|
|
|
|
:confirmLoading="createConfigLoading"
|
|
|
|
|
|
@ok="handleCreateConfig"
|
|
|
|
|
|
@cancel="() => (createConfigModalOpen = false)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-input v-model:value="createConfigName" placeholder="请输入配置名称" allow-clear />
|
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
2025-05-15 22:34:32 +08:00
|
|
|
|
<!-- 中间内容区域 -->
|
|
|
|
|
|
<div class="content">
|
|
|
|
|
|
<AgentChatComponent
|
2025-10-13 11:12:25 +08:00
|
|
|
|
ref="chatComponentRef"
|
2025-08-11 21:29:33 +08:00
|
|
|
|
:single-mode="false"
|
2025-06-29 15:43:40 +08:00
|
|
|
|
@open-config="toggleConf"
|
2025-08-11 21:29:33 +08:00
|
|
|
|
@open-agent-modal="openAgentModal"
|
2026-01-15 06:01:34 +08:00
|
|
|
|
@close-config-sidebar="() => (chatUIStore.isConfigSidebarOpen = false)"
|
2025-05-15 22:34:32 +08:00
|
|
|
|
>
|
2026-01-24 15:24:25 +08:00
|
|
|
|
<template #header-right>
|
2026-01-22 05:57:13 +08:00
|
|
|
|
<a-dropdown v-if="selectedAgentId" :trigger="['click']">
|
|
|
|
|
|
<div type="button" class="agent-nav-btn">
|
|
|
|
|
|
<Settings2 size="18" class="nav-btn-icon" />
|
2026-01-24 15:24:25 +08:00
|
|
|
|
<span class="text hide-text">
|
2026-01-22 05:57:13 +08:00
|
|
|
|
{{ selectedConfigSummary?.name || '配置' }}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<ChevronDown size="16" class="nav-btn-icon" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<template #overlay>
|
|
|
|
|
|
<a-menu
|
|
|
|
|
|
:selectedKeys="selectedAgentConfigId ? [String(selectedAgentConfigId)] : []"
|
|
|
|
|
|
>
|
|
|
|
|
|
<a-menu-item
|
|
|
|
|
|
v-for="cfg in agentConfigs[selectedAgentId] || []"
|
|
|
|
|
|
:key="String(cfg.id)"
|
|
|
|
|
|
@click="selectAgentConfig(cfg.id)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="menu-item-full">
|
|
|
|
|
|
<Star
|
|
|
|
|
|
:size="14"
|
|
|
|
|
|
:fill="cfg.is_default ? 'currentColor' : 'none'"
|
|
|
|
|
|
:style="{
|
|
|
|
|
|
color: cfg.is_default ? 'var(--color-warning-500)' : 'var(--gray-400)'
|
|
|
|
|
|
}"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<span>{{ cfg.name }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
|
<a-menu-divider v-if="userStore.isAdmin" />
|
|
|
|
|
|
<a-menu-item
|
|
|
|
|
|
v-if="userStore.isAdmin"
|
|
|
|
|
|
key="create_config"
|
|
|
|
|
|
@click="openCreateConfigModal"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="menu-item-layout">
|
|
|
|
|
|
<Plus :size="16" />
|
|
|
|
|
|
<span>新建配置</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
|
<a-menu-item
|
|
|
|
|
|
v-if="userStore.isAdmin"
|
|
|
|
|
|
key="open_config"
|
|
|
|
|
|
@click="openConfigSidebar"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="menu-item-layout">
|
|
|
|
|
|
<SquarePen :size="16" />
|
|
|
|
|
|
<span>编辑当前配置</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-menu-item>
|
|
|
|
|
|
</a-menu>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-dropdown>
|
2026-01-15 06:01:34 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="selectedAgentId"
|
|
|
|
|
|
ref="moreButtonRef"
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
class="agent-nav-btn"
|
|
|
|
|
|
@click="toggleMoreMenu"
|
|
|
|
|
|
>
|
|
|
|
|
|
<Ellipsis size="18" class="nav-btn-icon" />
|
2025-10-13 11:12:25 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2025-05-15 22:34:32 +08:00
|
|
|
|
</AgentChatComponent>
|
|
|
|
|
|
</div>
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 配置侧边栏 -->
|
|
|
|
|
|
<AgentConfigSidebar
|
2025-11-08 13:59:56 +08:00
|
|
|
|
:isOpen="chatUIStore.isConfigSidebarOpen"
|
2026-01-15 06:01:34 +08:00
|
|
|
|
@close="() => (chatUIStore.isConfigSidebarOpen = false)"
|
2025-08-22 23:17:48 +08:00
|
|
|
|
/>
|
2025-10-08 22:36:35 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 反馈模态框 -->
|
|
|
|
|
|
<FeedbackModalComponent ref="feedbackModal" :agent-id="selectedAgentId" />
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 自定义更多菜单 -->
|
|
|
|
|
|
<Teleport to="body">
|
|
|
|
|
|
<Transition name="menu-fade">
|
|
|
|
|
|
<div
|
2025-11-08 13:59:56 +08:00
|
|
|
|
v-if="chatUIStore.moreMenuOpen"
|
2025-10-13 11:12:25 +08:00
|
|
|
|
ref="moreMenuRef"
|
|
|
|
|
|
class="more-popup-menu"
|
|
|
|
|
|
:style="{
|
2025-11-08 13:59:56 +08:00
|
|
|
|
left: chatUIStore.moreMenuPosition.x + 'px',
|
|
|
|
|
|
top: chatUIStore.moreMenuPosition.y + 'px'
|
2025-10-13 11:12:25 +08:00
|
|
|
|
}"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="menu-item" @click="handleShareChat">
|
|
|
|
|
|
<ShareAltOutlined class="menu-icon" />
|
|
|
|
|
|
<span class="menu-text">分享对话</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="menu-item" @click="handleFeedback">
|
|
|
|
|
|
<MessageOutlined class="menu-icon" />
|
|
|
|
|
|
<span class="menu-text">查看反馈</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="menu-item" @click="handlePreview">
|
|
|
|
|
|
<EyeOutlined class="menu-icon" />
|
|
|
|
|
|
<span class="menu-text">预览页面</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Transition>
|
|
|
|
|
|
</Teleport>
|
2025-05-15 22:34:32 +08:00
|
|
|
|
</div>
|
2025-03-25 05:40:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2025-03-31 23:02:05 +08:00
|
|
|
|
<script setup>
|
2026-01-15 06:01:34 +08:00
|
|
|
|
import { ref, watch } from 'vue'
|
2025-04-02 00:00:04 +08:00
|
|
|
|
import {
|
2025-05-02 23:56:59 +08:00
|
|
|
|
StarOutlined,
|
2025-06-24 00:13:11 +08:00
|
|
|
|
StarFilled,
|
2025-10-08 22:36:35 +08:00
|
|
|
|
MessageOutlined,
|
2025-10-13 11:12:25 +08:00
|
|
|
|
ShareAltOutlined,
|
2026-01-15 06:01:34 +08:00
|
|
|
|
EyeOutlined
|
|
|
|
|
|
} from '@ant-design/icons-vue'
|
|
|
|
|
|
import { message } from 'ant-design-vue'
|
2026-01-22 05:57:13 +08:00
|
|
|
|
import { Settings2, Ellipsis, ChevronDown, Star, Plus, SquarePen } from 'lucide-vue-next'
|
2026-01-15 06:01:34 +08:00
|
|
|
|
import AgentChatComponent from '@/components/AgentChatComponent.vue'
|
|
|
|
|
|
import AgentConfigSidebar from '@/components/AgentConfigSidebar.vue'
|
|
|
|
|
|
import FeedbackModalComponent from '@/components/dashboard/FeedbackModalComponent.vue'
|
|
|
|
|
|
import { useUserStore } from '@/stores/user'
|
|
|
|
|
|
import { useAgentStore } from '@/stores/agent'
|
|
|
|
|
|
import { useChatUIStore } from '@/stores/chatUI'
|
|
|
|
|
|
import { ChatExporter } from '@/utils/chatExporter'
|
|
|
|
|
|
import { handleChatError } from '@/utils/errorHandler'
|
|
|
|
|
|
import { onClickOutside } from '@vueuse/core'
|
|
|
|
|
|
|
|
|
|
|
|
import { storeToRefs } from 'pinia'
|
2025-03-31 23:02:05 +08:00
|
|
|
|
|
2025-10-08 22:36:35 +08:00
|
|
|
|
// 组件引用
|
|
|
|
|
|
const feedbackModal = ref(null)
|
2025-10-13 11:12:25 +08:00
|
|
|
|
const chatComponentRef = ref(null)
|
2025-11-08 13:59:56 +08:00
|
|
|
|
|
|
|
|
|
|
// Stores
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
const agentStore = useAgentStore()
|
|
|
|
|
|
const chatUIStore = useChatUIStore()
|
2025-08-25 01:46:31 +08:00
|
|
|
|
|
2025-11-08 13:59:56 +08:00
|
|
|
|
// 从 agentStore 中获取响应式状态
|
2026-01-22 05:57:13 +08:00
|
|
|
|
const {
|
|
|
|
|
|
agents,
|
|
|
|
|
|
selectedAgentId,
|
|
|
|
|
|
defaultAgentId,
|
|
|
|
|
|
agentConfigs,
|
|
|
|
|
|
selectedAgentConfigId,
|
|
|
|
|
|
selectedConfigSummary
|
|
|
|
|
|
} = storeToRefs(agentStore)
|
2025-11-07 12:28:58 +08:00
|
|
|
|
|
2025-05-02 23:56:59 +08:00
|
|
|
|
// 设置为默认智能体
|
2025-08-31 12:22:49 +08:00
|
|
|
|
const setAsDefaultAgent = async (agentId) => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
if (!agentId || !userStore.isAdmin) return
|
2025-04-03 16:02:14 +08:00
|
|
|
|
|
2025-05-02 23:56:59 +08:00
|
|
|
|
try {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
await agentStore.setDefaultAgent(agentId)
|
|
|
|
|
|
message.success('已将当前智能体设为默认')
|
2025-05-02 23:56:59 +08:00
|
|
|
|
} catch (error) {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
console.error('设置默认智能体错误:', error)
|
|
|
|
|
|
message.error(error.message || '设置默认智能体时发生错误')
|
2025-05-02 23:56:59 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-07-24 00:45:47 +08:00
|
|
|
|
|
2025-08-25 01:46:31 +08:00
|
|
|
|
// 这些方法现在由agentStore处理,无需在组件中定义
|
2025-04-05 17:27:52 +08:00
|
|
|
|
|
2025-08-25 01:46:31 +08:00
|
|
|
|
// 选择智能体(使用store方法)
|
2026-01-22 05:57:13 +08:00
|
|
|
|
const selectAgent = async (agentId) => {
|
|
|
|
|
|
await agentStore.selectAgent(agentId)
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-03-31 23:02:05 +08:00
|
|
|
|
|
2025-08-09 23:18:19 +08:00
|
|
|
|
// 打开智能体选择弹窗
|
|
|
|
|
|
const openAgentModal = () => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
chatUIStore.agentModalOpen = true
|
|
|
|
|
|
}
|
2025-08-09 23:18:19 +08:00
|
|
|
|
|
|
|
|
|
|
// 从弹窗中选择智能体
|
2026-01-22 05:57:13 +08:00
|
|
|
|
const selectAgentFromModal = async (agentId) => {
|
|
|
|
|
|
await selectAgent(agentId)
|
2026-01-15 06:01:34 +08:00
|
|
|
|
chatUIStore.agentModalOpen = false
|
|
|
|
|
|
}
|
2025-08-22 23:17:48 +08:00
|
|
|
|
|
2025-10-13 11:12:25 +08:00
|
|
|
|
const toggleConf = () => {
|
2025-11-08 13:59:56 +08:00
|
|
|
|
chatUIStore.isConfigSidebarOpen = !chatUIStore.isConfigSidebarOpen
|
2025-10-13 11:12:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-22 05:57:13 +08:00
|
|
|
|
const openConfigSidebar = () => {
|
|
|
|
|
|
chatUIStore.isConfigSidebarOpen = true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const createConfigModalOpen = ref(false)
|
|
|
|
|
|
const createConfigLoading = ref(false)
|
|
|
|
|
|
const createConfigName = ref('')
|
|
|
|
|
|
|
|
|
|
|
|
const openCreateConfigModal = () => {
|
|
|
|
|
|
createConfigName.value = ''
|
|
|
|
|
|
createConfigModalOpen.value = true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleCreateConfig = async () => {
|
|
|
|
|
|
if (!selectedAgentId.value) return
|
|
|
|
|
|
if (!createConfigName.value) {
|
|
|
|
|
|
message.error('请输入配置名称')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
createConfigLoading.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
await agentStore.createAgentConfigProfile({
|
|
|
|
|
|
name: createConfigName.value,
|
|
|
|
|
|
setDefault: false,
|
|
|
|
|
|
fromCurrent: false
|
|
|
|
|
|
})
|
|
|
|
|
|
createConfigModalOpen.value = false
|
|
|
|
|
|
chatUIStore.isConfigSidebarOpen = true
|
|
|
|
|
|
message.success('配置已创建')
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
console.error('创建配置出错:', error)
|
|
|
|
|
|
message.error(error.message || '创建配置失败')
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
createConfigLoading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const selectAgentConfig = async (configId) => {
|
|
|
|
|
|
try {
|
|
|
|
|
|
await agentStore.selectAgentConfig(configId)
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
console.error('切换配置出错:', error)
|
|
|
|
|
|
message.error('切换配置失败')
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-13 11:12:25 +08:00
|
|
|
|
// 更多菜单相关
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const moreMenuRef = ref(null)
|
|
|
|
|
|
const moreButtonRef = ref(null)
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
|
|
|
|
|
const toggleMoreMenu = (event) => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
event.stopPropagation()
|
2025-10-13 11:12:25 +08:00
|
|
|
|
// 切换状态,而不是只打开
|
2026-01-15 06:01:34 +08:00
|
|
|
|
chatUIStore.moreMenuOpen = !chatUIStore.moreMenuOpen
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
2025-11-08 13:59:56 +08:00
|
|
|
|
if (chatUIStore.moreMenuOpen) {
|
2025-10-13 11:12:25 +08:00
|
|
|
|
// 只在打开时计算位置
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const rect = event.currentTarget.getBoundingClientRect()
|
|
|
|
|
|
chatUIStore.openMoreMenu(rect.right - 130, rect.bottom + 8)
|
2025-10-13 11:12:25 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
|
|
|
|
|
const closeMoreMenu = () => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
chatUIStore.closeMoreMenu()
|
|
|
|
|
|
}
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
|
|
|
|
|
// 使用 VueUse 的 onClickOutside
|
2026-01-15 06:01:34 +08:00
|
|
|
|
onClickOutside(
|
|
|
|
|
|
moreMenuRef,
|
|
|
|
|
|
() => {
|
|
|
|
|
|
if (chatUIStore.moreMenuOpen) {
|
|
|
|
|
|
closeMoreMenu()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{ ignore: [moreButtonRef] }
|
|
|
|
|
|
)
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
|
|
|
|
|
const handleShareChat = async () => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
closeMoreMenu()
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
// 从聊天组件获取导出数据
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const exportData = chatComponentRef.value?.getExportPayload?.()
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
2026-01-15 06:01:34 +08:00
|
|
|
|
console.log('[AgentView] Export data:', exportData)
|
2025-07-26 03:36:54 +08:00
|
|
|
|
|
2025-10-13 11:12:25 +08:00
|
|
|
|
if (!exportData) {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
message.warning('当前没有可导出的对话内容')
|
|
|
|
|
|
return
|
2025-10-13 11:12:25 +08:00
|
|
|
|
}
|
2025-08-31 12:22:49 +08:00
|
|
|
|
|
2025-10-13 11:12:25 +08:00
|
|
|
|
// 检查是否有实际的消息内容
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const hasMessages = exportData.messages && exportData.messages.length > 0
|
|
|
|
|
|
const hasOngoingMessages = exportData.onGoingMessages && exportData.onGoingMessages.length > 0
|
2025-10-13 11:12:25 +08:00
|
|
|
|
|
|
|
|
|
|
if (!hasMessages && !hasOngoingMessages) {
|
|
|
|
|
|
console.warn('[AgentView] Export data has no messages:', {
|
|
|
|
|
|
messages: exportData.messages,
|
|
|
|
|
|
onGoingMessages: exportData.onGoingMessages
|
2026-01-15 06:01:34 +08:00
|
|
|
|
})
|
|
|
|
|
|
message.warning('当前对话暂无内容可导出,请先进行对话')
|
|
|
|
|
|
return
|
2025-10-13 11:12:25 +08:00
|
|
|
|
}
|
2025-04-02 13:00:25 +08:00
|
|
|
|
|
2026-01-15 06:01:34 +08:00
|
|
|
|
const result = await ChatExporter.exportToHTML(exportData)
|
|
|
|
|
|
message.success(`对话已导出为HTML文件: ${result.filename}`)
|
2025-10-13 11:12:25 +08:00
|
|
|
|
} catch (error) {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
console.error('[AgentView] Export error:', error)
|
2025-10-13 11:12:25 +08:00
|
|
|
|
if (error?.message?.includes('没有可导出的对话内容')) {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
message.warning('当前对话暂无内容可导出,请先进行对话')
|
|
|
|
|
|
return
|
2025-10-13 11:12:25 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
handleChatError(error, 'export')
|
2025-04-02 13:00:25 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-04-02 13:00:25 +08:00
|
|
|
|
|
2025-10-13 11:12:25 +08:00
|
|
|
|
const handleFeedback = () => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
closeMoreMenu()
|
|
|
|
|
|
feedbackModal.value?.show()
|
|
|
|
|
|
}
|
2025-04-05 02:23:32 +08:00
|
|
|
|
|
2025-10-13 11:12:25 +08:00
|
|
|
|
const handlePreview = () => {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
closeMoreMenu()
|
2025-04-05 02:23:32 +08:00
|
|
|
|
if (selectedAgentId.value) {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
window.open(`/agent/${selectedAgentId.value}`, '_blank')
|
2025-04-05 02:23:32 +08:00
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
}
|
2025-03-31 23:02:05 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
.agent-view {
|
|
|
|
|
|
display: flex;
|
2025-05-15 22:34:32 +08:00
|
|
|
|
flex-direction: column;
|
2025-03-31 23:02:05 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100vh;
|
|
|
|
|
|
overflow: hidden;
|
2025-05-15 22:34:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.agent-view-body {
|
|
|
|
|
|
--gap-radius: 6px;
|
|
|
|
|
|
display: flex;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
flex-direction: row;
|
2025-05-15 22:34:32 +08:00
|
|
|
|
width: 100%;
|
|
|
|
|
|
flex: 1;
|
2025-10-13 11:12:25 +08:00
|
|
|
|
height: 100%;
|
2025-04-01 22:16:07 +08:00
|
|
|
|
overflow: hidden;
|
2025-08-22 23:17:48 +08:00
|
|
|
|
position: relative;
|
2025-04-01 22:16:07 +08:00
|
|
|
|
|
2025-08-25 01:46:31 +08:00
|
|
|
|
.content {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.no-agent-selected {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
background-color: var(--bg-content);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.no-agent-content {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
|
|
|
|
|
|
|
svg {
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
h3 {
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-08 22:57:14 +08:00
|
|
|
|
// .content {
|
|
|
|
|
|
// border-radius: var(--gap-radius);
|
|
|
|
|
|
// border: 1px solid var(--gray-300);
|
|
|
|
|
|
// }
|
2025-03-31 23:02:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-29 15:43:40 +08:00
|
|
|
|
.content {
|
|
|
|
|
|
flex: 1;
|
2025-03-31 23:02:05 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-29 15:43:40 +08:00
|
|
|
|
// 配置弹窗内容样式
|
|
|
|
|
|
.conf-content {
|
|
|
|
|
|
max-height: 70vh;
|
2025-04-05 02:23:32 +08:00
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
|
2025-06-29 15:43:40 +08:00
|
|
|
|
.agent-info {
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
overflow-y: visible;
|
|
|
|
|
|
max-height: none;
|
2025-04-05 02:23:32 +08:00
|
|
|
|
}
|
2025-03-31 23:02:05 +08:00
|
|
|
|
}
|
2025-04-01 22:16:07 +08:00
|
|
|
|
|
2025-06-29 15:43:40 +08:00
|
|
|
|
.agent-model {
|
|
|
|
|
|
width: 100%;
|
2025-04-01 22:16:07 +08:00
|
|
|
|
}
|
2025-04-03 16:02:14 +08:00
|
|
|
|
|
|
|
|
|
|
.config-modal-content {
|
2025-05-20 22:21:51 +08:00
|
|
|
|
user-select: text;
|
|
|
|
|
|
|
2026-01-15 06:01:34 +08:00
|
|
|
|
div[role='alert'] {
|
2025-05-20 22:21:51 +08:00
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
}
|
2025-04-03 16:02:14 +08:00
|
|
|
|
|
|
|
|
|
|
.description {
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-actions {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
gap: 10px;
|
2025-05-13 19:49:54 +08:00
|
|
|
|
|
|
|
|
|
|
.form-actions-left,
|
|
|
|
|
|
.form-actions-right {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
}
|
2025-04-03 16:02:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-05 02:23:32 +08:00
|
|
|
|
|
|
|
|
|
|
// 添加新按钮的样式
|
|
|
|
|
|
.agent-action-buttons {
|
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.action-button {
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background-color: var(--gray-0);
|
2025-07-30 11:00:50 +08:00
|
|
|
|
border: 1px solid var(--main-20);
|
2025-04-05 02:23:32 +08:00
|
|
|
|
text-align: left;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2025-07-30 11:00:50 +08:00
|
|
|
|
background-color: var(--main-20);
|
2025-04-05 02:23:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-02 23:56:59 +08:00
|
|
|
|
&.primary-action {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
|
|
|
|
|
|
&:disabled {
|
2025-07-26 03:36:54 +08:00
|
|
|
|
color: var(--main-color);
|
2025-07-30 11:00:50 +08:00
|
|
|
|
background-color: var(--main-20);
|
2025-05-02 23:56:59 +08:00
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-05 02:23:32 +08:00
|
|
|
|
.anticon {
|
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-05 17:27:52 +08:00
|
|
|
|
|
2025-05-02 23:56:59 +08:00
|
|
|
|
.agent-option {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
2025-07-22 04:12:55 +08:00
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
.agent-option-content {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 2px;
|
|
|
|
|
|
|
|
|
|
|
|
p {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.agent-option-description {
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
white-space: pre-wrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-05-02 23:56:59 +08:00
|
|
|
|
}
|
2025-07-24 00:45:47 +08:00
|
|
|
|
// 工具选择器样式(与项目风格一致)
|
|
|
|
|
|
.tools-selector {
|
|
|
|
|
|
.tools-summary {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
// margin-bottom: 8px;
|
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
|
background: var(--gray-50);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
border: 1px solid var(--gray-200);
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
transition: border-color 0.2s ease;
|
|
|
|
|
|
|
|
|
|
|
|
.tools-summary-left {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
|
|
|
|
|
|
.tools-count {
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.select-tools-btn {
|
|
|
|
|
|
background: var(--main-color);
|
|
|
|
|
|
border: none;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
color: var(--gray-0);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
padding: 4px 12px;
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
height: 28px;
|
|
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2025-07-26 03:36:54 +08:00
|
|
|
|
background: var(--main-color);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
transform: translateY(-1px);
|
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
|
|
transform: translateY(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.selected-tools-preview {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
gap: 6px;
|
|
|
|
|
|
padding: 8px 0;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
min-height: 32px;
|
|
|
|
|
|
:deep(.ant-tag) {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 4px 10px;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
background: var(--gray-100);
|
|
|
|
|
|
border: 1px solid var(--gray-300);
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
.anticon-close {
|
|
|
|
|
|
color: var(--gray-600);
|
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 工具选择弹窗样式(与项目风格一致)
|
|
|
|
|
|
.tools-modal {
|
|
|
|
|
|
:deep(.ant-modal-content) {
|
|
|
|
|
|
border-radius: 8px;
|
2026-01-15 06:01:34 +08:00
|
|
|
|
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
:deep(.ant-modal-header) {
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
border-bottom: 1px solid var(--gray-200);
|
|
|
|
|
|
padding: 16px 20px;
|
|
|
|
|
|
.ant-modal-title {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
:deep(.ant-modal-body) {
|
|
|
|
|
|
padding: 20px;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
.tools-modal-content {
|
|
|
|
|
|
.tools-search {
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
:deep(.ant-input) {
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
border: 1px solid var(--gray-300);
|
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
&:focus {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
box-shadow: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.tools-list {
|
|
|
|
|
|
max-height: 350px;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
border: 1px solid var(--gray-200);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
margin-bottom: 16px;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
.tool-item {
|
|
|
|
|
|
padding: 14px 16px;
|
|
|
|
|
|
border-bottom: 1px solid var(--gray-100);
|
|
|
|
|
|
cursor: pointer;
|
2026-01-15 06:01:34 +08:00
|
|
|
|
transition:
|
|
|
|
|
|
background 0.2s,
|
|
|
|
|
|
border 0.2s;
|
2025-07-24 00:45:47 +08:00
|
|
|
|
border-left: 3px solid transparent;
|
2026-01-15 06:01:34 +08:00
|
|
|
|
&:last-child {
|
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
|
}
|
2025-07-24 00:45:47 +08:00
|
|
|
|
&:hover {
|
|
|
|
|
|
background: var(--gray-50);
|
|
|
|
|
|
}
|
|
|
|
|
|
&.selected {
|
|
|
|
|
|
background: var(--main-10);
|
|
|
|
|
|
border-left: 3px solid var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
.tool-content {
|
|
|
|
|
|
.tool-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
|
.tool-name {
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
2026-01-15 06:01:34 +08:00
|
|
|
|
.tool-indicator {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
2025-07-24 00:45:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
.tool-description {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
|
-webkit-line-clamp: 2;
|
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.tools-modal-footer {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
padding: 12px 0 0 0;
|
|
|
|
|
|
border-top: 1px solid var(--gray-200);
|
|
|
|
|
|
.selected-count {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
.modal-actions {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
:deep(.ant-btn) {
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
padding: 6px 18px;
|
|
|
|
|
|
height: 36px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
&.ant-btn-default {
|
|
|
|
|
|
border: 1px solid var(--gray-300);
|
|
|
|
|
|
color: var(--gray-900);
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
background: var(--main-10);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
&.ant-btn-primary {
|
|
|
|
|
|
background: var(--main-color);
|
|
|
|
|
|
border: none;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
color: var(--gray-0);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
&:hover {
|
2025-07-26 03:36:54 +08:00
|
|
|
|
background: var(--main-color);
|
2025-07-24 00:45:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-06-24 00:13:11 +08:00
|
|
|
|
|
|
|
|
|
|
// 多选卡片样式
|
|
|
|
|
|
.multi-select-cards {
|
|
|
|
|
|
.multi-select-label {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--gray-600);
|
|
|
|
|
|
height: 24px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.options-grid {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-card {
|
|
|
|
|
|
border: 1px solid var(--gray-300);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: all 0.2s ease;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-06-24 00:13:11 +08:00
|
|
|
|
user-select: none;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.selected {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
background: var(--main-10);
|
|
|
|
|
|
|
|
|
|
|
|
.option-indicator {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-text {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.unselected {
|
|
|
|
|
|
.option-indicator {
|
|
|
|
|
|
color: var(--gray-400);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-text {
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-content {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-text {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.option-indicator {
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
transition: color 0.2s ease;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 响应式适配
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
|
.multi-select-cards {
|
|
|
|
|
|
.options-grid {
|
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-06-29 15:43:40 +08:00
|
|
|
|
|
|
|
|
|
|
.conf-content {
|
|
|
|
|
|
max-height: 60vh;
|
|
|
|
|
|
}
|
2025-06-24 00:13:11 +08:00
|
|
|
|
}
|
2025-07-22 04:12:55 +08:00
|
|
|
|
|
2025-08-09 23:18:19 +08:00
|
|
|
|
// 智能体选择器样式
|
|
|
|
|
|
.agent-selector {
|
|
|
|
|
|
border: 1px solid var(--gray-300);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 8px 12px;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-09 23:18:19 +08:00
|
|
|
|
transition: border-color 0.2s ease;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.selected-agent-display {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
.agent-name {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 智能体选择弹窗样式
|
|
|
|
|
|
.agent-modal {
|
|
|
|
|
|
:deep(.ant-modal-content) {
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-modal-header) {
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-09 23:18:19 +08:00
|
|
|
|
border-bottom: 1px solid var(--gray-200);
|
|
|
|
|
|
padding: 16px 20px;
|
|
|
|
|
|
|
|
|
|
|
|
.ant-modal-title {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-modal-body) {
|
|
|
|
|
|
padding: 20px;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-09 23:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.agent-modal-content {
|
|
|
|
|
|
.agents-grid {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
max-height: 500px;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.agent-card {
|
|
|
|
|
|
border: 1px solid var(--gray-200);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
padding: 16px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: border-color 0.2s ease;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-08-09 23:18:19 +08:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.agent-card-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
.agent-card-title {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
|
|
|
|
.agent-card-name {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
|
}
|
2025-12-22 04:32:45 +08:00
|
|
|
|
}
|
2025-08-09 23:18:19 +08:00
|
|
|
|
|
2025-12-22 04:32:45 +08:00
|
|
|
|
.default-icon {
|
|
|
|
|
|
color: var(--color-warning-500);
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
margin-left: 8px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
color: var(--color-warning-600);
|
2025-08-09 23:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.agent-card-description {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: var(--gray-700);
|
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
|
-webkit-line-clamp: 3;
|
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
}
|
2025-08-12 19:14:44 +08:00
|
|
|
|
|
|
|
|
|
|
&.selected {
|
|
|
|
|
|
border-color: var(--main-color);
|
|
|
|
|
|
background: var(--main-20);
|
|
|
|
|
|
// outline: 2px solid var(--main-color);
|
|
|
|
|
|
|
|
|
|
|
|
.agent-card-header .agent-card-title .agent-card-name {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.agent-card-description {
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-08-09 23:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 响应式适配智能体弹窗
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
|
.agent-modal {
|
|
|
|
|
|
.agent-modal-content {
|
|
|
|
|
|
.agents-grid {
|
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-13 11:12:25 +08:00
|
|
|
|
// 自定义更多菜单样式
|
|
|
|
|
|
.more-popup-menu {
|
|
|
|
|
|
position: fixed;
|
2026-01-22 12:15:46 +08:00
|
|
|
|
min-width: 100px;
|
2025-11-23 01:39:44 +08:00
|
|
|
|
background: var(--gray-0);
|
2025-10-13 11:12:25 +08:00
|
|
|
|
border-radius: 10px;
|
2026-01-15 06:01:34 +08:00
|
|
|
|
box-shadow:
|
|
|
|
|
|
0 8px 24px rgba(0, 0, 0, 0.08),
|
|
|
|
|
|
0 2px 8px rgba(0, 0, 0, 0.04);
|
2025-10-13 11:12:25 +08:00
|
|
|
|
border: 1px solid var(--gray-100);
|
2026-01-22 12:15:46 +08:00
|
|
|
|
padding: 4px;
|
2025-10-13 11:12:25 +08:00
|
|
|
|
z-index: 9999;
|
|
|
|
|
|
|
|
|
|
|
|
.menu-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 10px;
|
2026-01-22 12:15:46 +08:00
|
|
|
|
padding: 6px 8px;
|
2025-10-13 11:12:25 +08:00
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
user-select: none;
|
|
|
|
|
|
|
|
|
|
|
|
.menu-icon {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
color: var(--gray-600);
|
|
|
|
|
|
transition: color 0.15s ease;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu-text {
|
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
|
letter-spacing: 0.01em;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
background: var(--gray-50);
|
|
|
|
|
|
// color: var(--main-700);
|
|
|
|
|
|
|
|
|
|
|
|
// .menu-icon {
|
|
|
|
|
|
// color: var(--main-600);
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
|
|
background: var(--gray-100);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu-divider {
|
|
|
|
|
|
height: 1px;
|
|
|
|
|
|
background: var(--gray-100);
|
|
|
|
|
|
margin: 4px 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 菜单淡入淡出动画
|
|
|
|
|
|
.menu-fade-enter-active {
|
|
|
|
|
|
animation: menuSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu-fade-leave-active {
|
|
|
|
|
|
animation: menuSlideOut 0.15s cubic-bezier(0.4, 0, 1, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@keyframes menuSlideIn {
|
|
|
|
|
|
from {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
transform: translateY(-8px);
|
|
|
|
|
|
}
|
|
|
|
|
|
to {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
transform: translateY(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@keyframes menuSlideOut {
|
|
|
|
|
|
from {
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
transform: translateY(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
to {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
transform: translateY(-4px);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 响应式优化
|
|
|
|
|
|
@media (max-width: 520px) {
|
|
|
|
|
|
.more-popup-menu {
|
2026-01-15 06:01:34 +08:00
|
|
|
|
box-shadow:
|
|
|
|
|
|
0 12px 32px rgba(0, 0, 0, 0.12),
|
|
|
|
|
|
0 4px 12px rgba(0, 0, 0, 0.06);
|
2025-10-13 11:12:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-03-31 23:02:05 +08:00
|
|
|
|
</style>
|
|
|
|
|
|
|
2025-05-15 22:34:32 +08:00
|
|
|
|
<style lang="less">
|
2025-06-29 15:43:40 +08:00
|
|
|
|
.toggle-conf {
|
2025-05-15 22:34:32 +08:00
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
&.nav-btn {
|
|
|
|
|
|
height: 2.5rem;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
color: var(--gray-900);
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
width: auto;
|
|
|
|
|
|
padding: 0.5rem 1rem;
|
|
|
|
|
|
transition: background-color 0.3s;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
.text {
|
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2025-07-30 11:00:50 +08:00
|
|
|
|
background-color: var(--main-20);
|
2025-05-15 22:34:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.nav-btn-icon {
|
|
|
|
|
|
width: 1.5rem;
|
|
|
|
|
|
height: 1.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-22 04:12:55 +08:00
|
|
|
|
|
|
|
|
|
|
// 针对 Ant Design Select 组件的深度样式修复
|
|
|
|
|
|
:deep(.ant-select-item-option-content) {
|
|
|
|
|
|
.agent-option-name {
|
|
|
|
|
|
color: var(--main-color);
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-12-27 17:29:21 +08:00
|
|
|
|
|
2026-01-22 05:57:13 +08:00
|
|
|
|
// 菜单项布局样式
|
|
|
|
|
|
.menu-item-layout {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu-item-full {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-24 15:24:25 +08:00
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
|
.hide-text {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
}
|
2025-12-27 17:29:21 +08:00
|
|
|
|
}
|
2025-10-13 11:12:25 +08:00
|
|
|
|
</style>
|