feat: 增强知识库索引与设置页面模块化拆分
扩展知识库索引任务和 RAG 检索支持增量入库和文档去重,优 化本体检测和规则匹配精度,前端设置页面拆分为 LLM、邮件 和 Hermes 员工同步子面板并重构样式,新增日志详情组件和 知识入库日志模型,补充单元测试覆盖。
This commit is contained in:
@@ -3,7 +3,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { icons } from '../data/icons.js'
|
||||
|
||||
export const appViews = ['overview', 'workbench', 'requests', 'approval', 'archive', 'policies', 'audit', 'logs', 'employees', 'settings']
|
||||
export const appViews = ['overview', 'workbench', 'requests', 'approval', 'archive', 'policies', 'audit', 'employees', 'logs', 'settings']
|
||||
|
||||
export const navItems = [
|
||||
{
|
||||
@@ -62,14 +62,6 @@ export const navItems = [
|
||||
title: '任务规则中心',
|
||||
desc: '集中管理规则文件、外部 MCP 服务与定时任务调度。'
|
||||
},
|
||||
{
|
||||
id: 'logs',
|
||||
label: '日志管理',
|
||||
navHint: '查看 Hermes 调用与系统运行日志',
|
||||
icon: icons.logs,
|
||||
title: '日志管理',
|
||||
desc: '集中查看 Hermes 归纳任务进度、调用明细与系统运行日志。'
|
||||
},
|
||||
{
|
||||
id: 'employees',
|
||||
label: '员工管理',
|
||||
@@ -78,6 +70,14 @@ export const navItems = [
|
||||
title: '员工与组织管理',
|
||||
desc: '维护员工账号、组织结构与角色权限。'
|
||||
},
|
||||
{
|
||||
id: 'logs',
|
||||
label: '日志管理',
|
||||
navHint: '查看 Hermes 调用与系统运行日志',
|
||||
icon: icons.logs,
|
||||
title: '日志管理',
|
||||
desc: '集中查看 Hermes 归纳任务进度、调用明细与系统运行日志。'
|
||||
},
|
||||
{
|
||||
id: 'settings',
|
||||
label: '系统设置',
|
||||
@@ -101,13 +101,34 @@ const viewRouteNames = {
|
||||
settings: 'app-settings'
|
||||
}
|
||||
|
||||
const routeNameViews = Object.fromEntries(
|
||||
Object.entries(viewRouteNames).map(([view, routeName]) => [routeName, view])
|
||||
)
|
||||
|
||||
routeNameViews['app-request-detail'] = 'requests'
|
||||
routeNameViews['app-log-detail'] = 'logs'
|
||||
|
||||
export function resolveAppViewFromRoute(route) {
|
||||
const routeName = String(route?.name || '').trim()
|
||||
if (routeNameViews[routeName]) {
|
||||
return routeNameViews[routeName]
|
||||
}
|
||||
|
||||
const metaView = String(route?.meta?.appView || '').trim()
|
||||
return appViews.includes(metaView) ? metaView : 'overview'
|
||||
}
|
||||
|
||||
export function resolveTargetRouteName(view) {
|
||||
return viewRouteNames[view] || viewRouteNames.overview
|
||||
}
|
||||
|
||||
export function useNavigation() {
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
const activeView = computed({
|
||||
get() {
|
||||
return route.meta.appView || 'overview'
|
||||
return resolveAppViewFromRoute(route)
|
||||
},
|
||||
set(view) {
|
||||
setView(view)
|
||||
@@ -119,13 +140,13 @@ export function useNavigation() {
|
||||
)
|
||||
|
||||
function setView(view) {
|
||||
const targetName = viewRouteNames[view] || viewRouteNames.overview
|
||||
const targetName = resolveTargetRouteName(view)
|
||||
|
||||
if (route.name === targetName) {
|
||||
return
|
||||
}
|
||||
|
||||
router.push({ name: targetName })
|
||||
router.push({ name: targetName, params: {}, query: {}, hash: '' })
|
||||
}
|
||||
|
||||
return { activeView, currentView, setView, navItems }
|
||||
|
||||
Reference in New Issue
Block a user