123
This commit is contained in:
1 parent
225a268e32
commit
b49b6f8ec2
45 files changed
+11407
-13
No files matched your search
@@ -0,0 +1,191 @@
|
||||
import request from '@/utils/request';
|
||||
import {
|
||||
XljkEvaluationVO,
|
||||
XljkEvaluationForm,
|
||||
XljkEvaluationQuery,
|
||||
XljkEvaluationDetailVO,
|
||||
XljkEvaluationDetailForm,
|
||||
XljkEvaluationDetailQuery,
|
||||
CollegeOption,
|
||||
MajorOption,
|
||||
ClassOption,
|
||||
StudentInfo
|
||||
} from './types';
|
||||
|
||||
// 查询心理健康测评列表
|
||||
export const listEvaluation = (query: XljkEvaluationQuery) => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询心理健康测评详细信息
|
||||
export const getEvaluation = (id: string | number) => {
|
||||
return request({
|
||||
url: `/xljk/evaluation/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 新增心理健康测评
|
||||
export const addEvaluation = (data: XljkEvaluationForm) => {
|
||||
// 确保必填字段都有值,避免数据库插入错误
|
||||
if (data.departmentName && !data.departmentId) {
|
||||
data.departmentId = 0; // 使用临时ID,后端会根据名称处理
|
||||
}
|
||||
|
||||
if (data.majorName && !data.majorId) {
|
||||
data.majorId = 0; // 使用临时ID,后端会根据名称处理
|
||||
}
|
||||
|
||||
if (data.className && !data.classId) {
|
||||
data.classId = 0; // 使用临时ID,后端会根据名称处理
|
||||
}
|
||||
|
||||
return request({
|
||||
url: '/xljk/evaluation',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 修改心理健康测评
|
||||
export const updateEvaluation = (data: XljkEvaluationForm) => {
|
||||
return request({
|
||||
url: '/xljk/evaluation',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 删除心理健康测评
|
||||
export const delEvaluation = (ids: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: `/xljk/evaluation/${typeof ids === 'object' ? ids.join(',') : ids}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取院系选项
|
||||
export const getDepartmentOptions = () => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/options/department',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取院系选项(新接口)
|
||||
export const getCollegeOptions = () => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/options/colleges',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取专业选项
|
||||
export const getMajorOptions = (collegeName?: string) => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/options/majors',
|
||||
method: 'get',
|
||||
params: { collegeName }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取班级选项
|
||||
export const getClassOptions = (collegeName?: string, majorName?: string) => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/options/classes',
|
||||
method: 'get',
|
||||
params: { collegeName, majorName }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取班级学生列表
|
||||
export const getStudentsByClass = (collegeName?: string, majorName?: string, className?: string) => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/students',
|
||||
method: 'get',
|
||||
params: { collegeName, majorName, className }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取学期选项
|
||||
export const getSemesterOptions = () => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/options/semester',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 发布测评
|
||||
export const publishEvaluation = (id: string | number) => {
|
||||
return request({
|
||||
url: `/xljk/evaluation/${id}/publish`,
|
||||
method: 'put'
|
||||
});
|
||||
};
|
||||
|
||||
// 完成测评
|
||||
export const completeEvaluation = (id: string | number) => {
|
||||
return request({
|
||||
url: `/xljk/evaluation/${id}/complete`,
|
||||
method: 'put'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取测评统计数据
|
||||
export const getEvaluationStatistics = (id: string | number) => {
|
||||
return request({
|
||||
url: `/xljk/evaluation/${id}/statistics`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取重点关注学生统计
|
||||
export const getFocusStudentsStatistics = (query: XljkEvaluationQuery) => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/statistics/focus',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询测评明细列表
|
||||
export const listEvaluationDetail = (query: XljkEvaluationDetailQuery) => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/detail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 获取测评明细列表
|
||||
export const getEvaluationDetailsByEvaluationId = (evaluationId: string | number) => {
|
||||
return request({
|
||||
url: `/xljk/evaluation/detail/evaluation/${evaluationId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 批量新增测评明细
|
||||
export const batchAddEvaluationDetails = (data: XljkEvaluationDetailForm[]) => {
|
||||
return request({
|
||||
url: '/xljk/evaluation/detail/batch',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 批量更新学生心理状态
|
||||
export const batchUpdateMentalStatus = (data: XljkEvaluationDetailForm[]) => {
|
||||
// 确保数据中的ID字段保持原有格式,不做Number转换
|
||||
console.log('批量更新数据 - 第一条记录evaluationId:', data[0]?.evaluationId);
|
||||
|
||||
return request({
|
||||
url: '/xljk/evaluation/detail/batch/mentalStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,513 @@
|
||||
export interface XljkEvaluationVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 院系ID
|
||||
*/
|
||||
departmentId: number;
|
||||
|
||||
/**
|
||||
* 院系名称
|
||||
*/
|
||||
departmentName: string;
|
||||
|
||||
/**
|
||||
* 测评名称
|
||||
*/
|
||||
evaluationName: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId: number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId: number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 学期
|
||||
*/
|
||||
semester: string;
|
||||
|
||||
/**
|
||||
* 状态(0-草稿,1-已发布,2-已完成)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 创建者ID(班主任ID)
|
||||
*/
|
||||
createBy: number;
|
||||
|
||||
/**
|
||||
* 创建者姓名
|
||||
*/
|
||||
createName: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
updateBy: number;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 学生总数
|
||||
*/
|
||||
studentCount?: number;
|
||||
|
||||
/**
|
||||
* 重点关注学生数
|
||||
*/
|
||||
focusCount?: number;
|
||||
}
|
||||
|
||||
export interface XljkEvaluationForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 院系ID
|
||||
*/
|
||||
departmentId?: number;
|
||||
|
||||
/**
|
||||
* 院系名称
|
||||
*/
|
||||
departmentName?: string;
|
||||
|
||||
/**
|
||||
* 测评名称
|
||||
*/
|
||||
evaluationName?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 学期
|
||||
*/
|
||||
semester?: string;
|
||||
|
||||
/**
|
||||
* 状态(0-草稿,1-已发布,2-已完成)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 创建者姓名
|
||||
*/
|
||||
createName?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface XljkEvaluationQuery extends PageQuery {
|
||||
/**
|
||||
* 院系ID
|
||||
*/
|
||||
departmentId?: number;
|
||||
|
||||
/**
|
||||
* 院系名称
|
||||
*/
|
||||
departmentName?: string;
|
||||
|
||||
/**
|
||||
* 测评名称
|
||||
*/
|
||||
evaluationName?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 学期
|
||||
*/
|
||||
semester?: string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface XljkEvaluationDetailVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 测评表ID
|
||||
*/
|
||||
evaluationId: number;
|
||||
|
||||
/**
|
||||
* 测评名称
|
||||
*/
|
||||
evaluationName?: string;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId: number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男,F-女)
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
birthDate: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 心理状态(1-健康,2-良好,3-重点关注)
|
||||
*/
|
||||
mentalStatus: string;
|
||||
|
||||
/**
|
||||
* 分数
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
createBy: number;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
updateBy: number;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学期
|
||||
*/
|
||||
semester?: string;
|
||||
}
|
||||
|
||||
export interface XljkEvaluationDetailForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 测评表ID
|
||||
*/
|
||||
evaluationId?: string | number; // 支持字符串类型的ID
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId?: number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男,F-女)
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
birthDate?: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 心理状态(1-健康,2-良好,3-重点关注)
|
||||
*/
|
||||
mentalStatus?: string;
|
||||
|
||||
/**
|
||||
* 分数
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface XljkEvaluationDetailQuery extends PageQuery {
|
||||
/**
|
||||
* 测评表ID
|
||||
*/
|
||||
evaluationId?: number;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId?: number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 心理状态
|
||||
*/
|
||||
mentalStatus?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
export interface StudentInfo {
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
studentId: number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男,F-女)
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
birthDate: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 心理状态(1-健康,2-良好,3-重点关注)
|
||||
*/
|
||||
mentalStatus?: string;
|
||||
|
||||
/**
|
||||
* 分数,当心理状态为"重点关注"时需要填写
|
||||
*/
|
||||
score?: number;
|
||||
|
||||
/**
|
||||
* 测评明细ID,已有测评数据时存在
|
||||
*/
|
||||
detailId?: number;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface CollegeOption {
|
||||
/**
|
||||
* 院系名称
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface MajorOption {
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ClassOption {
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface SemesterOption {
|
||||
/**
|
||||
* 学期值
|
||||
*/
|
||||
value: string;
|
||||
|
||||
/**
|
||||
* 学期名称
|
||||
*/
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface EvaluationStatistics {
|
||||
/**
|
||||
* 学生总数
|
||||
*/
|
||||
totalStudents: number;
|
||||
|
||||
/**
|
||||
* 健康学生数
|
||||
*/
|
||||
healthyCount: number;
|
||||
|
||||
/**
|
||||
* 良好学生数
|
||||
*/
|
||||
goodCount: number;
|
||||
|
||||
/**
|
||||
* 重点关注学生数
|
||||
*/
|
||||
focusCount: number;
|
||||
|
||||
/**
|
||||
* 健康学生百分比
|
||||
*/
|
||||
healthyPercent: number;
|
||||
|
||||
/**
|
||||
* 良好学生百分比
|
||||
*/
|
||||
goodPercent: number;
|
||||
|
||||
/**
|
||||
* 重点关注学生百分比
|
||||
*/
|
||||
focusPercent: number;
|
||||
}
|
||||
Reference in new issue
Block a user