【新增】学生管理页面新增
This commit is contained in:
58
src/api/exam/student/index.ts
Normal file
58
src/api/exam/student/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 学生 VO
|
||||
export interface StudentVO {
|
||||
id: number // 编号
|
||||
name: string // 名字
|
||||
code: string // 学号
|
||||
status: number // 状态
|
||||
userName: string // 学生用户名
|
||||
passWord: string // 学生密码
|
||||
sex: number // 性别
|
||||
email: string // 电子邮件
|
||||
phone: string // 学生电话
|
||||
description: string // 简介
|
||||
avatar: string // 头像
|
||||
}
|
||||
// 学生班级 VO
|
||||
export interface StudentClassVO {
|
||||
id: number // 班级编号
|
||||
studentClassDOS: any // 学生集合
|
||||
}
|
||||
|
||||
// 学生 API
|
||||
export const StudentApi = {
|
||||
// 查询学生分页
|
||||
getStudentPage: async (params: any) => {
|
||||
return await request.get({ url: `/exam/student/page`, params })
|
||||
},
|
||||
// 获取没有绑定过班级的学生列表
|
||||
getStuList: async () => {
|
||||
return await request.get({ url: `/exam/student/getStuList` })
|
||||
},
|
||||
|
||||
// 查询学生详情
|
||||
getStudent: async (id: number) => {
|
||||
return await request.get({ url: `/exam/student/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增学生
|
||||
createStudent: async (data: StudentVO) => {
|
||||
return await request.post({ url: `/exam/student/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生
|
||||
updateStudent: async (data: StudentVO) => {
|
||||
return await request.put({ url: `/exam/student/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生
|
||||
deleteStudent: async (id: number) => {
|
||||
return await request.delete({ url: `/exam/student/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出学生 Excel
|
||||
exportStudent: async (params) => {
|
||||
return await request.download({ url: `/exam/student/export-excel`, params })
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user