班级绑定
build / build (push) Successful in 4m3s

This commit is contained in:
wanghu
2026-10-20 12:11:15 +08:00
parent d79becc317
commit 95de5b06c2
3 changed files with 11 additions and 14 deletions
+1 -9
View File
@@ -249,18 +249,10 @@ class EquipmentApi {
}
class SchoolClassApi {
/** 班级列表(全校,可按年级过滤;行含 classroomId=绑定的教室 id,未绑定为 null) */
/** 班级列表(全校高中学段,来源=班级管理平台接口,可按年级过滤;行含 classroomId=绑定的教室 id,未绑定为 null;studentCount 可空) */
list(grade?: number | null) {
return get<SchoolClass[]>(`${SCHOOLCLASS}/List`, { grade: grade ?? undefined });
}
/** 新增班级 */
add(className: string, grade: number, studentCount?: number, headTeacher?: string) {
return postForm<number>(`${SCHOOLCLASS}/Add`, { className, grade, studentCount, headTeacher });
}
/** 删除班级(已被教室绑定时后端拒绝) */
del(serid: number) {
return postForm<void>(`${SCHOOLCLASS}/Delete`, { serid });
}
}
export const baseApi = new BaseApi();
+5 -2
View File
@@ -205,12 +205,15 @@ export interface EquipmentPageResult {
total: number;
}
/** 班级档案(绑定班级页;classroomId=绑定到的教室 id,未绑定为 null) */
/**
* 班级(绑定班级页;来源=班级管理平台接口,本应用不落库)。
* serID=平台分组体系 classId;studentCount 来自学生树派生,树不可达时为 null。
*/
export interface SchoolClass {
serID: number;
className: string;
grade: GradeValue;
studentCount: number;
studentCount: number | null;
headTeacher?: string | null;
classroomId?: number | null;
}
+5 -3
View File
@@ -26,7 +26,7 @@ const GRADES: { value: GradeValue; label: string }[] = [
// ---------- 主数据 ----------
const campuses = ref<Campus[]>([]);
const buildings = ref<Building[]>([]);
/** 全校班级(全年级一次取,Tab 计数与下拉选项共用) */
/** 全校班级(来源=班级管理平台接口,全年级一次取,Tab 计数与下拉选项共用;studentCount 可空) */
const classes = ref<SchoolClass[]>([]);
// ---------- 年级 Tab ----------
@@ -352,7 +352,7 @@ onMounted(async () => {
<Tag color="primary" class="bind-cell__tag">{{ row.className }}</Tag>
</Tooltip>
<span class="bind-cell__meta">
{{ row.studentCount ?? 0 }}人 · 班主任{{ row.headTeacher || "—" }}
<template v-if="row.studentCount != null">{{ row.studentCount }}人 · </template>班主任{{ row.headTeacher || "—" }}
</span>
<span
:class="['row-action', 'row-action--danger', { 'is-busy': unbindingId === row.serID }]"
@@ -375,7 +375,9 @@ onMounted(async () => {
<Option v-for="c in availableClasses" :key="c.serID" :value="c.serID" :label="c.className">
<span class="klass-option">
<span class="klass-option__name">{{ c.className }}</span>
<span class="klass-option__meta">{{ c.studentCount }}人 · 班主任{{ c.headTeacher || "—" }}</span>
<span class="klass-option__meta">
<template v-if="c.studentCount != null">{{ c.studentCount }}人 · </template>班主任{{ c.headTeacher || "—" }}
</span>
</span>
</Option>
</Select>