fix: update ui
This commit is contained in:
1 parent
b1613824ce
commit
8e263a1d76
9 files changed
+617
-400
No files matched your search
@@ -11,7 +11,8 @@
|
||||
* - 该页面后续可继续优化按模块懒加载数据
|
||||
*/
|
||||
import { ref, onMounted, watch, computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import KbAdminPanel from '../components/kb/KbAdminPanel.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { config } from '../config';
|
||||
import ThemeToggleButton from '../components/ThemeToggleButton.vue';
|
||||
@@ -68,6 +69,7 @@ const sidebarItems = computed(() => {
|
||||
{ id: 'users', icon: UserCog, label: t('admin.nav.users') },
|
||||
{ id: 'departments', icon: Building, label: t('admin.nav.departments') },
|
||||
{ id: 'agents', icon: Bot, label: t('admin.nav.agents') },
|
||||
{ id: 'knowledge_base', icon: FileText, label: t('admin.nav.knowledgeBase') },
|
||||
{ id: 'schedules', icon: Settings2, label: '排程管理' },
|
||||
{ id: 'announcements', icon: Megaphone, label: t('admin.nav.announcements') },
|
||||
{ id: 'questions', icon: MessageCircleQuestion, label: t('admin.nav.questions') },
|
||||
@@ -235,9 +237,10 @@ interface WecomIntegrationManifest {
|
||||
|
||||
// 获取路由实例,用于页面跳转
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
// 当前左侧菜单激活的模块:dashboard / agents / permissions
|
||||
const activeModule = ref<'dashboard' | 'agents' | 'announcements' | 'permissions' | 'requests' | 'reports' | 'approvals' | 'users' | 'departments' | 'questions' | 'wecom' | 'schedules'>('dashboard');
|
||||
const activeModule = ref<'dashboard' | 'agents' | 'announcements' | 'permissions' | 'requests' | 'reports' | 'approvals' | 'users' | 'departments' | 'questions' | 'wecom' | 'schedules' | 'knowledge_base'>('dashboard');
|
||||
const expandedReports = ref(true);
|
||||
|
||||
// agents:管理员视角下的所有 Agent 列表
|
||||
@@ -2106,6 +2109,15 @@ onMounted(async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const moduleQuery = typeof route.query.module === 'string' ? route.query.module : '';
|
||||
const allowedModules = sidebarItems.value.map((item) => item.id);
|
||||
if (moduleQuery && allowedModules.includes(moduleQuery)) {
|
||||
activeModule.value = moduleQuery as typeof activeModule.value;
|
||||
if (route.query.module) {
|
||||
router.replace({ path: '/admin' });
|
||||
}
|
||||
}
|
||||
|
||||
isLoading.value = true;
|
||||
await Promise.all([
|
||||
loadAgents(),
|
||||
@@ -3343,13 +3355,6 @@ const handlePermissionImport = async (event: Event) => {
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<button
|
||||
@click="router.push('/kb/admin')"
|
||||
class="hidden md:inline-flex items-center gap-2 rounded-xl border border-slate-200 px-4 py-2 text-sm font-medium text-slate-600 transition-colors hover:bg-slate-50 hover:text-slate-900 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800 dark:hover:text-slate-100"
|
||||
>
|
||||
<Settings2 class="w-4 h-4" />
|
||||
<span>知识库管理</span>
|
||||
</button>
|
||||
<ThemeToggleButton />
|
||||
<!-- Language Selector -->
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -3776,6 +3781,11 @@ const handlePermissionImport = async (event: Event) => {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Knowledge Base Management -->
|
||||
<section v-else-if="activeModule === 'knowledge_base'" class="overflow-hidden rounded-2xl border border-gray-100 bg-white shadow-sm animate-fade-in-up dark:border-slate-700 dark:bg-slate-900">
|
||||
<KbAdminPanel />
|
||||
</section>
|
||||
|
||||
<!-- Agent Management -->
|
||||
<section v-else-if="activeModule === 'agents'" class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden animate-fade-in-up">
|
||||
<div class="px-8 py-6 border-b border-gray-100 flex flex-col md:flex-row justify-between items-start md:items-center gap-4 bg-white">
|
||||
|
||||
Reference in new issue
Block a user