import { PermissionConst, EditionConst, RoleConst } from '@/utils/permission/data' import { ComplexPermission } from '@/utils/permission/type' const systemRouter = { path: '/system', name: 'system', meta: { title: 'views.system.title' }, hidden: true, component: () => import('@/layout/layout-template/SystemMainLayout.vue'), children: [ { path: '/system/user', name: 'user', meta: { icon: 'User', iconActive: 'UserFilled', title: 'views.userManage.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [RoleConst.ADMIN, PermissionConst.USER_READ], }, component: () => import('@/views/system/user-manage/index.vue'), }, { path: '/system/role', name: 'role', meta: { icon: 'app-role', iconActive: 'app-role-active', title: 'views.role.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole], [PermissionConst.ROLE_READ], [EditionConst.IS_EE], 'OR', ), ], }, component: () => import('@/views/system/role/index.vue'), }, { path: '/system/workspace', name: 'workspace', meta: { icon: 'app-resource-authorization', // TODO iconActive: 'app-resource-authorization-active', // TODO title: 'views.workspace.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.WORKSPACE_MANAGE, RoleConst.ADMIN], [ PermissionConst.WORKSPACE_READ.getWorkspacePermissionWorkspaceManageRole, PermissionConst.WORKSPACE_READ, ], [EditionConst.IS_EE], 'OR', ), ], }, component: () => import('@/views/system/workspace/index.vue'), }, // { // path: '/system/resource-management', // name: 'resourceManagement', // meta: { // icon: 'app-shared', // iconActive: 'app-shared-active', // title: 'views.system.resource_management.label', // activeMenu: '/system', // parentPath: '/system', // parentName: 'system', // }, // children: [ // { // path: '/system/resource-management/knowledge', // name: 'knowledgeResourceManagement', // meta: { // title: 'views.knowledge.title', // activeMenu: '/system', // parentPath: '/system', // parentName: 'system', // }, // component: () => import('@/views/resource-management/knowledge/index.vue'), // }, // { // path: '/system/resource-management/tool', // name: 'toolResourceManagement', // meta: { // title: 'views.tool.title', // activeMenu: '/system', // parentPath: '/system', // parentName: 'system', // }, // component: () => import('@/views/resource-management/tool/index.vue'), // }, // ], // }, { path: '/system/authorization', name: 'authorization', meta: { icon: 'app-resource-authorization', iconActive: 'app-resource-authorization-active', title: 'views.resourceAuthorization.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', }, component: () => import('@/views/system/resource-authorization/index.vue'), }, { path: '/system/shared', name: 'shared', meta: { icon: 'app-shared', iconActive: 'app-shared-active', title: 'views.shared.shared_resources', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [EditionConst.IS_EE], }, children: [ { path: '/system/shared/knowledge', name: 'knowledgeBase', meta: { title: 'views.knowledge.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.ADMIN], [PermissionConst.SHARED_KNOWLEDGE_READ], [EditionConst.IS_EE], 'OR', ), ], }, component: () => import('@/views/system-shared/KnowLedgeSharedIndex.vue'), }, { path: '/system/shared/tool', name: 'tools', meta: { title: 'views.tool.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.ADMIN], [PermissionConst.SHARED_TOOL_READ], [EditionConst.IS_EE], 'OR', ), ], }, component: () => import('@/views/system-shared/ToolSharedIndex.vue'), }, { path: '/system/shared/model', name: 'models', meta: { title: 'views.model.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.ADMIN], [PermissionConst.SHARED_MODEL_READ], [EditionConst.IS_EE], 'OR', ), ], }, component: () => import('@/views/system-shared/ModelSharedIndex.vue'), }, ], }, { path: '/system/chat', name: 'SystemChat', meta: { icon: 'app-shared', iconActive: 'app-shared-active', title: 'views.chatUser.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN], [PermissionConst.WORKSPACE_USER_GROUP_READ], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR', ), ], }, children: [ { path: '/system/chat/chat-user', name: 'ChatUser', meta: { title: 'views.chatUser.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN], [PermissionConst.WORKSPACE_CHAT_USER_READ], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR', ), ], }, component: () => import('@/views/system-chat-user/user-manage/index.vue'), }, { path: '/system/chat/group', name: 'Group', meta: { title: 'views.chatUser.group.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN], [PermissionConst.WORKSPACE_USER_GROUP_READ], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR', ), ], }, component: () => import('@/views/system-chat-user/group/index.vue'), }, { path: '/system/chat/authentication', name: 'Authentication', meta: { title: 'views.system.authentication.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [ new ComplexPermission( [RoleConst.WORKSPACE_MANAGE.getWorkspaceRole, RoleConst.ADMIN], [PermissionConst.CHAT_USER_AUTH_READ], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR', ), ], }, component: () => import('@/views/system-chat-user/authentication/index.vue'), }, ], }, { path: '/system/setting', name: 'setting', meta: { icon: 'app-setting', iconActive: 'app-setting-active', title: 'views.system.subTitle', activeMenu: '/system', parentPath: '/system', parentName: 'system', }, children: [ { path: '/system/setting/theme', name: 'theme', meta: { title: 'theme.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [EditionConst.IS_PE, EditionConst.IS_EE], }, component: () => import('@/views/system-setting/theme/index.vue'), }, { path: '/system/authentication', name: 'SystemAuthentication', meta: { title: 'views.system.authentication.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [EditionConst.IS_PE, EditionConst.IS_EE], }, component: () => import('@/views/system-setting/authentication/index.vue'), }, { path: '/system/email', name: 'email', meta: { title: 'views.system.email.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', }, component: () => import('@/views/system-setting/email/index.vue'), }, ], }, { path: '/operate', name: 'operate', meta: { icon: 'app-document', iconActive: 'app-document-active', title: 'views.operateLog.title', activeMenu: '/system', parentPath: '/system', parentName: 'system', permission: [EditionConst.IS_PE, EditionConst.IS_EE], }, component: () => import('@/views/system/operate-log/index.vue'), }, ], } export default systemRouter