@@ -249,18 +249,10 @@ class EquipmentApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SchoolClassApi {
|
class SchoolClassApi {
|
||||||
/** 班级列表(全校,可按年级过滤;行含 classroomId=绑定的教室 id,未绑定为 null) */
|
/** 班级列表(全校高中学段,来源=班级管理平台接口,可按年级过滤;行含 classroomId=绑定的教室 id,未绑定为 null;studentCount 可空) */
|
||||||
list(grade?: number | null) {
|
list(grade?: number | null) {
|
||||||
return get<SchoolClass[]>(`${SCHOOLCLASS}/List`, { grade: grade ?? undefined });
|
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();
|
export const baseApi = new BaseApi();
|
||||||
|
|||||||
@@ -205,12 +205,15 @@ export interface EquipmentPageResult {
|
|||||||
total: number;
|
total: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 班级档案(绑定班级页;classroomId=绑定到的教室 id,未绑定为 null) */
|
/**
|
||||||
|
* 班级(绑定班级页;来源=班级管理平台接口,本应用不落库)。
|
||||||
|
* serID=平台分组体系 classId;studentCount 来自学生树派生,树不可达时为 null。
|
||||||
|
*/
|
||||||
export interface SchoolClass {
|
export interface SchoolClass {
|
||||||
serID: number;
|
serID: number;
|
||||||
className: string;
|
className: string;
|
||||||
grade: GradeValue;
|
grade: GradeValue;
|
||||||
studentCount: number;
|
studentCount: number | null;
|
||||||
headTeacher?: string | null;
|
headTeacher?: string | null;
|
||||||
classroomId?: number | null;
|
classroomId?: number | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const GRADES: { value: GradeValue; label: string }[] = [
|
|||||||
// ---------- 主数据 ----------
|
// ---------- 主数据 ----------
|
||||||
const campuses = ref<Campus[]>([]);
|
const campuses = ref<Campus[]>([]);
|
||||||
const buildings = ref<Building[]>([]);
|
const buildings = ref<Building[]>([]);
|
||||||
/** 全校班级(全年级一次取,Tab 计数与下拉选项共用) */
|
/** 全校班级(来源=班级管理平台接口,全年级一次取,Tab 计数与下拉选项共用;studentCount 可空) */
|
||||||
const classes = ref<SchoolClass[]>([]);
|
const classes = ref<SchoolClass[]>([]);
|
||||||
|
|
||||||
// ---------- 年级 Tab ----------
|
// ---------- 年级 Tab ----------
|
||||||
@@ -352,7 +352,7 @@ onMounted(async () => {
|
|||||||
<Tag color="primary" class="bind-cell__tag">{{ row.className }}</Tag>
|
<Tag color="primary" class="bind-cell__tag">{{ row.className }}</Tag>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<span class="bind-cell__meta">
|
<span class="bind-cell__meta">
|
||||||
{{ row.studentCount ?? 0 }}人 · 班主任{{ row.headTeacher || "—" }}
|
<template v-if="row.studentCount != null">{{ row.studentCount }}人 · </template>班主任{{ row.headTeacher || "—" }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
:class="['row-action', 'row-action--danger', { 'is-busy': unbindingId === row.serID }]"
|
: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">
|
<Option v-for="c in availableClasses" :key="c.serID" :value="c.serID" :label="c.className">
|
||||||
<span class="klass-option">
|
<span class="klass-option">
|
||||||
<span class="klass-option__name">{{ c.className }}</span>
|
<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>
|
</span>
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
Reference in New Issue
Block a user