From c33b5ebfefbb3ae507141bd2e9414231fd1512d4 Mon Sep 17 00:00:00 2001 From: Soybean Date: Thu, 14 Jul 2022 23:32:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(projects):=20=E6=B7=BB=E5=8A=A0=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=AE=A1=E7=90=86=E7=9A=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 - README.md | 7 +- mock/model/route.ts | 128 +++++++++++++++--- src/router/modules/index.ts | 2 +- src/router/modules/management.ts | 54 ++++++++ src/router/modules/plugin.ts | 10 -- src/typings/route.d.ts | 7 +- .../charts/d3 => management/auth}/index.vue | 4 +- src/views/management/role/index.vue | 7 + src/views/management/route/index.vue | 7 + src/views/management/user/index.vue | 7 + 11 files changed, 191 insertions(+), 43 deletions(-) create mode 100644 src/router/modules/management.ts rename src/views/{plugin/charts/d3 => management/auth}/index.vue (71%) create mode 100644 src/views/management/role/index.vue create mode 100644 src/views/management/route/index.vue create mode 100644 src/views/management/user/index.vue diff --git a/.vscode/settings.json b/.vscode/settings.json index eb210df3..4be6d416 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -43,7 +43,6 @@ "terminal.integrated.fontSize": 14, "terminal.integrated.fontWeight": 500, "terminal.integrated.tabs.enabled": true, - "unocss.root": "src", "workbench.iconTheme": "material-icon-theme", "workbench.colorTheme": "One Dark Pro", "[html]": { diff --git a/README.md b/README.md index e0a5420e..b025a08e 100644 --- a/README.md +++ b/README.md @@ -77,14 +77,13 @@ Soybean Admin 是一个基于 Vue3、Vite、TypeScript、Naive UI 的免费中 - [x] 图表示例:ECharts、AntV G2 - [x] 多页签:支持query、hash等参数,同一页面支持多个Tab - [x] 缓存主题配置 -- [ ] 添加锁屏组件、全局Iframe组件(去掉锁屏组件) -- [ ] 性能优化(优化递归函数) -- [ ] 表单、表格示例 +- [ ] 表单、表格示例(ing...) +- [ ] 全局Iframe组件 - [ ] 示例页面完善 - [ ] 精简版(新分支thin) - [ ] 文档完善 -- [ ] i18n国际化 - [ ] element-plus版本 +- [ ] i18n国际化 - [ ] 其他UI版本 - [ ] soybean-admin cli工具(选择不同UI) - [ ] soybean-admin 后台服务java版: [soybean-admin-java](https://github.com/honghuangdc/soybean-admin-java) diff --git a/mock/model/route.ts b/mock/model/route.ts index 34e502a2..3df0d50a 100644 --- a/mock/model/route.ts +++ b/mock/model/route.ts @@ -146,16 +146,6 @@ export const routeModel: Record = { icon: 'simple-icons:apacheecharts' } }, - { - name: 'plugin_charts_d3', - path: '/plugin/charts/d3', - component: 'self', - meta: { - title: 'D3', - requiresAuth: true, - icon: 'simple-icons:d3dotjs' - } - }, { name: 'plugin_charts_antv', path: '/plugin/charts/antv', @@ -445,6 +435,58 @@ export const routeModel: Record = { order: 8 } }, + { + name: 'management', + path: '/management', + component: 'basic', + children: [ + { + name: 'management_auth', + path: '/management/auth', + component: 'self', + meta: { + title: '权限管理', + requiresAuth: true, + icon: 'ic:baseline-security' + } + }, + { + name: 'management_role', + path: '/management/role', + component: 'self', + meta: { + title: '角色管理', + requiresAuth: true, + icon: 'carbon:user-role' + } + }, + { + name: 'management_user', + path: '/management/user', + component: 'self', + meta: { + title: '用户管理', + requiresAuth: true, + icon: 'ic:round-manage-accounts' + } + }, + { + name: 'management_route', + path: '/management/route', + component: 'self', + meta: { + title: '路由管理', + requiresAuth: true, + icon: 'material-symbols:route' + } + } + ], + meta: { + title: '系统管理', + icon: 'carbon:cloud-service-management', + order: 9 + } + }, { name: 'about', path: '/about', @@ -454,7 +496,7 @@ export const routeModel: Record = { requiresAuth: true, singleLayout: 'basic', icon: 'fluent:book-information-24-regular', - order: 9 + order: 10 } } ], @@ -605,16 +647,6 @@ export const routeModel: Record = { icon: 'simple-icons:apacheecharts' } }, - { - name: 'plugin_charts_d3', - path: '/plugin/charts/d3', - component: 'self', - meta: { - title: 'D3', - requiresAuth: true, - icon: 'simple-icons:d3dotjs' - } - }, { name: 'plugin_charts_antv', path: '/plugin/charts/antv', @@ -894,6 +926,58 @@ export const routeModel: Record = { order: 8 } }, + { + name: 'management', + path: '/management', + component: 'basic', + children: [ + { + name: 'management_auth', + path: '/management/auth', + component: 'self', + meta: { + title: '权限管理', + requiresAuth: true, + icon: 'ic:baseline-security' + } + }, + { + name: 'management_role', + path: '/management/role', + component: 'self', + meta: { + title: '角色管理', + requiresAuth: true, + icon: 'carbon:user-role' + } + }, + { + name: 'management_user', + path: '/management/user', + component: 'self', + meta: { + title: '用户管理', + requiresAuth: true, + icon: 'ic:round-manage-accounts' + } + }, + { + name: 'management_route', + path: '/management/route', + component: 'self', + meta: { + title: '路由管理', + requiresAuth: true, + icon: 'material-symbols:route' + } + } + ], + meta: { + title: '系统管理', + icon: 'carbon:cloud-service-management', + order: 9 + } + }, { name: 'about', path: '/about', @@ -903,7 +987,7 @@ export const routeModel: Record = { requiresAuth: true, singleLayout: 'basic', icon: 'fluent:book-information-24-regular', - order: 9 + order: 10 } } ], diff --git a/src/router/modules/index.ts b/src/router/modules/index.ts index 114ded82..bba3f776 100644 --- a/src/router/modules/index.ts +++ b/src/router/modules/index.ts @@ -1,5 +1,5 @@ import { handleModuleRoutes } from '@/utils'; -const modules = import.meta.globEager('./**/*.ts') as AuthRoute.RouteModule; +const modules = import.meta.glob('./**/*.ts', { eager: true }) as AuthRoute.RouteModule; export const routes = handleModuleRoutes(modules); diff --git a/src/router/modules/management.ts b/src/router/modules/management.ts new file mode 100644 index 00000000..c0fd7879 --- /dev/null +++ b/src/router/modules/management.ts @@ -0,0 +1,54 @@ +const management: AuthRoute.Route = { + name: 'management', + path: '/management', + component: 'basic', + children: [ + { + name: 'management_auth', + path: '/management/auth', + component: 'self', + meta: { + title: '权限管理', + requiresAuth: true, + icon: 'ic:baseline-security' + } + }, + { + name: 'management_role', + path: '/management/role', + component: 'self', + meta: { + title: '角色管理', + requiresAuth: true, + icon: 'carbon:user-role' + } + }, + { + name: 'management_user', + path: '/management/user', + component: 'self', + meta: { + title: '用户管理', + requiresAuth: true, + icon: 'ic:round-manage-accounts' + } + }, + { + name: 'management_route', + path: '/management/route', + component: 'self', + meta: { + title: '路由管理', + requiresAuth: true, + icon: 'material-symbols:route' + } + } + ], + meta: { + title: '系统管理', + icon: 'carbon:cloud-service-management', + order: 9 + } +}; + +export default management; diff --git a/src/router/modules/plugin.ts b/src/router/modules/plugin.ts index 8ce05645..7d52a4c4 100644 --- a/src/router/modules/plugin.ts +++ b/src/router/modules/plugin.ts @@ -18,16 +18,6 @@ const plugin: AuthRoute.Route = { icon: 'simple-icons:apacheecharts' } }, - { - name: 'plugin_charts_d3', - path: '/plugin/charts/d3', - component: 'self', - meta: { - title: 'D3', - requiresAuth: true, - icon: 'simple-icons:d3dotjs' - } - }, { name: 'plugin_charts_antv', path: '/plugin/charts/antv', diff --git a/src/typings/route.d.ts b/src/typings/route.d.ts index b1611cfa..c1436ed0 100644 --- a/src/typings/route.d.ts +++ b/src/typings/route.d.ts @@ -38,9 +38,7 @@ declare namespace AuthRoute { | 'plugin_swiper' | 'plugin_charts' | 'plugin_charts_echarts' - | 'plugin_charts_d3' | 'plugin_charts_antv' - | 'plugin_charts_chartjs' | 'auth-demo' | 'auth-demo_permission' | 'auth-demo_super' @@ -57,6 +55,11 @@ declare namespace AuthRoute { | 'multi-menu_first_second' | 'multi-menu_first_second-new' | 'multi-menu_first_second-new_third' + | 'management' + | 'management_user' + | 'management_role' + | 'management_auth' + | 'management_route' | 'about'; /** 路由的path */ diff --git a/src/views/plugin/charts/d3/index.vue b/src/views/management/auth/index.vue similarity index 71% rename from src/views/plugin/charts/d3/index.vue rename to src/views/management/auth/index.vue index 90ef4606..bac9bc8f 100644 --- a/src/views/plugin/charts/d3/index.vue +++ b/src/views/management/auth/index.vue @@ -1,7 +1,5 @@ diff --git a/src/views/management/role/index.vue b/src/views/management/role/index.vue new file mode 100644 index 00000000..3f1b1432 --- /dev/null +++ b/src/views/management/role/index.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/src/views/management/route/index.vue b/src/views/management/route/index.vue new file mode 100644 index 00000000..f42651c0 --- /dev/null +++ b/src/views/management/route/index.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/src/views/management/user/index.vue b/src/views/management/user/index.vue new file mode 100644 index 00000000..82c18fa2 --- /dev/null +++ b/src/views/management/user/index.vue @@ -0,0 +1,7 @@ + + + + +