diff --git a/build/plugins/router.ts b/build/plugins/router.ts index 40a5ae518..3d6917e75 100644 --- a/build/plugins/router.ts +++ b/build/plugins/router.ts @@ -8,20 +8,6 @@ export function setupElegantRouter() { base: 'src/layouts/base-layout/index.vue', blank: 'src/layouts/blank-layout/index.vue' }, - customRoutes: { - names: [ - 'exception_403', - 'exception_404', - 'exception_500', - 'document_project', - 'document_project-link', - 'document_vue', - 'document_vite', - 'document_unocss', - 'document_naive', - 'document_antd' - ] - }, routePathTransformer(routeName, routePath) { const key = routeName as RouteKey; diff --git a/src/constants/business.ts b/src/constants/business.ts deleted file mode 100644 index a84d74209..000000000 --- a/src/constants/business.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { transformRecordToOption } from '@/utils/common'; - -export const enableStatusRecord: Record = { - '1': 'page.manage.common.status.enable', - '2': 'page.manage.common.status.disable' -}; - -export const enableStatusOptions = transformRecordToOption(enableStatusRecord); - -export const userGenderRecord: Record = { - '1': 'page.manage.user.gender.male', - '2': 'page.manage.user.gender.female' -}; - -export const userGenderOptions = transformRecordToOption(userGenderRecord); - -export const menuTypeRecord: Record = { - '1': 'page.manage.menu.type.directory', - '2': 'page.manage.menu.type.menu' -}; - -export const menuTypeOptions = transformRecordToOption(menuTypeRecord); - -export const menuIconTypeRecord: Record = { - '1': 'page.manage.menu.iconType.iconify', - '2': 'page.manage.menu.iconType.local' -}; - -export const menuIconTypeOptions = transformRecordToOption(menuIconTypeRecord); diff --git a/src/layouts/modules/global-header/components/user-avatar.vue b/src/layouts/modules/global-header/components/user-avatar.vue index 24ef98927..78f5ade0c 100644 --- a/src/layouts/modules/global-header/components/user-avatar.vue +++ b/src/layouts/modules/global-header/components/user-avatar.vue @@ -18,7 +18,7 @@ function loginOrRegister() { toLogin(); } -type DropdownKey = 'user-center' | 'logout'; +type DropdownKey = 'logout'; type DropdownOption = | { @@ -33,15 +33,6 @@ type DropdownOption = const options = computed(() => { const opts: DropdownOption[] = [ - { - label: $t('common.userCenter'), - key: 'user-center', - icon: SvgIconVNode({ icon: 'ph:user-circle', fontSize: 18 }) - }, - { - type: 'divider', - key: 'divider' - }, { label: $t('common.logout'), key: 'logout', @@ -68,6 +59,7 @@ function handleDropdown(key: DropdownKey) { if (key === 'logout') { logout(); } else { + // If your other options are jumps from other routes, they will be directly supported here routerPushByKey(key); } } diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 00b103aa6..c33896e06 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -23,6 +23,7 @@ const local: App.I18n.Schema = { deleteSuccess: 'Delete Success', confirmDelete: 'Are you sure you want to delete?', edit: 'Edit', + warning: 'Warning', error: 'Error', index: 'Index', keywordSearch: 'Please enter keyword', @@ -147,42 +148,7 @@ const local: App.I18n.Schema = { 404: 'Page Not Found', 500: 'Server Error', 'iframe-page': 'Iframe', - home: 'Home', - document: 'Document', - document_project: 'Project Document', - 'document_project-link': 'Project Document(External Link)', - document_vue: 'Vue Document', - document_vite: 'Vite Document', - document_unocss: 'UnoCSS Document', - document_naive: 'Naive UI Document', - document_antd: 'Ant Design Vue Document', - 'user-center': 'User Center', - about: 'About', - function: 'System Function', - function_tab: 'Tab', - 'function_multi-tab': 'Multi Tab', - 'function_hide-child': 'Hide Child', - 'function_hide-child_one': 'Hide Child', - 'function_hide-child_two': 'Two', - 'function_hide-child_three': 'Three', - function_request: 'Request', - 'function_toggle-auth': 'Toggle Auth', - 'function_super-page': 'Super Admin Visible', - manage: 'System Manage', - manage_user: 'User Manage', - 'manage_user-detail': 'User Detail', - manage_role: 'Role Manage', - manage_menu: 'Menu Manage', - 'multi-menu': 'Multi Menu', - 'multi-menu_first': 'Menu One', - 'multi-menu_first_child': 'Menu One Child', - 'multi-menu_second': 'Menu Two', - 'multi-menu_second_child': 'Menu Two Child', - 'multi-menu_second_child_home': 'Menu Two Child Home', - exception: 'Exception', - exception_403: '403', - exception_404: '404', - exception_500: '500' + home: 'Home' }, page: { login: { @@ -231,20 +197,9 @@ const local: App.I18n.Schema = { title: 'Bind WeChat' } }, - about: { - title: 'About', - introduction: `SoybeanAdmin is an elegant and powerful admin template, based on the latest front-end technology stack, including Vue3, Vite5, TypeScript, Pinia and UnoCSS. It has built-in rich theme configuration and components, strict code specifications, and an automated file routing system. In addition, it also uses the online mock data solution based on ApiFox. SoybeanAdmin provides you with a one-stop admin solution, no additional configuration, and out of the box. It is also a best practice for learning cutting-edge technologies quickly.`, - projectInfo: { - title: 'Project Info', - version: 'Version', - latestBuildTime: 'Latest Build Time', - githubLink: 'Github Link', - previewLink: 'Preview Link' - }, - prdDep: 'Production Dependency', - devDep: 'Development Dependency' - }, home: { + branchDesc: + 'For the convenience of everyone in developing and updating the merge, we have streamlined the code of the main branch, only retaining the homepage menu, and the rest of the content has been moved to the example branch for maintenance. The preview address displays the content of the example branch.', greeting: 'Good morning, {userName}, today is another day full of vitality!', weatherDesc: 'Today is cloudy to clear, 20℃ - 25℃!', projectCount: 'Project Count', @@ -270,163 +225,6 @@ const local: App.I18n.Schema = { desc5: 'Soybean just wrote some of the workbench pages casually, and it was enough to see!' }, creativity: 'Creativity' - }, - function: { - tab: { - tabOperate: { - title: 'Tab Operation', - addTab: 'Add Tab', - addTabDesc: 'To about page', - closeTab: 'Close Tab', - closeCurrentTab: 'Close Current Tab', - closeAboutTab: 'Close "About" Tab', - addMultiTab: 'Add Multi Tab', - addMultiTabDesc1: 'To MultiTab page', - addMultiTabDesc2: 'To MultiTab page(with query params)' - }, - tabTitle: { - title: 'Tab Title', - changeTitle: 'Change Title', - change: 'Change', - resetTitle: 'Reset Title', - reset: 'Reset' - } - }, - multiTab: { - routeParam: 'Route Param', - backTab: 'Back function_tab' - }, - toggleAuth: { - toggleAccount: 'Toggle Account', - authHook: 'Auth Hook Function `hasAuth`', - superAdminVisible: 'Super Admin Visible', - adminVisible: 'Admin Visible', - adminOrUserVisible: 'Admin and User Visible' - }, - request: { - repeatedErrorOccurOnce: 'Repeated Request Error Occurs Once', - repeatedError: 'Repeated Request Error', - repeatedErrorMsg1: 'Custom Request Error 1', - repeatedErrorMsg2: 'Custom Request Error 2' - } - }, - manage: { - common: { - status: { - enable: 'Enable', - disable: 'Disable' - } - }, - role: { - title: 'Role List', - roleName: 'Role Name', - roleCode: 'Role Code', - roleStatus: 'Role Status', - roleDesc: 'Role Description', - menuAuth: 'Menu Auth', - buttonAuth: 'Button Auth', - form: { - roleName: 'Please enter role name', - roleCode: 'Please enter role code', - roleStatus: 'Please select role status', - roleDesc: 'Please enter role description' - }, - addRole: 'Add Role', - editRole: 'Edit Role' - }, - user: { - title: 'User List', - userName: 'User Name', - userGender: 'Gender', - nickName: 'Nick Name', - userPhone: 'Phone Number', - userEmail: 'Email', - userStatus: 'User Status', - userRole: 'User Role', - form: { - userName: 'Please enter user name', - userGender: 'Please select gender', - nickName: 'Please enter nick name', - userPhone: 'Please enter phone number', - userEmail: 'Please enter email', - userStatus: 'Please select user status', - userRole: 'Please select user role' - }, - addUser: 'Add User', - editUser: 'Edit User', - gender: { - male: 'Male', - female: 'Female' - } - }, - menu: { - home: 'Home', - title: 'Menu List', - id: 'ID', - parentId: 'Parent ID', - menuType: 'Menu Type', - menuName: 'Menu Name', - routeName: 'Route Name', - routePath: 'Route Path', - pathParam: 'Path Param', - layout: 'Layout Component', - page: 'Page Component', - i18nKey: 'I18n Key', - icon: 'Icon', - localIcon: 'Local Icon', - iconTypeTitle: 'Icon Type', - order: 'Order', - constant: 'Constant', - keepAlive: 'Keep Alive', - href: 'Href', - hideInMenu: 'Hide In Menu', - activeMenu: 'Active Menu', - multiTab: 'Multi Tab', - fixedIndexInTab: 'Fixed Index In Tab', - query: 'Query Params', - button: 'Button', - buttonCode: 'Button Code', - buttonDesc: 'Button Desc', - menuStatus: 'Menu Status', - form: { - home: 'Please select home', - menuType: 'Please select menu type', - menuName: 'Please enter menu name', - routeName: 'Please enter route name', - routePath: 'Please enter route path', - pathParam: 'Please enter path param', - page: 'Please select page component', - layout: 'Please select layout component', - i18nKey: 'Please enter i18n key', - icon: 'Please enter iconify name', - localIcon: 'Please enter local icon name', - order: 'Please enter order', - keepAlive: 'Please select whether to cache route', - href: 'Please enter href', - hideInMenu: 'Please select whether to hide menu', - activeMenu: 'Please select route name of the highlighted menu', - multiTab: 'Please select whether to support multiple tabs', - fixedInTab: 'Please select whether to fix in the tab', - fixedIndexInTab: 'Please enter the index fixed in the tab', - queryKey: 'Please enter route parameter Key', - queryValue: 'Please enter route parameter Value', - button: 'Please select whether it is a button', - buttonCode: 'Please enter button code', - buttonDesc: 'Please enter button description', - menuStatus: 'Please select menu status' - }, - addMenu: 'Add Menu', - editMenu: 'Edit Menu', - addChildMenu: 'Add Child Menu', - type: { - directory: 'Directory', - menu: 'Menu' - }, - iconType: { - iconify: 'Iconify Icon', - local: 'Local Icon' - } - } } }, form: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 43e971632..2357ea7ea 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -23,6 +23,7 @@ const local: App.I18n.Schema = { deleteSuccess: '删除成功', confirmDelete: '确认删除吗?', edit: '编辑', + warning: '警告', error: '错误', index: '序号', keywordSearch: '请输入关键词搜索', @@ -147,42 +148,7 @@ const local: App.I18n.Schema = { 404: '页面不存在', 500: '服务器错误', 'iframe-page': '外链页面', - home: '首页', - document: '文档', - document_project: '项目文档', - 'document_project-link': '项目文档(外链)', - document_vue: 'Vue文档', - document_vite: 'Vite文档', - document_unocss: 'UnoCSS文档', - document_naive: 'Naive UI文档', - document_antd: 'Ant Design Vue文档', - 'user-center': '个人中心', - about: '关于', - function: '系统功能', - function_tab: '标签页', - 'function_multi-tab': '多标签页', - 'function_hide-child': '隐藏子菜单', - 'function_hide-child_one': '隐藏子菜单', - 'function_hide-child_two': '菜单二', - 'function_hide-child_three': '菜单三', - function_request: '请求', - 'function_toggle-auth': '切换权限', - 'function_super-page': '超级管理员可见', - manage: '系统管理', - manage_user: '用户管理', - 'manage_user-detail': '用户详情', - manage_role: '角色管理', - manage_menu: '菜单管理', - 'multi-menu': '多级菜单', - 'multi-menu_first': '菜单一', - 'multi-menu_first_child': '菜单一子菜单', - 'multi-menu_second': '菜单二', - 'multi-menu_second_child': '菜单二子菜单', - 'multi-menu_second_child_home': '菜单二子菜单首页', - exception: '异常页', - exception_403: '403', - exception_404: '404', - exception_500: '500' + home: '首页' }, page: { login: { @@ -231,20 +197,9 @@ const local: App.I18n.Schema = { title: '绑定微信' } }, - about: { - title: '关于', - introduction: `SoybeanAdmin 是一个优雅且功能强大的后台管理模板,基于最新的前端技术栈,包括 Vue3, Vite5, TypeScript, Pinia 和 UnoCSS。它内置了丰富的主题配置和组件,代码规范严谨,实现了自动化的文件路由系统。此外,它还采用了基于 ApiFox 的在线Mock数据方案。SoybeanAdmin 为您提供了一站式的后台管理解决方案,无需额外配置,开箱即用。同样是一个快速学习前沿技术的最佳实践。`, - projectInfo: { - title: '项目信息', - version: '版本', - latestBuildTime: '最新构建时间', - githubLink: 'Github 地址', - previewLink: '预览地址' - }, - prdDep: '生产依赖', - devDep: '开发依赖' - }, home: { + branchDesc: + '为了方便大家开发和更新合并,我们对main分支的代码进行了精简,只保留了首页菜单,其余内容已移至example分支进行维护。预览地址显示的内容即为example分支的内容。', greeting: '早安,{userName}, 今天又是充满活力的一天!', weatherDesc: '今日多云转晴,20℃ - 25℃!', projectCount: '项目数', @@ -270,163 +225,6 @@ const local: App.I18n.Schema = { desc5: 'Soybean 刚才把工作台页面随便写了一些,凑合能看了!' }, creativity: '创意' - }, - function: { - tab: { - tabOperate: { - title: '标签页操作', - addTab: '添加标签页', - addTabDesc: '跳转到关于页面', - closeTab: '关闭标签页', - closeCurrentTab: '关闭当前标签页', - closeAboutTab: '关闭"关于"标签页', - addMultiTab: '添加多标签页', - addMultiTabDesc1: '跳转到多标签页页面', - addMultiTabDesc2: '跳转到多标签页页面(带有查询参数)' - }, - tabTitle: { - title: '标签页标题', - changeTitle: '修改标题', - change: '修改', - resetTitle: '重置标题', - reset: '重置' - } - }, - multiTab: { - routeParam: '路由参数', - backTab: '返回 function_tab' - }, - toggleAuth: { - toggleAccount: '切换账号', - authHook: '权限钩子函数 `hasAuth`', - superAdminVisible: '超级管理员可见', - adminVisible: '管理员可见', - adminOrUserVisible: '管理员和用户可见' - }, - request: { - repeatedErrorOccurOnce: '重复请求错误只出现一次', - repeatedError: '重复请求错误', - repeatedErrorMsg1: '自定义请求错误 1', - repeatedErrorMsg2: '自定义请求错误 2' - } - }, - manage: { - common: { - status: { - enable: '启用', - disable: '禁用' - } - }, - role: { - title: '角色列表', - roleName: '角色名称', - roleCode: '角色编码', - roleStatus: '角色状态', - roleDesc: '角色描述', - menuAuth: '菜单权限', - buttonAuth: '按钮权限', - form: { - roleName: '请输入角色名称', - roleCode: '请输入角色编码', - roleStatus: '请选择角色状态', - roleDesc: '请输入角色描述' - }, - addRole: '新增角色', - editRole: '编辑角色' - }, - user: { - title: '用户列表', - userName: '用户名', - userGender: '性别', - nickName: '昵称', - userPhone: '手机号', - userEmail: '邮箱', - userStatus: '用户状态', - userRole: '用户角色', - form: { - userName: '请输入用户名', - userGender: '请选择性别', - nickName: '请输入昵称', - userPhone: '请输入手机号', - userEmail: '请输入邮箱', - userStatus: '请选择用户状态', - userRole: '请选择用户角色' - }, - addUser: '新增用户', - editUser: '编辑用户', - gender: { - male: '男', - female: '女' - } - }, - menu: { - home: '首页', - title: '菜单列表', - id: 'ID', - parentId: '父级菜单ID', - menuType: '菜单类型', - menuName: '菜单名称', - routeName: '路由名称', - routePath: '路由路径', - pathParam: '路径参数', - layout: '布局', - page: '页面组件', - i18nKey: '国际化key', - icon: '图标', - localIcon: '本地图标', - iconTypeTitle: '图标类型', - order: '排序', - constant: '常量路由', - keepAlive: '缓存路由', - href: '外链', - hideInMenu: '隐藏菜单', - activeMenu: '高亮的菜单', - multiTab: '支持多页签', - fixedIndexInTab: '固定在页签中的序号', - query: '路由参数', - button: '按钮', - buttonCode: '按钮编码', - buttonDesc: '按钮描述', - menuStatus: '菜单状态', - form: { - home: '请选择首页', - menuType: '请选择菜单类型', - menuName: '请输入菜单名称', - routeName: '请输入路由名称', - routePath: '请输入路由路径', - pathParam: '请输入路径参数', - page: '请选择页面组件', - layout: '请选择布局组件', - i18nKey: '请输入国际化key', - icon: '请输入图标', - localIcon: '请选择本地图标', - order: '请输入排序', - keepAlive: '请选择是否缓存路由', - href: '请输入外链', - hideInMenu: '请选择是否隐藏菜单', - activeMenu: '请选择高亮的菜单的路由名称', - multiTab: '请选择是否支持多标签', - fixedInTab: '请选择是否固定在页签中', - fixedIndexInTab: '请输入固定在页签中的序号', - queryKey: '请输入路由参数Key', - queryValue: '请输入路由参数Value', - button: '请选择是否按钮', - buttonCode: '请输入按钮编码', - buttonDesc: '请输入按钮描述', - menuStatus: '请选择菜单状态' - }, - addMenu: '新增菜单', - editMenu: '编辑菜单', - addChildMenu: '新增子菜单', - type: { - directory: '目录', - menu: '菜单' - }, - iconType: { - iconify: 'iconify图标', - local: '本地图标' - } - } } }, form: { diff --git a/src/router/elegant/imports.ts b/src/router/elegant/imports.ts index 5c9ebeefa..ce1b9d7d8 100644 --- a/src/router/elegant/imports.ts +++ b/src/router/elegant/imports.ts @@ -20,21 +20,5 @@ export const views: Record Promise import("@/views/_builtin/500/index.vue"), "iframe-page": () => import("@/views/_builtin/iframe-page/[url].vue"), login: () => import("@/views/_builtin/login/index.vue"), - about: () => import("@/views/about/index.vue"), - "function_hide-child_one": () => import("@/views/function/hide-child/one/index.vue"), - "function_hide-child_three": () => import("@/views/function/hide-child/three/index.vue"), - "function_hide-child_two": () => import("@/views/function/hide-child/two/index.vue"), - "function_multi-tab": () => import("@/views/function/multi-tab/index.vue"), - function_request: () => import("@/views/function/request/index.vue"), - "function_super-page": () => import("@/views/function/super-page/index.vue"), - function_tab: () => import("@/views/function/tab/index.vue"), - "function_toggle-auth": () => import("@/views/function/toggle-auth/index.vue"), home: () => import("@/views/home/index.vue"), - manage_menu: () => import("@/views/manage/menu/index.vue"), - manage_role: () => import("@/views/manage/role/index.vue"), - "manage_user-detail": () => import("@/views/manage/user-detail/[id].vue"), - manage_user: () => import("@/views/manage/user/index.vue"), - "multi-menu_first_child": () => import("@/views/multi-menu/first_child/index.vue"), - "multi-menu_second_child_home": () => import("@/views/multi-menu/second_child_home/index.vue"), - "user-center": () => import("@/views/user-center/index.vue"), }; diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index 822c0be55..9566e125f 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -39,135 +39,6 @@ export const generatedRoutes: GeneratedRoute[] = [ hideInMenu: true } }, - { - name: 'about', - path: '/about', - component: 'layout.base$view.about', - meta: { - title: 'about', - i18nKey: 'route.about', - icon: 'fluent:book-information-24-regular', - order: 10 - } - }, - { - name: 'function', - path: '/function', - component: 'layout.base', - meta: { - title: 'function', - i18nKey: 'route.function', - icon: 'icon-park-outline:all-application', - order: 6 - }, - children: [ - { - name: 'function_hide-child', - path: '/function/hide-child', - meta: { - title: 'function_hide-child', - i18nKey: 'route.function_hide-child', - icon: 'material-symbols:filter-list-off', - order: 2 - }, - redirect: '/function/hide-child/one', - children: [ - { - name: 'function_hide-child_one', - path: '/function/hide-child/one', - component: 'view.function_hide-child_one', - meta: { - title: 'function_hide-child_one', - i18nKey: 'route.function_hide-child_one', - icon: 'material-symbols:filter-list-off', - hideInMenu: true, - activeMenu: 'function_hide-child' - } - }, - { - name: 'function_hide-child_three', - path: '/function/hide-child/three', - component: 'view.function_hide-child_three', - meta: { - title: 'function_hide-child_three', - i18nKey: 'route.function_hide-child_three', - hideInMenu: true, - activeMenu: 'function_hide-child' - } - }, - { - name: 'function_hide-child_two', - path: '/function/hide-child/two', - component: 'view.function_hide-child_two', - meta: { - title: 'function_hide-child_two', - i18nKey: 'route.function_hide-child_two', - hideInMenu: true, - activeMenu: 'function_hide-child' - } - } - ] - }, - { - name: 'function_multi-tab', - path: '/function/multi-tab', - component: 'view.function_multi-tab', - meta: { - title: 'function_multi-tab', - i18nKey: 'route.function_multi-tab', - icon: 'ic:round-tab', - multiTab: true, - hideInMenu: true, - activeMenu: 'function_tab' - } - }, - { - name: 'function_request', - path: '/function/request', - component: 'view.function_request', - meta: { - title: 'function_request', - i18nKey: 'route.function_request', - icon: 'carbon:network-overlay', - order: 3 - } - }, - { - name: 'function_super-page', - path: '/function/super-page', - component: 'view.function_super-page', - meta: { - title: 'function_super-page', - i18nKey: 'route.function_super-page', - icon: 'ic:round-supervisor-account', - order: 5, - roles: ['R_SUPER'] - } - }, - { - name: 'function_tab', - path: '/function/tab', - component: 'view.function_tab', - meta: { - title: 'function_tab', - i18nKey: 'route.function_tab', - icon: 'ic:round-tab', - order: 1 - } - }, - { - name: 'function_toggle-auth', - path: '/function/toggle-auth', - component: 'view.function_toggle-auth', - meta: { - title: 'function_toggle-auth', - i18nKey: 'route.function_toggle-auth', - icon: 'ic:round-construction', - order: 4 - } - } - ] - }, { name: 'home', path: '/home', @@ -203,141 +74,5 @@ export const generatedRoutes: GeneratedRoute[] = [ constant: true, hideInMenu: true } - }, - { - name: 'manage', - path: '/manage', - component: 'layout.base', - meta: { - title: 'manage', - i18nKey: 'route.manage', - icon: 'carbon:cloud-service-management', - order: 9, - roles: ['R_ADMIN'] - }, - children: [ - { - name: 'manage_menu', - path: '/manage/menu', - component: 'view.manage_menu', - meta: { - title: 'manage_menu', - i18nKey: 'route.manage_menu', - icon: 'material-symbols:route', - order: 3, - roles: ['R_ADMIN'], - keepAlive: true - } - }, - { - name: 'manage_role', - path: '/manage/role', - component: 'view.manage_role', - meta: { - title: 'manage_role', - i18nKey: 'route.manage_role', - icon: 'carbon:user-role', - order: 2, - roles: ['R_SUPER'] - } - }, - { - name: 'manage_user', - path: '/manage/user', - component: 'view.manage_user', - meta: { - title: 'manage_user', - i18nKey: 'route.manage_user', - icon: 'ic:round-manage-accounts', - order: 1, - roles: ['R_ADMIN'] - } - }, - { - name: 'manage_user-detail', - path: '/manage/user-detail/:id', - component: 'view.manage_user-detail', - props: true, - meta: { - title: 'manage_user-detail', - i18nKey: 'route.manage_user-detail', - hideInMenu: true, - roles: ['R_ADMIN'], - activeMenu: 'manage_user' - } - } - ] - }, - { - name: 'multi-menu', - path: '/multi-menu', - component: 'layout.base', - meta: { - title: 'multi-menu', - i18nKey: 'route.multi-menu', - order: 8 - }, - children: [ - { - name: 'multi-menu_first', - path: '/multi-menu/first', - meta: { - title: 'multi-menu_first', - i18nKey: 'route.multi-menu_first', - order: 1 - }, - children: [ - { - name: 'multi-menu_first_child', - path: '/multi-menu/first/child', - component: 'view.multi-menu_first_child', - meta: { - title: 'multi-menu_first_child', - i18nKey: 'route.multi-menu_first_child' - } - } - ] - }, - { - name: 'multi-menu_second', - path: '/multi-menu/second', - meta: { - title: 'multi-menu_second', - i18nKey: 'route.multi-menu_second', - order: 2 - }, - children: [ - { - name: 'multi-menu_second_child', - path: '/multi-menu/second/child', - meta: { - title: 'multi-menu_second_child', - i18nKey: 'route.multi-menu_second_child' - }, - children: [ - { - name: 'multi-menu_second_child_home', - path: '/multi-menu/second/child/home', - component: 'view.multi-menu_second_child_home', - meta: { - title: 'multi-menu_second_child_home', - i18nKey: 'route.multi-menu_second_child_home' - } - } - ] - } - ] - } - ] - }, - { - name: 'user-center', - path: '/user-center', - component: 'layout.base$view.user-center', - meta: { - title: 'user-center', - i18nKey: 'route.user-center', - hideInMenu: true - } } ]; diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index e2af8aa17..137820ab5 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -161,47 +161,12 @@ function transformElegantRouteToVueRoute( const routeMap: RouteMap = { "root": "/", "not-found": "/:pathMatch(.*)*", - "exception": "/exception", - "exception_403": "/exception/403", - "exception_404": "/exception/404", - "exception_500": "/exception/500", - "document": "/document", - "document_project": "/document/project", - "document_project-link": "/document/project-link", - "document_vue": "/document/vue", - "document_vite": "/document/vite", - "document_unocss": "/document/unocss", - "document_naive": "/document/naive", - "document_antd": "/document/antd", "403": "/403", "404": "/404", "500": "/500", - "about": "/about", - "function": "/function", - "function_hide-child": "/function/hide-child", - "function_hide-child_one": "/function/hide-child/one", - "function_hide-child_three": "/function/hide-child/three", - "function_hide-child_two": "/function/hide-child/two", - "function_multi-tab": "/function/multi-tab", - "function_request": "/function/request", - "function_super-page": "/function/super-page", - "function_tab": "/function/tab", - "function_toggle-auth": "/function/toggle-auth", "home": "/home", "iframe-page": "/iframe-page/:url", - "login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?", - "manage": "/manage", - "manage_menu": "/manage/menu", - "manage_role": "/manage/role", - "manage_user": "/manage/user", - "manage_user-detail": "/manage/user-detail/:id", - "multi-menu": "/multi-menu", - "multi-menu_first": "/multi-menu/first", - "multi-menu_first_child": "/multi-menu/first/child", - "multi-menu_second": "/multi-menu/second", - "multi-menu_second_child": "/multi-menu/second/child", - "multi-menu_second_child_home": "/multi-menu/second/child/home", - "user-center": "/user-center" + "login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?" }; /** diff --git a/src/router/routes/index.ts b/src/router/routes/index.ts index 96322a9ed..5a295d8fd 100644 --- a/src/router/routes/index.ts +++ b/src/router/routes/index.ts @@ -8,160 +8,7 @@ import { transformElegantRoutesToVueRoutes } from '../elegant/transform'; * * @link https://github.com/soybeanjs/elegant-router?tab=readme-ov-file#custom-route */ -const customRoutes: CustomRoute[] = [ - { - name: 'exception', - path: '/exception', - component: 'layout.base', - meta: { - title: 'exception', - i18nKey: 'route.exception', - icon: 'ant-design:exception-outlined', - order: 7 - }, - children: [ - { - name: 'exception_403', - path: '/exception/403', - component: 'view.403', - meta: { - title: 'exception_403', - i18nKey: 'route.exception_403', - icon: 'ic:baseline-block' - } - }, - { - name: 'exception_404', - path: '/exception/404', - component: 'view.404', - meta: { - title: 'exception_404', - i18nKey: 'route.exception_404', - icon: 'ic:baseline-web-asset-off' - } - }, - { - name: 'exception_500', - path: '/exception/500', - component: 'view.500', - meta: { - title: 'exception_500', - i18nKey: 'route.exception_500', - icon: 'ic:baseline-wifi-off' - } - } - ] - }, - { - name: 'document', - path: '/document', - component: 'layout.base', - meta: { - title: 'document', - i18nKey: 'route.document', - order: 2, - icon: 'mdi:file-document-multiple-outline' - }, - children: [ - { - name: 'document_antd', - path: '/document/antd', - component: 'view.iframe-page', - props: { - url: 'https://antdv.com/components/overview-cn' - }, - meta: { - title: 'document_antd', - i18nKey: 'route.document_antd', - order: 7, - icon: 'logos:ant-design' - } - }, - { - name: 'document_naive', - path: '/document/naive', - component: 'view.iframe-page', - props: { - url: 'https://www.naiveui.com/zh-CN/os-theme/docs/introduction' - }, - meta: { - title: 'document_naive', - i18nKey: 'route.document_naive', - order: 6, - icon: 'logos:naiveui' - } - }, - { - name: 'document_project', - path: '/document/project', - component: 'view.iframe-page', - props: { - url: 'https://docs.soybeanjs.cn/zh' - }, - meta: { - title: 'document_project', - i18nKey: 'route.document_project', - order: 1, - localIcon: 'logo' - } - }, - { - name: 'document_project-link', - path: '/document/project-link', - component: 'view.iframe-page', - meta: { - title: 'document_project-link', - i18nKey: 'route.document_project-link', - order: 2, - localIcon: 'logo', - href: 'https://docs.soybeanjs.cn/zh' - } - }, - { - name: 'document_unocss', - path: '/document/unocss', - component: 'view.iframe-page', - props: { - url: 'https://unocss.dev/' - }, - meta: { - title: 'document_unocss', - i18nKey: 'route.document_unocss', - order: 5, - icon: 'logos:unocss' - } - }, - { - name: 'document_vite', - path: '/document/vite', - component: 'view.iframe-page', - props: { - url: 'https://cn.vitejs.dev/' - }, - meta: { - title: 'document_vite', - i18nKey: 'route.document_vite', - order: 4, - icon: 'logos:vitejs' - } - }, - { - name: 'document_vue', - path: '/document/vue', - component: 'view.iframe-page', - props: { - url: 'https://cn.vuejs.org/' - }, - meta: { - title: 'document_vue', - i18nKey: 'route.document_vue', - order: 3, - icon: 'logos:vue' - } - } - ] - } -]; +const customRoutes: CustomRoute[] = []; /** create routes when the auth route mode is static */ export function createStaticRoutes() { diff --git a/src/service/api/index.ts b/src/service/api/index.ts index c9d31d11b..89f4e5819 100644 --- a/src/service/api/index.ts +++ b/src/service/api/index.ts @@ -1,3 +1,2 @@ export * from './auth'; export * from './route'; -export * from './system-manage'; diff --git a/src/service/api/system-manage.ts b/src/service/api/system-manage.ts deleted file mode 100644 index cb975b2ce..000000000 --- a/src/service/api/system-manage.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { request } from '../request'; - -/** get role list */ -export function fetchGetRoleList(params?: Api.SystemManage.RoleSearchParams) { - return request({ - url: '/systemManage/getRoleList', - method: 'get', - params - }); -} - -/** - * get all roles - * - * these roles are all enabled - */ -export function fetchGetAllRoles() { - return request({ - url: '/systemManage/getAllRoles', - method: 'get' - }); -} - -/** get user list */ -export function fetchGetUserList(params?: Api.SystemManage.UserSearchParams) { - return request({ - url: '/systemManage/getUserList', - method: 'get', - params - }); -} - -/** get menu list */ -export function fetchGetMenuList() { - return request({ - url: '/systemManage/getMenuList/v2', - method: 'get' - }); -} - -/** get all pages */ -export function fetchGetAllPages() { - return request({ - url: '/systemManage/getAllPages', - method: 'get' - }); -} - -/** get menu tree */ -export function fetchGetMenuTree() { - return request({ - url: '/systemManage/getMenuTree', - method: 'get' - }); -} diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 391bc8df8..58c8a45b9 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -273,6 +273,7 @@ declare namespace App { deleteSuccess: string; confirmDelete: string; edit: string; + warning: string; error: string; index: string; keywordSearch: string; @@ -406,20 +407,8 @@ declare namespace App { title: string; }; }; - about: { - title: string; - introduction: string; - projectInfo: { - title: string; - version: string; - latestBuildTime: string; - githubLink: string; - previewLink: string; - }; - prdDep: string; - devDep: string; - }; home: { + branchDesc: string; greeting: string; weatherDesc: string; projectCount: string; @@ -446,163 +435,6 @@ declare namespace App { }; creativity: string; }; - function: { - tab: { - tabOperate: { - title: string; - addTab: string; - addTabDesc: string; - closeTab: string; - closeCurrentTab: string; - closeAboutTab: string; - addMultiTab: string; - addMultiTabDesc1: string; - addMultiTabDesc2: string; - }; - tabTitle: { - title: string; - changeTitle: string; - change: string; - resetTitle: string; - reset: string; - }; - }; - multiTab: { - routeParam: string; - backTab: string; - }; - toggleAuth: { - toggleAccount: string; - authHook: string; - superAdminVisible: string; - adminVisible: string; - adminOrUserVisible: string; - }; - request: { - repeatedErrorOccurOnce: string; - repeatedError: string; - repeatedErrorMsg1: string; - repeatedErrorMsg2: string; - }; - }; - manage: { - common: { - status: { - enable: string; - disable: string; - }; - }; - role: { - title: string; - roleName: string; - roleCode: string; - roleStatus: string; - roleDesc: string; - form: { - roleName: string; - roleCode: string; - roleStatus: string; - roleDesc: string; - }; - addRole: string; - editRole: string; - menuAuth: string; - buttonAuth: string; - }; - user: { - title: string; - userName: string; - userGender: string; - nickName: string; - userPhone: string; - userEmail: string; - userStatus: string; - userRole: string; - form: { - userName: string; - userGender: string; - nickName: string; - userPhone: string; - userEmail: string; - userStatus: string; - userRole: string; - }; - addUser: string; - editUser: string; - gender: { - male: string; - female: string; - }; - }; - menu: { - home: string; - title: string; - id: string; - parentId: string; - menuType: string; - menuName: string; - routeName: string; - routePath: string; - pathParam: string; - layout: string; - page: string; - i18nKey: string; - icon: string; - localIcon: string; - iconTypeTitle: string; - order: string; - constant: string; - keepAlive: string; - href: string; - hideInMenu: string; - activeMenu: string; - multiTab: string; - fixedIndexInTab: string; - query: string; - button: string; - buttonCode: string; - buttonDesc: string; - menuStatus: string; - form: { - home: string; - menuType: string; - menuName: string; - routeName: string; - routePath: string; - pathParam: string; - layout: string; - page: string; - i18nKey: string; - icon: string; - localIcon: string; - order: string; - keepAlive: string; - href: string; - hideInMenu: string; - activeMenu: string; - multiTab: string; - fixedInTab: string; - fixedIndexInTab: string; - queryKey: string; - queryValue: string; - button: string; - buttonCode: string; - buttonDesc: string; - menuStatus: string; - }; - addMenu: string; - editMenu: string; - addChildMenu: string; - type: { - directory: string; - menu: string; - }; - iconType: { - iconify: string; - local: string; - }; - }; - }; }; form: { required: string; diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 06ad42c20..1067e4db1 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -37,6 +37,7 @@ declare module 'vue' { LangSwitch: typeof import('./../components/common/lang-switch.vue')['default'] LookForward: typeof import('./../components/custom/look-forward.vue')['default'] MenuToggler: typeof import('./../components/common/menu-toggler.vue')['default'] + NAlert: typeof import('naive-ui')['NAlert'] NBreadcrumb: typeof import('naive-ui')['NBreadcrumb'] NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem'] NButton: typeof import('naive-ui')['NButton'] diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index ac91d1d11..5557d6d93 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -17,47 +17,12 @@ declare module "@elegant-router/types" { export type RouteMap = { "root": "/"; "not-found": "/:pathMatch(.*)*"; - "exception": "/exception"; - "exception_403": "/exception/403"; - "exception_404": "/exception/404"; - "exception_500": "/exception/500"; - "document": "/document"; - "document_project": "/document/project"; - "document_project-link": "/document/project-link"; - "document_vue": "/document/vue"; - "document_vite": "/document/vite"; - "document_unocss": "/document/unocss"; - "document_naive": "/document/naive"; - "document_antd": "/document/antd"; "403": "/403"; "404": "/404"; "500": "/500"; - "about": "/about"; - "function": "/function"; - "function_hide-child": "/function/hide-child"; - "function_hide-child_one": "/function/hide-child/one"; - "function_hide-child_three": "/function/hide-child/three"; - "function_hide-child_two": "/function/hide-child/two"; - "function_multi-tab": "/function/multi-tab"; - "function_request": "/function/request"; - "function_super-page": "/function/super-page"; - "function_tab": "/function/tab"; - "function_toggle-auth": "/function/toggle-auth"; "home": "/home"; "iframe-page": "/iframe-page/:url"; "login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?"; - "manage": "/manage"; - "manage_menu": "/manage/menu"; - "manage_role": "/manage/role"; - "manage_user": "/manage/user"; - "manage_user-detail": "/manage/user-detail/:id"; - "multi-menu": "/multi-menu"; - "multi-menu_first": "/multi-menu/first"; - "multi-menu_first_child": "/multi-menu/first/child"; - "multi-menu_second": "/multi-menu/second"; - "multi-menu_second_child": "/multi-menu/second/child"; - "multi-menu_second_child_home": "/multi-menu/second/child/home"; - "user-center": "/user-center"; }; /** @@ -77,18 +42,6 @@ declare module "@elegant-router/types" { RouteKey, | "root" | "not-found" - | "exception" - | "exception_403" - | "exception_404" - | "exception_500" - | "document" - | "document_project" - | "document_project-link" - | "document_vue" - | "document_vite" - | "document_unocss" - | "document_naive" - | "document_antd" >; /** @@ -104,14 +57,9 @@ declare module "@elegant-router/types" { | "403" | "404" | "500" - | "about" - | "function" | "home" | "iframe-page" | "login" - | "manage" - | "multi-menu" - | "user-center" >; /** @@ -121,8 +69,6 @@ declare module "@elegant-router/types" { CustomRouteKey, | "root" | "not-found" - | "exception" - | "document" >; /** @@ -135,23 +81,7 @@ declare module "@elegant-router/types" { | "500" | "iframe-page" | "login" - | "about" - | "function_hide-child_one" - | "function_hide-child_three" - | "function_hide-child_two" - | "function_multi-tab" - | "function_request" - | "function_super-page" - | "function_tab" - | "function_toggle-auth" | "home" - | "manage_menu" - | "manage_role" - | "manage_user-detail" - | "manage_user" - | "multi-menu_first_child" - | "multi-menu_second_child_home" - | "user-center" >; /** @@ -161,16 +91,6 @@ declare module "@elegant-router/types" { CustomRouteKey, | "root" | "not-found" - | "exception_403" - | "exception_404" - | "exception_500" - | "document_project" - | "document_project-link" - | "document_vue" - | "document_vite" - | "document_unocss" - | "document_naive" - | "document_antd" >; /** diff --git a/src/views/about/index.vue b/src/views/about/index.vue deleted file mode 100644 index 2812fbb1b..000000000 --- a/src/views/about/index.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - - - diff --git a/src/views/function/hide-child/one/index.vue b/src/views/function/hide-child/one/index.vue deleted file mode 100644 index 2a654c50d..000000000 --- a/src/views/function/hide-child/one/index.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/views/function/hide-child/three/index.vue b/src/views/function/hide-child/three/index.vue deleted file mode 100644 index 2a654c50d..000000000 --- a/src/views/function/hide-child/three/index.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/views/function/hide-child/two/index.vue b/src/views/function/hide-child/two/index.vue deleted file mode 100644 index 2a654c50d..000000000 --- a/src/views/function/hide-child/two/index.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/views/function/multi-tab/index.vue b/src/views/function/multi-tab/index.vue deleted file mode 100644 index cb14b8a2d..000000000 --- a/src/views/function/multi-tab/index.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/src/views/function/request/index.vue b/src/views/function/request/index.vue deleted file mode 100644 index fb6df0b16..000000000 --- a/src/views/function/request/index.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - diff --git a/src/views/function/super-page/index.vue b/src/views/function/super-page/index.vue deleted file mode 100644 index 2a654c50d..000000000 --- a/src/views/function/super-page/index.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/views/function/tab/index.vue b/src/views/function/tab/index.vue deleted file mode 100644 index 236e5bfba..000000000 --- a/src/views/function/tab/index.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/src/views/function/toggle-auth/index.vue b/src/views/function/toggle-auth/index.vue deleted file mode 100644 index e3af4dd54..000000000 --- a/src/views/function/toggle-auth/index.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - diff --git a/src/views/home/index.vue b/src/views/home/index.vue index bd69cf5c8..7b5a5ed6e 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -15,6 +15,9 @@ const gap = computed(() => (appStore.isMobile ? 0 : 16));