diff --git a/src/router/index.ts b/src/router/index.ts index 0dc7918..5ef3416 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -12,6 +12,7 @@ import tableRouter from './modules/table' import errorRouter from './modules/error' import excelRouter from './modules/excel' import nestedRouter from './modules/nested' +import systemRouter from './modules/system' interface extendRoute { @@ -108,6 +109,7 @@ export const asyncRoutes = [ errorRouter, externalLink, clipboardTable, + systemRouter, permissionRouter, { diff --git a/src/router/modules/system.ts b/src/router/modules/system.ts new file mode 100644 index 0000000..e6bac22 --- /dev/null +++ b/src/router/modules/system.ts @@ -0,0 +1,36 @@ +/** When your routing table is too long, you can split it into small modules**/ + +import Layout from '@/layout/index.vue' + +const systemRouter = { + path: '/system', + component: Layout, + redirect: 'noRedirect', + name: 'system', + meta: { + title: '系统管理', + icon: 'management' + }, + children: [ + { + path: 'user', + component: () => import('@/views/system/user.vue'), + name: 'user', + meta: { title: '用户管理', roles: ['other'] } + }, + { + path: 'role', + component: () => import('@/views/system/role.vue'), + name: 'role', + meta: { title: '角色管理', roles: ['other'] } + }, + { + path: 'menu', + component: () => import('@/views/system/menu.vue'), + name: 'menu', + meta: { title: '菜单管理', roles: ['other'] } + }, + ] +} + +export default systemRouter diff --git a/src/views/home/index.vue b/src/views/home/index.vue index f93530d..55f16f1 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -19,6 +19,7 @@
性别:男
现住址:中国-浙江-杭州
邮箱:1135957121@qq.com
+
微信:19550102670(欢迎加)
技术栈:JavaScript、HTML、CSS、Vue、Node、React
diff --git a/src/views/system/data/user.ts b/src/views/system/data/user.ts new file mode 100644 index 0000000..78f5e88 --- /dev/null +++ b/src/views/system/data/user.ts @@ -0,0 +1,237 @@ +export const userData =[ + { + username:'zzb', + nickname:'林峰', + sex:1, + role:'超级管理员', + status:true, + }, + { + username:'zhangsan', + nickname:'张三', + sex:0, + role:'管理员', + status:true, + }, + { + username:'lisi', + nickname:'李四', + sex:1, + role:'管理员', + status:true, + }, + { + username:'wangwu', + nickname:'王五', + sex:0, + role:'超级管理员', + status:false, + }, + { + username:'zhaoliu', + nickname:'赵柳', + sex:0, + role:'普通用户', + status:false, + }, + +] + + +export const roleData =[ + { + roleName:'超级管理员', + roleId:'admin', + createTime:'2022-09-02', + }, + { + roleName:'管理员', + roleId:'role', + createTime:'2022-09-02', + }, + { + roleName:'普通用户', + roleId:'other', + createTime:'2022-09-02', + }, + +] + + +export const menuData =[ + { + menuName:'首页', + menuType:'菜单', + menuRouter:'/home', + identification:'menu:home', + parentId:0, + level:1, + id:0, + createTime:'2022-09-02', + }, + { + menuName:'表格', + menuType:'目录', + menuRouter:'/table', + identification:'menu:table', + parentId:0, + level:1, + id:1, + createTime:'2022-09-02', + children:[ + { + menuName:'菜单1', + menuType:'菜单', + menuRouter:'/table', + identification:'menu1:view', + parentId:1, + level:2, + id:10, + createTime:'2022-09-02', + children:[ + { + menuName:'按钮1', + menuType:'按钮', + menuRouter:'/table', + identification:'menu1:view:btn1', + parentId:10, + id:20, + level:3, + createTime:'2022-09-02', + }, + { + menuName:'按钮2', + menuType:'按钮', + menuRouter:'/table', + identification:'menu1:view:btn2', + parentId:10, + id:21, + level:3, + createTime:'2022-09-02', + }, + { + menuName:'按钮3', + menuType:'按钮', + menuRouter:'/table', + identification:'menu1:view:btn2', + parentId:10, + id:22, + level:3, + createTime:'2022-09-02', + } + ] + } + ] + }, + + { + menuName:'可视化图表', + menuType:'目录', + menuRouter:'/charts', + identification:'menu:charts', + parentId:0, + level:1, + id:1, + createTime:'2022-09-02', + children:[ + { + menuName:'菜单1', + menuType:'菜单', + menuRouter:'/charts', + identification:'menu1:view', + parentId:1, + level:2, + id:10, + createTime:'2022-09-02', + children:[ + { + menuName:'按钮1', + menuType:'按钮', + menuRouter:'/charts', + identification:'menu1:view:btn1', + parentId:10, + id:20, + level:3, + createTime:'2022-09-02', + }, + { + menuName:'按钮2', + menuType:'按钮', + menuRouter:'/charts', + identification:'menu1:view:btn2', + parentId:10, + id:21, + level:3, + createTime:'2022-09-02', + }, + { + menuName:'按钮3', + menuType:'按钮', + menuRouter:'/charts', + identification:'menu1:view:btn2', + parentId:10, + id:22, + level:3, + createTime:'2022-09-02', + } + ] + } + ] + }, + { + menuName:'基础组件', + menuType:'目录', + menuRouter:'/components', + identification:'menu:components', + parentId:0, + level:1, + id:1, + createTime:'2022-09-02', + children:[ + { + menuName:'菜单1', + menuType:'菜单', + menuRouter:'/components', + identification:'menu1:view', + parentId:1, + level:2, + id:10, + createTime:'2022-09-02', + children:[ + { + menuName:'按钮1', + menuType:'按钮', + menuRouter:'/components', + identification:'menu1:view:btn1', + parentId:10, + id:20, + level:3, + createTime:'2022-09-02', + }, + { + menuName:'按钮2', + menuType:'按钮', + menuRouter:'/components', + identification:'menu1:view:btn2', + parentId:10, + id:21, + level:3, + createTime:'2022-09-02', + }, + { + menuName:'按钮3', + menuType:'按钮', + menuRouter:'/components', + identification:'menu1:view:btn2', + parentId:10, + id:22, + level:3, + createTime:'2022-09-02', + } + ] + } + ] + }, +] + + diff --git a/src/views/system/menu.vue b/src/views/system/menu.vue new file mode 100644 index 0000000..fa135c8 --- /dev/null +++ b/src/views/system/menu.vue @@ -0,0 +1,202 @@ + + + + + + diff --git a/src/views/system/role.vue b/src/views/system/role.vue new file mode 100644 index 0000000..f680d7d --- /dev/null +++ b/src/views/system/role.vue @@ -0,0 +1,197 @@ + + + + + + diff --git a/src/views/system/user.vue b/src/views/system/user.vue new file mode 100644 index 0000000..e338205 --- /dev/null +++ b/src/views/system/user.vue @@ -0,0 +1,204 @@ + + + + + + diff --git a/vite.config.ts b/vite.config.ts index 6277a84..139743e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -58,4 +58,14 @@ export default defineConfig({ https: false, proxy: {}, }, + // 生产环境打包配置 + //去除 console debugger + // build: { + // terserOptions: { + // compress: { + // drop_console: true, + // drop_debugger: true, + // }, + // }, + // }, })