This commit is contained in:
李旭明 committed 2025-08-23 10:00:14 +08:00
1 parent 0db0a99c85
commit 8dc6aab1a6
31 files changed
+4859

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TeacherVO, TeacherQuery, DeptTreeNode } from './types';
import { TableDataInfo } from '@/api/types';
/**
* 查询教师信息列表
*/
export function listTeacher(query: TeacherQuery): AxiosPromise<TableDataInfo<TeacherVO>> {
return request({
url: '/system/teacher/list',
method: 'get',
params: query
});
}
/**
* 获取教师详细信息
*/
export function getTeacher(userId: string | number): AxiosPromise<TeacherVO> {
return request({
url: '/system/teacher/' + userId,
method: 'get'
});
}
/**
* 根据姓名搜索教师
*/
export function searchTeacherByName(name: string, limit = 10): AxiosPromise<TeacherVO[]> {
return request({
url: '/system/teacher/search',
method: 'get',
params: { name, limit }
});
}
/**
* 获取部门树形结构
*/
export function getDeptTreeData(): AxiosPromise<DeptTreeNode[]> {
return request({
url: '/system/teacher/deptTree',
method: 'get'
});
}
/**
* 根据部门ID获取教师列表
*/
export function getTeachersByDeptId(deptId: string | number): AxiosPromise<TeacherVO[]> {
return request({
url: '/system/teacher/dept/' + deptId,
method: 'get'
});
}
+111
View File
@@ -0,0 +1,111 @@
import { PageQuery } from '@/api/types';
/**
* 教师信息视图对象
*/
export interface TeacherVO {
/**
* 用户ID
*/
userId: string | number;
/**
* 用户账号
*/
userName: string;
/**
* 用户昵称(教师姓名)
*/
nickName: string;
/**
* 手机号码
*/
phonenumber: string;
/**
* 用户邮箱
*/
email: string;
/**
* 部门ID
*/
deptId: string | number;
/**
* 部门名称
*/
deptName: string;
/**
* 用户性别
*/
sex: string;
/**
* 帐号状态
*/
status: string;
/**
* 创建时间
*/
createTime: string;
}
/**
* 教师查询对象
*/
export interface TeacherQuery extends PageQuery {
/**
* 用户昵称(教师姓名)
*/
nickName?: string;
/**
* 用户账号
*/
userName?: string;
/**
* 手机号码
*/
phonenumber?: string;
/**
* 部门ID
*/
deptId?: string | number;
/**
* 帐号状态
*/
status?: string;
}
/**
* 部门树形节点
*/
export interface DeptTreeNode {
/**
* 部门ID
*/
id: string | number;
/**
* 部门名称
*/
label: string;
/**
* 子部门
*/
children?: DeptTreeNode[];
/**
* 教师数量
*/
teacherCount?: number;
}
+56
View File
@@ -0,0 +1,56 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StudentVO, StudentQuery, StudentTreeNode } from './types';
import { TableDataInfo } from '@/api/types';
/**
* 查询学生信息列表
*/
export function listStudent(query: StudentQuery): AxiosPromise<TableDataInfo<StudentVO>> {
return request({
url: '/xg/student/list',
method: 'get',
params: query
});
}
/**
* 获取学生详细信息
*/
export function getStudent(id: string | number): AxiosPromise<StudentVO> {
return request({
url: '/xg/student/' + id,
method: 'get'
});
}
/**
* 根据姓名搜索学生
*/
export function searchStudentByName(name: string, limit = 10): AxiosPromise<StudentVO[]> {
return request({
url: '/xg/student/search',
method: 'get',
params: { name, limit }
});
}
/**
* 获取学院专业班级树形结构
*/
export function getStudentTreeData(): AxiosPromise<StudentTreeNode[]> {
return request({
url: '/xg/student/tree',
method: 'get'
});
}
/**
* 根据班级ID获取学生列表
*/
export function getStudentsByClassId(classId: string | number): AxiosPromise<StudentVO[]> {
return request({
url: '/xg/student/class/' + classId,
method: 'get'
});
}
+146
View File
@@ -0,0 +1,146 @@
import { PageQuery } from '@/api/types';
/**
* 学生信息视图对象
*/
export interface StudentVO {
/**
* 主键ID
*/
id: string | number;
/**
* 学号
*/
studentNo: string;
/**
* 姓名
*/
name: string;
/**
* 性别
*/
gender: string;
/**
* 手机号码
*/
phone: string;
/**
* 院系ID
*/
collegeId: string;
/**
* 院系名称
*/
collegeName: string;
/**
* 专业ID
*/
majorId: string;
/**
* 专业名称
*/
majorName: string;
/**
* 班级ID
*/
classId: string;
/**
* 班级名称
*/
className: string;
/**
* 年级
*/
grade: string;
/**
* 学籍状态
*/
studentStatus: string;
/**
* 入学年份
*/
enrollmentYear: number;
}
/**
* 学生查询对象
*/
export interface StudentQuery extends PageQuery {
/**
* 姓名
*/
name?: string;
/**
* 学号
*/
studentNo?: string;
/**
* 院系ID
*/
collegeId?: string;
/**
* 专业ID
*/
majorId?: string;
/**
* 班级ID
*/
classId?: string;
/**
* 年级
*/
grade?: string;
/**
* 学籍状态
*/
studentStatus?: string;
}
/**
* 学院专业班级树形节点
*/
export interface StudentTreeNode {
/**
* 节点ID
*/
id: string | number;
/**
* 节点名称
*/
label: string;
/**
* 节点类型: college-学院, major-专业, class-班级
*/
type: 'college' | 'major' | 'class';
/**
* 子节点
*/
children?: StudentTreeNode[];
/**
* 学生数量(仅班级节点有)
*/
studentCount?: number;
}