合并冲突解决:学生消息管理和招生就业模块更新
This commit is contained in:
commit
593aa01a70
132 files changed
+158752
-1005
No files matched your search
@@ -0,0 +1,65 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 获取管理员列表
|
||||
export function getAdminList(params?: any) {
|
||||
// 根据不同类型构造不同参数
|
||||
return request({
|
||||
url: '/studentMsg/admin/list',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 新增管理员
|
||||
export function addAdmin(data: any) {
|
||||
return request({
|
||||
url: '/studentMsg/admin',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 更新管理员
|
||||
export function updateAdmin(data: any) {
|
||||
return request({
|
||||
url: '/studentMsg/admin',
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除管理员
|
||||
export function deleteAdmin(id: number | string) {
|
||||
return request({
|
||||
url: `/studentMsg/admin/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 分配范围
|
||||
export function assignScope(params: any, data: any) {
|
||||
return request({
|
||||
url: '/studentMsg/admin/assignScope',
|
||||
method: 'post',
|
||||
params,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取范围名称
|
||||
export function getScopeNames(params: any) {
|
||||
return request({
|
||||
url: '/studentMsg/admin/getScopeNames',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 获取可分配的范围
|
||||
export function getScopeOptions(type: string) {
|
||||
return request({
|
||||
url: '/studentMsg/admin/getScopeOptions',
|
||||
method: 'get',
|
||||
params: { type }
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,424 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StudentQuery, StudentVO, StudentForm, XgDeptTreeVO, R, TableDataInfo } from './types';
|
||||
|
||||
|
||||
/**
|
||||
* 查询部门下拉树结构
|
||||
* @param deptId 部门ID
|
||||
*/
|
||||
export const XgDeptTreeSelect = (belongDeptId?: number): AxiosPromise<XgDeptTreeVO[]> => {
|
||||
// 实际项目中连接后端接口
|
||||
return request({
|
||||
url: '/system/user/deptTree',
|
||||
method: 'get',
|
||||
params: {
|
||||
belongDeptId
|
||||
}
|
||||
});
|
||||
|
||||
// // 模拟数据,直接返回与页面组件期望格式一致的数据
|
||||
// return Promise.resolve({
|
||||
// data: mockDeptTree,
|
||||
// status: 200,
|
||||
// statusText: 'OK',
|
||||
// headers: {},
|
||||
// config: {} as any
|
||||
// }) as any;
|
||||
};
|
||||
|
||||
|
||||
// 查询学生列表
|
||||
export function listStudent(query?: StudentQuery): AxiosPromise<R<TableDataInfo<StudentVO[]>>> {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
// url: '/studentMsg/student/list',
|
||||
// method: 'get',
|
||||
// params: query
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
msg: 'success',
|
||||
data: {
|
||||
total: mockStudentData.length,
|
||||
rows: mockStudentData
|
||||
}
|
||||
}
|
||||
} as any);
|
||||
}
|
||||
|
||||
// 查询学生详细
|
||||
export function getStudent(studentId?: string | number): AxiosPromise<R<{
|
||||
student: StudentVO;
|
||||
majors: any[];
|
||||
classes: any[];
|
||||
}>> {
|
||||
if (studentId) {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
// url: '/studentMsg/student/' + studentId,
|
||||
// method: 'get'
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
const student = mockStudentData.find(item => item.studentId === studentId);
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
msg: 'success',
|
||||
data: {
|
||||
student: student || {},
|
||||
majors: mockMajors,
|
||||
classes: mockClasses
|
||||
}
|
||||
}
|
||||
} as any);
|
||||
} else {
|
||||
// 新增时返回初始空对象和选项数据
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
msg: 'success',
|
||||
data: {
|
||||
student: {},
|
||||
majors: mockMajors,
|
||||
classes: mockClasses
|
||||
}
|
||||
}
|
||||
} as any);
|
||||
}
|
||||
}
|
||||
|
||||
// 新增学生
|
||||
export function addStudent(data: StudentForm): AxiosPromise<R<any>> {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
// url: '/studentMsg/student',
|
||||
// method: 'post',
|
||||
// data: data
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
msg: '添加成功'
|
||||
}
|
||||
} as any);
|
||||
}
|
||||
|
||||
// 修改学生
|
||||
export function updateStudent(data: StudentForm): AxiosPromise<R<any>> {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
// url: '/studentMsg/student',
|
||||
// method: 'put',
|
||||
// data: data
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
msg: '修改成功'
|
||||
}
|
||||
} as any);
|
||||
}
|
||||
|
||||
// 删除学生
|
||||
export function delStudent(studentId: string | number | Array<string | number>): AxiosPromise<R<any>> {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
// url: '/studentMsg/student/' + studentId,
|
||||
// method: 'delete'
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
msg: '删除成功'
|
||||
}
|
||||
} as any);
|
||||
}
|
||||
|
||||
// 查询院系树结构
|
||||
export function deptTreeSelect(): AxiosPromise<R<any>> {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
// url: '/studentMsg/dept/treeselect',
|
||||
// method: 'get'
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
msg: 'success',
|
||||
data: mockDeptTree
|
||||
}
|
||||
} as any);
|
||||
}
|
||||
|
||||
// 导出学生
|
||||
export function exportStudent(query?: StudentQuery): AxiosPromise<any> {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
// url: '/studentMsg/student/export',
|
||||
// method: 'get',
|
||||
// params: query
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
return Promise.resolve({
|
||||
data: mockStudentData,
|
||||
status: 200,
|
||||
statusText: 'OK',
|
||||
headers: {},
|
||||
config: {} as any
|
||||
}) as any;
|
||||
}
|
||||
|
||||
// 学生状态修改
|
||||
export function changeStudentStatus(studentId: string | number, status: string): AxiosPromise<R<any>> {
|
||||
// 实际使用时连接后端接口
|
||||
// return request({
|
||||
// url: '/studentMsg/student/changeStatus',
|
||||
// method: 'put',
|
||||
// data: {
|
||||
// studentId,
|
||||
// status
|
||||
// }
|
||||
// });
|
||||
|
||||
// 模拟数据
|
||||
return Promise.resolve({
|
||||
data: {
|
||||
code: 200,
|
||||
msg: '状态修改成功'
|
||||
}
|
||||
} as any);
|
||||
}
|
||||
|
||||
// 模拟数据 - 学生列表
|
||||
const mockStudentData: StudentVO[] = [
|
||||
{
|
||||
studentId: 1,
|
||||
studentNo: '202001001',
|
||||
studentName: '张三',
|
||||
nickName: '小张',
|
||||
sex: '0',
|
||||
age: 20,
|
||||
phonenumber: '13800138001',
|
||||
email: 'zhangsan@example.com',
|
||||
idCard: '110101200101011234',
|
||||
deptId: 105,
|
||||
deptName: '计算机科学与技术系',
|
||||
majorId: 1,
|
||||
majorName: '计算机科学与技术',
|
||||
classId: 101,
|
||||
className: '计算机2001班',
|
||||
address: '北京市海淀区',
|
||||
status: '0',
|
||||
createTime: '2023-01-01 10:00:00',
|
||||
remark: ''
|
||||
},
|
||||
{
|
||||
studentId: 2,
|
||||
studentNo: '202001002',
|
||||
studentName: '李四',
|
||||
nickName: '小李',
|
||||
sex: '0',
|
||||
age: 21,
|
||||
phonenumber: '13800138002',
|
||||
email: 'lisi@example.com',
|
||||
idCard: '110101200001011235',
|
||||
deptId: 105,
|
||||
deptName: '计算机科学与技术系',
|
||||
majorId: 1,
|
||||
majorName: '计算机科学与技术',
|
||||
classId: 101,
|
||||
className: '计算机2001班',
|
||||
address: '上海市浦东新区',
|
||||
status: '0',
|
||||
createTime: '2023-01-01 10:10:00',
|
||||
remark: ''
|
||||
},
|
||||
{
|
||||
studentId: 3,
|
||||
studentNo: '202001003',
|
||||
studentName: '王五',
|
||||
nickName: '小王',
|
||||
sex: '0',
|
||||
age: 19,
|
||||
phonenumber: '13800138003',
|
||||
email: 'wangwu@example.com',
|
||||
idCard: '110101200201011236',
|
||||
deptId: 106,
|
||||
deptName: '软件工程系',
|
||||
majorId: 2,
|
||||
majorName: '软件工程',
|
||||
classId: 201,
|
||||
className: '软工2001班',
|
||||
address: '广州市天河区',
|
||||
status: '0',
|
||||
createTime: '2023-01-02 09:00:00',
|
||||
remark: ''
|
||||
},
|
||||
{
|
||||
studentId: 4,
|
||||
studentNo: '202001004',
|
||||
studentName: '赵六',
|
||||
nickName: '小赵',
|
||||
sex: '1',
|
||||
age: 20,
|
||||
phonenumber: '13800138004',
|
||||
email: 'zhaoliu@example.com',
|
||||
idCard: '110101200101011237',
|
||||
deptId: 106,
|
||||
deptName: '软件工程系',
|
||||
majorId: 2,
|
||||
majorName: '软件工程',
|
||||
classId: 201,
|
||||
className: '软工2001班',
|
||||
address: '深圳市南山区',
|
||||
status: '0',
|
||||
createTime: '2023-01-02 10:30:00',
|
||||
remark: ''
|
||||
},
|
||||
{
|
||||
studentId: 5,
|
||||
studentNo: '202001005',
|
||||
studentName: '钱七',
|
||||
nickName: '小钱',
|
||||
sex: '1',
|
||||
age: 21,
|
||||
phonenumber: '13800138005',
|
||||
email: 'qianqi@example.com',
|
||||
idCard: '110101200001011238',
|
||||
deptId: 107,
|
||||
deptName: '人工智能系',
|
||||
majorId: 3,
|
||||
majorName: '人工智能',
|
||||
classId: 301,
|
||||
className: '人工智能2001班',
|
||||
address: '杭州市西湖区',
|
||||
status: '1', // 停用状态
|
||||
createTime: '2023-01-03 11:20:00',
|
||||
remark: '休学中'
|
||||
}
|
||||
];
|
||||
|
||||
// 模拟数据 - 院系树
|
||||
const mockDeptTree = [
|
||||
{
|
||||
id: 100,
|
||||
label: '信息学院',
|
||||
children: [
|
||||
{
|
||||
id: 105,
|
||||
label: '计算机科学与技术系',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
id: 106,
|
||||
label: '软件工程系',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
id: 107,
|
||||
label: '人工智能系',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 200,
|
||||
label: '经济管理学院',
|
||||
children: [
|
||||
{
|
||||
id: 205,
|
||||
label: '市场营销系',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
id: 206,
|
||||
label: '财务管理系',
|
||||
children: []
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// 模拟数据 - 专业
|
||||
const mockMajors = [
|
||||
{
|
||||
majorId: 1,
|
||||
majorName: '计算机科学与技术',
|
||||
deptId: 105
|
||||
},
|
||||
{
|
||||
majorId: 2,
|
||||
majorName: '软件工程',
|
||||
deptId: 106
|
||||
},
|
||||
{
|
||||
majorId: 3,
|
||||
majorName: '人工智能',
|
||||
deptId: 107
|
||||
},
|
||||
{
|
||||
majorId: 4,
|
||||
majorName: '市场营销',
|
||||
deptId: 205
|
||||
},
|
||||
{
|
||||
majorId: 5,
|
||||
majorName: '财务管理',
|
||||
deptId: 206
|
||||
}
|
||||
];
|
||||
|
||||
// 模拟数据 - 班级
|
||||
const mockClasses = [
|
||||
{
|
||||
classId: 101,
|
||||
className: '计算机2001班',
|
||||
majorId: 1
|
||||
},
|
||||
{
|
||||
classId: 102,
|
||||
className: '计算机2002班',
|
||||
majorId: 1
|
||||
},
|
||||
{
|
||||
classId: 201,
|
||||
className: '软工2001班',
|
||||
majorId: 2
|
||||
},
|
||||
{
|
||||
classId: 202,
|
||||
className: '软工2002班',
|
||||
majorId: 2
|
||||
},
|
||||
{
|
||||
classId: 301,
|
||||
className: '人工智能2001班',
|
||||
majorId: 3
|
||||
},
|
||||
{
|
||||
classId: 401,
|
||||
className: '市场营销2001班',
|
||||
majorId: 4
|
||||
},
|
||||
{
|
||||
classId: 501,
|
||||
className: '财务管理2001班',
|
||||
majorId: 5
|
||||
}
|
||||
];
|
||||
|
||||
export default { listStudent, getStudent, addStudent, updateStudent, delStudent, deptTreeSelect, exportStudent, changeStudentStatus, XgDeptTreeSelect };
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { StudentMsgVO, StudentMsgForm, StudentMsgQuery } from '@/api/studentMsg/studentMsg/types';
|
||||
|
||||
/**
|
||||
* 查询学生信息列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listStudentMsg = (query?: StudentMsgQuery): AxiosPromise<StudentMsgVO[]> => {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询学生信息详细
|
||||
* @param id
|
||||
*/
|
||||
export const getStudentMsg = (id: string | number): AxiosPromise<StudentMsgVO> => {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增学生信息
|
||||
* @param data
|
||||
*/
|
||||
export const addStudentMsg = (data: StudentMsgForm) => {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改学生信息
|
||||
* @param data
|
||||
*/
|
||||
export const updateStudentMsg = (data: StudentMsgForm) => {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除学生信息
|
||||
* @param id
|
||||
*/
|
||||
export const delStudentMsg = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/studentMsg/studentMsg/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* 部门树结构
|
||||
*/
|
||||
export interface XgDeptTreeVO extends BaseEntity {
|
||||
id: number | string;
|
||||
label: string;
|
||||
parentId: number | string;
|
||||
weight: number;
|
||||
children: XgDeptTreeVO[];
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
// 学生查询参数
|
||||
export interface StudentQuery {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
studentName?: string;
|
||||
studentNo?: string;
|
||||
phonenumber?: string;
|
||||
status?: string;
|
||||
deptId?: number;
|
||||
}
|
||||
|
||||
// 学生视图对象
|
||||
export interface StudentVO {
|
||||
studentId: number | string;
|
||||
studentNo: string;
|
||||
studentName: string;
|
||||
nickName?: string;
|
||||
sex?: string;
|
||||
age?: number;
|
||||
phonenumber?: string;
|
||||
email?: string;
|
||||
idCard?: string;
|
||||
deptId?: number;
|
||||
deptName?: string;
|
||||
majorId?: number;
|
||||
majorName?: string;
|
||||
classId?: number;
|
||||
className?: string;
|
||||
address?: string;
|
||||
status?: string;
|
||||
createBy?: number;
|
||||
createTime?: string;
|
||||
updateBy?: number;
|
||||
updateTime?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
// 学生表单对象
|
||||
export interface StudentForm {
|
||||
studentId?: number | string;
|
||||
deptId?: number;
|
||||
studentNo: string;
|
||||
studentName: string;
|
||||
nickName?: string;
|
||||
password?: string;
|
||||
phonenumber?: string;
|
||||
email?: string;
|
||||
idCard?: string;
|
||||
sex?: string;
|
||||
status?: string;
|
||||
majorId?: number;
|
||||
classId?: number;
|
||||
address?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
// 统一响应类型
|
||||
export interface R<T> {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
// 表格数据信息类型
|
||||
export interface TableDataInfo<T> {
|
||||
total: number;
|
||||
rows: T;
|
||||
}
|
||||
@@ -149,6 +149,16 @@ export interface EnrollmentInfoVO {
|
||||
*/
|
||||
qrCodeSource: string;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName: string;
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
collegeId: string;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@@ -320,6 +330,16 @@ export interface EnrollmentInfoForm extends BaseEntity {
|
||||
* 二维码来源标识
|
||||
*/
|
||||
qrCodeSource?: string;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
collegeId?: string;
|
||||
}
|
||||
|
||||
export interface EnrollmentInfoQuery extends PageQuery {
|
||||
@@ -368,8 +388,18 @@ export interface EnrollmentInfoQuery extends PageQuery {
|
||||
*/
|
||||
examRegion?: string;
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
collegeId?: string;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 报名时间范围
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
}
|
||||
@@ -151,6 +151,76 @@ export interface EnrollmentProcessVO {
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)
|
||||
*/
|
||||
gender?: string
|
||||
|
||||
/**
|
||||
* 地区/省份
|
||||
*/
|
||||
province?: string
|
||||
|
||||
/**
|
||||
* 学院名称(驼峰命名)
|
||||
*/
|
||||
collegeName?: string
|
||||
|
||||
/**
|
||||
* 学院代码(驼峰命名)
|
||||
*/
|
||||
collegeId?: string
|
||||
|
||||
/**
|
||||
* 学院名称(下划线命名)
|
||||
*/
|
||||
college_name?: string
|
||||
|
||||
/**
|
||||
* 学院代码(下划线命名)
|
||||
*/
|
||||
college_id?: string
|
||||
|
||||
/**
|
||||
* 学院名称(拼写变体 - collage)
|
||||
*/
|
||||
collage_name?: string
|
||||
|
||||
/**
|
||||
* 学院代码(拼写变体 - collage)
|
||||
*/
|
||||
collage_id?: string
|
||||
|
||||
/**
|
||||
* 专业名称(驼峰命名)
|
||||
*/
|
||||
majorName?: string
|
||||
|
||||
/**
|
||||
* 专业代码(驼峰命名)
|
||||
*/
|
||||
majorCode?: string
|
||||
|
||||
/**
|
||||
* 专业名称(下划线命名)
|
||||
*/
|
||||
major_name?: string
|
||||
|
||||
/**
|
||||
* 专业代码(下划线命名)
|
||||
*/
|
||||
major_code?: string
|
||||
|
||||
/**
|
||||
* 报考专业(来自报名信息表)
|
||||
*/
|
||||
appliedMajor?: string
|
||||
|
||||
/**
|
||||
* 关联的报名信息对象
|
||||
*/
|
||||
enrollmentInfo?: any
|
||||
}
|
||||
|
||||
export interface EnrollmentProcessForm extends BaseEntity {
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request'
|
||||
import type { PageQuery } from '@/types/page'
|
||||
import type { EnrollmentProcessVO } from './enrollmentProcess'
|
||||
|
||||
/**
|
||||
* 查询招生录取统计列表
|
||||
* @param query 查询参数
|
||||
* @returns 招生录取统计列表
|
||||
*/
|
||||
export function listEnrollmentStatistics(query: PageQuery) {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出招生录取统计列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export function exportEnrollmentStatistics(query: PageQuery) {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/export',
|
||||
method: 'post',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取招生录取统计详细信息
|
||||
* @param id 统计ID
|
||||
* @returns 招生录取统计详细信息
|
||||
*/
|
||||
export function getEnrollmentStatistics(id: string | number) {
|
||||
return request({
|
||||
url: `/zsjy/enrollment/statistics/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招生录取统计图表数据
|
||||
* @returns 图表数据
|
||||
*/
|
||||
export function getEnrollmentStatisticsChartData() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/chart',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招生录取统计概览数据
|
||||
* @returns 概览数据
|
||||
*/
|
||||
export function getEnrollmentStatisticsOverview() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/overview',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招生录取统计按专业分布数据
|
||||
* @returns 专业分布数据
|
||||
*/
|
||||
export function getEnrollmentStatisticsByMajor() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/major',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招生录取统计按学院分布数据
|
||||
* @returns 学院分布数据
|
||||
*/
|
||||
export function getEnrollmentStatisticsByCollege() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/college',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招生录取统计按地区分布数据
|
||||
* @returns 地区分布数据
|
||||
*/
|
||||
export function getEnrollmentStatisticsByRegion() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/region',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招生录取统计按性别分布数据
|
||||
* @returns 性别分布数据
|
||||
*/
|
||||
export function getEnrollmentStatisticsByGender() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/gender',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招生录取统计按缴费状态分布数据
|
||||
* @returns 缴费状态分布数据
|
||||
*/
|
||||
export function getEnrollmentStatisticsByPayment() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/payment',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询招生录取统计按流程状态分布数据
|
||||
* @returns 流程状态分布数据
|
||||
*/
|
||||
export function getEnrollmentStatisticsByStatus() {
|
||||
return request({
|
||||
url: '/zsjy/enrollment/statistics/status',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,12 +1,20 @@
|
||||
import request from '@/utils/request';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
/**
|
||||
* 获取统计概览数据
|
||||
*/
|
||||
export function getStatisticsOverview() {
|
||||
return request({
|
||||
url: '/dev-api/zsjy/statistics/overview',
|
||||
method: 'get'
|
||||
url: '/zsjy/statistics/overview',
|
||||
method: 'get',
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取统计概览数据失败:', error);
|
||||
ElMessage.error('获取统计数据失败,请联系管理员');
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,8 +23,15 @@ export function getStatisticsOverview() {
|
||||
*/
|
||||
export function getMajorDistribution() {
|
||||
return request({
|
||||
url: '/dev-api/zsjy/statistics/major',
|
||||
method: 'get'
|
||||
url: '/zsjy/statistics/major',
|
||||
method: 'get',
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取专业分布数据失败:', error);
|
||||
ElMessage.error('获取专业分布数据失败,请联系管理员');
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,8 +40,15 @@ export function getMajorDistribution() {
|
||||
*/
|
||||
export function getRegionDistribution() {
|
||||
return request({
|
||||
url: '/dev-api/zsjy/statistics/region',
|
||||
method: 'get'
|
||||
url: '/zsjy/statistics/region',
|
||||
method: 'get',
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取地区分布数据失败:', error);
|
||||
ElMessage.error('获取地区分布数据失败,请联系管理员');
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -35,8 +57,15 @@ export function getRegionDistribution() {
|
||||
*/
|
||||
export function getGenderRatio() {
|
||||
return request({
|
||||
url: '/dev-api/zsjy/statistics/gender',
|
||||
method: 'get'
|
||||
url: '/zsjy/statistics/gender',
|
||||
method: 'get',
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取性别比例数据失败:', error);
|
||||
ElMessage.error('获取性别比例数据失败,请联系管理员');
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -46,9 +75,16 @@ export function getGenderRatio() {
|
||||
*/
|
||||
export function getEnrollmentTrend(days?: number) {
|
||||
return request({
|
||||
url: '/dev-api/zsjy/statistics/trend',
|
||||
url: '/zsjy/statistics/trend',
|
||||
method: 'get',
|
||||
params: { days }
|
||||
params: { days },
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取报名趋势数据失败:', error);
|
||||
ElMessage.error('获取报名趋势数据失败,请联系管理员');
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,8 +93,15 @@ export function getEnrollmentTrend(days?: number) {
|
||||
*/
|
||||
export function getStatusDistribution() {
|
||||
return request({
|
||||
url: '/dev-api/zsjy/statistics/status',
|
||||
method: 'get'
|
||||
url: '/zsjy/statistics/status',
|
||||
method: 'get',
|
||||
headers: {
|
||||
'isToken': true
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取状态分布数据失败:', error);
|
||||
ElMessage.error('获取状态分布数据失败,请联系管理员');
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="mode === 'add' ? '新增' + getTypeLabel(type) : '编辑' + getTypeLabel(type)"
|
||||
v-model="visible"
|
||||
width="500px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入手机号码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-radio-group v-model="form.sex">
|
||||
<el-radio :label="0">男</el-radio>
|
||||
<el-radio :label="1">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watchEffect, computed } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'add'
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'school'
|
||||
},
|
||||
admin: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'submit']);
|
||||
|
||||
// 计算属性:对话框可见性
|
||||
const visible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => emit('update:modelValue', value)
|
||||
});
|
||||
|
||||
// 表单和校验
|
||||
const formRef = ref(null);
|
||||
const form = reactive({
|
||||
id: null,
|
||||
name: '',
|
||||
phone: '',
|
||||
sex: 0,
|
||||
remark: ''
|
||||
});
|
||||
|
||||
// 表单校验规则
|
||||
const rules = reactive({
|
||||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
||||
phone: [
|
||||
{ required: true, message: '请输入手机号码', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
|
||||
// 监听传入的admin数据,更新表单
|
||||
watchEffect(() => {
|
||||
if (props.admin) {
|
||||
form.id = props.admin.id;
|
||||
form.name = props.admin.name;
|
||||
form.phone = props.admin.phone;
|
||||
form.sex = props.admin.sex;
|
||||
form.remark = props.admin.remark;
|
||||
}
|
||||
});
|
||||
|
||||
// 根据类型获取标签文本
|
||||
function getTypeLabel(type) {
|
||||
switch (type) {
|
||||
case 'school':
|
||||
return '全校管理员';
|
||||
case 'custom':
|
||||
return '自定义管理员';
|
||||
case 'teacher':
|
||||
return '班主任';
|
||||
default:
|
||||
return '管理员';
|
||||
}
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
function submitForm() {
|
||||
formRef.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
// 这里模拟保存
|
||||
emit('submit', {
|
||||
id: form.id,
|
||||
name: form.name,
|
||||
phone: form.phone,
|
||||
sex: form.sex,
|
||||
remark: form.remark,
|
||||
scope: props.admin?.scope || ''
|
||||
});
|
||||
|
||||
ElMessage.success('保存成功');
|
||||
visible.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 取消
|
||||
function cancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 暴露组件以修复导出问题
|
||||
defineExpose({
|
||||
submitForm,
|
||||
cancel
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<el-dialog :title="getScopeDialogTitle(type)" v-model="visible" width="600px" append-to-body destroy-on-close>
|
||||
<el-form :model="form" label-width="100px">
|
||||
<el-form-item :label="getScopeName(type)">
|
||||
<div v-if="type === 'custom'">
|
||||
<el-checkbox-group v-model="form.selectedScopes">
|
||||
<el-checkbox v-for="item in scopeOptions.custom" :key="item.id" :label="item.id">
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<div v-else-if="type === 'teacher'">
|
||||
<el-checkbox-group v-model="form.selectedScopes">
|
||||
<el-checkbox v-for="item in scopeOptions.teacher" :key="item.id" :label="item.id">
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
admin: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'custom'
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'submit']);
|
||||
|
||||
// 计算属性:对话框可见性
|
||||
const visible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => emit('update:modelValue', value)
|
||||
});
|
||||
|
||||
// 范围选项(模拟数据)
|
||||
const scopeOptions = {
|
||||
custom: [
|
||||
{ id: 1, name: '高一年级' },
|
||||
{ id: 2, name: '高二年级' },
|
||||
{ id: 3, name: '高三年级' },
|
||||
{ id: 4, name: '初一年级' },
|
||||
{ id: 5, name: '初二年级' },
|
||||
{ id: 6, name: '初三年级' }
|
||||
],
|
||||
teacher: [
|
||||
{ id: 101, name: '高一(1)班' },
|
||||
{ id: 102, name: '高一(2)班' },
|
||||
{ id: 103, name: '高一(3)班' },
|
||||
{ id: 104, name: '高二(1)班' },
|
||||
{ id: 105, name: '高二(2)班' },
|
||||
{ id: 106, name: '高三(1)班' },
|
||||
{ id: 107, name: '高三(2)班' }
|
||||
]
|
||||
};
|
||||
|
||||
// 表单数据
|
||||
const form = reactive({
|
||||
selectedScopes: [] as number[]
|
||||
});
|
||||
|
||||
// 获取范围对话框标题
|
||||
function getScopeDialogTitle(type: string) {
|
||||
const name = props.admin?.name || '';
|
||||
switch (type) {
|
||||
case 'custom':
|
||||
return `为【${name}】分配管理范围`;
|
||||
case 'teacher':
|
||||
return `为【${name}】分配班级`;
|
||||
default:
|
||||
return `为【${name}】分配范围`;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取范围名称
|
||||
function getScopeName(type: string) {
|
||||
switch (type) {
|
||||
case 'custom':
|
||||
return '管理范围';
|
||||
case 'teacher':
|
||||
return '所管理班级';
|
||||
default:
|
||||
return '管理范围';
|
||||
}
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
function submitForm() {
|
||||
// 组装要提交的数据
|
||||
const selectedIds = form.selectedScopes;
|
||||
let scopeName = '';
|
||||
|
||||
// 根据类型获取选中的名称
|
||||
if (type.value === 'custom') {
|
||||
scopeName = scopeOptions.custom
|
||||
.filter((item) => selectedIds.includes(item.id))
|
||||
.map((item) => item.name)
|
||||
.join(', ');
|
||||
} else if (type.value === 'teacher') {
|
||||
scopeName = scopeOptions.teacher
|
||||
.filter((item) => selectedIds.includes(item.id))
|
||||
.map((item) => item.name)
|
||||
.join(', ');
|
||||
}
|
||||
|
||||
// 提交
|
||||
emit('submit', {
|
||||
sourceIds: selectedIds,
|
||||
scopeName: scopeName
|
||||
});
|
||||
|
||||
ElMessage.success('分配成功');
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 取消
|
||||
function cancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
// 从props获取类型的响应式引用
|
||||
const type = computed(() => props.type);
|
||||
|
||||
// 暴露组件以修复导出问题
|
||||
defineExpose({
|
||||
submitForm,
|
||||
cancel
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.el-checkbox-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.el-checkbox {
|
||||
margin-right: 15px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,391 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<el-card>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="全校管理员" name="school">
|
||||
<!-- 检索栏(全校管理员) -->
|
||||
<div class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form :inline="true" :model="schoolSearchForm" class="search-form">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="schoolSearchForm.name" placeholder="请输入姓名" clearable @keyup.enter="handleSearch('school')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码">
|
||||
<el-input v-model="schoolSearchForm.phone" placeholder="请输入手机号码" clearable @keyup.enter="handleSearch('school')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch('school')">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset('school')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
<!-- 按钮+列表区域 -->
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="onAdd('school')">新增管理员</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :data="filteredAdmins('school')" border>
|
||||
<el-table-column prop="name" label="姓名" align="center" />
|
||||
<el-table-column prop="phone" label="手机号码" align="center" />
|
||||
<el-table-column prop="sex" label="性别" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.sex === 0 ? '男' : '女' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" align="center" />
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" plain icon="Edit" @click="onEdit('school', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" plain icon="Delete" @click="onDelete('school', scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="自定义管理员" name="custom">
|
||||
<!-- 检索栏(自定义管理员) -->
|
||||
<div class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form :inline="true" :model="customSearchForm" class="search-form">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="customSearchForm.name" placeholder="请输入姓名" clearable @keyup.enter="handleSearch('custom')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码">
|
||||
<el-input v-model="customSearchForm.phone" placeholder="请输入手机号码" clearable @keyup.enter="handleSearch('custom')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch('custom')">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset('custom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="onAdd('custom')">新增管理员</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :data="filteredAdmins('custom')" border>
|
||||
<el-table-column prop="name" label="姓名" align="center" />
|
||||
<el-table-column prop="phone" label="手机号码" align="center" />
|
||||
<el-table-column prop="sex" label="性别" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.sex === 0 ? '男' : '女' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="scope" label="管理范围" align="center" />
|
||||
<el-table-column prop="remark" label="备注" align="center" />
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" plain icon="Edit" @click="onEdit('custom', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="分配范围" placement="top">
|
||||
<el-button link type="warning" plain icon="Setting" @click="onScope('custom', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" plain icon="Delete" @click="onDelete('custom', scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="班主任" name="teacher">
|
||||
<!-- 检索栏(班主任) -->
|
||||
<div class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form :inline="true" :model="teacherSearchForm" class="search-form">
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="teacherSearchForm.name" placeholder="请输入姓名" clearable @keyup.enter="handleSearch('teacher')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码">
|
||||
<el-input v-model="teacherSearchForm.phone" placeholder="请输入手机号码" clearable @keyup.enter="handleSearch('teacher')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch('teacher')">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset('teacher')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="onAdd('teacher')">新增班主任</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-table :data="filteredAdmins('teacher')" border>
|
||||
<el-table-column prop="name" label="姓名" align="center" />
|
||||
<el-table-column prop="phone" label="手机号码" align="center" />
|
||||
<el-table-column prop="sex" label="性别" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.sex === 0 ? '男' : '女' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="scope" label="所管理班级" align="center" />
|
||||
<el-table-column prop="remark" label="备注" align="center" />
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" plain icon="Edit" @click="onEdit('teacher', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="分配班级" placement="top">
|
||||
<el-button link type="warning" plain icon="Setting" @click="onScope('teacher', scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" plain icon="Delete" @click="onDelete('teacher', scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<admin-dialog v-model="dialogVisible" :mode="dialogMode" :admin="currentAdmin" :type="activeTab" @submit="onDialogSubmit" />
|
||||
<scope-dialog v-model="scopeDialogVisible" :admin="currentAdmin" :type="scopeType" @submit="onScopeSubmit" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import AdminDialog from './components/AdminDialog.vue';
|
||||
import ScopeDialog from './components/ScopeDialog.vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
|
||||
// 暴露组件以修复导出问题
|
||||
defineExpose({});
|
||||
|
||||
// 导入改为使用模拟数据
|
||||
// import { getAdminList, deleteAdmin, assignScope, getScopeNames } from '@/api/studentMsg/authmsg';
|
||||
|
||||
const activeTab = ref('school');
|
||||
|
||||
// 各tab独立检索表单
|
||||
const schoolSearchForm = reactive({ name: '', phone: '' });
|
||||
const customSearchForm = reactive({ name: '', phone: '' });
|
||||
const teacherSearchForm = reactive({ name: '', phone: '' });
|
||||
|
||||
// 管理员数据
|
||||
const schoolAdmins = ref([]);
|
||||
const customAdmins = ref([]);
|
||||
const teacherAdmins = ref([]);
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const dialogMode = ref<'add' | 'edit'>('add');
|
||||
const currentAdmin = ref<any>(null);
|
||||
const scopeDialogVisible = ref(false);
|
||||
const scopeType = ref('');
|
||||
|
||||
// 模拟数据
|
||||
const mockData = {
|
||||
school: [
|
||||
{ id: 1, name: '张校长', phone: '13800138001', sex: 0, remark: '全校管理员' },
|
||||
{ id: 2, name: '李主任', phone: '13800138002', sex: 1, remark: '教务处负责人' }
|
||||
],
|
||||
custom: [
|
||||
{ id: 3, name: '王组长', phone: '13800138003', sex: 0, scope: '高一年级', remark: '年级组长' },
|
||||
{ id: 4, name: '赵主管', phone: '13800138004', sex: 1, scope: '高二年级', remark: '年级负责人' }
|
||||
],
|
||||
teacher: [
|
||||
{ id: 5, name: '刘老师', phone: '13800138005', sex: 0, scope: '高一(1)班', remark: '数学教师' },
|
||||
{ id: 6, name: '陈老师', phone: '13800138006', sex: 1, scope: '高一(2)班', remark: '语文教师' }
|
||||
]
|
||||
};
|
||||
|
||||
// 获取管理员列表
|
||||
async function fetchAdmins(type: string) {
|
||||
// 实际项目中这里会调用API
|
||||
// 此处使用模拟数据
|
||||
try {
|
||||
// 模拟API检索过滤
|
||||
const searchForm = getSearchForm(type);
|
||||
const filteredData = mockData[type].filter((item) => {
|
||||
const nameMatch = !searchForm.name || item.name.includes(searchForm.name);
|
||||
const phoneMatch = !searchForm.phone || item.phone.includes(searchForm.phone);
|
||||
return nameMatch && phoneMatch;
|
||||
});
|
||||
|
||||
// 更新对应类型的管理员数据
|
||||
switch (type) {
|
||||
case 'school':
|
||||
schoolAdmins.value = filteredData;
|
||||
break;
|
||||
case 'custom':
|
||||
customAdmins.value = filteredData;
|
||||
break;
|
||||
case 'teacher':
|
||||
teacherAdmins.value = filteredData;
|
||||
break;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取管理员列表失败:', error);
|
||||
ElMessage.error('获取管理员列表失败');
|
||||
}
|
||||
}
|
||||
|
||||
function getSearchForm(type: string) {
|
||||
switch (type) {
|
||||
case 'school':
|
||||
return schoolSearchForm;
|
||||
case 'custom':
|
||||
return customSearchForm;
|
||||
case 'teacher':
|
||||
return teacherSearchForm;
|
||||
default:
|
||||
return schoolSearchForm;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchAdmins('school');
|
||||
fetchAdmins('custom');
|
||||
fetchAdmins('teacher');
|
||||
});
|
||||
|
||||
function onAdd(type: string) {
|
||||
dialogMode.value = 'add';
|
||||
currentAdmin.value = { id: null, name: '', phone: '', sex: 0, remark: '', scope: '' };
|
||||
activeTab.value = type; // 确保当前标签页与点击的按钮一致
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
|
||||
function onEdit(type: string, admin: any) {
|
||||
dialogMode.value = 'edit';
|
||||
currentAdmin.value = { ...admin };
|
||||
activeTab.value = type; // 确保当前标签页与编辑的管理员类型一致
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
|
||||
async function onDelete(type: string, admin: any) {
|
||||
// 二次确认
|
||||
ElMessageBox.confirm(`确定要删除管理员【${admin.name}】吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
try {
|
||||
// 模拟删除成功
|
||||
mockData[type] = mockData[type].filter((item) => item.id !== admin.id);
|
||||
ElMessage.success('删除成功');
|
||||
fetchAdmins(type); // 删除后刷新
|
||||
} catch (e) {
|
||||
ElMessage.error('删除失败');
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户取消
|
||||
});
|
||||
}
|
||||
|
||||
function onScope(type: string, admin: any) {
|
||||
currentAdmin.value = { ...admin };
|
||||
scopeType.value = type;
|
||||
scopeDialogVisible.value = true;
|
||||
}
|
||||
|
||||
function onDialogSubmit(admin: any) {
|
||||
// 模拟添加或编辑操作
|
||||
if (dialogMode.value === 'add') {
|
||||
// 生成新ID
|
||||
const newId = Math.max(...mockData[activeTab.value].map((item) => item.id), 0) + 1;
|
||||
admin.id = newId;
|
||||
mockData[activeTab.value].push(admin);
|
||||
} else {
|
||||
// 编辑
|
||||
const index = mockData[activeTab.value].findIndex((item) => item.id === admin.id);
|
||||
if (index !== -1) {
|
||||
mockData[activeTab.value][index] = admin;
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新列表数据
|
||||
fetchAdmins(activeTab.value);
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
|
||||
async function onScopeSubmit(scope: any) {
|
||||
try {
|
||||
// 模拟分配范围
|
||||
const index = mockData[scopeType.value].findIndex((item) => item.id === currentAdmin.value.id);
|
||||
if (index !== -1) {
|
||||
mockData[scopeType.value][index].scope = scope.scopeName;
|
||||
}
|
||||
|
||||
// 成功后刷新数据并提示
|
||||
ElMessage.success('管理范围分配成功');
|
||||
fetchAdmins(scopeType.value);
|
||||
scopeDialogVisible.value = false;
|
||||
} catch (error) {
|
||||
ElMessage.error('管理范围分配失败');
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
function getListByType(type: string) {
|
||||
switch (type) {
|
||||
case 'school':
|
||||
return schoolAdmins;
|
||||
case 'custom':
|
||||
return customAdmins;
|
||||
case 'teacher':
|
||||
return teacherAdmins;
|
||||
default:
|
||||
return schoolAdmins;
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤
|
||||
function filteredAdmins(type: string) {
|
||||
return getListByType(type).value;
|
||||
}
|
||||
|
||||
function handleSearch(type: string) {
|
||||
fetchAdmins(type);
|
||||
}
|
||||
|
||||
function handleReset(type: string) {
|
||||
switch (type) {
|
||||
case 'school':
|
||||
schoolSearchForm.name = '';
|
||||
schoolSearchForm.phone = '';
|
||||
break;
|
||||
case 'custom':
|
||||
customSearchForm.name = '';
|
||||
customSearchForm.phone = '';
|
||||
break;
|
||||
case 'teacher':
|
||||
teacherSearchForm.name = '';
|
||||
teacherSearchForm.phone = '';
|
||||
break;
|
||||
}
|
||||
fetchAdmins(type);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card {
|
||||
padding: 8px !important;
|
||||
}
|
||||
.search-form {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,713 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-row :gutter="20">
|
||||
<!-- 部门树 -->
|
||||
<el-col :lg="4" :xs="24" style="">
|
||||
<el-card shadow="hover">
|
||||
<el-input v-model="deptName" placeholder="请输入院系名称" prefix-icon="Search" clearable />
|
||||
<el-tree
|
||||
ref="deptTreeRef"
|
||||
class="mt-2"
|
||||
node-key="id"
|
||||
:data="deptOptions"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :lg="20" :xs="24">
|
||||
<transition enter-active-class="animate__animated animate__fadeIn" leave-active-class="animate__animated animate__fadeOut">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" inline>
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="学生状态" clearable>
|
||||
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" style="width: 308px">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button :disabled="single" icon="Edit" @click="handleUpdate()"> 修改 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button :disabled="multiple" icon="Delete" @click="handleDelete()"> 删除 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-dropdown class="mt-[1px]">
|
||||
<el-button>
|
||||
更多
|
||||
<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item icon="Download" @click="importTemplate">下载模板</el-dropdown-item>
|
||||
<el-dropdown-item icon="Top" @click="handleImport">导入数据</el-dropdown-item>
|
||||
<el-dropdown-item icon="Download" @click="handleExport">导出数据</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-col>
|
||||
<right-toolbar v-model:show-search="showSearch" :columns="columns" :search="true" @query-table="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="studentList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column v-if="columns[0].visible" key="studentId" label="学生编号" align="center" prop="studentId" />
|
||||
<el-table-column v-if="columns[1].visible" key="studentNo" label="学号" align="center" prop="studentNo" :show-overflow-tooltip="true" />
|
||||
<el-table-column
|
||||
v-if="columns[2].visible"
|
||||
key="studentName"
|
||||
label="姓名"
|
||||
align="center"
|
||||
prop="studentName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column v-if="columns[3].visible" key="deptName" label="院系" align="center" prop="deptName" :show-overflow-tooltip="true" />
|
||||
<el-table-column v-if="columns[4].visible" key="majorName" label="专业" align="center" prop="majorName" :show-overflow-tooltip="true" />
|
||||
<el-table-column v-if="columns[5].visible" key="className" label="班级" align="center" prop="className" :show-overflow-tooltip="true" />
|
||||
<el-table-column v-if="columns[6].visible" key="phonenumber" label="手机号码" align="center" prop="phonenumber" width="120" />
|
||||
<el-table-column v-if="columns[7].visible" key="status" label="状态" align="center">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column v-if="columns[8].visible" label="创建时间" align="center" prop="createTime" width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right" width="240" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip content="重置密码" placement="top">
|
||||
<el-button link type="primary" icon="Key" @click="handleResetPwd(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip content="详细信息" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleDetail(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改学生配置对话框 -->
|
||||
<el-dialog v-model="dialog.visible" :title="dialog.title" width="600px" append-to-body @close="closeDialog">
|
||||
<el-form ref="studentFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="form.studentName" placeholder="请输入学生姓名" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入昵称" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属院系" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="form.deptId"
|
||||
:data="deptOptions"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
value-key="id"
|
||||
placeholder="请选择归属院系"
|
||||
check-strictly
|
||||
@change="handleDeptChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="专业" prop="majorId">
|
||||
<el-select v-model="form.majorId" placeholder="请选择专业" @change="handleMajorChange">
|
||||
<el-option v-for="item in majorOptions" :key="item.majorId" :label="item.majorName" :value="item.majorId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班级" prop="classId">
|
||||
<el-select v-model="form.classId" placeholder="请选择班级">
|
||||
<el-option v-for="item in classOptions" :key="item.classId" :label="item.className" :value="item.classId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="form.idCard" placeholder="请输入身份证号" maxlength="18" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.studentId == undefined" label="学号" prop="studentNo">
|
||||
<el-input v-model="form.studentNo" placeholder="请输入学号" maxlength="20" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="form.studentId == undefined" label="密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入密码" type="password" maxlength="20" show-password />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生性别">
|
||||
<el-select v-model="form.sex" placeholder="请选择">
|
||||
<el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="form.address" type="textarea" placeholder="请输入地址"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel()">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 学生详情对话框 -->
|
||||
<el-dialog v-model="detailDialog.visible" :title="detailDialog.title" width="700px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="学生姓名">{{ detailForm.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">{{ detailForm.studentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="院系">{{ detailForm.deptName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">{{ detailForm.majorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ detailForm.className }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
{{ detailForm.sex === '0' ? '男' : detailForm.sex === '1' ? '女' : '未知' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号码">{{ detailForm.phonenumber }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">{{ detailForm.email }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号">{{ detailForm.idCard }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<el-tag :type="detailForm.status === '0' ? 'success' : 'danger'">
|
||||
{{ detailForm.status === '0' ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="地址" :span="2">{{ detailForm.address }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ detailForm.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailDialog.visible = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 学生导入对话框 -->
|
||||
<el-dialog v-model="upload.open" :title="upload.title" width="400px" append-to-body>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<el-icon class="el-icon--upload">
|
||||
<i-ep-upload-filled />
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<template #tip>
|
||||
<div class="text-center el-upload__tip">
|
||||
<div class="el-upload__tip"><el-checkbox v-model="upload.updateSupport" />是否更新已经存在的学生数据</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import api from '@/api/studentMsg/index';
|
||||
import { StudentForm, StudentQuery, StudentVO } from '@/api/studentMsg/types';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { getCurrentInstance, ref, reactive, toRefs, watchEffect, onMounted } from 'vue';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { to } from 'await-to-js';
|
||||
import type { UploadFile, UploadInstance } from 'element-plus';
|
||||
import type { FormInstance, TreeInstance } from 'element-plus';
|
||||
|
||||
interface ComponentInternalInstance {
|
||||
proxy?: any;
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const sys_normal_disable = ref([
|
||||
{ value: '0', label: '正常' },
|
||||
{ value: '1', label: '停用' }
|
||||
]);
|
||||
const sys_user_sex = ref([
|
||||
{ value: '0', label: '男' },
|
||||
{ value: '1', label: '女' },
|
||||
{ value: '2', label: '未知' }
|
||||
]);
|
||||
|
||||
const studentList = ref<StudentVO[]>([]);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<number | string>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
const deptName = ref('');
|
||||
const deptOptions = ref([]);
|
||||
const majorOptions = ref([]);
|
||||
const classOptions = ref([]);
|
||||
|
||||
// 列显隐信息
|
||||
const columns = ref([
|
||||
{ key: 0, label: `学生编号`, visible: false },
|
||||
{ key: 1, label: `学号`, visible: true },
|
||||
{ key: 2, label: `姓名`, visible: true },
|
||||
{ key: 3, label: `院系`, visible: true },
|
||||
{ key: 4, label: `专业`, visible: true },
|
||||
{ key: 5, label: `班级`, visible: true },
|
||||
{ key: 6, label: `手机号码`, visible: true },
|
||||
{ key: 7, label: `状态`, visible: true },
|
||||
{ key: 8, label: `创建时间`, visible: true }
|
||||
]);
|
||||
|
||||
const deptTreeRef = ref<TreeInstance>();
|
||||
const queryFormRef = ref<FormInstance>();
|
||||
const studentFormRef = ref<FormInstance>();
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
|
||||
const initPassword = ref('123456');
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const detailDialog = reactive({
|
||||
visible: false,
|
||||
title: '学生详情'
|
||||
});
|
||||
|
||||
const detailForm = reactive<StudentVO>({
|
||||
studentId: '',
|
||||
studentNo: '',
|
||||
studentName: ''
|
||||
});
|
||||
|
||||
// 导入参数
|
||||
const upload = reactive({
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的数据
|
||||
updateSupport: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' },
|
||||
// 上传的地址
|
||||
url: '/api/studentMsg/student/importData'
|
||||
});
|
||||
|
||||
const initFormData: StudentForm = {
|
||||
studentId: undefined,
|
||||
deptId: undefined,
|
||||
studentNo: '',
|
||||
studentName: '',
|
||||
nickName: '',
|
||||
password: '',
|
||||
phonenumber: '',
|
||||
email: '',
|
||||
idCard: '',
|
||||
sex: '0',
|
||||
status: '0',
|
||||
majorId: undefined,
|
||||
classId: undefined,
|
||||
address: '',
|
||||
remark: ''
|
||||
};
|
||||
|
||||
const form = reactive<StudentForm>({
|
||||
...initFormData
|
||||
});
|
||||
|
||||
const rules = reactive({
|
||||
studentName: [{ required: true, message: '学生姓名不能为空', trigger: 'blur' }],
|
||||
studentNo: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '密码不能为空', trigger: 'blur' }],
|
||||
deptId: [{ required: true, message: '归属院系不能为空', trigger: 'blur' }],
|
||||
majorId: [{ required: true, message: '专业不能为空', trigger: 'blur' }],
|
||||
classId: [{ required: true, message: '班级不能为空', trigger: 'blur' }],
|
||||
email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
|
||||
phonenumber: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }],
|
||||
idCard: [{ pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '请输入正确的身份证号码', trigger: 'blur' }]
|
||||
});
|
||||
|
||||
const queryParams = reactive<StudentQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
phonenumber: '',
|
||||
status: '',
|
||||
deptId: undefined
|
||||
});
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value: string, data: any) => {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
/** 根据名称筛选部门树 */
|
||||
watchEffect(
|
||||
() => {
|
||||
deptTreeRef.value?.filter(deptName.value);
|
||||
},
|
||||
{ flush: 'post' }
|
||||
);
|
||||
|
||||
/** 查询学生列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await api.listStudent(queryParams);
|
||||
loading.value = false;
|
||||
studentList.value = res.data.data.rows;
|
||||
total.value = res.data.data.total;
|
||||
};
|
||||
|
||||
/** 查询部门下拉树结构 */
|
||||
const getDeptTree = async () => {
|
||||
try {
|
||||
const res = await api.XgDeptTreeSelect(101);
|
||||
// XgDeptTreeSelect返回的数据结构与deptTreeSelect不同,需要进行适当处理
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
deptOptions.value = res.data;
|
||||
} else {
|
||||
console.warn('部门树数据格式不符合预期');
|
||||
// 回退到默认处理
|
||||
const backup = await api.deptTreeSelect();
|
||||
deptOptions.value = backup.data.data;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取部门树失败:', error);
|
||||
// 如果API调用失败,可以使用默认的deptTreeSelect作为备选
|
||||
const backup = await api.deptTreeSelect();
|
||||
deptOptions.value = backup.data.data;
|
||||
}
|
||||
};
|
||||
|
||||
/** 节点单击事件 */
|
||||
const handleNodeClick = (data: any) => {
|
||||
queryParams.deptId = data.id;
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
dateRange.value = ['', ''];
|
||||
queryFormRef.value?.resetFields();
|
||||
queryParams.pageNum = 1;
|
||||
queryParams.deptId = undefined;
|
||||
deptTreeRef.value?.setCurrentKey(undefined);
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: StudentVO) => {
|
||||
const studentIds = row?.studentId || ids.value;
|
||||
const [err] = await to(ElMessageBox.confirm('是否确认删除学生编号为"' + studentIds + '"的数据项?', '提示'));
|
||||
if (!err) {
|
||||
await api.delStudent(studentIds);
|
||||
await getList();
|
||||
ElMessage.success('删除成功');
|
||||
}
|
||||
};
|
||||
|
||||
/** 学生状态修改 */
|
||||
const handleStatusChange = async (row: StudentVO) => {
|
||||
const text = row.status === '0' ? '启用' : '停用';
|
||||
try {
|
||||
await ElMessageBox.confirm('确认要"' + text + '""' + row.studentName + '"学生吗?', '提示');
|
||||
await api.changeStudentStatus(row.studentId, row.status);
|
||||
ElMessage.success(text + '成功');
|
||||
} catch (err) {
|
||||
row.status = row.status === '0' ? '1' : '0';
|
||||
}
|
||||
};
|
||||
|
||||
/** 查看详情按钮操作 */
|
||||
const handleDetail = async (row: StudentVO) => {
|
||||
Object.assign(detailForm, row);
|
||||
detailDialog.visible = true;
|
||||
};
|
||||
|
||||
/** 重置密码按钮操作 */
|
||||
const handleResetPwd = async (row: StudentVO) => {
|
||||
const [err, res] = await to(
|
||||
ElMessageBox.prompt('请输入"' + row.studentName + '"的新密码', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
closeOnClickModal: false,
|
||||
inputPattern: /^.{6,20}$/,
|
||||
inputErrorMessage: '密码长度必须介于 6 和 20 之间'
|
||||
})
|
||||
);
|
||||
if (!err && res) {
|
||||
// 实际项目中需要调用重置密码API
|
||||
ElMessage.success('修改成功,新密码是:' + res.value);
|
||||
}
|
||||
};
|
||||
|
||||
/** 选择条数 */
|
||||
const handleSelectionChange = (selection: StudentVO[]) => {
|
||||
ids.value = selection.map((item) => item.studentId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 导入按钮操作 */
|
||||
const handleImport = () => {
|
||||
upload.title = '学生导入';
|
||||
upload.open = true;
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
// 实际项目中需要调用导出API
|
||||
ElMessage.success('导出成功');
|
||||
};
|
||||
|
||||
/** 下载模板操作 */
|
||||
const importTemplate = () => {
|
||||
// 实际项目中需要调用下载模板API
|
||||
ElMessage.success('下载模板成功');
|
||||
};
|
||||
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = () => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response: any) => {
|
||||
upload.open = false;
|
||||
upload.isUploading = false;
|
||||
uploadRef.value?.clearFiles();
|
||||
ElMessageBox.alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>', '导入结果', {
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 提交上传文件 */
|
||||
const submitFileForm = () => {
|
||||
uploadRef.value?.submit();
|
||||
};
|
||||
|
||||
/** 重置操作表单 */
|
||||
const reset = () => {
|
||||
Object.assign(form, initFormData);
|
||||
studentFormRef.value?.resetFields();
|
||||
majorOptions.value = [];
|
||||
classOptions.value = [];
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
dialog.visible = false;
|
||||
reset();
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = async () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '新增学生';
|
||||
form.password = initPassword.value;
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: StudentForm) => {
|
||||
reset();
|
||||
const studentId = row?.studentId || ids.value[0];
|
||||
const { data } = await api.getStudent(studentId);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改学生';
|
||||
Object.assign(form, data.data.student);
|
||||
majorOptions.value = data.data.majors;
|
||||
classOptions.value = data.data.classes;
|
||||
};
|
||||
|
||||
/** 院系变更事件 */
|
||||
const handleDeptChange = (deptId: number) => {
|
||||
form.majorId = undefined;
|
||||
form.classId = undefined;
|
||||
majorOptions.value = [];
|
||||
classOptions.value = [];
|
||||
// 根据院系ID过滤专业选项
|
||||
const majors = api.getStudent().then((res) => {
|
||||
return res.data.data.majors.filter((item: any) => item.deptId === deptId);
|
||||
});
|
||||
majors.then((data) => {
|
||||
majorOptions.value = data;
|
||||
});
|
||||
};
|
||||
|
||||
/** 专业变更事件 */
|
||||
const handleMajorChange = (majorId: number) => {
|
||||
form.classId = undefined;
|
||||
classOptions.value = [];
|
||||
// 根据专业ID过滤班级选项
|
||||
const classes = api.getStudent().then((res) => {
|
||||
return res.data.data.classes.filter((item: any) => item.majorId === majorId);
|
||||
});
|
||||
classes.then((data) => {
|
||||
classOptions.value = data;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
studentFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (form.studentId !== undefined) {
|
||||
await api.updateStudent(form);
|
||||
} else {
|
||||
await api.addStudent(form);
|
||||
}
|
||||
ElMessage.success('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 关闭学生弹窗
|
||||
*/
|
||||
const closeDialog = () => {
|
||||
dialog.visible = false;
|
||||
reset();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getDeptTree(); // 初始化部门数据
|
||||
getList(); // 初始化列表数据
|
||||
});
|
||||
</script>
|
||||
@@ -26,7 +26,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="性别" prop="gender" required>
|
||||
<el-select v-model="applyForm.gender" placeholder="请选择性别" style="width: 100%">
|
||||
<el-select v-model="applyForm.gender" placeholder="请选择性别" style="width: 100%; font-size: 14px; font-weight: bold;" :key="applyForm.gender">
|
||||
<el-option v-for="dict in zsjy_gender" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -269,7 +269,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="EnrollmentApply" lang="ts">
|
||||
import { reactive, ref, toRefs, getCurrentInstance, ComponentInternalInstance, onMounted } from 'vue';
|
||||
import { reactive, ref, toRefs, getCurrentInstance, ComponentInternalInstance, onMounted, nextTick } from 'vue';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { submitEnrollmentApplication, queryMyEnrollmentStatus } from '@/api/zsjy/enrollment';
|
||||
import { EnrollmentInfoForm } from '@/api/zsjy/enrollment/types';
|
||||
@@ -358,15 +358,31 @@ const rules = {
|
||||
const onIdCardChange = () => {
|
||||
const idCard = applyForm.idCard;
|
||||
if (idCard && idCard.length === 18) {
|
||||
// 提取出生日期
|
||||
const year = idCard.substring(6, 10);
|
||||
const month = idCard.substring(10, 12);
|
||||
const day = idCard.substring(12, 14);
|
||||
applyForm.birthDate = `${year}-${month}-${day}`;
|
||||
|
||||
// 提取性别(奇数为男M,偶数为女F)
|
||||
const genderCode = parseInt(idCard.substring(16, 17));
|
||||
applyForm.gender = genderCode % 2 === 1 ? 'M' : 'F';
|
||||
try {
|
||||
// 提取出生日期
|
||||
const year = idCard.substring(6, 10);
|
||||
const month = idCard.substring(10, 12);
|
||||
const day = idCard.substring(12, 14);
|
||||
applyForm.birthDate = `${year}-${month}-${day}`;
|
||||
|
||||
// 提取性别(奇数为男,偶数为女)
|
||||
const genderCode = parseInt(idCard.substring(16, 17));
|
||||
|
||||
// 根据奇偶性设置性别为'M'或'F'
|
||||
applyForm.gender = genderCode % 2 === 1 ? 'M' : 'F';
|
||||
|
||||
// 性别设置完成后,强制重新渲染一下
|
||||
nextTick(() => {
|
||||
// 通过临时设置为空再重新设置回来,强制UI更新
|
||||
const currentGender = applyForm.gender;
|
||||
applyForm.gender = '';
|
||||
setTimeout(() => {
|
||||
applyForm.gender = currentGender;
|
||||
}, 10);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('解析身份证信息时出错:', error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -426,6 +442,14 @@ const submitApplication = () => {
|
||||
if (valid) {
|
||||
try {
|
||||
submitLoading.value = true;
|
||||
|
||||
// 处理是否住宿字段,将"Y"/"N"转换为1/0
|
||||
if (applyForm.isBoarding === 'Y') {
|
||||
applyForm.isBoarding = 1;
|
||||
} else if (applyForm.isBoarding === 'N') {
|
||||
applyForm.isBoarding = 0;
|
||||
}
|
||||
|
||||
await submitEnrollmentApplication(applyForm);
|
||||
proxy?.$modal.msgSuccess('报名申请提交成功!');
|
||||
resetForm();
|
||||
@@ -452,14 +476,14 @@ const queryStatus = async () => {
|
||||
proxy?.$modal.msgWarning('请输入身份证号或准考证号');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
queryLoading.value = true;
|
||||
const response = await queryMyEnrollmentStatus({
|
||||
idCard: queryForm.idCard,
|
||||
examNumber: queryForm.examNumber
|
||||
});
|
||||
|
||||
|
||||
if (response.data) {
|
||||
statusInfo.value = response.data;
|
||||
statusDialog.visible = true;
|
||||
@@ -571,4 +595,4 @@ onMounted(() => {
|
||||
.status-tips p {
|
||||
margin: 5px 0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -28,7 +28,8 @@
|
||||
<span class="detail-value">{{ processData.currentHandlerName || '-' }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="完成状态">
|
||||
<dict-tag :options="sys_yes_no" :value="processData.isCompleted" />
|
||||
<el-tag type="success" v-if="processData.isCompleted === 1 || processData.isCompleted === '1'">已完成</el-tag>
|
||||
<el-tag type="info" v-else>未完成</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
<span class="detail-value">{{ parseTime(processData.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
@@ -111,7 +112,9 @@
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="缴费状态">
|
||||
<dict-tag :options="zsjy_payment_status" :value="processData.paymentStatus" />
|
||||
<el-tag :type="processData.paymentStatus == 1 ? 'success' : 'info'">
|
||||
{{ processData.paymentStatus == 1 ? '已缴费' : '未缴费' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="缴费确认时间">
|
||||
<span class="detail-value">{{ parseTime(processData.paymentConfirmTime, '{y}-{m}-{d} {h}:{i}:{s}') || '-' }}</span>
|
||||
@@ -191,6 +194,15 @@ const dialogVisible = computed({
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
const isCompletedTag = computed(() => {
|
||||
return String(processData.value.isCompleted) === '1' ? 'success' : 'info'
|
||||
})
|
||||
|
||||
const isCompletedText = computed(() => {
|
||||
return String(processData.value.isCompleted) === '1' ? '已完成' : '未完成'
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -395,4 +407,4 @@ const handleClose = () => {
|
||||
background: #fff !important;
|
||||
color: #303133 !important;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="page-container">
|
||||
<!-- 搜索区域 -->
|
||||
<el-card class="search-card">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="80px">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
@@ -27,50 +27,18 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="当前状态" prop="currentStatus">
|
||||
<el-select
|
||||
v-model="queryParams.currentStatus"
|
||||
placeholder="请选择当前状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in zsjy_enrollment_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="完成状态" prop="isCompleted">
|
||||
<el-select
|
||||
v-model="queryParams.isCompleted"
|
||||
placeholder="请选择完成状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="search-btn-container">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 统计卡片 -->
|
||||
<el-row :gutter="16" class="stat-cards">
|
||||
<el-col :span="6">
|
||||
<el-col :span="8">
|
||||
<el-card class="stat-card stat-card-primary" shadow="hover">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
@@ -78,46 +46,33 @@
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.total || 0 }}</div>
|
||||
<div class="stat-label">总流程数</div>
|
||||
<div class="stat-label">待处理录取数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card stat-card-warning" shadow="hover">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Clock /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.pending || 0 }}</div>
|
||||
<div class="stat-label">待处理</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="8">
|
||||
<el-card class="stat-card stat-card-info" shadow="hover">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Clock /></el-icon>
|
||||
<el-icon><CreditCard /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.processing || 0 }}</div>
|
||||
<div class="stat-label">处理中</div>
|
||||
<div class="stat-value">{{ statistics.paymentConfirmed || 0 }}</div>
|
||||
<div class="stat-label">已缴费人数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="8">
|
||||
<el-card class="stat-card stat-card-success" shadow="hover">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Select /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.completed || 0 }}</div>
|
||||
<div class="stat-label">已完成</div>
|
||||
<div class="stat-value">{{ statistics.admissionProcessed || 0 }}</div>
|
||||
<div class="stat-label">已处理人数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -128,7 +83,7 @@
|
||||
<el-card class="button-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="toolbar-title">录取流程管理</span>
|
||||
<span class="toolbar-title">录取处理管理</span>
|
||||
<div class="toolbar-actions">
|
||||
<el-button
|
||||
v-hasPermi="['zsjy:enrollmentProcess:export']"
|
||||
@@ -162,9 +117,11 @@
|
||||
row-key="id"
|
||||
class="scroll-table"
|
||||
@selection-change="handleSelectionChange"
|
||||
fit
|
||||
border
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="学生信息" align="center" width="200">
|
||||
<el-table-column label="学生信息" align="center" min-width="180">
|
||||
<template #default="scope">
|
||||
<div style="text-align: left;">
|
||||
<div style="font-weight: 600; color: #303133;">{{ scope.row.studentName }}</div>
|
||||
@@ -172,36 +129,36 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前状态" align="center" width="120">
|
||||
<el-table-column label="当前状态" align="center" min-width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="zsjy_enrollment_status" :value="scope.row.currentStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前处理人" align="center" width="120" prop="currentHandlerName" />
|
||||
<el-table-column label="缴费状态" align="center" width="100">
|
||||
<el-table-column label="当前处理人" align="center" min-width="100" prop="currentHandlerName" />
|
||||
<el-table-column label="缴费状态" align="center" min-width="90">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.payment_status === '1' || scope.row.paymentStatus === '1'" type="success">已缴费</el-tag>
|
||||
<el-tag v-else-if="scope.row.payment_status === '0' || scope.row.paymentStatus === '0'" type="warning">未缴费</el-tag>
|
||||
<el-tag v-else type="info">未知</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="录取通知书" align="center" width="150" show-overflow-tooltip>
|
||||
<el-table-column label="录取通知书" align="center" min-width="120" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.noticeNumber || scope.row.notice_number || '未生成' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成状态" align="center" width="100">
|
||||
<el-table-column label="完成状态" align="center" min-width="90">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.is_completed === 1 || scope.row.is_completed === '1' || scope.row.is_completed === 'Y'" type="success">是</el-tag>
|
||||
<el-tag v-else type="info">否</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" width="180">
|
||||
<el-table-column label="创建时间" align="center" min-width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="280" fixed="right">
|
||||
<el-table-column label="操作" align="center" min-width="250" fixed="right">
|
||||
<template #default="scope">
|
||||
<div class="action-buttons">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
@@ -224,7 +181,7 @@
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="(scope.row.payment_status !== '1' && scope.row.paymentStatus !== '1') ?
|
||||
'请先完成缴费确认' : '录取处理'" placement="top">
|
||||
'请先完成缴费确认' : '录取处理'" placement="top">
|
||||
<el-button
|
||||
v-hasPermi="['zsjy:enrollmentProcess:process']"
|
||||
link
|
||||
@@ -241,9 +198,9 @@
|
||||
type="info"
|
||||
icon="CircleCheck"
|
||||
:disabled="(scope.row.payment_status !== '1' && scope.row.paymentStatus !== '1') ||
|
||||
(scope.row.admissionStatus !== '1' && scope.row.admission_status !== '1') ||
|
||||
scope.row.is_completed === 1 ||
|
||||
scope.row.is_completed === 'Y'"
|
||||
(scope.row.admissionStatus !== '1' && scope.row.admission_status !== '1') ||
|
||||
scope.row.is_completed === 1 ||
|
||||
scope.row.is_completed === 'Y'"
|
||||
@click="handleComplete(scope.row)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
@@ -372,9 +329,8 @@ const handleSelectionChange = (selection: EnrollmentProcessVO[]) => {
|
||||
// 统计数据
|
||||
const statistics = ref({
|
||||
total: 0,
|
||||
pending: 0,
|
||||
processing: 0,
|
||||
completed: 0
|
||||
paymentConfirmed: 0,
|
||||
admissionProcessed: 0
|
||||
})
|
||||
|
||||
// 对话框状态
|
||||
@@ -389,65 +345,93 @@ const currentProcess = ref<Partial<EnrollmentProcessVO>>({})
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
// 设置查询参数,只查询录取处理中且未完成的数据
|
||||
queryParams.value.currentStatus = '2' // 只查询录取处理中的数据
|
||||
queryParams.value.isCompleted = 0 // 只查询未完成的数据
|
||||
|
||||
const res = await listEnrollmentProcess(queryParams.value)
|
||||
|
||||
// 对返回的数据进行处理,确保字段名一致
|
||||
const processedList = (res.rows || []).map(item => {
|
||||
// 添加日志用于调试(首行数据)
|
||||
if (item === res.rows[0]) {
|
||||
console.log('首行数据字段:', Object.keys(item))
|
||||
console.log('首行数据内容:', JSON.stringify(item))
|
||||
}
|
||||
const processedList = (res.rows || [])
|
||||
// 过滤掉已完成录取的数据
|
||||
.filter(item => {
|
||||
const isCompleted = item.isCompleted || item.is_completed || 0;
|
||||
// 只保留未完成录取的数据
|
||||
return isCompleted === 0 || isCompleted === '0';
|
||||
})
|
||||
.map(item => {
|
||||
// 添加日志用于调试(首行数据)
|
||||
if (item === res.rows[0]) {
|
||||
console.log('首行数据字段:', Object.keys(item))
|
||||
console.log('首行数据内容:', JSON.stringify(item))
|
||||
}
|
||||
|
||||
// 字段名映射处理
|
||||
return {
|
||||
...item,
|
||||
// 确保同时有驼峰式和下划线式的字段
|
||||
paymentStatus: item.paymentStatus || item.payment_status,
|
||||
payment_status: item.payment_status || item.paymentStatus,
|
||||
isCompleted: item.isCompleted || item.is_completed,
|
||||
is_completed: item.is_completed || item.isCompleted,
|
||||
noticeNumber: item.noticeNumber || item.notice_number,
|
||||
notice_number: item.notice_number || item.noticeNumber
|
||||
}
|
||||
})
|
||||
// 字段名映射处理
|
||||
return {
|
||||
...item,
|
||||
// 确保同时有驼峰式和下划线式的字段
|
||||
paymentStatus: item.paymentStatus || item.payment_status,
|
||||
payment_status: item.payment_status || item.paymentStatus,
|
||||
isCompleted: item.isCompleted || item.is_completed,
|
||||
is_completed: item.is_completed || item.isCompleted,
|
||||
noticeNumber: item.noticeNumber || item.notice_number,
|
||||
notice_number: item.notice_number || item.noticeNumber,
|
||||
admissionStatus: item.admissionStatus || item.admission_status,
|
||||
admission_status: item.admission_status || item.admissionStatus
|
||||
}
|
||||
})
|
||||
|
||||
processList.value = processedList
|
||||
total.value = res.total || 0
|
||||
total.value = processedList.length // 更新总数为过滤后的数量
|
||||
} catch (error) {
|
||||
console.error('获取流程列表失败:', error)
|
||||
|
||||
// 如果是404错误(接口不存在),使用模拟数据
|
||||
if (error?.response?.status === 404 || error?.message?.includes('404')) {
|
||||
console.warn('后端接口不存在,使用模拟数据')
|
||||
// 创建模拟的流程数据
|
||||
// 创建模拟的流程数据,只包含未完成录取的数据
|
||||
processList.value = [
|
||||
{
|
||||
id: 1946510098494091300,
|
||||
enrollmentId: 1001,
|
||||
studentName: '张三',
|
||||
idCard: '330101200501010001',
|
||||
currentStatus: '0',
|
||||
infoAuditStatus: '0',
|
||||
admissionStatus: '0',
|
||||
id: 1946510098494091302,
|
||||
enrollmentId: 1003,
|
||||
studentName: '王五',
|
||||
idCard: '110101200601010003',
|
||||
currentStatus: '2', // 录取处理中
|
||||
infoAuditStatus: '1',
|
||||
admissionStatus: '0', // 未处理录取
|
||||
paymentStatus: '0', // 未缴费
|
||||
finalAuditStatus: '0',
|
||||
isCompleted: 0,
|
||||
createTime: '2025-07-20 10:28:09'
|
||||
isCompleted: 0, // 未完成
|
||||
createTime: '2025-07-20 10:28:27'
|
||||
},
|
||||
{
|
||||
id: 1946510098494091301,
|
||||
enrollmentId: 1946510098494091266,
|
||||
studentName: '赵四',
|
||||
idCard: '340403201509091234',
|
||||
currentStatus: '0',
|
||||
infoAuditStatus: '0',
|
||||
admissionStatus: '0',
|
||||
id: 1946510098494091303,
|
||||
enrollmentId: 1004,
|
||||
studentName: '李六',
|
||||
idCard: '440106200701010004',
|
||||
currentStatus: '2', // 录取处理中
|
||||
infoAuditStatus: '1',
|
||||
admissionStatus: '0', // 未处理录取
|
||||
paymentStatus: '1', // 已缴费
|
||||
finalAuditStatus: '0',
|
||||
isCompleted: 0,
|
||||
createTime: '2025-07-20 10:28:18'
|
||||
isCompleted: 0, // 未完成
|
||||
createTime: '2025-07-20 10:28:36'
|
||||
},
|
||||
{
|
||||
id: 1946510098494091304,
|
||||
enrollmentId: 1005,
|
||||
studentName: '赵七',
|
||||
idCard: '330106200801010005',
|
||||
currentStatus: '2', // 录取处理中
|
||||
infoAuditStatus: '1',
|
||||
admissionStatus: '1', // 已处理录取
|
||||
paymentStatus: '1', // 已缴费
|
||||
finalAuditStatus: '0',
|
||||
isCompleted: 0, // 未完成
|
||||
createTime: '2025-07-20 10:28:45'
|
||||
}
|
||||
]
|
||||
total.value = 2
|
||||
total.value = 3
|
||||
proxy?.$modal.msgWarning('后端接口暂未实现,显示模拟数据')
|
||||
} else {
|
||||
// 其他错误,设置空数据并抛出错误
|
||||
@@ -467,28 +451,38 @@ const getStatistics = async () => {
|
||||
// const res = await getProcessStatistics()
|
||||
// const stats = res.data || []
|
||||
|
||||
// 基于当前流程列表计算统计数据
|
||||
// 基于当前流程列表计算统计数据(只包含录取处理中的数据)
|
||||
const stats = processList.value || []
|
||||
const statusCounts = stats.reduce((acc: any, item: any) => {
|
||||
const status = item.currentStatus
|
||||
acc[status] = (acc[status] || 0) + 1
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
// 计算已缴费人数和已处理人数
|
||||
let paymentConfirmed = 0
|
||||
let admissionProcessed = 0
|
||||
|
||||
stats.forEach(item => {
|
||||
// 计算已缴费人数
|
||||
if (item.paymentStatus === '1' || item.payment_status === '1') {
|
||||
paymentConfirmed++
|
||||
}
|
||||
|
||||
// 计算已处理人数(录取状态为已处理)
|
||||
if (item.admissionStatus === '1' || item.admission_status === '1') {
|
||||
admissionProcessed++
|
||||
}
|
||||
})
|
||||
|
||||
// 更新统计数据
|
||||
statistics.value = {
|
||||
total: stats.length,
|
||||
pending: (statusCounts['0'] || 0) + (statusCounts['1'] || 0), // 待审核 + 信息审核中
|
||||
processing: (statusCounts['2'] || 0) + (statusCounts['3'] || 0), // 录取处理中 + 待最终确认
|
||||
completed: statusCounts['4'] || 0 // 录取完成
|
||||
paymentConfirmed,
|
||||
admissionProcessed
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error)
|
||||
// 设置默认值
|
||||
statistics.value = {
|
||||
total: 0,
|
||||
pending: 0,
|
||||
processing: 0,
|
||||
completed: 0
|
||||
paymentConfirmed: 0,
|
||||
admissionProcessed: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -713,9 +707,28 @@ const getCompleteButtonTooltip = (row: any): string => {
|
||||
return '完成录取';
|
||||
}
|
||||
|
||||
/** 判断是否已缴费 */
|
||||
const isPaymentConfirmed = (row: any): boolean => {
|
||||
return row.payment_status === '1' || row.paymentStatus === '1';
|
||||
}
|
||||
|
||||
/** 判断是否已处理录取 */
|
||||
const isAdmissionProcessed = (row: any): boolean => {
|
||||
return row.admissionStatus === '1' || row.admission_status === '1';
|
||||
}
|
||||
|
||||
/** 判断是否已完成 */
|
||||
const isCompleted = (row: any): boolean => {
|
||||
return row.is_completed === 1 || row.is_completed === '1' || row.is_completed === 'Y';
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// 设置默认查询参数
|
||||
queryParams.value.currentStatus = '2' // 录取处理中
|
||||
queryParams.value.isCompleted = 0 // 未完成
|
||||
|
||||
// 处理路由参数
|
||||
const route = useRoute();
|
||||
if (route && route.query) {
|
||||
@@ -747,6 +760,8 @@ onMounted(async () => {
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 搜索卡片样式 */
|
||||
@@ -886,21 +901,28 @@ onMounted(async () => {
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
padding: 20px !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 表格容器 - 支持横向滚动 */
|
||||
.table-container {
|
||||
width: 100%;
|
||||
margin-bottom: 0;
|
||||
overflow-x: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* 横向滚动表格样式 */
|
||||
.scroll-table {
|
||||
width: 100%;
|
||||
table-layout: auto;
|
||||
}
|
||||
|
||||
/* 表格横向滚动条样式优化 */
|
||||
@@ -909,8 +931,12 @@ onMounted(async () => {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__header-wrapper) {
|
||||
overflow-x: hidden;
|
||||
/* 强制表格自适应容器宽度 */
|
||||
.scroll-table :deep(.el-table__header),
|
||||
.scroll-table :deep(.el-table__body) {
|
||||
width: 100% !important;
|
||||
min-width: 100% !important;
|
||||
table-layout: auto !important;
|
||||
}
|
||||
|
||||
/* 强制显示表格横向滚动条 - 适用于所有浏览器 */
|
||||
@@ -975,9 +1001,31 @@ onMounted(async () => {
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
padding: 16px 0 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 确保整个表格区域适应容器 */
|
||||
.el-card.table-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.el-card.table-card :deep(.el-card__body) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
padding: 20px !important;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
/* 操作按钮样式 */
|
||||
|
||||
@@ -0,0 +1,323 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
title="学生报名详情"
|
||||
width="1000px"
|
||||
class="student-detail-dialog"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="detail-container">
|
||||
<!-- 基本信息 -->
|
||||
<el-card class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="section-title">基本信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="姓名">{{ studentData.studentName || studentData.name || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号">{{ formatIdCard(studentData.idCard) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{ studentData.gender === 'M' ? '男' : '女' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">{{ formatDate(studentData.birthDate) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ studentData.phone1 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备用电话">{{ studentData.phone2 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="民族">{{ studentData.nation || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="是否住宿">{{ studentData.isBoarding === 1 || studentData.isBoarding === '1' ? '是' : '否' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="健康状况">{{ studentData.healthStatus || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="家庭住址" :span="3">{{ studentData.homeAddress || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 学业信息 -->
|
||||
<el-card class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="section-title">学业信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="毕业中学">{{ studentData.middleSchool || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="准考证号">{{ studentData.examNumber || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="中考地区">{{ studentData.examRegion || studentData.province || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="中考满分">{{ studentData.totalScoreFull || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="中考成绩">{{ studentData.totalScore || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="语文成绩">{{ studentData.chineseScore || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="数学成绩">{{ studentData.mathScore || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="英语成绩">{{ studentData.englishScore || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="科学成绩">{{ studentData.scienceScore || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="社会成绩">{{ studentData.socialScore || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="体育成绩">{{ studentData.peScore || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 报考信息 -->
|
||||
<el-card class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="section-title">报考信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="报考专业">{{ studentData.majorName || studentData.appliedMajor || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业代码">{{ studentData.majorCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="校服尺码">{{ studentData.uniformSize || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 其他信息 -->
|
||||
<el-card class="detail-card" shadow="never" v-if="studentData.specialties || studentData.awards">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="section-title">其他信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="特长爱好" v-if="studentData.specialties">{{ studentData.specialties }}</el-descriptions-item>
|
||||
<el-descriptions-item label="获奖情况" v-if="studentData.awards">{{ studentData.awards }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 录取流程信息 -->
|
||||
<el-card class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="section-title">录取流程信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="当前状态">
|
||||
<el-tag :type="getStatusType(studentData.currentStatus || studentData.enrollmentStatus)">
|
||||
{{ getStatusText(studentData.currentStatus || studentData.enrollmentStatus) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="处理人">{{ studentData.currentHandlerName || '-' }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="缴费状态">
|
||||
<span v-if="studentData.paymentStatus === '1'">
|
||||
<el-tag type="success">已缴费</el-tag>
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-tag type="info">未缴费</el-tag>
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="完成状态">
|
||||
<span v-if="isStudentCompleted">
|
||||
<el-tag type="success">已完成</el-tag>
|
||||
</span>
|
||||
<span v-else>
|
||||
<el-tag type="info">未完成</el-tag>
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="报名时间">{{ formatTime(studentData.createTime || studentData.applicationTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="最后更新时间">{{ formatTime(studentData.updateTime) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 备注信息 -->
|
||||
<el-card class="detail-card" shadow="never" v-if="studentData.remark">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="section-title">备注信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="remark-content">
|
||||
{{ studentData.remark }}
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import type { EnrollmentProcessVO } from '@/api/zsjy/enrollmentProcess';
|
||||
import type { EnrollmentInfoVO } from '@/api/zsjy/enrollment/types';
|
||||
|
||||
// 合并类型,处理可能存在的字段
|
||||
type StudentDataType = Partial<EnrollmentProcessVO> & Partial<EnrollmentInfoVO> & {
|
||||
// 额外可能存在的字段
|
||||
studentName?: string;
|
||||
majorName?: string;
|
||||
province?: string;
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
studentData: {
|
||||
type: Object as () => StudentDataType,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible']);
|
||||
|
||||
// 对话框可见性
|
||||
const dialogVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (value) => {
|
||||
emit('update:visible', value);
|
||||
}
|
||||
});
|
||||
|
||||
// 判断学生是否已完成
|
||||
const isStudentCompleted = computed(() => {
|
||||
const isCompleted = props.studentData.isCompleted;
|
||||
// 显式检查字符串和数字类型的值
|
||||
return String(isCompleted) === '1';
|
||||
});
|
||||
|
||||
// 格式化身份证号(隐藏中间部分)
|
||||
const formatIdCard = (idCard: string | undefined) => {
|
||||
if (!idCard) return '-';
|
||||
if (idCard.length >= 18) {
|
||||
return idCard.substring(0, 6) + '********' + idCard.substring(14);
|
||||
}
|
||||
return idCard;
|
||||
};
|
||||
|
||||
// 格式化日期
|
||||
const formatDate = (date: string | Date | undefined) => {
|
||||
if (!date) return '-';
|
||||
const d = new Date(date);
|
||||
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
||||
};
|
||||
|
||||
// 格式化时间
|
||||
const formatTime = (time: string | Date | undefined) => {
|
||||
if (!time) return '-';
|
||||
const date = new Date(time);
|
||||
return date.toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取状态类型
|
||||
const getStatusType = (status: string | undefined) => {
|
||||
if (!status) return 'info';
|
||||
switch (status) {
|
||||
case '0': return 'info'; // 待审核
|
||||
case '1': return 'warning'; // 信息审核中
|
||||
case '2': return 'warning'; // 录取处理中
|
||||
case '3': return 'warning'; // 待最终确认
|
||||
case '4': return 'success'; // 录取完成
|
||||
case '9': return 'danger'; // 已驳回
|
||||
default: return 'info';
|
||||
}
|
||||
};
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: string | undefined) => {
|
||||
if (!status) return '未知状态';
|
||||
switch (status) {
|
||||
case '0': return '待审核';
|
||||
case '1': return '信息审核中';
|
||||
case '2': return '录取处理中';
|
||||
case '3': return '待最终确认';
|
||||
case '4': return '录取完成';
|
||||
case '9': return '已驳回';
|
||||
default: return '未知状态';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.student-detail-dialog :deep(.el-dialog__header) {
|
||||
background: linear-gradient(135deg, rgb(93, 135, 255) 0%, rgb(73, 190, 255) 100%);
|
||||
color: white;
|
||||
padding: 20px 24px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.student-detail-dialog :deep(.el-dialog__title) {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.student-detail-dialog :deep(.el-dialog__body) {
|
||||
padding: 20px 24px;
|
||||
}
|
||||
|
||||
.detail-container {
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
margin-bottom: 16px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.detail-card:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
position: relative;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.section-title::before {
|
||||
content: '';
|
||||
width: 3px;
|
||||
height: 16px;
|
||||
background: linear-gradient(135deg, rgb(93, 135, 255), rgb(73, 190, 255));
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.remark-content {
|
||||
background-color: #f8f9fa;
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
border-left: 3px solid #409eff;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions__label) {
|
||||
width: 120px;
|
||||
background-color: #f7f7f7 !important;
|
||||
}
|
||||
|
||||
/* 美化滚动条 */
|
||||
.detail-container::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.detail-container::-webkit-scrollbar-thumb {
|
||||
border-radius: 3px;
|
||||
background-color: #c0c4cc;
|
||||
}
|
||||
|
||||
.detail-container::-webkit-scrollbar-track {
|
||||
border-radius: 3px;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,755 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 搜索条件区域 -->
|
||||
<transition :enter-active-class="animate.searchAnimate?.enter" :leave-active-class="animate.searchAnimate?.leave">
|
||||
<div ref="searchRef" v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<!-- 第一行条件 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属学院" prop="collegeId">
|
||||
<el-select v-model="queryParams.params.collegeId" placeholder="请选择学院" clearable class="w-100" @change="onSearchCollegeChange">
|
||||
<el-option
|
||||
v-for="college in collegeOptions"
|
||||
:key="college.deptId"
|
||||
:label="college.deptName"
|
||||
:value="college.deptCategory"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="专业" prop="majorId">
|
||||
<el-select v-model="queryParams.params.majorId" placeholder="请选择专业" clearable class="w-100">
|
||||
<el-option
|
||||
v-for="major in searchMajorOptions"
|
||||
:key="major.value"
|
||||
:label="major.label"
|
||||
:value="major.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第二行条件 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="queryParams.params.gender" placeholder="请选择性别" clearable >
|
||||
<el-option v-for="option in genderOptions" :key="option.code" :label="option.name" :value="option.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="当前状态" prop="currentStatus">
|
||||
<el-select v-model="queryParams.currentStatus" placeholder="请选择状态" clearable >
|
||||
<el-option v-for="option in statusOptions" :key="option.code" :label="option.name" :value="option.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="地区" prop="province">
|
||||
<el-select v-model="queryParams.params.province" placeholder="请选择地区" clearable>
|
||||
<el-option v-for="option in regionOptions" :key="option.code" :label="option.name" :value="option.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="缴费状态" prop="paymentStatus">
|
||||
<el-select v-model="queryParams.params.paymentStatus" placeholder="请选择缴费状态" clearable>
|
||||
<el-option :label="'未缴费'" :value="'0'" />
|
||||
<el-option :label="'已缴费'" :value="'1'" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第三行条件 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名日期" prop="dateRange">
|
||||
<el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 380px" value-format="YYYY-MM-DD" @change="handleDateRangeChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button icon="Download" @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 表格数据展示 -->
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Download" type="primary" plain @click="handleExport">导出数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="tableLoading" :data="enrollmentList" stripe border style="width: 100%">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column prop="studentName" label="学生姓名" min-width="100" align="center" />
|
||||
<el-table-column prop="idCard" label="身份证号" min-width="180" align="center" :formatter="formatIdCard" show-overflow-tooltip />
|
||||
<el-table-column prop="gender" label="性别" width="80" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.gender === 'M' ? '男' : '女' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属学院" min-width="150" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ scope.row.applied_major }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专业" min-width="150" align="center" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ scope.row.majorName || scope.row.applied_major || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="province" label="地区" min-width="100" align="center" />
|
||||
<el-table-column prop="currentStatus" label="当前状态" min-width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusType(scope.row.currentStatus)">{{ getStatusText(scope.row.currentStatus) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="paymentStatus" label="缴费状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.paymentStatus === '1' ? 'success' : 'info'">
|
||||
{{ scope.row.paymentStatus === '1' ? '已缴费' : '未缴费' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isCompleted" label="是否完成" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.isCompleted === 1 || scope.row.isCompleted === '1' ? 'success' : 'info'">
|
||||
{{ scope.row.isCompleted === 1 || scope.row.isCompleted === '1' ? '已完成' : '未完成' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="报名时间" min-width="160" align="center" sortable />
|
||||
<el-table-column label="操作" fixed="right" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 学生详情对话框 -->
|
||||
<StudentDetailDialog
|
||||
v-model:visible="detailDialogVisible"
|
||||
:student-data="currentStudent"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, getCurrentInstance } from 'vue';
|
||||
import { listEnrollmentProcess, exportEnrollmentProcess, EnrollmentProcessQuery, EnrollmentProcessVO, getEnrollmentProcess } from '@/api/zsjy/enrollmentProcess';
|
||||
import { listDept } from '@/api/system/dept';
|
||||
import type { DeptVO } from '@/api/system/dept/types';
|
||||
import StudentDetailDialog from './components/StudentDetailDialog.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { zsjy_gender, sys_yes_no, zsjy_major, zsjy_college } = proxy?.useDict('zsjy_gender', 'sys_yes_no', 'zsjy_major', 'zsjy_college');
|
||||
|
||||
// 设置动画效果
|
||||
const animate = {
|
||||
searchAnimate: {
|
||||
enter: 'animate__fadeInDown',
|
||||
leave: 'animate__fadeOutUp'
|
||||
}
|
||||
};
|
||||
|
||||
// 查询条件
|
||||
const queryFormRef = ref();
|
||||
const showSearch = ref(true);
|
||||
const queryParams = reactive<EnrollmentProcessQuery>({
|
||||
studentName: undefined,
|
||||
idCard: undefined,
|
||||
currentStatus: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
params: {
|
||||
beginCreateTime: undefined,
|
||||
endCreateTime: undefined,
|
||||
collegeId: undefined,
|
||||
majorId: undefined,
|
||||
province: undefined,
|
||||
gender: undefined,
|
||||
paymentStatus: undefined
|
||||
}
|
||||
});
|
||||
|
||||
// 日期范围
|
||||
const dateRange = ref<[Date, Date]>();
|
||||
|
||||
// 学院和专业选项
|
||||
const collegeOptions = ref<DeptVO[]>([]);
|
||||
const majorOptionsByCollege = ref<{[key: string]: DeptVO[]}>({});
|
||||
const searchMajorOptions = ref<any[]>([]);
|
||||
|
||||
// 所有专业数据(包含学院信息)
|
||||
const allMajors = ref<any[]>([
|
||||
{ code: '1', name: '计算机科学与技术', collegeCode: 'CS' },
|
||||
{ code: '2', name: '软件工程', collegeCode: 'CS' },
|
||||
{ code: '3', name: '数据科学', collegeCode: 'CS' },
|
||||
{ code: '4', name: '电子信息工程', collegeCode: 'EE' },
|
||||
{ code: '5', name: '通信工程', collegeCode: 'EE' },
|
||||
{ code: '6', name: '自动化', collegeCode: 'EE' },
|
||||
{ code: '7', name: '机械设计制造及其自动化', collegeCode: 'ME' },
|
||||
{ code: '8', name: '机械电子工程', collegeCode: 'ME' },
|
||||
{ code: '9', name: '工商管理', collegeCode: 'EC' },
|
||||
{ code: '10', name: '会计学', collegeCode: 'EC' },
|
||||
{ code: '11', name: '汉语言文学', collegeCode: 'LA' },
|
||||
{ code: '12', name: '英语', collegeCode: 'LA' }
|
||||
]);
|
||||
|
||||
/** 搜索区域学院选择变化处理 */
|
||||
const onSearchCollegeChange = (selectedCollegeId: string) => {
|
||||
console.log('搜索区域学院选择变化:', selectedCollegeId);
|
||||
// 清空专业选择
|
||||
queryParams.params.majorId = undefined;
|
||||
|
||||
if (!selectedCollegeId) {
|
||||
// 如果没有选择学院,清空专业选项
|
||||
searchMajorOptions.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据选择的学院获取对应的专业列表
|
||||
const majors: any[] = [];
|
||||
|
||||
// 首先从字典中获取
|
||||
if (zsjy_major?.value) {
|
||||
const filteredMajors = zsjy_major.value.filter(
|
||||
item => item.cssClass === selectedCollegeId
|
||||
);
|
||||
majors.push(...filteredMajors.map(m => ({ value: m.value, label: m.label })));
|
||||
}
|
||||
|
||||
// 然后从部门数据中获取
|
||||
const college = collegeOptions.value.find(c => c.deptCategory === selectedCollegeId);
|
||||
if (college && majorOptionsByCollege.value[college.deptId]) {
|
||||
const deptMajors = majorOptionsByCollege.value[college.deptId];
|
||||
majors.push(...deptMajors.map(m => ({
|
||||
value: m.deptName,
|
||||
label: m.deptName
|
||||
})));
|
||||
}
|
||||
|
||||
// 去除可能的重复项
|
||||
const uniqueMajors = majors.filter((item, index, self) =>
|
||||
index === self.findIndex(m => m.value === item.value)
|
||||
);
|
||||
|
||||
// 更新专业选项
|
||||
searchMajorOptions.value = uniqueMajors;
|
||||
console.log('搜索专业选项已更新:', searchMajorOptions.value);
|
||||
};
|
||||
|
||||
/** 获取学院和专业数据 */
|
||||
const getCollegeAndMajorData = async () => {
|
||||
try {
|
||||
console.log('开始加载学院和专业数据...');
|
||||
|
||||
// 强制刷新字典数据
|
||||
console.log('加载学院字典数据...');
|
||||
try {
|
||||
const dictResponse = await proxy?.getDicts("zsjy_college");
|
||||
console.log('学院字典加载结果:', dictResponse);
|
||||
} catch (dictError) {
|
||||
console.error('加载字典数据出错:', dictError);
|
||||
}
|
||||
|
||||
// 获取所有部门数据
|
||||
console.log('加载部门数据...');
|
||||
const res = await listDept();
|
||||
|
||||
if (res.code === 200 && res.data) {
|
||||
// 找出学院 - 类别编码以xy开头的部门
|
||||
const colleges = res.data.filter((dept: DeptVO) => {
|
||||
return dept.deptCategory && dept.deptCategory.startsWith('xy');
|
||||
});
|
||||
|
||||
collegeOptions.value = colleges;
|
||||
console.log('获取到的学院数据:', colleges.map(c => ({
|
||||
deptId: c.deptId,
|
||||
deptName: c.deptName,
|
||||
deptCategory: c.deptCategory
|
||||
})));
|
||||
|
||||
// 如果没有找到学院数据,尝试其他可能的过滤条件
|
||||
if (colleges.length === 0) {
|
||||
console.log('未找到xy开头的学院,尝试其他可能的部门...');
|
||||
|
||||
// 尝试查找所有非叶子节点部门
|
||||
const possibleColleges = res.data.filter((dept: DeptVO) => {
|
||||
return !dept.isLeaf;
|
||||
});
|
||||
|
||||
if (possibleColleges.length > 0) {
|
||||
collegeOptions.value = possibleColleges;
|
||||
console.log('找到可能的学院:', possibleColleges.map(c => ({
|
||||
deptId: c.deptId,
|
||||
deptName: c.deptName,
|
||||
deptCategory: c.deptCategory
|
||||
})));
|
||||
}
|
||||
}
|
||||
|
||||
// 找出专业 - 类别编码以zy开头的部门
|
||||
const allMajors = res.data.filter((dept: DeptVO) => {
|
||||
return dept.deptCategory && dept.deptCategory.startsWith('zy');
|
||||
});
|
||||
|
||||
console.log('获取到的所有专业数据:', allMajors.length);
|
||||
|
||||
// 按照上下级关系组织专业
|
||||
colleges.forEach((college: DeptVO) => {
|
||||
// 找出该学院下的所有专业
|
||||
const majors = allMajors.filter((dept: DeptVO) =>
|
||||
// 使用上下级关系或其他关联关系确定专业归属哪个学院
|
||||
dept.parentId === college.deptId
|
||||
);
|
||||
|
||||
majorOptionsByCollege.value[college.deptId] = majors;
|
||||
if (majors.length > 0) {
|
||||
console.log(`学院 ${college.deptName} 的专业数量: ${majors.length}`);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
collegeCount: collegeOptions.value.length
|
||||
};
|
||||
} else {
|
||||
console.error('部门数据返回异常:', res);
|
||||
return {
|
||||
success: false,
|
||||
error: '部门数据返回异常'
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取部门数据出错:', error);
|
||||
proxy?.$modal.msgError('获取学院和专业数据失败');
|
||||
return {
|
||||
success: false,
|
||||
error: error
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const regionOptions = ref<any[]>([
|
||||
{ code: '330000', name: '浙江省' },
|
||||
{ code: '320000', name: '江苏省' }
|
||||
]);
|
||||
|
||||
const statusOptions = ref<any[]>([
|
||||
{ code: '0', name: '待审核' },
|
||||
{ code: '1', name: '信息审核中' },
|
||||
{ code: '2', name: '录取处理中' },
|
||||
{ code: '3', name: '待最终确认' },
|
||||
{ code: '4', name: '录取完成' },
|
||||
{ code: '9', name: '已驳回' }
|
||||
]);
|
||||
|
||||
const genderOptions = ref<any[]>([
|
||||
{ code: 'M', name: '男' },
|
||||
{ code: 'F', name: '女' }
|
||||
]);
|
||||
|
||||
// 报名列表数据
|
||||
const enrollmentList = ref<EnrollmentProcessVO[]>([]);
|
||||
const total = ref(0);
|
||||
|
||||
// 加载状态
|
||||
const tableLoading = ref(false);
|
||||
|
||||
// 详情对话框相关
|
||||
const detailDialogVisible = ref(false);
|
||||
const currentStudent = ref<Partial<EnrollmentProcessVO>>({});
|
||||
const detailLoading = ref(false);
|
||||
|
||||
// 初始化
|
||||
onMounted(async () => {
|
||||
// 获取学院和专业数据
|
||||
await getCollegeAndMajorData();
|
||||
await getList();
|
||||
});
|
||||
|
||||
// 处理日期范围变化
|
||||
const handleDateRangeChange = (val: [Date, Date] | null) => {
|
||||
if (val && val.length === 2) {
|
||||
queryParams.params = {
|
||||
...queryParams.params,
|
||||
beginCreateTime: val[0],
|
||||
endCreateTime: val[1]
|
||||
};
|
||||
} else {
|
||||
queryParams.params = {
|
||||
...queryParams.params,
|
||||
beginCreateTime: undefined,
|
||||
endCreateTime: undefined
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// 处理查询
|
||||
const handleQuery = async () => {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 获取列表数据
|
||||
const getList = async () => {
|
||||
tableLoading.value = true;
|
||||
try {
|
||||
console.log('查询参数:', queryParams);
|
||||
|
||||
// 检查API路径是否正确
|
||||
console.log('调用API: listEnrollmentProcess', listEnrollmentProcess);
|
||||
|
||||
// 尝试调用API
|
||||
const res = await listEnrollmentProcess(queryParams);
|
||||
console.log('API响应:', res);
|
||||
|
||||
if (res && res.code === 200) {
|
||||
console.log('获取到数据条数:', res.rows?.length || 0);
|
||||
console.log('原始数据详情:', JSON.stringify(res.rows));
|
||||
|
||||
// 检查原始数据中是否包含学院信息
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
const firstRow = res.rows[0];
|
||||
console.log('第一行数据的所有字段:', Object.keys(firstRow));
|
||||
console.log('第一行数据的学院相关字段:', {
|
||||
collegeName: firstRow.collegeName,
|
||||
college_name: firstRow.college_name,
|
||||
collage_name: firstRow.collage_name,
|
||||
collegeId: firstRow.collegeId,
|
||||
college_id: firstRow.college_id,
|
||||
collage_id: firstRow.collage_id,
|
||||
applied_major: firstRow.applied_major
|
||||
});
|
||||
}
|
||||
|
||||
// 简单处理,不做额外转换
|
||||
enrollmentList.value = res.rows || [];
|
||||
total.value = res.total || 0;
|
||||
} else {
|
||||
console.error('API返回错误:', res);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取报名数据失败:', error);
|
||||
} finally {
|
||||
tableLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 重置查询条件
|
||||
const resetQuery = () => {
|
||||
dateRange.value = undefined;
|
||||
queryFormRef.value.resetFields();
|
||||
queryParams.params = {
|
||||
beginCreateTime: undefined,
|
||||
endCreateTime: undefined,
|
||||
collegeId: undefined,
|
||||
majorId: undefined,
|
||||
province: undefined,
|
||||
gender: undefined,
|
||||
paymentStatus: undefined
|
||||
};
|
||||
// 重置后清空专业选项
|
||||
searchMajorOptions.value = [];
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
// 处理导出
|
||||
const handleExport = () => {
|
||||
exportEnrollmentProcess(queryParams);
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleView = async (row: EnrollmentProcessVO) => {
|
||||
detailLoading.value = true;
|
||||
try {
|
||||
let processData: any = {};
|
||||
|
||||
// 如果是从报名信息表里直接获取的数据(可能没有流程ID)
|
||||
if (row.id) {
|
||||
const res = await getEnrollmentProcess(row.id);
|
||||
if (res && res.code === 200) {
|
||||
processData = res.data;
|
||||
} else {
|
||||
// 回退到使用行数据
|
||||
processData = { ...row };
|
||||
}
|
||||
} else {
|
||||
// 使用行数据(可能是从enrollment_info表里直接获取的)
|
||||
processData = { ...row };
|
||||
}
|
||||
|
||||
// 处理完成状态,确保它是字符串类型
|
||||
if (processData.isCompleted !== undefined) {
|
||||
processData.isCompleted = String(processData.isCompleted);
|
||||
}
|
||||
|
||||
// 处理缴费状态,确保它不为空
|
||||
if (processData.paymentStatus === undefined || processData.paymentStatus === null) {
|
||||
processData.paymentStatus = '0'; // 默认为未缴费
|
||||
}
|
||||
|
||||
// 设置当前流程数据
|
||||
currentStudent.value = processData;
|
||||
|
||||
// 打开详情对话框
|
||||
detailDialogVisible.value = true;
|
||||
} catch (error) {
|
||||
console.error('获取流程详情失败:', error);
|
||||
// 即使获取详情失败,也尝试使用行数据显示
|
||||
const processData = { ...row };
|
||||
|
||||
// 处理完成状态,确保它是字符串类型
|
||||
if (processData.isCompleted !== undefined) {
|
||||
processData.isCompleted = String(processData.isCompleted);
|
||||
}
|
||||
|
||||
// 处理缴费状态,确保它不为空
|
||||
if (processData.paymentStatus === undefined || processData.paymentStatus === null) {
|
||||
processData.paymentStatus = '0'; // 默认为未缴费
|
||||
}
|
||||
|
||||
currentStudent.value = processData;
|
||||
detailDialogVisible.value = true;
|
||||
} finally {
|
||||
detailLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 格式化身份证号(隐藏中间部分)
|
||||
const formatIdCard = (row: any) => {
|
||||
if (!row.idCard) return '';
|
||||
const idCard = row.idCard.toString();
|
||||
if (idCard.length >= 18) {
|
||||
return idCard.substring(0, 6) + '********' + idCard.substring(14);
|
||||
}
|
||||
return idCard;
|
||||
};
|
||||
|
||||
// 获取状态类型
|
||||
const getStatusType = (status: string) => {
|
||||
switch (status) {
|
||||
case '0': return 'info'; // 待审核
|
||||
case '1': return 'warning'; // 信息审核中
|
||||
case '2': return 'warning'; // 录取处理中
|
||||
case '3': return 'warning'; // 待最终确认
|
||||
case '4': return 'success'; // 录取完成
|
||||
case '9': return 'danger'; // 已驳回
|
||||
default: return 'info';
|
||||
}
|
||||
};
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: string) => {
|
||||
switch (status) {
|
||||
case '0': return '待审核';
|
||||
case '1': return '信息审核中';
|
||||
case '2': return '录取处理中';
|
||||
case '3': return '待最终确认';
|
||||
case '4': return '录取完成';
|
||||
case '9': return '已驳回';
|
||||
default: return '未知状态';
|
||||
}
|
||||
};
|
||||
|
||||
// 获取学院名称的方法
|
||||
const getCollegeName = (row: any): string => {
|
||||
// 如果已有学院名称,直接返回
|
||||
if (row.collegeName) {
|
||||
return row.collegeName;
|
||||
}
|
||||
|
||||
// 检查下划线命名方式
|
||||
if (row.college_name) {
|
||||
return row.college_name;
|
||||
}
|
||||
|
||||
// 如果有学院代码,尝试从映射表获取
|
||||
let collegeId = row.collegeId || row.college_id;
|
||||
|
||||
if (collegeId) {
|
||||
const collegeMap: {[key: string]: string} = {
|
||||
'CS': '计算机科学与技术学院',
|
||||
'EE': '电子信息工程学院',
|
||||
'ME': '机械工程学院',
|
||||
'EC': '经济管理学院',
|
||||
'LA': '文理学院'
|
||||
};
|
||||
|
||||
if (collegeMap[collegeId]) {
|
||||
return collegeMap[collegeId];
|
||||
}
|
||||
}
|
||||
|
||||
// 默认返回空字符串
|
||||
return '-';
|
||||
};
|
||||
|
||||
// 从代码获取学院名称
|
||||
const getCollegeNameFromCode = (code: string): string => {
|
||||
if (!code) return '-';
|
||||
|
||||
// 从字典获取
|
||||
if (zsjy_college?.value) {
|
||||
const collegeDict = zsjy_college.value.find(dict => dict.value === code);
|
||||
if (collegeDict) {
|
||||
return collegeDict.label;
|
||||
}
|
||||
}
|
||||
|
||||
// 从硬编码映射获取
|
||||
const collegeMap: {[key: string]: string} = {
|
||||
'CS': '计算机科学与技术学院',
|
||||
'EE': '电子信息工程学院',
|
||||
'ME': '机械工程学院',
|
||||
'EC': '经济管理学院',
|
||||
'LA': '文理学院',
|
||||
'XY001': '计算机科学与技术学院',
|
||||
'XY002': '电子信息工程学院',
|
||||
'XY003': '机械工程学院',
|
||||
'XY004': '经济管理学院',
|
||||
'XY005': '文理学院'
|
||||
};
|
||||
|
||||
return collegeMap[code] || code;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
padding: var(--space-sm);
|
||||
}
|
||||
|
||||
.search-card {
|
||||
margin-bottom: var(--space-lg);
|
||||
border-radius: var(--border-radius-lg);
|
||||
box-shadow: var(--art-box-shadow-sm) !important;
|
||||
}
|
||||
|
||||
.table-card {
|
||||
border-radius: var(--border-radius-lg);
|
||||
margin-bottom: var(--space-lg);
|
||||
box-shadow: var(--art-box-shadow-sm) !important;
|
||||
}
|
||||
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
margin-top: var(--space-lg);
|
||||
}
|
||||
|
||||
.mr-1 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.w-100 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
:deep(.el-table th) {
|
||||
background-color: var(--tableHeaderBg) !important;
|
||||
color: var(--tableHeaderTextColor) !important;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
font-weight: 500;
|
||||
color: var(--art-text-gray-700);
|
||||
}
|
||||
|
||||
:deep(.el-button--primary) {
|
||||
background-color: rgb(var(--art-primary));
|
||||
border-color: rgb(var(--art-primary));
|
||||
}
|
||||
|
||||
:deep(.el-button--primary.is-plain) {
|
||||
color: rgb(var(--art-primary));
|
||||
background: rgb(var(--art-bg-primary));
|
||||
border-color: rgba(var(--art-primary), 0.2);
|
||||
}
|
||||
|
||||
:deep(.el-select) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.el-date-editor) {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
:deep(.el-tag--primary) {
|
||||
background-color: rgb(var(--art-bg-primary));
|
||||
border-color: rgba(var(--art-primary), 0.2);
|
||||
color: rgb(var(--art-primary));
|
||||
}
|
||||
|
||||
:deep(.el-tag--success) {
|
||||
background-color: rgb(var(--art-bg-success));
|
||||
border-color: rgba(var(--art-success), 0.2);
|
||||
color: rgb(var(--art-success));
|
||||
}
|
||||
|
||||
:deep(.el-tag--info) {
|
||||
background-color: rgb(var(--art-bg-info));
|
||||
border-color: rgba(var(--art-info), 0.2);
|
||||
color: rgb(var(--art-info));
|
||||
}
|
||||
|
||||
:deep(.el-tag--warning) {
|
||||
background-color: rgb(var(--art-bg-warning));
|
||||
border-color: rgba(var(--art-warning), 0.2);
|
||||
color: rgb(var(--art-warning));
|
||||
}
|
||||
|
||||
:deep(.el-tag--danger) {
|
||||
background-color: rgb(var(--art-bg-error));
|
||||
border-color: rgba(var(--art-error), 0.2);
|
||||
color: rgb(var(--art-error));
|
||||
}
|
||||
|
||||
.mb8 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 320 KiB |
@@ -186,9 +186,10 @@ const loadStatisticsData = async () => {
|
||||
}
|
||||
|
||||
statisticsData.value = res.data;
|
||||
console.log('已设置统计数据:', statisticsData.value);
|
||||
|
||||
// 加载所有图表
|
||||
loadAllCharts();
|
||||
await loadAllCharts();
|
||||
} catch (error) {
|
||||
console.error('获取统计概览数据失败', error);
|
||||
ElMessage.error('获取统计数据失败,请联系管理员');
|
||||
@@ -198,12 +199,29 @@ const loadStatisticsData = async () => {
|
||||
};
|
||||
|
||||
// 加载所有图表
|
||||
const loadAllCharts = () => {
|
||||
loadTrendChart();
|
||||
loadGenderChart();
|
||||
loadMajorChart();
|
||||
loadRegionChart();
|
||||
loadStatusChart();
|
||||
const loadAllCharts = async () => {
|
||||
try {
|
||||
console.log('开始加载所有图表...');
|
||||
|
||||
// 确保等待DOM元素完全加载
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
|
||||
// 依次加载各个图表(改为串行以避免资源竞争)
|
||||
await loadTrendChart();
|
||||
await loadGenderChart();
|
||||
await loadMajorChart();
|
||||
await loadRegionChart();
|
||||
await loadStatusChart();
|
||||
|
||||
console.log('所有图表加载完成');
|
||||
|
||||
// 最后再次调整所有图表大小
|
||||
nextTick(() => {
|
||||
handleResize();
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('加载图表失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 加载趋势图
|
||||
@@ -220,18 +238,25 @@ const loadTrendChart = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const trendData = res.data;
|
||||
// 确保DOM元素已经加载
|
||||
await nextTick();
|
||||
|
||||
// 初始化趋势图
|
||||
if (!trendChartInstance) {
|
||||
const chartDom = document.getElementById('trendChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到趋势图DOM元素!');
|
||||
return;
|
||||
}
|
||||
trendChartInstance = echarts.init(chartDom);
|
||||
// 检查DOM元素
|
||||
const chartDom = document.getElementById('trendChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到趋势图DOM元素! 请检查HTML结构');
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化图表,如果已存在则销毁重建
|
||||
if (trendChartInstance) {
|
||||
trendChartInstance.dispose();
|
||||
}
|
||||
|
||||
trendChartInstance = echarts.init(chartDom);
|
||||
console.log('趋势图实例已创建');
|
||||
|
||||
const trendData = res.data.data || res.data;
|
||||
const dates: string[] = [];
|
||||
const counts: number[] = [];
|
||||
|
||||
@@ -240,6 +265,7 @@ const loadTrendChart = async () => {
|
||||
dates.push(item.date as string);
|
||||
counts.push(item.count as number);
|
||||
});
|
||||
console.log('趋势数据已处理:', { dates, counts });
|
||||
} else {
|
||||
console.error('趋势数据不是数组格式:', trendData);
|
||||
return;
|
||||
@@ -294,10 +320,15 @@ const loadTrendChart = async () => {
|
||||
]
|
||||
};
|
||||
|
||||
// 设置选项并绘制图表
|
||||
trendChartInstance.setOption(option);
|
||||
console.log('趋势图已渲染完成');
|
||||
|
||||
// 强制更新布局
|
||||
trendChartInstance.resize();
|
||||
} catch (error) {
|
||||
console.error('获取报名趋势数据失败', error);
|
||||
ElMessage.warning('获取报名趋势数据失败');
|
||||
ElMessage.warning('获取报名趋势数据失败,请检查网络连接');
|
||||
} finally {
|
||||
trendLoading.value = false;
|
||||
}
|
||||
@@ -317,18 +348,27 @@ const loadGenderChart = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const genderData = res.data;
|
||||
// 确保DOM元素已经加载
|
||||
await nextTick();
|
||||
|
||||
// 初始化性别比例图
|
||||
if (!genderChartInstance) {
|
||||
const chartDom = document.getElementById('genderChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到性别比例图DOM元素!');
|
||||
return;
|
||||
}
|
||||
genderChartInstance = echarts.init(chartDom);
|
||||
// 检查DOM元素
|
||||
const chartDom = document.getElementById('genderChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到性别比例图DOM元素! 请检查HTML结构');
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化图表,如果已存在则销毁重建
|
||||
if (genderChartInstance) {
|
||||
genderChartInstance.dispose();
|
||||
}
|
||||
|
||||
genderChartInstance = echarts.init(chartDom);
|
||||
console.log('性别比例图实例已创建');
|
||||
|
||||
const genderData = res.data.data || res.data;
|
||||
console.log('原始性别数据:', genderData);
|
||||
|
||||
const pieData = [];
|
||||
let total = 0;
|
||||
|
||||
@@ -349,6 +389,8 @@ const loadGenderChart = async () => {
|
||||
});
|
||||
});
|
||||
|
||||
console.log('处理后的性别数据:', pieData);
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
@@ -389,10 +431,15 @@ const loadGenderChart = async () => {
|
||||
]
|
||||
};
|
||||
|
||||
// 设置选项并绘制图表
|
||||
genderChartInstance.setOption(option);
|
||||
console.log('性别比例图已渲染完成');
|
||||
|
||||
// 强制更新布局
|
||||
genderChartInstance.resize();
|
||||
} catch (error) {
|
||||
console.error('获取性别比例数据失败', error);
|
||||
ElMessage.warning('获取性别比例数据失败');
|
||||
ElMessage.warning('获取性别比例数据失败,请检查网络连接');
|
||||
} finally {
|
||||
genderLoading.value = false;
|
||||
}
|
||||
@@ -412,88 +459,88 @@ const loadMajorChart = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const majorData = res.data;
|
||||
// 确保DOM元素已经加载
|
||||
await nextTick();
|
||||
|
||||
// 初始化专业分布图
|
||||
if (!majorChartInstance) {
|
||||
const chartDom = document.getElementById('majorChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到专业分布图DOM元素!');
|
||||
return;
|
||||
}
|
||||
majorChartInstance = echarts.init(chartDom);
|
||||
}
|
||||
|
||||
const majorNames: string[] = [];
|
||||
const majorCounts: number[] = [];
|
||||
|
||||
if (Array.isArray(majorData)) {
|
||||
majorData.forEach(item => {
|
||||
majorNames.push(item.name as string);
|
||||
majorCounts.push(item.value as number);
|
||||
});
|
||||
} else {
|
||||
console.error('专业分布数据不是数组格式:', majorData);
|
||||
// 检查DOM元素
|
||||
const chartDom = document.getElementById('majorChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到专业分布图DOM元素! 请检查HTML结构');
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化图表,如果已存在则销毁重建
|
||||
if (majorChartInstance) {
|
||||
majorChartInstance.dispose();
|
||||
}
|
||||
|
||||
majorChartInstance = echarts.init(chartDom);
|
||||
console.log('专业分布图实例已创建');
|
||||
|
||||
// 获取数据
|
||||
const majorData = res.data.data || res.data;
|
||||
console.log('专业分布原始数据:', majorData);
|
||||
|
||||
if (!Array.isArray(majorData)) {
|
||||
console.error('专业分布数据格式错误,应为数组:', majorData);
|
||||
return;
|
||||
}
|
||||
|
||||
// 限制显示的专业数量,避免图表过于拥挤
|
||||
const displayLimit = 10;
|
||||
const sortedData = [...majorData].sort((a, b) => b.value - a.value);
|
||||
const displayData = sortedData.slice(0, displayLimit);
|
||||
|
||||
// 如果数据超过限制,添加"其他"类别
|
||||
if (sortedData.length > displayLimit) {
|
||||
const otherSum = sortedData.slice(displayLimit).reduce((sum, item) => sum + item.value, 0);
|
||||
displayData.push({
|
||||
name: '其他',
|
||||
value: otherSum
|
||||
});
|
||||
}
|
||||
|
||||
console.log('处理后的专业分布数据:', displayData);
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} ({d}%)'
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: majorNames,
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
rotate: majorNames.length > 5 ? 45 : 0,
|
||||
textStyle: {
|
||||
fontSize: 12
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '报名人数',
|
||||
minInterval: 1
|
||||
legend: {
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
right: 10,
|
||||
top: 20,
|
||||
bottom: 20,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '报名人数',
|
||||
type: 'bar',
|
||||
data: majorCounts,
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#5d87ff' },
|
||||
{ offset: 1, color: '#83bff6' }
|
||||
])
|
||||
},
|
||||
name: '专业分布',
|
||||
type: 'pie',
|
||||
radius: '55%',
|
||||
center: ['40%', '50%'],
|
||||
data: displayData,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#2378f7' },
|
||||
{ offset: 0.7, color: '#2378f7' },
|
||||
{ offset: 1, color: '#83bff6' }
|
||||
])
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// 设置选项并绘制图表
|
||||
majorChartInstance.setOption(option);
|
||||
console.log('专业分布图已渲染完成');
|
||||
|
||||
// 强制更新布局
|
||||
majorChartInstance.resize();
|
||||
} catch (error) {
|
||||
console.error('获取专业分布数据失败', error);
|
||||
ElMessage.warning('获取专业分布数据失败');
|
||||
ElMessage.warning('获取专业分布数据失败,请检查网络连接');
|
||||
} finally {
|
||||
majorLoading.value = false;
|
||||
}
|
||||
@@ -513,66 +560,110 @@ const loadRegionChart = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const regionData = res.data;
|
||||
// 确保DOM元素已经加载
|
||||
await nextTick();
|
||||
|
||||
// 初始化地区分布图
|
||||
if (!regionChartInstance) {
|
||||
const chartDom = document.getElementById('regionChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到地区分布图DOM元素!');
|
||||
return;
|
||||
}
|
||||
regionChartInstance = echarts.init(chartDom);
|
||||
}
|
||||
|
||||
const pieData: { name: string; value: number }[] = [];
|
||||
|
||||
if (Array.isArray(regionData)) {
|
||||
regionData.forEach(item => {
|
||||
pieData.push({
|
||||
name: item.name as string,
|
||||
value: item.value as number
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.error('地区分布数据不是数组格式:', regionData);
|
||||
// 检查DOM元素
|
||||
const chartDom = document.getElementById('regionChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到地区分布图DOM元素! 请检查HTML结构');
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化图表,如果已存在则销毁重建
|
||||
if (regionChartInstance) {
|
||||
regionChartInstance.dispose();
|
||||
}
|
||||
|
||||
regionChartInstance = echarts.init(chartDom);
|
||||
console.log('地区分布图实例已创建');
|
||||
|
||||
// 获取数据
|
||||
const regionData = res.data.data || res.data;
|
||||
console.log('地区分布原始数据:', regionData);
|
||||
|
||||
if (!Array.isArray(regionData)) {
|
||||
console.error('地区分布数据格式错误,应为数组:', regionData);
|
||||
return;
|
||||
}
|
||||
|
||||
// 限制显示的地区数量,避免图表过于拥挤
|
||||
const displayLimit = 6;
|
||||
const sortedData = [...regionData].sort((a, b) => b.value - a.value);
|
||||
const displayData = sortedData.slice(0, displayLimit);
|
||||
|
||||
// 如果数据超过限制,添加"其他"类别
|
||||
if (sortedData.length > displayLimit) {
|
||||
const otherSum = sortedData.slice(displayLimit).reduce((sum, item) => sum + item.value, 0);
|
||||
displayData.push({
|
||||
name: '其他',
|
||||
value: otherSum
|
||||
});
|
||||
}
|
||||
|
||||
const regions = displayData.map(item => item.name);
|
||||
const values = displayData.map(item => item.value);
|
||||
|
||||
console.log('处理后的地区分布数据:', { regions, values });
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
right: 10,
|
||||
top: 20,
|
||||
bottom: 20
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: regions,
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
rotate: 0
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '地区分布',
|
||||
type: 'pie',
|
||||
radius: '55%',
|
||||
center: ['40%', '50%'],
|
||||
data: pieData,
|
||||
name: '报名人数',
|
||||
type: 'bar',
|
||||
data: values,
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
|
||||
{ offset: 0, color: '#83bff6' },
|
||||
{ offset: 0.5, color: '#188df0' },
|
||||
{ offset: 1, color: '#188df0' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
|
||||
{ offset: 0, color: '#2378f7' },
|
||||
{ offset: 0.7, color: '#2378f7' },
|
||||
{ offset: 1, color: '#83bff6' }
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// 设置选项并绘制图表
|
||||
regionChartInstance.setOption(option);
|
||||
console.log('地区分布图已渲染完成');
|
||||
|
||||
// 强制更新布局
|
||||
regionChartInstance.resize();
|
||||
} catch (error) {
|
||||
console.error('获取地区分布数据失败', error);
|
||||
ElMessage.warning('获取地区分布数据失败');
|
||||
ElMessage.warning('获取地区分布数据失败,请检查网络连接');
|
||||
} finally {
|
||||
regionLoading.value = false;
|
||||
}
|
||||
@@ -592,18 +683,28 @@ const loadStatusChart = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const statusData = res.data;
|
||||
// 确保DOM元素已经加载
|
||||
await nextTick();
|
||||
|
||||
// 初始化状态分布图
|
||||
if (!statusChartInstance) {
|
||||
const chartDom = document.getElementById('statusChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到状态分布图DOM元素!');
|
||||
return;
|
||||
}
|
||||
statusChartInstance = echarts.init(chartDom);
|
||||
// 检查DOM元素
|
||||
const chartDom = document.getElementById('statusChart');
|
||||
if (!chartDom) {
|
||||
console.error('找不到状态分布图DOM元素! 请检查HTML结构');
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化图表,如果已存在则销毁重建
|
||||
if (statusChartInstance) {
|
||||
statusChartInstance.dispose();
|
||||
}
|
||||
|
||||
statusChartInstance = echarts.init(chartDom);
|
||||
console.log('状态分布图实例已创建');
|
||||
|
||||
// 获取数据
|
||||
const statusData = res.data.data || res.data;
|
||||
console.log('状态分布原始数据:', statusData);
|
||||
|
||||
const statusMap: Record<string, string> = {
|
||||
'0': '未开始',
|
||||
'1': '信息审核中',
|
||||
@@ -637,6 +738,8 @@ const loadStatusChart = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
console.log('处理后的状态分布数据:', chartData);
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
@@ -677,10 +780,15 @@ const loadStatusChart = async () => {
|
||||
]
|
||||
};
|
||||
|
||||
// 设置选项并绘制图表
|
||||
statusChartInstance.setOption(option);
|
||||
console.log('状态分布图已渲染完成');
|
||||
|
||||
// 强制更新布局
|
||||
statusChartInstance.resize();
|
||||
} catch (error) {
|
||||
console.error('获取状态分布数据失败', error);
|
||||
ElMessage.warning('获取状态分布数据失败');
|
||||
ElMessage.warning('获取状态分布数据失败,请检查网络连接');
|
||||
} finally {
|
||||
statusLoading.value = false;
|
||||
}
|
||||
@@ -700,16 +808,23 @@ const handleResize = () => {
|
||||
statusChartInstance?.resize();
|
||||
};
|
||||
|
||||
// 页面初始化
|
||||
onMounted(() => {
|
||||
console.log('统计页面已挂载');
|
||||
try {
|
||||
// 加载后台真实数据
|
||||
loadStatisticsData();
|
||||
window.addEventListener('resize', handleResize);
|
||||
console.log('添加窗口resize事件监听');
|
||||
} catch (e) {
|
||||
console.error('页面初始化错误:', e);
|
||||
}
|
||||
// 延迟执行,确保DOM完全加载
|
||||
setTimeout(() => {
|
||||
console.log('开始页面初始化流程...');
|
||||
try {
|
||||
// 加载后台真实数据
|
||||
loadStatisticsData();
|
||||
|
||||
// 添加窗口resize事件监听
|
||||
window.addEventListener('resize', handleResize);
|
||||
console.log('添加窗口resize事件监听');
|
||||
} catch (e) {
|
||||
console.error('页面初始化错误:', e);
|
||||
}
|
||||
}, 300); // 添加300ms延迟,确保DOM完全加载
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
Reference in new issue
Block a user