基于Vue+Nodejs实现宿舍管理系统

?
作者主页:

?简介:Java领域优质创作者、CSDN博客专家? Java项目、简历模板、学习资料、面试题库、技术互助

文末获取源码

?

项目编号:BS-QD-002

主要需求:

  • 学生信息录入、修改、删除、查询
  • 宿舍管理评分
  • 学生早起率、懒床率
  • 学生宿舍打扫频率
  • 学生晚归情况
  • 楼层管理

考虑到实用性,该系统需要拆分为两大子系统,一个是学生端系统,一个是后台管理端系统。学生端系统主要提供给学生使用,负责一些宿舍记录及个人信息记录的基本操作;后台管理模块则是主要负责对所有学生信息的整理,提供宿舍管理、楼层管理、数据查看等权限,提供给宿舍管理员使用的。

学生登陆

学生系统拥有以下功能:

  • 创建账户
  • 分配宿舍
  • 填写个人信息
  • 修改个人信息
  • 起床打卡(用于统计懒床率)
  • 归宿登记(用于统计晚归情况)
  • 打扫记录(用于统计宿舍打扫频率)
  • 查看宿日常数据

管理员登陆

管理系统拥有以下功能:

  • 楼层管理
  • 宿舍评价
  • 宿舍信息管理
  • 学生信息查看
  • 保洁人员管理
  • 统计学生早起率
  • 统计学生宿舍打扫频率
  • 统计学生晚归

超级管理员在享有上述管理员同等权限的同时额外拥有如下功能:

  • 创建管理员
  • 创建宿舍楼
  • 为宿舍楼分配管理员
  • 为宿舍楼分配保洁人员

前端:

  • Vue 作为基础框架
  • vue-router 控制路由(hash 模式)
  • vuex 状态管理
  • axios 接入数据
  • Vue-element-admin 作为基础框架

后台(Nodejs):

  • Koa 作为基础框架
  • koa-router —— 服务端路由控制
  • koa-static —— 读取静态文件
  • koa-jwt —— JWT 登录校验
  • koa-body —— http body 数据处理
  • koa-compress —— Gzip 压缩
  • koa-cors —— CORS 解决跨域问题
  • sequelize —— ORM

数据库:

  • MySQL

数据库设计一览:

下面展示一下系统的部分功能:

仪表盘概揽:选择不同的宿舍楼查看相关信息

管理员管理:

宿舍楼管理

楼层管理

宿舍信息

宿舍入住学生信息

查看学生起床记录

查看学生归宿信息

查看学生宿舍打扫信息

查看个人信息

学生注册

注册后登陆系统

入住宿舍

起床打卡

归宿记录

打扫记录

后端工程:

前端工程

部门核心代码:

const { Building } = require("../model")

module.exports = {
  getStudents: async function(buildingId) {
    const FloorController = require("./floor_controller")
    let users = []
    const building = await Building.findOne({ where: { id: buildingId } })
    const floors = await building.getFloors()
    for (let floor of floors) {
      const floorId = floor.id
      users = [...users, ...(await FloorController.getStudents(floorId))]
    }
    return users
  },
  delBuilding: async function(id) {
    const { setStudentRoomNull } = require("./user_controller")
    const students = await this.getStudents(id)
    students.forEach(student => {
      setStudentRoomNull(student.id)
    })
    return await Building.destroy({ where: { id } })
  }
}


const _ = require("lodash")
const { User } = require("../model")

module.exports = {
  async getEvaluatesInfo(evaluates) {
    const cpEvaluates = _.cloneDeep(evaluates)
    for (let evaluate of cpEvaluates) {
      const creator = await evaluate.getUser()
      evaluate.dataValues.userName = creator.name
    }
    return cpEvaluates
  }
}


const { Floor } = require("../model")

module.exports = {
  getStudents: async function(floorId) {
    const { getStudentInfo } = require("./user_controller")
    let users = []
    const floor = await Floor.findOne({ where: { id: floorId } })
    const rooms = await floor.getRooms()
    for (let room of rooms) {
      const roomUsers = await room.getUsers()
      for (let user of roomUsers) {
        users.push(await getStudentInfo(user.id))
      }
    }
    return u
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值