This commit is contained in:
zlwu committed 2025-08-04 13:09:17 +08:00
commit e5029688e5
168 files changed
+26977 -401

No files matched your search

@@ -0,0 +1 @@
+214
View File
@@ -0,0 +1,214 @@
import request from '@/utils/request';
import {
XljkConsultationScheduleVO,
XljkConsultationScheduleForm,
XljkConsultationScheduleQuery,
XljkConsultationAppointmentVO,
XljkConsultationAppointmentForm,
XljkConsultationAppointmentQuery,
AvailableTimeSlot,
TimeSlotDetail,
CounselorOption
} from './types';
// ===== 预约时段管理 API =====
// 查询预约时段列表
export const listSchedule = (query: XljkConsultationScheduleQuery) => {
return request({
url: '/api/xljk/consultation/schedule/list',
method: 'get',
params: query
});
};
// 查询预约时段详细信息
export const getSchedule = (id: string | number) => {
return request({
url: `/api/xljk/consultation/schedule/${id}`,
method: 'get'
});
};
// 新增预约时段
export const addSchedule = (data: any) => {
return request({
url: '/api/xljk/consultation/schedule',
method: 'post',
data: data
});
};
// 修改预约时段
export const updateSchedule = (data: XljkConsultationScheduleForm) => {
return request({
url: '/api/xljk/consultation/schedule',
method: 'put',
data: data
});
};
// 删除预约时段
export const delSchedule = (ids: string | number | Array<string | number>) => {
return request({
url: `/api/xljk/consultation/schedule/${typeof ids === 'object' ? ids.join(',') : ids}`,
method: 'delete'
});
};
// ===== 预约记录管理 API =====
// 查询预约记录列表
export const listAppointment = (query: XljkConsultationAppointmentQuery) => {
return request({
url: '/api/xljk/consultation/appointment/list',
method: 'get',
params: query
});
};
// 查询预约记录详细信息
export const getAppointment = (id: string | number) => {
return request({
url: `/api/xljk/consultation/appointment/${id}`,
method: 'get'
});
};
// 修改预约记录
export const updateAppointment = (data: XljkConsultationAppointmentForm) => {
return request({
url: '/api/xljk/consultation/appointment',
method: 'put',
data: data
});
};
// 删除预约记录
export const delAppointment = (ids: string | number | Array<string | number>) => {
return request({
url: `/api/xljk/consultation/appointment/${typeof ids === 'object' ? ids.join(',') : ids}`,
method: 'delete'
});
};
// 获取可预约时段列表(用于日历视图)
export const getAvailableTimeSlots = (startDate: string, endDate: string) => {
return request({
url: '/api/xljk/consultation/appointment/available-slots',
method: 'get',
params: { startDate, endDate }
});
};
// 获取可用的详细时段列表(30分钟一个时段)
export const getAvailableDetailSlots = (date: string, timeSlot: string) => {
return request({
url: '/api/xljk/consultation/appointment/available-detail-slots',
method: 'get',
params: { date, timeSlot }
});
};
// 学生提交预约
export const submitAppointment = async (data: XljkConsultationAppointmentForm) => {
// 检查是否被限制预约
try {
const { checkLimitation } = await import('./noshow');
if (data.studentId) {
const res = await checkLimitation(data.studentId);
if (res.code === 200 && res.data && res.data.limited) {
return {
code: 400,
msg: `由于您近期多次未按时到访,暂时无法预约咨询服务。限制将于 ${res.data.expireDateStr} 自动解除。如有特殊情况,请联系心理咨询中心。`,
data: null
};
}
}
} catch (error) {
console.error('检查预约限制失败', error);
// 检查失败不阻止预约,继续提交
}
// 提交预约申请
return request({
url: '/api/xljk/consultation/appointment/submit',
method: 'post',
data: data
});
};
// 获取我的预约记录(学生用)
export const getMyAppointments = (studentId: string | number, forceRefresh: boolean = false) => {
let url = `/api/xljk/consultation/appointment/my-appointments/${studentId}`;
// 强制添加时间戳参数,确保绕过浏览器缓存
url += `?_t=${new Date().getTime()}`;
// 如果需要额外强制刷新(如用户手动点击刷新按钮)
if (forceRefresh) {
url += `&force=true`;
}
return request({
url,
method: 'get',
headers: {
// 禁止所有缓存
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': '0'
}
});
};
// 记录咨询结果
export const recordConsultation = (id: string | number, data: any) => {
return request({
url: `/api/xljk/consultation/appointment/record-consultation/${id}`,
method: 'post',
data: data
});
};
// 获取咨询师选项
export const getCounselorOptions = () => {
return request({
url: '/api/xljk/consultation/schedule/options/counselors',
method: 'get'
});
};
// 获取学生信息(通过学号)
export const getStudentByNo = (studentNo: string) => {
return request({
url: `/api/xljk/consultation/student/${studentNo}`,
method: 'get'
});
};
// 获取院系选项
export const getCollegeOptions = () => {
return request({
url: '/api/xljk/consultation/appointment/options/colleges',
method: 'get'
});
};
// 获取专业选项
export const getMajorOptions = (collegeName?: string) => {
return request({
url: '/api/xljk/consultation/appointment/options/majors',
method: 'get',
params: { collegeName }
});
};
// 获取班级选项
export const getClassOptions = (collegeName?: string, majorName?: string) => {
return request({
url: '/api/xljk/consultation/appointment/options/classes',
method: 'get',
params: { collegeName, majorName }
});
};
+60
View File
@@ -0,0 +1,60 @@
import request from '@/utils/request';
import { NoShowQuery, NoShowVO } from './types';
/**
* 查询未到访记录列表
* @param query 查询参数
* @returns 未到访记录列表
*/
export function listNoShow(query: NoShowQuery) {
// 创建一个新的查询对象,避免修改原始对象
const params = { ...query };
// 如果状态是'all',表示"全部",则从参数中移除
if (params.status === 'all') {
delete params.status;
}
return request({
url: '/api/xljk/consultation/no-show/list',
method: 'get',
params
});
}
/**
* 获取未到访记录详情
* @param id 未到访记录ID
* @returns 未到访记录详情
*/
export function getNoShow(id: string | number) {
return request({
url: `/api/xljk/consultation/no-show/${id}`,
method: 'get'
});
}
/**
* 解除预约限制
* @param id 未到访记录ID
* @returns 操作结果
*/
export function releaseNoShowLimitation(id: string | number) {
return request({
url: `/api/xljk/consultation/no-show/${id}/release`,
method: 'put'
});
}
/**
* 检查学生是否被限制预约
* @param studentId 学生ID
* @returns 限制状态
*/
export function checkLimitation(studentId: string | number) {
return request({
url: '/api/xljk/consultation/no-show/check-limitation',
method: 'get',
params: { studentId }
});
}
+604
View File
@@ -0,0 +1,604 @@
export interface XljkConsultationScheduleVO {
/**
* 主键ID
*/
id: string | number;
/**
* 咨询师ID
*/
counselorId: number;
/**
* 咨询师姓名(关联展示字段)
*/
counselorName?: string;
/**
* 排班日期
*/
scheduleDate: string;
/**
* 时段类型(0上午 1下午)
*/
timeSlot: string;
/**
* 开始时间(HH:mm)
*/
startTime: string;
/**
* 结束时间(HH:mm)
*/
endTime: string;
/**
* 状态(0正常 1停用)
*/
status: string;
/**
* 创建者
*/
createBy: number;
/**
* 创建时间
*/
createTime: string;
/**
* 更新者
*/
updateBy: number;
/**
* 更新时间
*/
updateTime: string;
}
export interface XljkConsultationScheduleForm extends BaseEntity {
/**
* 主键ID
*/
id?: string | number;
/**
* 咨询师ID
*/
counselorId?: number;
/**
* 排班日期
*/
scheduleDate?: string;
/**
* 时段类型(0上午 1下午)
*/
timeSlot?: string;
/**
* 开始时间(HH:mm)
*/
startTime?: string;
/**
* 结束时间(HH:mm)
*/
endTime?: string;
/**
* 状态(0正常 1停用)
*/
status?: string;
}
export interface XljkConsultationScheduleQuery extends PageQuery {
/**
* 咨询师ID
*/
counselorId?: number;
/**
* 排班日期开始
*/
beginScheduleDate?: string;
/**
* 排班日期结束
*/
endScheduleDate?: string;
/**
* 时段类型(0上午 1下午)
*/
timeSlot?: string;
/**
* 状态(0正常 1停用)
*/
status?: string;
/**
* 日期范围参数
*/
params?: any;
}
export interface XljkConsultationAppointmentVO extends BaseEntity {
/**
* 学生ID
*/
studentId?: number;
/**
* 学号
*/
studentNo?: string;
/**
* 咨询师ID
*/
counselorId?: number;
/**
* 排班ID
*/
scheduleId?: number;
/**
* 预约日期
*/
appointmentDate?: string;
/**
* 预约时段
*/
appointmentTime?: string;
/**
* 具体预约时间段,如"08:30-09:00"
*/
appointmentDetailTime?: string;
/**
* 咨询原因
*/
reason?: string;
/**
* 状态(0待咨询 1已完成 2已取消 3未到访)
*/
status?: number;
/**
* 实际到访时间
*/
actualVisitTime?: any;
/**
* 沟通时长(分钟)
*/
communicationDuration?: number;
/**
* 咨询内容
*/
consultationContent?: string;
/**
* 咨询师建议
*/
counselorSuggestion?: string;
/**
* 学生姓名
*/
studentName?: string;
/**
* 班级
*/
className?: string;
/**
* 咨询师姓名
*/
counselorName?: string;
/**
* 院系
*/
collegeName?: string;
/**
* 专业
*/
majorName?: string;
}
export interface XljkConsultationAppointmentForm {
/**
* 主键
*/
id?: string | number;
/**
* 学生ID
*/
studentId?: string | number;
/**
* 学号
*/
studentNo?: string;
/**
* 咨询师ID
*/
counselorId?: number;
/**
* 排班ID
*/
scheduleId?: number;
/**
* 预约日期
*/
appointmentDate?: string;
/**
* 预约时段
*/
appointmentTime?: string;
/**
* 具体预约时间段,如"08:30-09:00"
*/
appointmentDetailTime?: string;
/**
* 咨询原因
*/
reason?: string;
/**
* 状态(0待咨询 1已完成 2已取消 3未到访)
*/
status?: number;
/**
* 实际到访时间
*/
actualVisitTime?: any;
/**
* 沟通时长(分钟)
*/
communicationDuration?: number;
/**
* 咨询内容
*/
consultationContent?: string;
/**
* 咨询师建议
*/
counselorSuggestion?: string;
}
export interface XljkConsultationAppointmentQuery extends PageQuery {
/**
* 学生ID
*/
studentId?: number;
/**
* 学生姓名
*/
studentName?: string;
/**
* 学号
*/
studentNo?: string;
/**
* 院系
*/
collegeName?: string;
/**
* 专业
*/
majorName?: string;
/**
* 咨询师ID
*/
counselorId?: number;
/**
* 预约日期开始
*/
beginAppointmentDate?: string;
/**
* 预约日期结束
*/
endAppointmentDate?: string;
/**
* 状态(0待咨询 1已完成 2已取消 3未到访)
*/
status?: string;
/**
* 日期范围参数
*/
params?: any;
}
export interface AvailableTimeSlot {
/**
* 预约时段ID
*/
scheduleId: number;
/**
* 咨询师ID
*/
counselorId: number;
/**
* 咨询师姓名
*/
counselorName?: string;
/**
* 日期
*/
date: string;
/**
* 时段类型(0上午 1下午)
*/
timeSlot: string;
/**
* 开始时间
*/
startTime: string;
/**
* 结束时间
*/
endTime: string;
/**
* 是否全部约满
*/
allBooked?: boolean;
/**
* 可用数量
*/
availableCount?: number;
/**
* 是否已过期
*/
isExpired?: boolean;
/**
* 日历事件标题
*/
title?: string;
/**
* 日历事件开始时间
*/
start?: string;
/**
* 日历事件结束时间
*/
end?: string;
}
export interface TimeSlotDetail {
/**
* 开始时间(HH:mm)
*/
startTime: string;
/**
* 结束时间(HH:mm)
*/
endTime: string;
/**
* 是否已预约
*/
isBooked: boolean;
/**
* 是否已过期
*/
isExpired: boolean;
/**
* 完整时段表示(如"08:30-09:00")
*/
timeSlot: string;
}
export interface CounselorOption {
/**
* 咨询师ID
*/
id: number;
/**
* 咨询师姓名
*/
name: string;
}
// 预约时段汇总视图对象
export interface XljkConsultationScheduleSummaryVO {
id: number;
tenantId: string;
createDept: number;
createBy: number;
createTime: string;
updateBy: number;
updateTime: string;
deleted: number;
counselorId: number;
counselorName: string;
dateRange: string;
morningEnabled: boolean;
morningTime: string;
afternoonEnabled: boolean;
afternoonTime: string;
status: string;
scheduleCount: number;
batchId: string;
}
// 院系选项
export interface CollegeOption {
/**
* 院系ID
*/
id: number;
/**
* 院系名称
*/
name: string;
}
// 专业选项
export interface MajorOption {
/**
* 专业ID
*/
id: number;
/**
* 专业名称
*/
name: string;
}
// 班级选项
export interface ClassOption {
/**
* 班级ID
*/
id: number;
/**
* 班级名称
*/
name: string;
}
// 未到访记录查询参数
export interface NoShowQuery extends PageQuery {
/**
* 学生姓名
*/
studentName?: string;
/**
* 学号
*/
studentNo?: string;
/**
* 状态(0生效中 1已过期 2已解除 'all'全部)
*/
status?: string;
/**
* 未到访日期开始
*/
startDate?: string;
/**
* 未到访日期结束
*/
endDate?: string;
/**
* 日期范围参数
*/
params?: any;
}
// 未到访记录VO
export interface NoShowVO {
/**
* 主键ID
*/
id: string | number;
/**
* 学生ID
*/
studentId: string | number;
/**
* 学生姓名
*/
studentName?: string;
/**
* 学号
*/
studentNo?: string;
/**
* 院系
*/
collegeName?: string;
/**
* 专业
*/
majorName?: string;
/**
* 班级
*/
className?: string;
/**
* 咨询师名称
*/
counselorName?: string;
/**
* 预约日期
*/
appointmentDate?: string;
/**
* 预约时段
*/
appointmentDetailTime?: string;
/**
* 咨询原因
*/
reason?: string;
/**
* 预约记录ID
*/
appointmentId: string | number;
/**
* 未到访日期
*/
noShowDate: string;
/**
* 限制到期日
*/
expireDate?: string;
/**
* 状态(0生效中 1已过期 2已解除)
*/
status?: string;
/**
* 创建时间
*/
createTime?: string;
/**
* 更新时间
*/
updateTime?: string;
}
+21 -21
View File
@@ -15,7 +15,7 @@ import {
// 查询心理健康测评列表
export const listEvaluation = (query: XljkEvaluationQuery) => {
return request({
url: '/xljk/evaluation/list',
url: '/api/xljk/evaluation/list',
method: 'get',
params: query
});
@@ -24,7 +24,7 @@ export const listEvaluation = (query: XljkEvaluationQuery) => {
// 查询心理健康测评详细信息
export const getEvaluation = (id: string | number) => {
return request({
url: `/xljk/evaluation/${id}`,
url: `/api/xljk/evaluation/${id}`,
method: 'get'
});
};
@@ -45,7 +45,7 @@ export const addEvaluation = (data: XljkEvaluationForm) => {
}
return request({
url: '/xljk/evaluation',
url: '/api/xljk/evaluation',
method: 'post',
data: data
});
@@ -54,7 +54,7 @@ export const addEvaluation = (data: XljkEvaluationForm) => {
// 修改心理健康测评
export const updateEvaluation = (data: XljkEvaluationForm) => {
return request({
url: '/xljk/evaluation',
url: '/api/xljk/evaluation',
method: 'put',
data: data
});
@@ -63,7 +63,7 @@ export const updateEvaluation = (data: XljkEvaluationForm) => {
// 删除心理健康测评
export const delEvaluation = (ids: string | number | Array<string | number>) => {
return request({
url: `/xljk/evaluation/${typeof ids === 'object' ? ids.join(',') : ids}`,
url: `/api/xljk/evaluation/${typeof ids === 'object' ? ids.join(',') : ids}`,
method: 'delete'
});
};
@@ -71,7 +71,7 @@ export const delEvaluation = (ids: string | number | Array<string | number>) =>
// 获取院系选项
export const getDepartmentOptions = () => {
return request({
url: '/xljk/evaluation/options/department',
url: '/api/xljk/evaluation/options/department',
method: 'get'
});
};
@@ -79,7 +79,7 @@ export const getDepartmentOptions = () => {
// 获取院系选项(新接口)
export const getCollegeOptions = () => {
return request({
url: '/xljk/evaluation/options/colleges',
url: '/api/xljk/evaluation/options/colleges',
method: 'get'
});
};
@@ -87,7 +87,7 @@ export const getCollegeOptions = () => {
// 获取专业选项
export const getMajorOptions = (collegeName?: string) => {
return request({
url: '/xljk/evaluation/options/majors',
url: '/api/xljk/evaluation/options/majors',
method: 'get',
params: { collegeName }
});
@@ -96,7 +96,7 @@ export const getMajorOptions = (collegeName?: string) => {
// 获取班级选项
export const getClassOptions = (collegeName?: string, majorName?: string) => {
return request({
url: '/xljk/evaluation/options/classes',
url: '/api/xljk/evaluation/options/classes',
method: 'get',
params: { collegeName, majorName }
});
@@ -105,7 +105,7 @@ export const getClassOptions = (collegeName?: string, majorName?: string) => {
// 获取班级学生列表
export const getStudentsByClass = (collegeName?: string, majorName?: string, className?: string) => {
return request({
url: '/xljk/evaluation/students',
url: '/api/xljk/evaluation/students',
method: 'get',
params: { collegeName, majorName, className }
});
@@ -114,23 +114,23 @@ export const getStudentsByClass = (collegeName?: string, majorName?: string, cla
// 获取学期选项
export const getSemesterOptions = () => {
return request({
url: '/xljk/evaluation/options/semester',
url: '/api/xljk/evaluation/options/semester',
method: 'get'
});
};
// 发布测评
// 发布测评(已废弃,改为提交功能)
export const publishEvaluation = (id: string | number) => {
return request({
url: `/xljk/evaluation/${id}/publish`,
url: `/api/xljk/evaluation/${id}/publish`,
method: 'put'
});
};
// 完成测评
// 提交测评
export const completeEvaluation = (id: string | number) => {
return request({
url: `/xljk/evaluation/${id}/complete`,
url: `/api/xljk/evaluation/${id}/complete`,
method: 'put'
});
};
@@ -138,7 +138,7 @@ export const completeEvaluation = (id: string | number) => {
// 获取测评统计数据
export const getEvaluationStatistics = (id: string | number) => {
return request({
url: `/xljk/evaluation/${id}/statistics`,
url: `/api/xljk/evaluation/${id}/statistics`,
method: 'get'
});
};
@@ -146,7 +146,7 @@ export const getEvaluationStatistics = (id: string | number) => {
// 获取重点关注学生统计
export const getFocusStudentsStatistics = (query: XljkEvaluationQuery) => {
return request({
url: '/xljk/evaluation/statistics/focus',
url: '/api/xljk/evaluation/statistics/focus',
method: 'get',
params: query
});
@@ -155,7 +155,7 @@ export const getFocusStudentsStatistics = (query: XljkEvaluationQuery) => {
// 查询测评明细列表
export const listEvaluationDetail = (query: XljkEvaluationDetailQuery) => {
return request({
url: '/xljk/evaluation/detail/list',
url: '/api/xljk/evaluation/detail/list',
method: 'get',
params: query
});
@@ -164,7 +164,7 @@ export const listEvaluationDetail = (query: XljkEvaluationDetailQuery) => {
// 获取测评明细列表
export const getEvaluationDetailsByEvaluationId = (evaluationId: string | number) => {
return request({
url: `/xljk/evaluation/detail/evaluation/${evaluationId}`,
url: `/api/xljk/evaluation/detail/evaluation/${evaluationId}`,
method: 'get'
});
};
@@ -172,7 +172,7 @@ export const getEvaluationDetailsByEvaluationId = (evaluationId: string | number
// 批量新增测评明细
export const batchAddEvaluationDetails = (data: XljkEvaluationDetailForm[]) => {
return request({
url: '/xljk/evaluation/detail/batch',
url: '/api/xljk/evaluation/detail/batch',
method: 'post',
data: data
});
@@ -184,7 +184,7 @@ export const batchUpdateMentalStatus = (data: XljkEvaluationDetailForm[]) => {
console.log('批量更新数据 - 第一条记录evaluationId:', data[0]?.evaluationId);
return request({
url: '/xljk/evaluation/detail/batch/mentalStatus',
url: '/api/xljk/evaluation/detail/batch/mentalStatus',
method: 'put',
data: data
});
+17 -2
View File
@@ -45,7 +45,7 @@ export interface XljkEvaluationVO {
semester: string;
/**
* 状态(0-草稿,1-已发布,2-已完成)
* 状态(0-草稿,2-已完成)
*/
status: string;
@@ -137,7 +137,7 @@ export interface XljkEvaluationForm extends BaseEntity {
semester?: string;
/**
* 状态(0-草稿,1-已发布,2-已完成)
* 状态(0-草稿,2-已完成)
*/
status?: string;
@@ -443,6 +443,11 @@ export interface StudentInfo {
}
export interface CollegeOption {
/**
* 院系ID
*/
id: number;
/**
* 院系名称
*/
@@ -450,6 +455,11 @@ export interface CollegeOption {
}
export interface MajorOption {
/**
* 专业ID
*/
id: number;
/**
* 专业名称
*/
@@ -457,6 +467,11 @@ export interface MajorOption {
}
export interface ClassOption {
/**
* 班级ID
*/
id: number;
/**
* 班级名称
*/