diff --git a/app/components.d.ts b/app/components.d.ts index 0af365e..9a41fe1 100644 --- a/app/components.d.ts +++ b/app/components.d.ts @@ -49,6 +49,7 @@ declare module 'vue' { ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTag: typeof import('element-plus/es')['ElTag'] ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] + ElTree: typeof import('element-plus/es')['ElTree'] ElUpload: typeof import('element-plus/es')['ElUpload'] ExportExcelCom: typeof import('./src/components/excel/ExportExcelCom.vue')['default'] ImportExcelCom: typeof import('./src/components/excel/ImportExcelCom.vue')['default'] diff --git a/app/src/db/asideData.js b/app/src/db/asideData.js new file mode 100644 index 0000000..6602628 --- /dev/null +++ b/app/src/db/asideData.js @@ -0,0 +1,106 @@ +export const asideData = [ + { + id: 1, + index: '/home', + icon: 'icon iconfont icon-shujutongji', + name: '数据统计', + pid: 0 + }, + { + id: 2, + index: '/user-manage', + icon: 'icon iconfont icon-yonghuguanli', + name: '用户管理', + pid: 0 + }, + { + id: 3, + index: '/employee-manage', + icon: 'icon iconfont icon-shenfenzhongxin-xinxiguanlizhigongxinxiguanli', + name: '职工管理', + pid: 0 + }, + { + id: 4, + index: '/reward-manage', + icon: 'icon iconfont icon-gerenjixiao', + name: '绩效管理', + pid: 0 + }, + { + id: 5, + index: '/feedback', + icon: 'icon iconfont icon-fankui', + name: '员工反馈与投诉管理', + pid: 0, + children: [ + { + id: 6, + index: '/feedback/manage', + name: '投诉管理', + pid: 5 + }, + { + id: 7, + index: '/feedback/view', + name: '员工反馈', + pid: 5 + } + ] + }, + { + id: 8, + index: '/request', + icon: 'icon iconfont icon-qingjiashenqing', + name: '请假管理', + pid: 0, + children: [ + { + id: 9, + index: '/request/manage', + name: '请假信息管理', + pid: 8 + }, + { + id: 10, + index: '/request/view', + name: '个人请假信息', + pid: 8 + } + ] + }, + { + id: 11, + index: '/person', + icon: 'icon iconfont icon-gerenxinxiguanli', + name: '个人信息管理', + pid: 0, + children: [ + { + id: 12, + index: '/person/password', + name: '修改密码', + pid: 11 + }, + { + id: 13, + index: '/person/avatar', + name: '修改个人信息', + pid: 11 + } + ] + } +] +export function generateNested(nodes, parentId = 0) { + const result = [] + for (const node of nodes) { + if (node.pid === parentId) { + const children = generateNested(nodes, node.id) + if (children.length) { + node.children = children + } + result.push(node) + } + } + return result +} \ No newline at end of file diff --git a/app/src/db/routerData.js b/app/src/db/routerData.js new file mode 100644 index 0000000..e69de29 diff --git a/app/src/stores/modules/user.js b/app/src/stores/modules/user.js index 75835de..7f89a65 100644 --- a/app/src/stores/modules/user.js +++ b/app/src/stores/modules/user.js @@ -2,7 +2,7 @@ * @Author: BINGWU * @Date: 2024-02-15 14:18:43 * @LastEditors: BINGWU HuJiaCheng2003@163.com - * @LastEditTime: 2024-05-14 00:23:33 + * @LastEditTime: 2024-05-14 23:55:39 * @FilePath: \employee-information-management-system\app\src\stores\modules\user.js * @Describe: * @Mark: ૮(˶ᵔ ᵕ ᵔ˶)ა @@ -287,219 +287,7 @@ const useUserStore = defineStore( const hasPermission = (auth) => { return authArr.value.indexOf(auth) !== -1 } - // 切换用户 - const switchUser = (username) => { - if (username === 'cxk') { - asideData.value = [ - { - index: '/home', - icon: 'icon iconfont icon-home', - name: '首页' - }, - { - index: '/rich-text', - icon: 'icon iconfont icon-fuwenben2', - name: '富文本编辑器' - }, - { - index: '/excel', - icon: 'icon iconfont icon-excel', - name: 'excel(导出/导入)' - }, - { - index: '/file', - icon: 'icon iconfont icon-wenjian', - name: '文件上传' - }, - { - index: '/permission', - icon: 'icon iconfont icon-quanxian', - name: '按钮权限管理' - }, - { - index: '/international', - icon: 'icon iconfont icon-yuyan1', - name: '国际化' - } - ] - routerData.value = [ - { - path: 'home', - name: 'home', - meta: { - // 路由组件的路径 - url: '../views/HomeView.vue' - } - }, - { - path: 'international', - name: 'international', - - meta: { - name: '国际化', - url: '../views/InternationalView.vue' - } - }, - - { - path: 'excel', - name: 'excel', - - meta: { - name: 'excel', - url: '../views/ExcelView.vue' - } - }, - { - path: 'file', - name: 'file', - - meta: { - name: 'file', - url: '../views/FileView.vue' - } - }, - - { - path: 'rich-text', - name: 'rich-text', - meta: { - name: 'rich-text', - url: '../views/RichTextView.vue' - } - }, - { - path: 'permission', - name: 'permission', - - meta: { - name: 'permission', - url: '../views/PermissionView.vue' - } - }, - { - path: 'home', - name: 'home', - meta: { - // 路由组件的路径 - url: '../views/HomeView.vue' - } - } - ] - authArr.value = ['a', 'b'] - } else { - asideData.value = [ - { - index: '/permission', - icon: 'icon iconfont icon-quanxian', - name: '按钮权限管理' - }, - // 二级 - { - index: '/table', - icon: 'icon iconfont icon-biaoge', - name: '表格', - children: [ - { - index: '/table/main-table1', - name: '表格1' - }, - { - index: '/table/main-table2', - name: '表格2' - } - ] - }, - // 二级 - { - index: '/error', - icon: 'icon iconfont icon-cuowu', - name: '错误页面', - children: [ - { - index: '/error/not-find1', - name: '错误页面1' - }, - { - index: '/error/not-find2', - name: '错误页面2' - }, - { - index: '/error/not-find3', - name: '错误页面3' - } - ] - }, - // 三级 - { - index: '/menu', - icon: 'icon iconfont icon-caidan', - name: '多级菜单', - children: [ - { - index: '/menu/menu-1-1', - name: '菜单1-1' - }, - { - index: '/menu/menu-1-2', - name: '菜单1-2' - }, - { - index: '/menu/menu-1-3', - name: '菜单1-3', - sons: [ - { - index: '/menu/menu-1-1/menu-1-3-1', - name: '菜单1-3-1' - }, - { - index: '/menu/menu-1-1/menu-1-3-2', - name: '菜单1-3-2' - } - ] - } - ] - } - ] - routerData.value = [ - { - path: 'permission', - name: 'permission', - meta: { - name: 'permission', - url: '../views/PermissionView.vue' - } - }, - { - path: 'table/main-table1', - name: 'main-table', - meta: { - name: '表格1', - url: '../views/table/MainTableView.vue' - } - }, - // 三级路由 - { - path: 'menu/menu-1-1', - name: 'child-menu', - meta: { - name: '菜单1-1', - url: '../views/FatherMenu/FatherMenuView.vue' - } - }, - { - path: '/menu/menu-1-1/menu-1-3-1', - name: 'father-menu', - meta: { - name: '菜单1-3-1', - url: '../views/FatherMenu/ChildMenu/ChildMenuView.vue' - } - } - ] - authArr.value = ['c', 'd'] - } - } return { authArr, hasPermission, @@ -507,8 +295,7 @@ const useUserStore = defineStore( routerData, setToken, token, - asideData, - switchUser + asideData } }, { diff --git a/app/src/views/InternationalView.vue b/app/src/views/InternationalView.vue deleted file mode 100644 index 2f9d9b3..0000000 --- a/app/src/views/InternationalView.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/app/src/views/UserManageView.vue b/app/src/views/UserManageView.vue index 9444cc8..72e0941 100644 --- a/app/src/views/UserManageView.vue +++ b/app/src/views/UserManageView.vue @@ -13,11 +13,13 @@
+ diff --git a/app/src/views/components/form/UserFormCom.vue b/app/src/views/components/form/UserFormCom.vue new file mode 100644 index 0000000..90cbb47 --- /dev/null +++ b/app/src/views/components/form/UserFormCom.vue @@ -0,0 +1,70 @@ + + + + +