feat: 新增 Chat 聊天页面并优化 Agents

- 新增 Chat.vue 聊天页面组件
- 重构 Agents.vue 页面代码
- 更新侧边栏和路由配置

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 16:09:09 +08:00
parent b8110b6bdd
commit 577dceebfe
4 changed files with 618 additions and 389 deletions

View File

@@ -41,7 +41,7 @@ interface MenuItem {
// 第1组: Chat, Agents
const group1 = computed(() => [
{ name: 'Chat', icon: 'fa-robot', path: '/agents' },
{ name: 'Chat', icon: 'fa-robot', path: '/chat' },
{ name: 'Agents', icon: 'fa-users', badge: 3, path: '/agents' },
])
@@ -68,11 +68,6 @@ const group4 = computed(() => [
const activeMenu = computed(() => {
const currentPath = route.path
// Special case for /agents - prioritize Chat over Agents
if (currentPath === '/agents') {
return 'Chat'
}
// Check all groups
const allGroups = [...group1.value, ...group2.value, ...group3.value, ...group4.value]
const item = allGroups.find(item => item.path === currentPath)
@@ -135,7 +130,7 @@ const handleUserCommand = (command: string) => {
<!-- 第1组: Chat, Agents -->
<li v-for="item in group1" :key="item.name">
<a
href="#"
href="javascript:void(0)"
class="flex items-center justify-between px-3 py-2.5 rounded-lg transition-colors text-sm"
:class="activeMenu === item.name ? 'bg-dark-600 text-white' : 'text-gray-400 hover:bg-dark-600 hover:text-white'"
@click="navigateTo(item)"
@@ -154,7 +149,7 @@ const handleUserCommand = (command: string) => {
<!-- 第2组: Database, Knowledge -->
<li v-for="item in group2" :key="item.name">
<a
href="#"
href="javascript:void(0)"
class="flex items-center justify-between px-3 py-2.5 rounded-lg transition-colors text-sm"
:class="activeMenu === item.name ? 'bg-dark-600 text-white' : 'text-gray-400 hover:bg-dark-600 hover:text-white'"
@click="navigateTo(item)"
@@ -173,7 +168,7 @@ const handleUserCommand = (command: string) => {
<!-- 第3组: Skills, Tools, Script -->
<li v-for="item in group3" :key="item.name">
<a
href="#"
href="javascript:void(0)"
class="flex items-center justify-between px-3 py-2.5 rounded-lg transition-colors text-sm"
:class="activeMenu === item.name ? 'bg-dark-600 text-white' : 'text-gray-400 hover:bg-dark-600 hover:text-white'"
@click="navigateTo(item)"
@@ -192,7 +187,7 @@ const handleUserCommand = (command: string) => {
<!-- 第4组: Dashboard, Account, Settings -->
<li v-for="item in group4" :key="item.name">
<a
href="#"
href="javascript:void(0)"
class="flex items-center justify-between px-3 py-2.5 rounded-lg transition-colors text-sm"
:class="activeMenu === item.name ? 'bg-dark-600 text-white' : 'text-gray-400 hover:bg-dark-600 hover:text-white'"
@click="navigateTo(item)"