diff --git a/API.md b/API.md index 6807ef0..3655223 100644 --- a/API.md +++ b/API.md @@ -188,6 +188,42 @@ - **参数**: - `file` (file, 必填): 图片文件 +#### 4.15 获取教室选座列表 +- **URL**: `GET /api/admin/classroom/getSeatList` +- **说明**: 获取教室的选座列表,以座位号排序 +- **需要登录**: 是 +- **参数**: + - `id` (int, 必填): 教室ID +- **返回数据**: + ```json + { + "code": 200, + "message": "获取成功", + "data": [ + { + "seat_number": "1", + "is_selected": 1, + "student_name": "张三", + "student_mobile": "13800138000", + "select_time": "2024-03-20 10:00:00" + }, + { + "seat_number": "2", + "is_selected": 0, + "student_name": "", + "student_mobile": "", + "select_time": "" + } + ] + } + ``` +- **字段说明**: + - `seat_number` (string): 座位号 + - `is_selected` (int): 是否选座(1已选,0未选) + - `student_name` (string): 学员姓名(未选座时为空) + - `student_mobile` (string): 学员手机号(未选座时为空) + - `select_time` (string): 选座时间(未选座时为空) + ### 5. 预订管理 #### 5.1 获取预订列表 diff --git a/apps/web-antd/.env.production b/apps/web-antd/.env.production index 869d031..e84c54f 100644 --- a/apps/web-antd/.env.production +++ b/apps/web-antd/.env.production @@ -1,6 +1,6 @@ # 生产环境配置 VITE_BASE=/super/ -VITE_GLOB_API_URL=https://xuanzuo.dhdjy.com +VITE_GLOB_API_URL=http://xz.dhdjy.com VITE_ROUTER_HISTORY=history VITE_COMPRESS=gzip VITE_PWA=false diff --git a/apps/web-antd/src/api/admin/classroom.ts b/apps/web-antd/src/api/admin/classroom.ts index 6ed1b8b..7e13de9 100644 --- a/apps/web-antd/src/api/admin/classroom.ts +++ b/apps/web-antd/src/api/admin/classroom.ts @@ -22,10 +22,13 @@ export namespace ClassroomApi { export interface ClassroomLayoutCell { col: number; row: number; - type: 'empty' | 'pillar' | 'aisle' | 'seat' | 'door'; + type: 'empty' | 'pillar' | 'aisle' | 'seat' | 'door' | 'projector'; number?: string; - status?: number; + status?: number; // 座位状态:1=可用, 0=禁坐 name?: string; + colspan?: number; // 合并列数(默认1) + rowspan?: number; // 合并行数(默认1) + merged?: boolean; // 是否为被合并的单元格(用于标记被主单元格合并的单元格) } /** 教室座位布局 */ @@ -107,6 +110,20 @@ export namespace ClassroomApi { export interface CancelBookingAutoParams { ids: number[]; } + + /** 获取教室选座列表参数 */ + export interface GetSeatListParams { + id: number; + } + + /** 座位信息 */ + export interface SeatInfo { + seat_number: string; + is_selected: number; // 1已选,0未选 + student_name: string; + student_mobile: string; + select_time: string; + } } /** @@ -235,3 +252,15 @@ export async function uploadClassroomImageApi(file: File) { }); } +/** + * 获取教室选座列表 + * GET /api/admin/classroom/getSeatList + */ +export async function getClassroomSeatListApi(params: ClassroomApi.GetSeatListParams) { + // 使用 responseReturn: 'body' 获取完整响应体 + return requestClient.get('/api/admin/classroom/getSeatList', { + params, + responseReturn: 'body', + }); +} + diff --git a/apps/web-antd/src/api/admin/index-page.ts b/apps/web-antd/src/api/admin/index-page.ts index d16928a..8d56c02 100644 --- a/apps/web-antd/src/api/admin/index-page.ts +++ b/apps/web-antd/src/api/admin/index-page.ts @@ -1,6 +1,17 @@ import { requestClient } from '#/api/request'; export namespace IndexApi { + /** 统计数据 */ + export interface Statistics { + school_count?: number; + classroom_count?: number; + class_count?: number; + student_count?: number; + teacher_count?: number; + booking_count?: number; + selected_seat_count?: number; + } + /** 系统信息 */ export interface SystemInfo { os?: string; @@ -14,6 +25,7 @@ export namespace IndexApi { disk_usage?: string; runtime_path?: string; framework_version?: string; + statistics?: Statistics; [key: string]: any; } } diff --git a/apps/web-antd/src/api/admin/setting.ts b/apps/web-antd/src/api/admin/setting.ts index 26775a0..b0d04b4 100644 --- a/apps/web-antd/src/api/admin/setting.ts +++ b/apps/web-antd/src/api/admin/setting.ts @@ -56,10 +56,12 @@ export async function saveSettingApi(data: SettingApi.SaveParams) { export async function uploadSettingImageApi(file: File) { const formData = new FormData(); formData.append('file', file); - return requestClient.post('/api/admin/setting/upload', formData, { + // 使用 responseReturn: 'body' 获取完整响应体 + return requestClient.post('/api/admin/setting/upload', formData, { headers: { 'Content-Type': 'multipart/form-data', }, + responseReturn: 'body', }); } diff --git a/apps/web-antd/src/components/classroom/SeatLayoutEditor.vue b/apps/web-antd/src/components/classroom/SeatLayoutEditor.vue index 2f56e25..544a11d 100644 --- a/apps/web-antd/src/components/classroom/SeatLayoutEditor.vue +++ b/apps/web-antd/src/components/classroom/SeatLayoutEditor.vue @@ -1,6 +1,6 @@ + + + +
+ +
+ + +
+
+ + + +
+ 加载中... +
+ +
diff --git a/apps/web-antd/src/views/dashboard/index.vue b/apps/web-antd/src/views/dashboard/index.vue index 7c0c704..30ce165 100644 --- a/apps/web-antd/src/views/dashboard/index.vue +++ b/apps/web-antd/src/views/dashboard/index.vue @@ -17,11 +17,9 @@ const fetchSystemInfo = async () => { if (res && (res.code === 0 || res.code === 200)) { // 根据实际返回格式,数据在 res.data 中 systemInfo.value = res.data || {}; - } else { - console.error('获取系统信息失败:', res?.message || res?.msg); } } catch (error) { - console.error('获取系统信息失败:', error); + // 静默处理错误 } finally { loading.value = false; } @@ -34,45 +32,75 @@ onMounted(() => { diff --git a/apps/web-antd/src/views/setting/index.vue b/apps/web-antd/src/views/setting/index.vue index d51f887..59fd5b4 100644 --- a/apps/web-antd/src/views/setting/index.vue +++ b/apps/web-antd/src/views/setting/index.vue @@ -1,10 +1,12 @@