diff --git a/src/router/router.js b/src/router/router.js index 77992d0..1a6952e 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -24,68 +24,114 @@ import AbsentRegister from "../views/AbsentRegister.vue"; // 创建路由实例 const routes = [ - { + { + path: '/systemAdmin', + name: '系统管理员', + component: SystemAdmin, + redirect: '/dormitoryAdminAdd', + children:[ + { + path: '/dormitoryAdminManager', + name: '宿管管理', + component: DormitoryAdminManager + }, + { + path: '/dormitoryAdminAdd', + name: '添加宿舍', + component: DormitoryAdminAdd + }/* , + { + path: '/dormitoryAdminUpdate', + name: '修改宿舍', + component: DormitoryAdminUpdate + }, + { + path: '/studentAdd', + name: '添加学生', + component: StudentAdd + }, + { + path: '/studentManager', + name: '学生管理', + component: StudentManager + }, + { + path: '/studentUpdate', + name: '修改学生', + component: StudentUpdate + }, + { + path: '/buildingAdd', + name: '添加楼宇', + component: BuildingAdd + }, + { + path: '/buildingManager', + name: '楼宇管理', + component: BuildingManager + }, + { + path: '/buildingUpdate', + name: '修改楼宇', + component: BuildingUpdate + }, + { + path: '/dormitoryAdd', + name: '添加宿舍', + component: DormitoryAdd + }, + { + path: '/dormitoryManager', + name: '宿舍管理', + component: DormitoryManager + }, + { + path: '/dormitoryUpdate', + name: '修改宿舍', + component: DormitoryUpdate + }, + { + path: '/moveoutRegister', + name: '迁出登记', + component: MoveoutRegister + }, + { + path: '/moveoutRecord', + name: '迁出记录', + component: MoveRecord + }, + { + path: '/absentRecord', + name: '缺寝记录', + component: AbsentRecord + }*/ + ] + }, + /* { path: '/dormitoryAdmin', - name: 'DormitoryAdmin', // 通常使用驼峰命名或下划线分隔,避免使用空格和特殊字符 + name: '宿舍管理员', component: DormitoryAdmin, - redirect: '/dormitoryAdmin/absentRegister', // 注意路径的修改,使用相对路径 - children: [ + redirect: '/absentRegister', + children:[ { - path: 'absentRecord2', // 去掉前导斜杠 - name: 'AbsentRecord2', + path: '/absentRecord2', + name: '缺寝记录', component: AbsentRecord }, { - path: 'absentRegister', - name: 'AbsentRegister', + path: '/absentRegister', + name: '缺寝登记', component: AbsentRegister } - ] - }, - { - path: '/systemAdmin', - name: 'SystemAdmin', - component: SystemAdmin, - redirect: '/systemAdmin/dormitoryAdminAdd', // 注意路径的修改,使用相对路径 - children: [ - // 注意:确保路径是唯一的,避免重复,例如 '/dormitoryAdminAdd' 在这里和上面已经作为重定向使用过,需要更改 - { - path: 'dormitoryAdminManager', - name: 'DormitoryAdminManager', - component: DormitoryAdminManager - }, - { - path: 'dormitoryAdminAddNew', // 修改路径以避免冲突 - name: 'AddDormitoryAdmin', // 修改名称以更清晰地表达意图 - component: DormitoryAdminAdd - }, - // ... 其他子路由,确保路径唯一 - { - path: 'moveoutRegister', - name: 'MoveoutRegister', - component: MoveoutRegister - }, - // 注意:'absentRecord' 已经作为 '/dormitoryAdmin' 的子路由存在,不需要再次添加 - // { - // path: '/absentRecord', - // name: 'AbsentRecord', - // component: AbsentRecord - // } - // 其他子路由... - ] - // 注意:由于路径冲突和冗余,我已经注释掉了一些重复的或冲突的路由配置 - }, + ] + }, */ + { path: '/login', - name: 'Login', + name: '登录', component: Login - }, - // 如果需要,可以添加其他顶级路由或重定向 - // { - // path: '/', - // redirect: '/login' // 例如,将根路径重定向到登录页面 - // } -]; + } +] // 创建并导出路由实例 const router = createRouter({ diff --git a/src/views/AbsentRecord.vue b/src/views/AbsentRecord.vue index 3d3fb27..538bf73 100644 --- a/src/views/AbsentRecord.vue +++ b/src/views/AbsentRecord.vue @@ -70,6 +70,7 @@