springboot+vue学生选课管理系统

如果你不相信努力和时光,那么成果就会是第一个选择辜负你的。不要去否定你自己的过去,也不要用你的过去牵扯你现在的努力和对未来的展望。不是因为拥有希望你才去努力,而是去努力了,你才有可能看到希望的光芒。springboot+vue学生选课管理系统,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文

添加链接描述# springboot+vue学生选课管理系统

项目介绍 这是一个采用前后端分离开发的项目,前端采用 Vue 开发、后端采用 SpringBoot + Mybatis 开发。

项目部署

  1. 将 studentms.sql 导入mysql数据库
  2. 运行前端webstorm导入student_client运行
  3. 运行后端idea导入student_server

项目展示

1、登陆界面

[外链图片转存中…(img-aY0cWxEX-1682584196839)]

学生端首页展示

[外链图片转存中…(img-rH9BTdc2-1682584196839)]

选课

[外链图片转存中…(img-yQdC4IOs-1682584196840)]

选好课后可以在查询课表看到:

[外链图片转存中…(img-2e31mHW0-1682584196840)]

教师端菜单

[外链图片转存中…(img-5DugmnaG-1682584196840)]

前端部分

1、项目运行

由于涉及大量的 ES6/7 等新属性,node 需要 6.0 以上版本

2、技术栈

Vuex

Router

Axios

Element ui

sessionStorage

3、项目介绍

采用 vue 2.0 开发,通过调用后端提供的数据接口实现数据的动态渲染。项目默认端口号 8080

使用监视器,得益于 Mybatis 强大的动态 SQL 功能,实现高性能动态搜索功能

使用 router 配置路由,实现不同用户类型导航栏的动态渲染

使用 axios 异步加载后端数据

使用 element ui 实现表单的前端校验功能

使用 sessionStorage 实现登录拦截

分别实现了基于前端和后端的数据分页功能

4、系统功能

1、admin

实现对教师,学生,课程的 CRUD

实现对教师业务以及学生业务的全方位控制

2、teacher

实现查询我开设的课程,以及选择我课程的学生信息

对学生成绩的管理

3、student

实现选课退课的功能

实现成绩查询的功能

后端部分

1、项目运行

JDK 版本需要 1.8或者以上

2、技术栈

Spring boot 2.6.3

Mybatis

Maven

3、项目介绍

采用 Restful 风格开发,采用 CrossOrigin 解决跨域问题。采用注解以及 xml 文件配置 SQL 语句,实现动态 SQL 的功能,为前端提供完备的数据接口。

由于 vue 项目占用了 8080 Tomcat 默认端口,所以指定项目启动在 10086 端口, 可以使用 YAML 文件配置,使用 Maven 项目进行打包。

4、系统功能

实现前端 Ajax 请求的全部数据接口,Get 请求通过 RESTful 风格开发。

数据库设计

[外链图片转存中…(img-vgSLLj6j-1682584196840)]

部分代码

@RestController
@CrossOrigin("*")
@RequestMapping("/course")
public class CourseController {
    @Autowired
    private CourseService courseService;

    @PostMapping("/findBySearch")
    public List<Course> findBySearch(@RequestBody Map<String, String> map) {
        return courseService.findBySearch(map);
    }

    @GetMapping("/findById/{cid}")
    public List<Course> findById(@PathVariable Integer cid) {
        return courseService.findBySearch(cid);
    }

    @PostMapping("/save")
    public boolean save(@RequestBody Course course) {
        System.out.println(course);
        return courseService.insertCourse(course);
    }

    @GetMapping("/deleteById/{cid}")
    public boolean deleteById(@PathVariable Integer cid) {
        System.out.println("正在删除课程 cid: " + cid);
        return courseService.deleteById(cid);
    }

    @PostMapping("/updateCourse")
    public boolean updateCourse(@RequestBody Course course) {
        System.out.println("正在修改课程: " + course);
        return courseService.updateById(course);
    }

}

后台用的mybatis,没用MP,后端端口是10086,前端的axios发请求是写死的后端地址,这一点有优化空间。

<template>
  <div>
    <el-form style="width: 60%" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
      <el-form-item label="课程名" prop="cname">
        <el-input v-model="ruleForm.cname"></el-input>
      </el-form-item>
      <el-form-item label="学分" prop="ccredit">
        <el-input v-model.number="ruleForm.ccredit"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
        <el-button @click="resetForm('ruleForm')">重置</el-button>
        <el-button @click="test">test</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  data() {
    return {
      ruleForm: {
        cname: null,
        ccredit: null
      },
      rules: {
        cname: [
          { required: true, message: '请输入名称', trigger: 'blur' },
        ],
        ccredit: [
          { required: true, message: '请输入学分', trigger: 'change' },
          { type: 'number', message: '请输入数字', trigger: 'blur' },
        ],
      }
    };
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          // 通过前端校验
          const that = this
          // console.log(this.ruleForm)
 
          axios.post("http://localhost:10086/course/save", this.ruleForm).then(function (resp) {
            console.log(resp)
            if (resp.data === true) {
              that.$message({
                showClose: true,
                message: '插入成功',
                type: 'success'
              });
            }
            else {
              that.$message.error('插入失败,请检查数据库t');
            }
            that.$router.push("/queryCourse")
          })
        } else {
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    test() {
      console.log(this.ruleForm)
    }
  }
}
</script>

前端就是比较标准的vue页面。

      return false;
    }
  });
},
resetForm(formName) {
  this.$refs[formName].resetFields();
},
test() {
  console.log(this.ruleForm)
}

}
}


前端就是比较标准的vue页面。

总的来说,是一套比较不错的系统,非常具有学习价值!

https://www.aliyundrive.com/s/g4WXvxbNZCh
i49h

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/196227.html

(0)
飞熊的头像飞熊bm

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!