Compare commits
No commits in common. 'master' and 'stu_login' have entirely different histories.
|
Before Width: | Height: | Size: 24 KiB |
@ -1,52 +0,0 @@
|
||||
package com.example.controller;
|
||||
|
||||
import com.example.common.Result;
|
||||
import com.example.entity.Course;
|
||||
import com.example.service.CourseService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/course")
|
||||
public class CourseController {
|
||||
|
||||
@Resource
|
||||
private CourseService courseService;
|
||||
/**
|
||||
* 分页条件查询课程
|
||||
*/
|
||||
@GetMapping("/selectPage")
|
||||
public Result selectPage(@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "5") Integer pageSize,
|
||||
Course course){
|
||||
PageInfo<Course> pageInfo = courseService.selectPage(pageNum, pageSize,course);
|
||||
return Result.success(pageInfo);
|
||||
}
|
||||
/**
|
||||
* 新增课程
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public Result add(@RequestBody Course course){
|
||||
courseService.add(course);
|
||||
return Result.success();
|
||||
}
|
||||
/**
|
||||
* 更新课程
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public Result update(@RequestBody Course course){
|
||||
courseService.updateById(course);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程
|
||||
*/
|
||||
@DeleteMapping("/delete/{id}")
|
||||
public Result delete(@PathVariable Integer id){
|
||||
courseService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@ -1,60 +0,0 @@
|
||||
package com.example.controller;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import com.example.common.Result;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/files")
|
||||
//上传
|
||||
public class FileController {
|
||||
|
||||
@Value("${ip}")
|
||||
private String ip;
|
||||
|
||||
@Value("${server.port}")
|
||||
private String port;
|
||||
|
||||
private static final String ROOT_PATH =System.getProperty("user.dir")+"/files";
|
||||
|
||||
@PostMapping("/upload")
|
||||
public Result upload(MultipartFile file) throws IOException {
|
||||
String originalFilename=file.getOriginalFilename();//文件名
|
||||
long flag=System.currentTimeMillis();
|
||||
String fileName=flag+"_"+originalFilename;
|
||||
|
||||
File finalFile = new File(ROOT_PATH + "/" + fileName);
|
||||
if (!finalFile.getParentFile().exists()){
|
||||
finalFile.getParentFile().mkdirs();
|
||||
}
|
||||
file.transferTo(finalFile);
|
||||
//返回url
|
||||
|
||||
String url ="http://" + ip +":" + port +"/files/download?fileName=" + fileName;
|
||||
|
||||
|
||||
return Result.success(url);
|
||||
}
|
||||
@GetMapping("/download")
|
||||
public void download(String fileName, HttpServletResponse response) throws IOException {
|
||||
File file = new File(ROOT_PATH + "/" + fileName); // 文件在存盘存储的对象
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
||||
response.setContentType("application/octet-stream");
|
||||
// os.write(FileUtil.readBytes(file));
|
||||
FileUtil.writeToStream(file, os);
|
||||
os.flush();
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
package com.example.controller;
|
||||
|
||||
import com.example.common.Result;
|
||||
import com.example.entity.Grade;
|
||||
import com.example.service.GradeService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 成绩接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/grade")
|
||||
public class GradeController {
|
||||
|
||||
@Resource
|
||||
GradeService gradeService;
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
public Result add(@RequestBody Grade grade) {
|
||||
gradeService.add(grade);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
public Result update(@RequestBody Grade grade) {
|
||||
gradeService.update(grade);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成绩
|
||||
*/
|
||||
@DeleteMapping("/delete/{id}")
|
||||
public Result delete(@PathVariable Integer id) {
|
||||
gradeService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页条件查询课程
|
||||
*/
|
||||
@GetMapping("/selectPage")
|
||||
public Result selectPage(@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "5") Integer pageSize,
|
||||
Grade grade) { // ?name=xx&no=xx
|
||||
PageInfo<Grade> pageInfo = gradeService.selectPage(pageNum, pageSize, grade);
|
||||
return Result.success(pageInfo);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,43 +1,4 @@
|
||||
package com.example.controller;
|
||||
|
||||
import com.example.common.Result;
|
||||
import com.example.entity.Student;
|
||||
import com.example.service.StudentService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/student")
|
||||
public class StudentController {
|
||||
|
||||
@Resource
|
||||
StudentService studentService;
|
||||
|
||||
@PostMapping("/add")
|
||||
public Result add(@RequestBody Student student) {
|
||||
studentService.add(student);
|
||||
return Result.success();
|
||||
}
|
||||
@DeleteMapping("/delete/{id}")
|
||||
public Result delete(@PathVariable Integer id) {
|
||||
studentService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PutMapping ("/update")
|
||||
public Result update(@RequestBody Student student) {
|
||||
studentService.updateById(student);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping ("/selectPage")
|
||||
public Result selectPage(@RequestParam(defaultValue = "1")Integer pageNum,
|
||||
@RequestParam(defaultValue = "10")Integer pageSize,
|
||||
Student student) {
|
||||
PageInfo<Student>pageInfo = studentService.selectPage(pageNum,pageSize,student);
|
||||
return Result.success(pageInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
package com.example.controller;
|
||||
|
||||
import com.example.common.Result;
|
||||
import com.example.entity.Course;
|
||||
import com.example.entity.StudentCourse;
|
||||
import com.example.service.StudentCourseService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/studentCourse")
|
||||
public class StudentCourseController {
|
||||
|
||||
@Resource
|
||||
StudentCourseService studentCourseService;
|
||||
|
||||
/**
|
||||
* 学生选课
|
||||
*/
|
||||
|
||||
@PostMapping("/add")
|
||||
public Result add(@RequestBody StudentCourse studentCourse) {
|
||||
|
||||
studentCourseService.add(studentCourse);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除选课
|
||||
*/
|
||||
@DeleteMapping("/delete/{id}")
|
||||
public Result delete(@PathVariable Integer id){
|
||||
studentCourseService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页条件查询课程
|
||||
*/
|
||||
@GetMapping("/selectPage")
|
||||
public Result selectPage(@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "5") Integer pageSize,
|
||||
StudentCourse studentCourse){
|
||||
PageInfo<StudentCourse> pageInfo = studentCourseService.selectPage(pageNum, pageSize,studentCourse);
|
||||
return Result.success(pageInfo);
|
||||
}
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
package com.example.entity;
|
||||
|
||||
public class Course {
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String no;
|
||||
private String descr;
|
||||
private String times;
|
||||
private String teacher;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
public void setNo(String no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public String getDescr() {
|
||||
return descr;
|
||||
}
|
||||
|
||||
public void setDescr(String descr) {
|
||||
this.descr = descr;
|
||||
}
|
||||
|
||||
public String getTimes() {
|
||||
return times;
|
||||
}
|
||||
|
||||
public void setTimes(String times) {
|
||||
this.times = times;
|
||||
}
|
||||
|
||||
public String getTeacher() {
|
||||
return teacher;
|
||||
}
|
||||
|
||||
public void setTeacher(String teacher) {
|
||||
this.teacher = teacher;
|
||||
}
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
package com.example.entity;
|
||||
|
||||
public class Grade {
|
||||
|
||||
private Integer id;
|
||||
private Integer courseId;
|
||||
private Integer studentId;
|
||||
private Double score;
|
||||
private String comment;
|
||||
private String feedback;
|
||||
private String studentName;
|
||||
private String courseName;
|
||||
|
||||
public String getStudentName() {
|
||||
return studentName;
|
||||
}
|
||||
|
||||
public void setStudentName(String studentName) {
|
||||
this.studentName = studentName;
|
||||
}
|
||||
|
||||
public String getCourseName() {
|
||||
return courseName;
|
||||
}
|
||||
|
||||
public void setCourseName(String courseName) {
|
||||
this.courseName = courseName;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getCourseId() {
|
||||
return courseId;
|
||||
}
|
||||
|
||||
public void setCourseId(Integer courseId) {
|
||||
this.courseId = courseId;
|
||||
}
|
||||
|
||||
public Integer getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(Integer studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
public Double getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setScore(Double score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getFeedback() {
|
||||
return feedback;
|
||||
}
|
||||
|
||||
public void setFeedback(String feedback) {
|
||||
this.feedback = feedback;
|
||||
}
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
package com.example.entity;
|
||||
|
||||
public class StudentCourse {
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String no;
|
||||
private Integer studentId;
|
||||
private Integer courseId;
|
||||
private String studentName;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
public void setNo(String no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public Integer getStudentId() {
|
||||
return studentId;
|
||||
}
|
||||
|
||||
public void setStudentId(Integer studentId) {
|
||||
this.studentId = studentId;
|
||||
}
|
||||
|
||||
public Integer getCourseId() {
|
||||
return courseId;
|
||||
}
|
||||
|
||||
public void setCourseId(Integer courseId) {
|
||||
this.courseId = courseId;
|
||||
}
|
||||
|
||||
public String getStudentName() {
|
||||
return studentName;
|
||||
}
|
||||
|
||||
public void setStudentName(String studentName) {
|
||||
this.studentName = studentName;
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.example.mapper;
|
||||
|
||||
import com.example.entity.Course;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseMapper {
|
||||
@Select("select * from course where name like concat('%',#{name},'%') and no like concat('%',#{no},'%') and teacher like concat('%',#{teacher},'%') order by id desc")
|
||||
List<Course> selectAll(Course course);
|
||||
@Insert("insert into course (name, no, descr, times, teacher) values(#{name},#{no},#{descr},#{times},#{teacher})")
|
||||
void insert(Course course);
|
||||
@Update("update course set name=#{name},no=#{no},descr=#{descr},times=#{times},teacher=#{teacher} where id=#{id}")
|
||||
void updateById(Course course);
|
||||
|
||||
@Delete("delete from course where id=#{id}")
|
||||
void deleteById(Integer id);
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
package com.example.mapper;
|
||||
|
||||
import com.example.entity.Grade;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface GradeMapper {
|
||||
|
||||
@Insert("insert into grade (course_id, student_id, score, comment, feedback) " +
|
||||
"values (#{courseId}, #{studentId}, #{score}, #{comment}, #{feedback})")
|
||||
void insert(Grade grade);
|
||||
|
||||
List<Grade> selectAll(Grade grade); // 关联查询
|
||||
|
||||
@Update("update grade set score = #{score}, comment = #{comment}, feedback = #{ feedback } where id = #{id}")
|
||||
void update(Grade grade);
|
||||
|
||||
@Select("select * from grade where student_id = #{studentId} and course_id = #{courseId}")
|
||||
Grade selectByCondition(Grade grade);
|
||||
|
||||
@Delete("delete from grade where id = #{id}")
|
||||
void deleteById(Integer id);
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.example.mapper;
|
||||
|
||||
import com.example.entity.StudentCourse;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StudentCourseMapper {
|
||||
|
||||
@Insert("insert into student_course (name,no,student_id,course_id) values (#{name},#{no},#{studentId},#{courseId})")
|
||||
void insert(StudentCourse studentCourse);
|
||||
|
||||
@Select("select * from student_course where student_id = #{studentId} and course_id = #{courseId}")
|
||||
StudentCourse selectByCondition(StudentCourse studentCourse);
|
||||
|
||||
// @Select("select * from student_course where name like concat('%',#{name},'%') and no like concat('%',#{no},'%') and student_id=#{studentId}")
|
||||
List<StudentCourse> selectAll(StudentCourse studentCourse);
|
||||
|
||||
@Delete("delete from student_course where id=#{id}")
|
||||
void deleteById(Integer id);
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
package com.example.service;
|
||||
|
||||
import com.example.entity.Course;
|
||||
import com.example.mapper.CourseMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CourseService {
|
||||
@Resource
|
||||
private CourseMapper courseMapper;
|
||||
|
||||
|
||||
//total是查询总数 list是数据列表
|
||||
public PageInfo<Course> selectPage(Integer pageNum, Integer pageSize,Course course){
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<Course> coursesList = courseMapper.selectAll(course);
|
||||
return PageInfo.of(coursesList);
|
||||
}
|
||||
//新增数据
|
||||
public void add(Course course) {
|
||||
courseMapper.insert(course);
|
||||
}
|
||||
|
||||
public void updateById(Course course) {
|
||||
courseMapper.updateById(course);
|
||||
}
|
||||
|
||||
public void deleteById(Integer id) {
|
||||
courseMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package com.example.service;
|
||||
|
||||
import com.example.entity.Grade;
|
||||
import com.example.exception.CustomException;
|
||||
import com.example.mapper.GradeMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class GradeService {
|
||||
|
||||
@Resource
|
||||
GradeMapper gradeMapper;
|
||||
|
||||
public void add(Grade grade) {
|
||||
Grade dbGrade = gradeMapper.selectByCondition(grade);
|
||||
if (dbGrade != null) { // 打过分了
|
||||
throw new CustomException("您已打过分了");
|
||||
}
|
||||
gradeMapper.insert(grade);
|
||||
}
|
||||
|
||||
public PageInfo<Grade> selectPage(Integer pageNum, Integer pageSize, Grade grade) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<Grade> list = gradeMapper.selectAll(grade);
|
||||
return PageInfo.of(list);
|
||||
}
|
||||
|
||||
public void update(Grade grade) {
|
||||
gradeMapper.update(grade);
|
||||
}
|
||||
|
||||
public void deleteById(Integer id) {
|
||||
gradeMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.example.service;
|
||||
|
||||
|
||||
import com.example.entity.StudentCourse;
|
||||
import com.example.exception.CustomException;
|
||||
import com.example.mapper.StudentCourseMapper;
|
||||
import com.example.mapper.StudentMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class StudentCourseService {
|
||||
|
||||
@Resource
|
||||
StudentCourseMapper studentCourseMapper;
|
||||
|
||||
public void add(StudentCourse studentCourse) {
|
||||
StudentCourse course = studentCourseMapper.selectByCondition(studentCourse);//通过学生Id和课程ID筛选看这个学生是否选过这门课
|
||||
if (course != null) {
|
||||
throw new CustomException("您已选过这门课程");
|
||||
}
|
||||
studentCourseMapper.insert(studentCourse);
|
||||
}
|
||||
|
||||
public PageInfo<StudentCourse> selectPage(Integer pageNum, Integer pageSize,StudentCourse studentCourse) {
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<StudentCourse> list = studentCourseMapper.selectAll(studentCourse);
|
||||
return PageInfo.of(list);
|
||||
}
|
||||
|
||||
public void deleteById(Integer id) {
|
||||
studentCourseMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.example.mapper.GradeMapper">
|
||||
|
||||
<select id="selectAll" resultType="com.example.entity.Grade">
|
||||
select grade.*, student.name as studentName, course.name as courseName
|
||||
from grade
|
||||
left join student
|
||||
on grade.student_id = student.id
|
||||
left join course
|
||||
on grade.course_id = course.id
|
||||
<where>
|
||||
<if test="studentName != null">and student.name like concat('%', #{studentName}, '%')</if>
|
||||
<if test="courseName != null">and course.name like concat('%', #{courseName}, '%')</if>
|
||||
<if test="studentId != null">and grade.student_id = #{studentId}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.example.mapper.StudentCourseMapper">
|
||||
|
||||
<select id="selectAll" resultType="com.example.entity.StudentCourse">
|
||||
select student_course.*,student.name as studentName from student_course
|
||||
left join student
|
||||
on student_course.student_id = student.id
|
||||
<where>
|
||||
<if test="name != null"> and student_course.name like concat('%',#{name},'%') </if>
|
||||
<if test="no != null">and student_course.no like concat('%',#{no},'%')</if>
|
||||
<if test="studentId!= null">and student_course.student_id = #{studentId}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,130 +0,0 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : localhost_3306
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50737
|
||||
Source Host : localhost:3306
|
||||
Source Schema : student
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50737
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 26/11/2023 16:31:45
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for admin
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `admin`;
|
||||
CREATE TABLE `admin` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '账号',
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '密码',
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '名称',
|
||||
`role` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '角色',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '管理员' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of admin
|
||||
-- ----------------------------
|
||||
INSERT INTO `admin` VALUES (1, 'admin', 'admin', '管理员', 'ADMIN');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for course
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `course`;
|
||||
CREATE TABLE `course` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '课程名称',
|
||||
`no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '课程编号',
|
||||
`descr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '课程描述',
|
||||
`times` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '课时',
|
||||
`teacher` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任课老师',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '课程信息' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of course
|
||||
-- ----------------------------
|
||||
INSERT INTO `course` VALUES (1, '大学英语', 'CS10012313', '大学英语真好玩', '24节', '张三三');
|
||||
INSERT INTO `course` VALUES (2, '大学物理', 'CS12332131', '大学物理真枯燥', '24节', '李思思');
|
||||
INSERT INTO `course` VALUES (5, '线性代数', 'CS10012325', '线性代数真好学', '20节', '王二二');
|
||||
INSERT INTO `course` VALUES (6, '李思思', NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `course` VALUES (7, '2', '2', '2', '2', '2');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for grade
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `grade`;
|
||||
CREATE TABLE `grade` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`course_id` int(11) NULL DEFAULT NULL COMMENT '课程ID',
|
||||
`student_id` int(11) NULL DEFAULT NULL COMMENT '学生ID',
|
||||
`score` double(10, 1) NULL DEFAULT NULL COMMENT '分数',
|
||||
`comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '评语',
|
||||
`feedback` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '学生反馈',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '成绩' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of grade
|
||||
-- ----------------------------
|
||||
INSERT INTO `grade` VALUES (1, 1, 8, 90.0, '非常nice 哈哈哈\n\n我现在更新数据', '老师非常用心,我很喜欢青哥哥的课程 哈哈哈');
|
||||
INSERT INTO `grade` VALUES (3, 2, 1, 60.0, '继续加油', '');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for student
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `student`;
|
||||
CREATE TABLE `student` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '学号',
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '密码',
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '名称',
|
||||
`phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '手机号',
|
||||
`email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '邮箱',
|
||||
`sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '性别',
|
||||
`birth` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '生日',
|
||||
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '头像',
|
||||
`role` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '角色',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '学生信息' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of student
|
||||
-- ----------------------------
|
||||
INSERT INTO `student` VALUES (1, '20191001', '123', '小白白', '13788997788', 'xbb@xm.com', '男', '2000-10-01', 'http://localhost:9090/files/download?fileName=1700576780918_QQ截图20230330090301.png', 'STUDENT');
|
||||
INSERT INTO `student` VALUES (2, '20191002', '123', '20191002', NULL, NULL, NULL, NULL, NULL, 'STUDENT');
|
||||
INSERT INTO `student` VALUES (3, '20191003', '123', '20191003', NULL, NULL, NULL, NULL, NULL, 'STUDENT');
|
||||
INSERT INTO `student` VALUES (4, '20191004', '123', '20191004', NULL, NULL, NULL, NULL, NULL, 'STUDENT');
|
||||
INSERT INTO `student` VALUES (5, '20191005', '123', '20191005', NULL, NULL, NULL, NULL, NULL, 'STUDENT');
|
||||
INSERT INTO `student` VALUES (6, '20191006', '123', '20191006', NULL, NULL, NULL, NULL, NULL, 'STUDENT');
|
||||
INSERT INTO `student` VALUES (7, '20191007', '123', '20191007', NULL, NULL, NULL, NULL, NULL, 'STUDENT');
|
||||
INSERT INTO `student` VALUES (8, '20191010', '123', '李思思', '13988998899', 'lss@xm.com', '女', '2001-11-01', 'http://localhost:9090/files/download?fileName=1700575670771_QQ图片20230301222231.gif', 'STUDENT');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for student_course
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `student_course`;
|
||||
CREATE TABLE `student_course` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '课程名称',
|
||||
`no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '课程编号',
|
||||
`student_id` int(11) NULL DEFAULT NULL COMMENT '学生ID',
|
||||
`course_id` int(11) NULL DEFAULT NULL COMMENT '课程ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '学生选课' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of student_course
|
||||
-- ----------------------------
|
||||
INSERT INTO `student_course` VALUES (4, '大学物理', 'CS12332131', 1, 2);
|
||||
INSERT INTO `student_course` VALUES (5, '大学英语', 'CS10012313', 8, 1);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/checkbox/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/checkbox.scss";
|
||||
//# sourceMappingURL=chunk-22246I36.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/input/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/input.scss";
|
||||
//# sourceMappingURL=chunk-5JKEUEZW.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/option/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/option.scss";
|
||||
//# sourceMappingURL=chunk-6L6I4RPD.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/base/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/base.scss";
|
||||
//# sourceMappingURL=chunk-772POZ6I.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/checkbox/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/checkbox.scss";
|
||||
//# sourceMappingURL=chunk-AJCL53Z6.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/popper/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/popper.scss";
|
||||
//# sourceMappingURL=chunk-CI3L27KN.js.map
|
||||
@ -1,6 +0,0 @@
|
||||
// node_modules/element-plus/es/components/option-group/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/option-group.scss";
|
||||
|
||||
// node_modules/element-plus/es/components/select/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/select.scss";
|
||||
//# sourceMappingURL=chunk-DJEZ4JTC.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/input/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/input.scss";
|
||||
//# sourceMappingURL=chunk-DS4Y6AOL.js.map
|
||||
@ -0,0 +1,6 @@
|
||||
// node_modules/element-plus/es/components/option-group/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/option-group.scss";
|
||||
|
||||
// node_modules/element-plus/es/components/select/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/select.scss";
|
||||
//# sourceMappingURL=chunk-EDNPP7CY.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/base/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/base.scss";
|
||||
//# sourceMappingURL=chunk-FGVA5UI6.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/button/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/button.scss";
|
||||
//# sourceMappingURL=chunk-GKVWLPNN.js.map
|
||||
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/button/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/button.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/option/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/option.scss";
|
||||
//# sourceMappingURL=chunk-GWFAMI2R.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/tag/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/tag.scss";
|
||||
//# sourceMappingURL=chunk-IEXUXUIS.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/tooltip/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/tooltip.scss";
|
||||
//# sourceMappingURL=chunk-KZYH6XRM.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/overlay/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/overlay.scss";
|
||||
//# sourceMappingURL=chunk-LLX57AWP.js.map
|
||||
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/overlay/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/overlay.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/tooltip/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/tooltip.scss";
|
||||
//# sourceMappingURL=chunk-MNGJP5CX.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/scrollbar/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/scrollbar.scss";
|
||||
//# sourceMappingURL=chunk-NHX6JBU6.js.map
|
||||
@ -1,3 +0,0 @@
|
||||
// node_modules/element-plus/es/components/tag/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/tag.scss";
|
||||
//# sourceMappingURL=chunk-PPVUTFQ4.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/popper/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/popper.scss";
|
||||
//# sourceMappingURL=chunk-UFP42AXV.js.map
|
||||
@ -0,0 +1,3 @@
|
||||
// node_modules/element-plus/es/components/scrollbar/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/scrollbar.scss";
|
||||
//# sourceMappingURL=chunk-YF6ER62I.js.map
|
||||
@ -1,2 +1,2 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
//# sourceMappingURL=element-plus_es_components_base_style_index.js.map
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import "./chunk-GKVWLPNN.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/button/style/index.mjs
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/button.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_button_style_index.js.map
|
||||
|
||||
6
vue/node_modules/.vite/deps/element-plus_es_components_button_style_index.js.map
generated
vendored
6
vue/node_modules/.vite/deps/element-plus_es_components_button_style_index.js.map
generated
vendored
@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"sources": ["../../element-plus/es/components/button/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/button.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
|
||||
9
vue/node_modules/.vite/deps/element-plus_es_components_date-picker_style_index.js
generated
vendored
9
vue/node_modules/.vite/deps/element-plus_es_components_date-picker_style_index.js
generated
vendored
@ -1,9 +0,0 @@
|
||||
import "./chunk-GKVWLPNN.js";
|
||||
import "./chunk-DS4Y6AOL.js";
|
||||
import "./chunk-NHX6JBU6.js";
|
||||
import "./chunk-CI3L27KN.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
|
||||
// node_modules/element-plus/es/components/date-picker/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/date-picker.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_date-picker_style_index.js.map
|
||||
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/date-picker/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/date-picker.scss';\r\nimport '../../input/style/index.mjs';\r\nimport '../../scrollbar/style/index.mjs';\r\nimport '../../popper/style/index.mjs';\r\nimport '../../button/style/index.mjs';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;;;;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
import "./chunk-LLX57AWP.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
|
||||
// node_modules/element-plus/es/components/dialog/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/dialog.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_dialog_style_index.js.map
|
||||
7
vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js.map
generated
vendored
7
vue/node_modules/.vite/deps/element-plus_es_components_dialog_style_index.js.map
generated
vendored
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/dialog/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/dialog.scss';\r\nimport '../../overlay/style/index.mjs';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
4
vue/node_modules/.vite/deps/element-plus_es_components_form-item_style_index.js
generated
vendored
4
vue/node_modules/.vite/deps/element-plus_es_components_form-item_style_index.js
generated
vendored
@ -1,5 +1,5 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/form-item/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/form-item.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/form-item.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_form-item_style_index.js.map
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/form/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/form.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/form.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_form_style_index.js.map
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/icon/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/icon.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/icon.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_icon_style_index.js.map
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
|
||||
// node_modules/element-plus/es/components/image/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/image.scss";
|
||||
|
||||
// node_modules/element-plus/es/components/image-viewer/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/image-viewer.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_image_style_index.js.map
|
||||
7
vue/node_modules/.vite/deps/element-plus_es_components_image_style_index.js.map
generated
vendored
7
vue/node_modules/.vite/deps/element-plus_es_components_image_style_index.js.map
generated
vendored
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/image/style/index.mjs", "../../element-plus/es/components/image-viewer/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/image.scss';\r\nimport '../../image-viewer/style/index.mjs';\r\n//# sourceMappingURL=index.mjs.map\r\n", "import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/image-viewer.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;AACA,OAAO;;;ACAP,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
@ -1,3 +1,3 @@
|
||||
import "./chunk-DS4Y6AOL.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-5JKEUEZW.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
//# sourceMappingURL=element-plus_es_components_input_style_index.js.map
|
||||
|
||||
4
vue/node_modules/.vite/deps/element-plus_es_components_menu-item_style_index.js
generated
vendored
4
vue/node_modules/.vite/deps/element-plus_es_components_menu-item_style_index.js
generated
vendored
@ -1,5 +1,5 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/menu-item/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/menu-item.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/menu-item.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_menu-item_style_index.js.map
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import "./chunk-MNGJP5CX.js";
|
||||
import "./chunk-CI3L27KN.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-KZYH6XRM.js";
|
||||
import "./chunk-UFP42AXV.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/menu/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/menu.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/menu.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_menu_style_index.js.map
|
||||
|
||||
8
vue/node_modules/.vite/deps/element-plus_es_components_message-box_style_index.js
generated
vendored
8
vue/node_modules/.vite/deps/element-plus_es_components_message-box_style_index.js
generated
vendored
@ -1,8 +0,0 @@
|
||||
import "./chunk-LLX57AWP.js";
|
||||
import "./chunk-GKVWLPNN.js";
|
||||
import "./chunk-DS4Y6AOL.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
|
||||
// node_modules/element-plus/es/components/message-box/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/message-box.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_message-box_style_index.js.map
|
||||
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/message-box/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/message-box.scss';\r\nimport '../../button/style/index.mjs';\r\nimport '../../input/style/index.mjs';\r\nimport '../../overlay/style/index.mjs';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;;;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/badge/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/badge.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/badge.scss";
|
||||
|
||||
// node_modules/element-plus/es/components/message/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/message.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/message.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_message_style_index.js.map
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
import "./chunk-GWFAMI2R.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-6L6I4RPD.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
//# sourceMappingURL=element-plus_es_components_option_style_index.js.map
|
||||
|
||||
16
vue/node_modules/.vite/deps/element-plus_es_components_pagination_style_index.js
generated
vendored
16
vue/node_modules/.vite/deps/element-plus_es_components_pagination_style_index.js
generated
vendored
@ -1,11 +1,11 @@
|
||||
import "./chunk-DJEZ4JTC.js";
|
||||
import "./chunk-PPVUTFQ4.js";
|
||||
import "./chunk-GWFAMI2R.js";
|
||||
import "./chunk-DS4Y6AOL.js";
|
||||
import "./chunk-NHX6JBU6.js";
|
||||
import "./chunk-CI3L27KN.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-EDNPP7CY.js";
|
||||
import "./chunk-5JKEUEZW.js";
|
||||
import "./chunk-YF6ER62I.js";
|
||||
import "./chunk-IEXUXUIS.js";
|
||||
import "./chunk-6L6I4RPD.js";
|
||||
import "./chunk-UFP42AXV.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/pagination/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/pagination.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/pagination.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_pagination_style_index.js.map
|
||||
|
||||
5
vue/node_modules/.vite/deps/element-plus_es_components_radio-group_style_index.js
generated
vendored
5
vue/node_modules/.vite/deps/element-plus_es_components_radio-group_style_index.js
generated
vendored
@ -1,5 +0,0 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
|
||||
// node_modules/element-plus/es/components/radio-group/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/radio-group.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_radio-group_style_index.js.map
|
||||
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/radio-group/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/radio-group.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
@ -1,5 +0,0 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
|
||||
// node_modules/element-plus/es/components/radio/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/radio.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_radio_style_index.js.map
|
||||
7
vue/node_modules/.vite/deps/element-plus_es_components_radio_style_index.js.map
generated
vendored
7
vue/node_modules/.vite/deps/element-plus_es_components_radio_style_index.js.map
generated
vendored
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/radio/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/radio.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;AACA,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
import "./chunk-DJEZ4JTC.js";
|
||||
import "./chunk-PPVUTFQ4.js";
|
||||
import "./chunk-GWFAMI2R.js";
|
||||
import "./chunk-DS4Y6AOL.js";
|
||||
import "./chunk-NHX6JBU6.js";
|
||||
import "./chunk-CI3L27KN.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-EDNPP7CY.js";
|
||||
import "./chunk-5JKEUEZW.js";
|
||||
import "./chunk-YF6ER62I.js";
|
||||
import "./chunk-IEXUXUIS.js";
|
||||
import "./chunk-6L6I4RPD.js";
|
||||
import "./chunk-UFP42AXV.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
//# sourceMappingURL=element-plus_es_components_select_style_index.js.map
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/sub-menu/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/sub-menu.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/sub-menu.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_sub-menu_style_index.js.map
|
||||
|
||||
8
vue/node_modules/.vite/deps/element-plus_es_components_table-column_style_index.js
generated
vendored
8
vue/node_modules/.vite/deps/element-plus_es_components_table-column_style_index.js
generated
vendored
@ -1,7 +1,7 @@
|
||||
import "./chunk-PPVUTFQ4.js";
|
||||
import "./chunk-AJCL53Z6.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-22246I36.js";
|
||||
import "./chunk-IEXUXUIS.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/table-column/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/table-column.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/table-column.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_table-column_style_index.js.map
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import "./chunk-AJCL53Z6.js";
|
||||
import "./chunk-MNGJP5CX.js";
|
||||
import "./chunk-NHX6JBU6.js";
|
||||
import "./chunk-CI3L27KN.js";
|
||||
import "./chunk-772POZ6I.js";
|
||||
import "./chunk-22246I36.js";
|
||||
import "./chunk-YF6ER62I.js";
|
||||
import "./chunk-KZYH6XRM.js";
|
||||
import "./chunk-UFP42AXV.js";
|
||||
import "./chunk-FGVA5UI6.js";
|
||||
|
||||
// node_modules/element-plus/es/components/table/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/table.scss";
|
||||
import "D:/learning/大二下/信息系统实践/student_system/vue/node_modules/element-plus/theme-chalk/src/table.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_table_style_index.js.map
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
import "./chunk-772POZ6I.js";
|
||||
|
||||
// node_modules/element-plus/es/components/upload/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/upload.scss";
|
||||
|
||||
// node_modules/element-plus/es/components/progress/style/index.mjs
|
||||
import "D:/虚拟C盘/CODE/GIt/vue/node_modules/element-plus/theme-chalk/src/progress.scss";
|
||||
//# sourceMappingURL=element-plus_es_components_upload_style_index.js.map
|
||||
7
vue/node_modules/.vite/deps/element-plus_es_components_upload_style_index.js.map
generated
vendored
7
vue/node_modules/.vite/deps/element-plus_es_components_upload_style_index.js.map
generated
vendored
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../element-plus/es/components/upload/style/index.mjs", "../../element-plus/es/components/progress/style/index.mjs"],
|
||||
"sourcesContent": ["import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/upload.scss';\r\nimport '../../progress/style/index.mjs';\r\n//# sourceMappingURL=index.mjs.map\r\n", "import '../../base/style/index.mjs';\r\nimport 'element-plus/theme-chalk/src/progress.scss';\r\n//# sourceMappingURL=index.mjs.map\r\n"],
|
||||
"mappings": ";;;AACA,OAAO;;;ACAP,OAAO;",
|
||||
"names": []
|
||||
}
|
||||
@ -1,148 +1,40 @@
|
||||
<template>
|
||||
<div class="card" style="margin-bottom: 10px">
|
||||
<el-input v-model="data.name" style="width: 240px;margin-right:10px" placeholder="请输入课程名称查询" :prefix-icon="Search"/>
|
||||
<el-input v-model="data.no" style="width: 240px;margin-right: 10px" placeholder="请输入课程编号查询" :prefix-icon="Search"/>
|
||||
<el-input v-model="data.teacher" style="width: 240px" placeholder="请输入任课老师查询" :prefix-icon="Search"/>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="load">查 询</el-button>
|
||||
<el-button type="info" @click="reset">重 置</el-button>
|
||||
<el-input v-model="data.name" style="width: 240px" placeholder="请输入课程名称查询" :prefix-icon="Search"/>
|
||||
<el-button type="primary" style="margin-left: 10px">查 询</el-button>
|
||||
<el-button type="info" >重 置</el-button>
|
||||
</div>
|
||||
<div class="card" style="margin-bottom: 10px">
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-button type="primary" @click="handleAdd">新 增</el-button>
|
||||
<el-button type="primary" >新 增</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table :data="data.tableData" style="width: 100%">
|
||||
<el-table-column prop="id" label="序号" width="70" />
|
||||
<el-table-column prop="name" label="课程名称" />
|
||||
<el-table-column prop="no" label="课程编号" />
|
||||
<el-table-column prop="id" label="序号" width="180" />
|
||||
<el-table-column prop="name" label="课程名称" width="180" />
|
||||
<el-table-column prop="no" label="课程编号" width="180" />
|
||||
<el-table-column prop="descr" label="课程描述" />
|
||||
<el-table-column prop="times" label="课时" />
|
||||
<el-table-column prop="teacher" label="任课老师" />
|
||||
<el-table-column label="操作" width="180">
|
||||
<el-table-column>
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" plain @click="handleEdit(scope.row)">编 辑</el-button>
|
||||
<el-button type="danger" size="small" plain @click="del(scope.row.id)">删 除</el-button>
|
||||
<el-button type="primary" size="small" plain>编 辑</el-button>
|
||||
<el-button type="danger" size="small" plain>删 除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<el-pagination v-model:current-page="data.pageNum" v-model:page-size="data.pageSize"
|
||||
@current-change = "handleCurrentChange"
|
||||
background layout="prev, pager, next" :total="data.total" />
|
||||
<el-pagination background layout="prev, pager, next" :total="1000" />
|
||||
</div>
|
||||
|
||||
<el-dialog width="35%" v-model="data.formVisible" title="课程信息" >
|
||||
<el-form :model="data.form" label-width="100px" label-position="right" style="padding-right:40px">
|
||||
<el-form-item label="课程名称" >
|
||||
<el-input v-model="data.form.name" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程编号" >
|
||||
<el-input v-model="data.form.no" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程描述" >
|
||||
<el-input v-model="data.form.descr" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课时" >
|
||||
<el-input v-model="data.form.times" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任课老师" >
|
||||
<el-input v-model="data.form.teacher" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="data.formVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="save">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {reactive} from "vue";
|
||||
import {Search} from "@element-plus/icons-vue";
|
||||
import request from "@/utils/request";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
|
||||
const data = reactive({
|
||||
name:'',
|
||||
no:'',
|
||||
teacher:'',
|
||||
tableData:[],
|
||||
total:0,
|
||||
pageSize:5,//每页的个数
|
||||
pageNum: 1, //当前的页码
|
||||
formVisible:false,
|
||||
form:{}
|
||||
tableData:[]
|
||||
})
|
||||
const load =()=>{
|
||||
request.get('course/selectPage',{
|
||||
params:{
|
||||
pageNum:data.pageNum,
|
||||
pageSize:data.pageSize,
|
||||
name:data.name,
|
||||
no:data.no,
|
||||
teacher:data.teacher
|
||||
}
|
||||
}).then((res)=>{
|
||||
data.tableData =res.data?.list || []
|
||||
data.total=res.data?.total || 0
|
||||
})
|
||||
}
|
||||
//调用方法获取数据
|
||||
load()
|
||||
|
||||
|
||||
const handleCurrentChange = (pageNum)=>{
|
||||
//翻页的时候重新加载数据即可
|
||||
load()
|
||||
}
|
||||
const reset =()=>{
|
||||
data.name = ''
|
||||
data.no = ''
|
||||
data.teacher = ''
|
||||
load()
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
data.form = {}
|
||||
data.formVisible = true
|
||||
}
|
||||
|
||||
|
||||
//保存数据到后台
|
||||
const save=()=>{
|
||||
request.request({
|
||||
url:data.form.id?'/course/update':'/course/add',
|
||||
method:data.form.id?'PUT':'POST',
|
||||
data:data.form
|
||||
}).then(res => {
|
||||
if(res.code === '200'){
|
||||
load()//重新获取数据
|
||||
data.formVisible=false;
|
||||
ElMessage.success("操作成功")
|
||||
}else{
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleEdit=(row)=>{
|
||||
data.form=JSON.parse(JSON.stringify(row))
|
||||
data.formVisible=true
|
||||
}
|
||||
|
||||
const del = (id)=>{
|
||||
ElMessageBox.confirm('删除数据数据后无法恢复','确认删除吗',{type:'warning'}).then(() => {
|
||||
request.delete('course/delete/' + id).then((res)=>{
|
||||
if(res.code === '200'){
|
||||
load()//重新获取数据
|
||||
ElMessage.success("操作成功")
|
||||
}else{
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(res=>{})
|
||||
}
|
||||
</script>
|
||||
@ -1,90 +0,0 @@
|
||||
<template>
|
||||
<div class="card" style="margin-bottom: 10px">
|
||||
<el-input v-model="data.name" style="width: 240px;margin-right:10px" placeholder="请输入课程名称查询" :prefix-icon="Search"/>
|
||||
<el-input v-model="data.no" style="width: 240px;margin-right: 10px" placeholder="请输入课程编号查询" :prefix-icon="Search"/>
|
||||
<el-input v-model="data.teacher" style="width: 240px" placeholder="请输入任课老师查询" :prefix-icon="Search"/>
|
||||
<el-button type="primary" style="margin-left: 10px" @click="load">查 询</el-button>
|
||||
<el-button type="info" @click="reset">重 置</el-button>
|
||||
</div>
|
||||
<div class="card" style="margin-bottom: 10px">
|
||||
|
||||
<div>
|
||||
<el-table :data="data.tableData" style="width: 100%">
|
||||
<el-table-column prop="id" label="序号" width="70" />
|
||||
<el-table-column prop="name" label="课程名称" />
|
||||
<el-table-column prop="no" label="课程编号" />
|
||||
<el-table-column prop="descr" label="课程描述" />
|
||||
<el-table-column prop="times" label="课时" />
|
||||
<el-table-column prop="teacher" label="任课老师" />
|
||||
<el-table-column label="操作" width="180">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" @click="selectCourse(scope.row)">选课</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<el-pagination v-model:current-page="data.pageNum" v-model:page-size="data.pageSize"
|
||||
@current-change = "handleCurrentChange"
|
||||
background layout="prev, pager, next" :total="data.total" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {reactive} from "vue";
|
||||
import {Search} from "@element-plus/icons-vue";
|
||||
import request from "@/utils/request";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
|
||||
const data = reactive({
|
||||
name:'',
|
||||
no:'',
|
||||
teacher:'',
|
||||
tableData:[],
|
||||
total:0,
|
||||
pageSize:5,//每页的个数
|
||||
pageNum: 1, //当前的页码
|
||||
student:JSON.parse(localStorage.getItem('student-user') || '{}')
|
||||
})
|
||||
const load =()=>{
|
||||
request.get('course/selectPage',{
|
||||
params:{
|
||||
pageNum:data.pageNum,
|
||||
pageSize:data.pageSize,
|
||||
name:data.name,
|
||||
no:data.no,
|
||||
teacher:data.teacher
|
||||
}
|
||||
}).then((res)=>{
|
||||
data.tableData =res.data?.list || []
|
||||
data.total=res.data?.total || 0
|
||||
})
|
||||
}
|
||||
//调用方法获取数据
|
||||
load()
|
||||
|
||||
|
||||
const handleCurrentChange = (pageNum)=>{
|
||||
//翻页的时候重新加载数据即可
|
||||
load()
|
||||
}
|
||||
const reset =()=>{
|
||||
data.name = ''
|
||||
data.no = ''
|
||||
data.teacher = ''
|
||||
load()
|
||||
}
|
||||
|
||||
const selectCourse = (row) => {
|
||||
request.post('/studentCourse/add',{studentId: data.student.id, name:row.name,no:row.no,courseId:row.id}).then(res => {
|
||||
if(res.code === '200'){
|
||||
ElMessage.success("操作成功")
|
||||
}else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue