1
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
This commit is contained in:
78
apps/web-antd/src/api/admin/booking.ts
Normal file
78
apps/web-antd/src/api/admin/booking.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BookingApi {
|
||||
/** 预订列表查询参数 */
|
||||
export interface ListParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
classroom_id?: number;
|
||||
booking_date?: string;
|
||||
status?: number;
|
||||
student_id?: number;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
/** 预订信息 */
|
||||
export interface BookingInfo {
|
||||
id?: number;
|
||||
booking_no?: string | null;
|
||||
classroom_id?: number;
|
||||
seat_number?: string;
|
||||
user_id?: number | null;
|
||||
user_name?: string | null;
|
||||
booking_date?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
purpose?: string | null;
|
||||
status?: number;
|
||||
remark?: string | null;
|
||||
create_time?: string;
|
||||
update_time?: string;
|
||||
seat_row_index?: number;
|
||||
seat_col_index?: number;
|
||||
student_id?: number;
|
||||
classroom_name?: string;
|
||||
time_range?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 同意座位变更申请参数 */
|
||||
export interface ApproveParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 拒绝座位变更申请参数 */
|
||||
export interface RejectParams {
|
||||
id: number;
|
||||
reason: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预订列表
|
||||
* GET /api/admin/booking/list
|
||||
*/
|
||||
export async function getBookingListApi(params?: BookingApi.ListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/booking/list', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 同意座位变更申请
|
||||
* POST /api/admin/booking/approve
|
||||
*/
|
||||
export async function approveBookingApi(data: BookingApi.ApproveParams) {
|
||||
return requestClient.post('/api/admin/booking/approve', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拒绝座位变更申请
|
||||
* POST /api/admin/booking/reject
|
||||
*/
|
||||
export async function rejectBookingApi(data: BookingApi.RejectParams) {
|
||||
return requestClient.post('/api/admin/booking/reject', data);
|
||||
}
|
||||
|
||||
143
apps/web-antd/src/api/admin/class.ts
Normal file
143
apps/web-antd/src/api/admin/class.ts
Normal file
@@ -0,0 +1,143 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace ClassApi {
|
||||
/** 班级列表查询参数 */
|
||||
export interface ListParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
name?: string;
|
||||
teacher_name?: string;
|
||||
school_id?: number;
|
||||
}
|
||||
|
||||
/** 班级信息 */
|
||||
export interface ClassInfo {
|
||||
id?: number;
|
||||
name?: string;
|
||||
grade?: string;
|
||||
department_id?: number;
|
||||
teacher_id?: number;
|
||||
student_count?: number;
|
||||
class_room_id?: number;
|
||||
description?: string;
|
||||
status?: number;
|
||||
create_time?: string;
|
||||
update_time?: string;
|
||||
teacher?: {
|
||||
id?: number;
|
||||
teacher_id?: string | null;
|
||||
name?: string;
|
||||
gender?: string;
|
||||
department_id?: number;
|
||||
title?: string | null;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
avatar?: string | null;
|
||||
remark?: string;
|
||||
status?: number;
|
||||
user_id?: number | null;
|
||||
create_time?: string;
|
||||
update_time?: string | null;
|
||||
nickname?: string;
|
||||
};
|
||||
classroom?: {
|
||||
id?: number;
|
||||
name?: string;
|
||||
location?: string;
|
||||
teacher_id?: number;
|
||||
type?: string;
|
||||
capacity?: number;
|
||||
layout?: string;
|
||||
status?: number;
|
||||
description?: string;
|
||||
create_time?: string;
|
||||
update_time?: string;
|
||||
layout_cols?: number;
|
||||
layout_rows?: number;
|
||||
fiexd_start_time?: string;
|
||||
fiexd_end_time?: string;
|
||||
view_images?: string;
|
||||
school_id?: number;
|
||||
school?: any;
|
||||
};
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 保存班级参数 */
|
||||
export interface SaveParams extends ClassInfo {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/** 删除班级参数 */
|
||||
export interface DeleteParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 班级详情参数 */
|
||||
export interface DetailParams {
|
||||
id: number;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班级列表
|
||||
* GET /api/admin/classmanager/list
|
||||
*/
|
||||
export async function getClassListApi(params?: ClassApi.ListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/classmanager/list', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班主任列表
|
||||
* GET /api/admin/classmanager/getTeachers
|
||||
*/
|
||||
export async function getTeachersApi() {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体,支持可能的 code/data 格式
|
||||
return requestClient.get<any>('/api/admin/classmanager/getTeachers', {
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教室列表
|
||||
* GET /api/admin/classmanager/getClassrooms
|
||||
*/
|
||||
export async function getClassroomsApi() {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体,支持可能的 code/data 格式
|
||||
return requestClient.get<any>('/api/admin/classmanager/getClassrooms', {
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班级详情
|
||||
* GET /api/admin/classmanager/detail
|
||||
*/
|
||||
export async function getClassDetailApi(params: ClassApi.DetailParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/classmanager/detail', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存班级(新增/编辑)
|
||||
* POST /api/admin/classmanager/save
|
||||
*/
|
||||
export async function saveClassApi(data: ClassApi.SaveParams) {
|
||||
return requestClient.post<ClassApi.ClassInfo>('/api/admin/classmanager/save', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班级
|
||||
* POST /api/admin/classmanager/deleteClass
|
||||
*/
|
||||
export async function deleteClassApi(data: ClassApi.DeleteParams) {
|
||||
return requestClient.post('/api/admin/classmanager/deleteClass', data);
|
||||
}
|
||||
|
||||
237
apps/web-antd/src/api/admin/classroom.ts
Normal file
237
apps/web-antd/src/api/admin/classroom.ts
Normal file
@@ -0,0 +1,237 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace ClassroomApi {
|
||||
/** 教室列表查询参数 */
|
||||
export interface ListParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
name?: string;
|
||||
building?: string;
|
||||
type?: 'normal' | 'multimedia' | 'lab';
|
||||
school_id?: number;
|
||||
}
|
||||
|
||||
/** 教室位置信息 */
|
||||
export interface ClassroomLocation {
|
||||
room?: string;
|
||||
floor?: string;
|
||||
building?: string;
|
||||
}
|
||||
|
||||
/** 教室座位布局单元格 */
|
||||
export interface ClassroomLayoutCell {
|
||||
col: number;
|
||||
row: number;
|
||||
type: 'empty' | 'pillar' | 'aisle' | 'seat' | 'door';
|
||||
number?: string;
|
||||
status?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/** 教室座位布局 */
|
||||
export interface ClassroomLayout {
|
||||
cols: number;
|
||||
rows: number;
|
||||
cells: ClassroomLayoutCell[];
|
||||
}
|
||||
|
||||
/** 教室信息 */
|
||||
export interface ClassroomInfo {
|
||||
id?: number;
|
||||
name?: string;
|
||||
location?: ClassroomLocation;
|
||||
teacher_id?: number;
|
||||
type?: 'normal' | 'multimedia' | 'lab' | string;
|
||||
capacity?: number;
|
||||
layout?: ClassroomLayout;
|
||||
school_id?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 教室详情参数 */
|
||||
export interface DetailParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 保存教室参数 */
|
||||
export interface SaveParams extends ClassroomInfo {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/** 删除教室参数 */
|
||||
export interface DeleteParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 批量删除教室参数 */
|
||||
export interface BatchDeleteParams {
|
||||
ids: number[];
|
||||
}
|
||||
|
||||
/** 保存座位布局参数 */
|
||||
export interface SaveLayoutParams {
|
||||
id: number;
|
||||
layout: any;
|
||||
}
|
||||
|
||||
/** 获取教室座位状态参数 */
|
||||
export interface StatusParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 分配座位参数 */
|
||||
export interface AssignSeatParams {
|
||||
classroomId: number;
|
||||
studentId: number;
|
||||
row: number;
|
||||
col: number;
|
||||
number: string;
|
||||
}
|
||||
|
||||
/** 随机分配座位参数 */
|
||||
export interface RandomAssignSeatsParams {
|
||||
classroomId: number;
|
||||
}
|
||||
|
||||
/** 获取未分配座位的学生列表参数 */
|
||||
export interface UnassignedStudentsParams {
|
||||
classroomId: number;
|
||||
}
|
||||
|
||||
/** 取消选座参数 */
|
||||
export interface CancelBookingParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 批量取消选座参数 */
|
||||
export interface CancelBookingAutoParams {
|
||||
ids: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教室列表
|
||||
* GET /api/admin/classroom/list
|
||||
*/
|
||||
export async function getClassroomListApi(params?: ClassroomApi.ListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体,包含 code, count, data 等字段
|
||||
return requestClient.get<any>('/api/admin/classroom/list', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教室详情
|
||||
* GET /api/admin/classroom/detail
|
||||
*/
|
||||
export async function getClassroomDetailApi(params: ClassroomApi.DetailParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/classroom/detail', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存教室(新增/编辑)
|
||||
* POST /api/admin/classroom/save
|
||||
*/
|
||||
export async function saveClassroomApi(data: ClassroomApi.SaveParams) {
|
||||
return requestClient.post<ClassroomApi.ClassroomInfo>('/api/admin/classroom/save', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教室
|
||||
* POST /api/admin/classroom/delete
|
||||
*/
|
||||
export async function deleteClassroomApi(data: ClassroomApi.DeleteParams) {
|
||||
return requestClient.post('/api/admin/classroom/delete', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除教室
|
||||
* POST /api/admin/classroom/batchDelete
|
||||
*/
|
||||
export async function batchDeleteClassroomApi(data: ClassroomApi.BatchDeleteParams) {
|
||||
return requestClient.post('/api/admin/classroom/batchDelete', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存座位布局
|
||||
* POST /api/admin/classroom/saveLayout
|
||||
*/
|
||||
export async function saveClassroomLayoutApi(data: ClassroomApi.SaveLayoutParams) {
|
||||
return requestClient.post('/api/admin/classroom/saveLayout', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教室座位状态
|
||||
* GET /api/admin/classroom/status
|
||||
*/
|
||||
export async function getClassroomStatusApi(params: ClassroomApi.StatusParams) {
|
||||
return requestClient.get<any>('/api/admin/classroom/status', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配座位
|
||||
* POST /api/admin/classroom/assignSeat
|
||||
*/
|
||||
export async function assignSeatApi(data: ClassroomApi.AssignSeatParams) {
|
||||
return requestClient.post('/api/admin/classroom/assignSeat', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 随机分配座位
|
||||
* POST /api/admin/classroom/randomAssignSeats
|
||||
*/
|
||||
export async function randomAssignSeatsApi(data: ClassroomApi.RandomAssignSeatsParams) {
|
||||
return requestClient.post('/api/admin/classroom/randomAssignSeats', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未分配座位的学生列表
|
||||
* GET /api/admin/classroom/getUnassignedStudents
|
||||
*/
|
||||
export async function getUnassignedStudentsApi(params: ClassroomApi.UnassignedStudentsParams) {
|
||||
return requestClient.get<any>('/api/admin/classroom/getUnassignedStudents', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消选座
|
||||
* POST /api/admin/classroom/cancelBooking
|
||||
*/
|
||||
export async function cancelBookingApi(data: ClassroomApi.CancelBookingParams) {
|
||||
return requestClient.post('/api/admin/classroom/cancelBooking', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量取消选座
|
||||
* POST /api/admin/classroom/cancelBookingAuto
|
||||
*/
|
||||
export async function cancelBookingAutoApi(data: ClassroomApi.CancelBookingAutoParams) {
|
||||
return requestClient.post('/api/admin/classroom/cancelBookingAuto', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分校列表(用于教室管理)
|
||||
* GET /api/admin/classroom/getSchoolList
|
||||
*/
|
||||
export async function getClassroomSchoolListApi() {
|
||||
return requestClient.get<any[]>('/api/admin/classroom/getSchoolList');
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
* POST /api/admin/classroom/upload
|
||||
*/
|
||||
export async function uploadClassroomImageApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<string>('/api/admin/classroom/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
19
apps/web-antd/src/api/admin/common.ts
Normal file
19
apps/web-antd/src/api/admin/common.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CommonApi {
|
||||
/** 必应壁纸信息 */
|
||||
export interface BingWallpaper {
|
||||
url?: string;
|
||||
copyright?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取必应每日壁纸
|
||||
* GET /api/admin/common/getBingWallpaper
|
||||
*/
|
||||
export async function getBingWallpaperApi() {
|
||||
return requestClient.get<CommonApi.BingWallpaper>('/api/admin/common/getBingWallpaper');
|
||||
}
|
||||
|
||||
31
apps/web-antd/src/api/admin/index-page.ts
Normal file
31
apps/web-antd/src/api/admin/index-page.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace IndexApi {
|
||||
/** 系统信息 */
|
||||
export interface SystemInfo {
|
||||
os?: string;
|
||||
php?: string;
|
||||
server?: string;
|
||||
mysql?: string;
|
||||
upload_max?: string;
|
||||
max_execution_time?: string;
|
||||
disk_free_space?: string;
|
||||
disk_total_space?: string;
|
||||
disk_usage?: string;
|
||||
runtime_path?: string;
|
||||
framework_version?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统信息
|
||||
* GET /api/admin/index/systemInfo
|
||||
*/
|
||||
export async function getSystemInfoApi() {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/index/systemInfo', {
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
10
apps/web-antd/src/api/admin/index.ts
Normal file
10
apps/web-antd/src/api/admin/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export * from './classroom';
|
||||
export * from './booking';
|
||||
export * from './student';
|
||||
export * from './class';
|
||||
export * from './teacher';
|
||||
export * from './school';
|
||||
export * from './setting';
|
||||
export * from './profile';
|
||||
export * from './common';
|
||||
export * from './index-page';
|
||||
75
apps/web-antd/src/api/admin/profile.ts
Normal file
75
apps/web-antd/src/api/admin/profile.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace ProfileApi {
|
||||
/** 个人信息 */
|
||||
export interface ProfileInfo {
|
||||
id?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
email?: string | null;
|
||||
avatar?: string | null;
|
||||
role?: string;
|
||||
school_id?: number | null;
|
||||
status?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 更新个人信息参数 */
|
||||
export interface UpdateProfileParams {
|
||||
nickname?: string;
|
||||
email?: string;
|
||||
avatar?: File | string;
|
||||
}
|
||||
|
||||
/** 修改密码参数 */
|
||||
export interface UpdatePasswordParams {
|
||||
old_password: string;
|
||||
new_password: string;
|
||||
confirm_password: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人信息
|
||||
* GET /api/admin/profile/info
|
||||
*/
|
||||
export async function getProfileInfoApi() {
|
||||
return requestClient.get<ProfileApi.ProfileInfo>('/api/admin/profile/info');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新个人信息
|
||||
* POST /api/admin/profile/update
|
||||
*/
|
||||
export async function updateProfileApi(data: ProfileApi.UpdateProfileParams) {
|
||||
const formData = new FormData();
|
||||
if (data.nickname) {
|
||||
formData.append('nickname', data.nickname);
|
||||
}
|
||||
// email 可能是空字符串,需要明确处理
|
||||
if (data.email !== undefined && data.email !== null && data.email !== '') {
|
||||
formData.append('email', data.email);
|
||||
} else if (data.email === '') {
|
||||
// 如果传了空字符串,可能需要传空值,根据后端需求调整
|
||||
formData.append('email', '');
|
||||
}
|
||||
if (data.avatar instanceof File) {
|
||||
formData.append('avatar', data.avatar);
|
||||
} else if (data.avatar) {
|
||||
formData.append('avatar', data.avatar);
|
||||
}
|
||||
return requestClient.post<ProfileApi.ProfileInfo>('/api/admin/profile/update', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
* POST /api/admin/profile/updatePassword
|
||||
*/
|
||||
export async function updatePasswordApi(data: ProfileApi.UpdatePasswordParams) {
|
||||
return requestClient.post('/api/admin/profile/updatePassword', data);
|
||||
}
|
||||
|
||||
134
apps/web-antd/src/api/admin/school.ts
Normal file
134
apps/web-antd/src/api/admin/school.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SchoolApi {
|
||||
/** 学校列表查询参数 */
|
||||
export interface ListParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/** 学校信息 */
|
||||
export interface SchoolInfo {
|
||||
id?: number;
|
||||
name?: string;
|
||||
address?: string;
|
||||
description?: string;
|
||||
contact?: string;
|
||||
phone?: string;
|
||||
create_time?: string;
|
||||
update_time?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 学校详情参数 */
|
||||
export interface DetailParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 保存学校参数 */
|
||||
export interface SaveParams extends SchoolInfo {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/** 删除学校参数 */
|
||||
export interface DeleteParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 获取分校账号列表参数 */
|
||||
export interface AccountListParams {
|
||||
school_id: number;
|
||||
}
|
||||
|
||||
/** 分校账号信息 */
|
||||
export interface AccountInfo {
|
||||
id?: number;
|
||||
school_id?: number;
|
||||
username?: string;
|
||||
password?: string;
|
||||
status?: number;
|
||||
create_time?: string;
|
||||
update_time?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 保存分校账号参数 */
|
||||
export interface SaveAccountParams extends AccountInfo {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/** 删除分校账号参数 */
|
||||
export interface DeleteAccountParams {
|
||||
id: number;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学校列表(仅超级管理员)
|
||||
* GET /api/admin/school/list
|
||||
*/
|
||||
export async function getSchoolListApi(params?: SchoolApi.ListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/school/list', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学校详情(仅超级管理员)
|
||||
* GET /api/admin/school/detail
|
||||
*/
|
||||
export async function getSchoolDetailApi(params: SchoolApi.DetailParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/school/detail', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存学校(新增/编辑)(仅超级管理员)
|
||||
* POST /api/admin/school/save
|
||||
*/
|
||||
export async function saveSchoolApi(data: SchoolApi.SaveParams) {
|
||||
return requestClient.post<SchoolApi.SchoolInfo>('/api/admin/school/save', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学校(仅超级管理员)
|
||||
* POST /api/admin/school/delete
|
||||
*/
|
||||
export async function deleteSchoolApi(data: SchoolApi.DeleteParams) {
|
||||
return requestClient.post('/api/admin/school/delete', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分校账号列表(仅超级管理员)
|
||||
* GET /api/admin/school/accountList
|
||||
*/
|
||||
export async function getSchoolAccountListApi(params: SchoolApi.AccountListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/school/accountList', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存分校账号(仅超级管理员)
|
||||
* POST /api/admin/school/saveAccount
|
||||
*/
|
||||
export async function saveSchoolAccountApi(data: SchoolApi.SaveAccountParams) {
|
||||
return requestClient.post<SchoolApi.AccountInfo>('/api/admin/school/saveAccount', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分校账号(仅超级管理员)
|
||||
* POST /api/admin/school/deleteAccount
|
||||
*/
|
||||
export async function deleteSchoolAccountApi(data: SchoolApi.DeleteAccountParams) {
|
||||
return requestClient.post('/api/admin/school/deleteAccount', data);
|
||||
}
|
||||
|
||||
65
apps/web-antd/src/api/admin/setting.ts
Normal file
65
apps/web-antd/src/api/admin/setting.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SettingApi {
|
||||
/** 系统设置 */
|
||||
export interface SettingInfo {
|
||||
site_name?: string;
|
||||
site_desc?: string;
|
||||
site_icp?: string;
|
||||
site_banners?: string; // JSON字符串
|
||||
default_avatar?: string;
|
||||
upload_allowed_ext?: string;
|
||||
upload_max_size?: string;
|
||||
upload_path?: string;
|
||||
upload_image_size?: string;
|
||||
upload_image_ext?: string;
|
||||
mail_host?: string;
|
||||
mail_port?: string;
|
||||
mail_username?: string;
|
||||
mail_password?: string;
|
||||
wxapp_appid?: string;
|
||||
wxapp_secret?: string;
|
||||
wxapp_name?: string;
|
||||
wxapp_original?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 保存系统设置参数 */
|
||||
export interface SaveParams extends SettingInfo {
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统设置(仅超级管理员)
|
||||
* GET /api/admin/setting/get
|
||||
*/
|
||||
export async function getSettingApi() {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/setting/get', {
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存系统设置(仅超级管理员)
|
||||
* POST /api/admin/setting/save
|
||||
*/
|
||||
export async function saveSettingApi(data: SettingApi.SaveParams) {
|
||||
return requestClient.post('/api/admin/setting/save', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片(仅超级管理员)
|
||||
* POST /api/admin/setting/upload
|
||||
*/
|
||||
export async function uploadSettingImageApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return requestClient.post<string>('/api/admin/setting/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
154
apps/web-antd/src/api/admin/student.ts
Normal file
154
apps/web-antd/src/api/admin/student.ts
Normal file
@@ -0,0 +1,154 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace StudentApi {
|
||||
/** 学生列表查询参数 */
|
||||
export interface ListParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
student_id?: string;
|
||||
name?: string;
|
||||
phone?: string;
|
||||
class_id?: number;
|
||||
school_id?: number;
|
||||
bind_status?: string;
|
||||
}
|
||||
|
||||
/** 学生信息 */
|
||||
export interface StudentInfo {
|
||||
id?: number;
|
||||
student_id?: string | null;
|
||||
name?: string;
|
||||
gender?: string;
|
||||
class_id?: number;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
avatar?: string | null;
|
||||
remark?: string;
|
||||
status?: number;
|
||||
user_id?: number | null;
|
||||
create_time?: string;
|
||||
update_time?: string | null;
|
||||
class_name?: string;
|
||||
bind_status?: string;
|
||||
school_name?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 学生详情参数 */
|
||||
export interface DetailParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 保存学生参数 */
|
||||
export interface SaveParams extends StudentInfo {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/** 删除学生参数 */
|
||||
export interface DeleteParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 更新学生状态参数 */
|
||||
export interface StatusParams {
|
||||
id: number;
|
||||
status: number;
|
||||
}
|
||||
|
||||
/** 解绑学生参数 */
|
||||
export interface UnbindParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 上传学生导入文件参数 */
|
||||
export interface UploadParams {
|
||||
file: File;
|
||||
}
|
||||
|
||||
/** 导入学生数据参数 */
|
||||
export interface ImportParams {
|
||||
class_id: number;
|
||||
file: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生列表
|
||||
* GET /api/admin/student/list
|
||||
*/
|
||||
export async function getStudentListApi(params?: StudentApi.ListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/student/list', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生详情
|
||||
* GET /api/admin/student/detail
|
||||
*/
|
||||
export async function getStudentDetailApi(params: StudentApi.DetailParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/student/detail', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存学生(新增/编辑)
|
||||
* POST /api/admin/student/save
|
||||
*/
|
||||
export async function saveStudentApi(data: StudentApi.SaveParams) {
|
||||
return requestClient.post<StudentApi.StudentInfo>('/api/admin/student/save', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生
|
||||
* POST /api/admin/student/delete
|
||||
*/
|
||||
export async function deleteStudentApi(data: StudentApi.DeleteParams) {
|
||||
return requestClient.post('/api/admin/student/delete', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新学生状态
|
||||
* POST /api/admin/student/status
|
||||
*/
|
||||
export async function updateStudentStatusApi(data: StudentApi.StatusParams) {
|
||||
return requestClient.post('/api/admin/student/status', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑学生
|
||||
* POST /api/admin/student/unbind
|
||||
*/
|
||||
export async function unbindStudentApi(data: StudentApi.UnbindParams) {
|
||||
return requestClient.post('/api/admin/student/unbind', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传学生导入文件
|
||||
* POST /api/admin/student/upload
|
||||
*/
|
||||
export async function uploadStudentFileApi(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.post<any>('/api/admin/student/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入学生数据
|
||||
* POST /api/admin/student/import
|
||||
*/
|
||||
export async function importStudentDataApi(data: StudentApi.ImportParams) {
|
||||
return requestClient.post('/api/admin/student/import', data);
|
||||
}
|
||||
|
||||
92
apps/web-antd/src/api/admin/teacher.ts
Normal file
92
apps/web-antd/src/api/admin/teacher.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace TeacherApi {
|
||||
/** 教师列表查询参数 */
|
||||
export interface ListParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
teacher_id?: string;
|
||||
name?: string;
|
||||
department_id?: number;
|
||||
nickname?: string;
|
||||
}
|
||||
|
||||
/** 教师信息 */
|
||||
export interface TeacherInfo {
|
||||
id?: number;
|
||||
teacher_id?: string | null;
|
||||
name?: string;
|
||||
gender?: string;
|
||||
department_id?: number;
|
||||
title?: string | null;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
avatar?: string | null;
|
||||
remark?: string;
|
||||
status?: number;
|
||||
user_id?: number | null;
|
||||
create_time?: string;
|
||||
update_time?: string | null;
|
||||
nickname?: string;
|
||||
department_name?: string | null;
|
||||
classroom_count?: number;
|
||||
classroom_names?: string[];
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 教师详情参数 */
|
||||
export interface DetailParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 保存教师参数 */
|
||||
export interface SaveParams extends TeacherInfo {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/** 删除教师参数 */
|
||||
export interface DeleteParams {
|
||||
id: number;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教师列表
|
||||
* GET /api/admin/teacher/list
|
||||
*/
|
||||
export async function getTeacherListApi(params?: TeacherApi.ListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/teacher/list', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教师详情
|
||||
* GET /api/admin/teacher/detail
|
||||
*/
|
||||
export async function getTeacherDetailApi(params: TeacherApi.DetailParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/teacher/detail', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存教师(新增/编辑)
|
||||
* POST /api/admin/teacher/save
|
||||
*/
|
||||
export async function saveTeacherApi(data: TeacherApi.SaveParams) {
|
||||
return requestClient.post<TeacherApi.TeacherInfo>('/api/admin/teacher/save', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教师
|
||||
* POST /api/admin/teacher/delete
|
||||
*/
|
||||
export async function deleteTeacherApi(data: TeacherApi.DeleteParams) {
|
||||
return requestClient.post('/api/admin/teacher/delete', data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user