@@ -201,7 +201,7 @@ class ClassroomApi {
|
||||
batchAdd(req: ClassroomBatchAddRequest) {
|
||||
return postJSON<BatchAddResult>(`${CLASSROOM}/BatchAdd`, req as unknown as Record<string, any>);
|
||||
}
|
||||
/** 编辑教室(类型/名称/编号/状态/容纳人数/座位数) */
|
||||
/** 编辑教室(类型/名称/编号/状态/座位数) */
|
||||
edit(req: ClassroomEditRequest) {
|
||||
return postJSON<void>(`${CLASSROOM}/Edit`, req as unknown as Record<string, any>);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export interface Building {
|
||||
}
|
||||
|
||||
/** 教室列表排序字段(与后端 classroom/List 的 sortField 对齐) */
|
||||
export type ClassroomSortField = "floor" | "roomCode" | "roomName" | "status" | "capacity" | "seatCount";
|
||||
export type ClassroomSortField = "floor" | "roomCode" | "roomName" | "status" | "seatCount";
|
||||
|
||||
/** 排序方向 */
|
||||
export type SortOrder = "asc" | "desc";
|
||||
@@ -97,7 +97,6 @@ export interface Classroom {
|
||||
typeId: number | null;
|
||||
typeName?: string;
|
||||
status: ClassroomStatus;
|
||||
capacity: number;
|
||||
seatCount: number;
|
||||
campusName?: string;
|
||||
buildingName?: string;
|
||||
@@ -148,6 +147,8 @@ export interface ClassroomBatchAddRequest {
|
||||
countPerFloor: number;
|
||||
/** 教室类型 id */
|
||||
typeId: number | null;
|
||||
/** 座位数(缺省 0) */
|
||||
seatCount?: number;
|
||||
/** 编号/名称前缀(缺省用楼栋编号) */
|
||||
namePrefix?: string;
|
||||
/** 关联设备(含每间数量,可空) */
|
||||
@@ -168,7 +169,6 @@ export interface ClassroomEditRequest {
|
||||
roomCode?: string;
|
||||
typeId?: number | null;
|
||||
status?: ClassroomStatus;
|
||||
capacity?: number;
|
||||
seatCount?: number;
|
||||
/** 关联设备(含每间数量;传数组含空=全量替换,不传=不改动) */
|
||||
equipments?: ClassroomEquipmentItem[];
|
||||
|
||||
@@ -217,7 +217,6 @@ const columns = [
|
||||
{ title: "楼栋", key: "buildingName", minWidth: 110, align: "center" as const, ellipsis: true },
|
||||
{ title: "层数", slot: "floor", width: 70, align: "center" as const },
|
||||
{ title: "教室", slot: "room", minWidth: 130, ellipsis: true },
|
||||
{ title: "容纳人数", key: "capacity", width: 96, align: "center" as const },
|
||||
{ title: "座位数", key: "seatCount", width: 96, align: "center" as const },
|
||||
{ title: "班级", slot: "klass", minWidth: 300 },
|
||||
];
|
||||
|
||||
@@ -438,7 +438,7 @@ async function exportCsv() {
|
||||
Message.warning("当前筛选范围内没有可导出的教室");
|
||||
return;
|
||||
}
|
||||
const header = ["教室编号", "教室名称", "校区", "楼栋", "楼层", "类型", "状态", "容纳人数", "座位数", "设备"];
|
||||
const header = ["教室编号", "教室名称", "校区", "楼栋", "楼层", "类型", "状态", "座位数", "设备"];
|
||||
const rows = all.map((r) => [
|
||||
r.roomCode,
|
||||
r.roomName,
|
||||
@@ -447,7 +447,6 @@ async function exportCsv() {
|
||||
`${r.floor}层`,
|
||||
r.typeName ?? "",
|
||||
r.status === "open" ? "开放" : "关闭",
|
||||
r.capacity ?? 0,
|
||||
r.seatCount ?? 0,
|
||||
r.equipmentNames ?? "",
|
||||
]);
|
||||
@@ -490,7 +489,6 @@ const focusRoom = computed<Classroom | null>(() => {
|
||||
typeId: null,
|
||||
typeName: "",
|
||||
status: t.status,
|
||||
capacity: 0,
|
||||
seatCount: 0,
|
||||
};
|
||||
});
|
||||
@@ -600,6 +598,7 @@ const batch = ref({
|
||||
floorTo: 1,
|
||||
countPerFloor: 4,
|
||||
typeId: null as number | null,
|
||||
seatCount: 0,
|
||||
namePrefix: "",
|
||||
equipmentIds: [] as number[],
|
||||
/** 设备 id → 每间教室数量(勾选时默认 1) */
|
||||
@@ -663,6 +662,7 @@ function openBatch() {
|
||||
floorTo: fc,
|
||||
countPerFloor: 4,
|
||||
typeId: enabledTypes.value[0].serID,
|
||||
seatCount: 0,
|
||||
namePrefix: "",
|
||||
equipmentIds: [],
|
||||
equipmentQty: {},
|
||||
@@ -671,7 +671,8 @@ function openBatch() {
|
||||
}
|
||||
|
||||
async function saveBatch() {
|
||||
const { buildingId, floorFrom, floorTo, countPerFloor, typeId, namePrefix, equipmentIds, equipmentQty } = batch.value;
|
||||
const { buildingId, floorFrom, floorTo, countPerFloor, typeId, seatCount, namePrefix, equipmentIds, equipmentQty } =
|
||||
batch.value;
|
||||
const b = batchBuilding.value;
|
||||
if (!buildingId || !b) {
|
||||
Message.warning("请选择楼栋");
|
||||
@@ -702,6 +703,7 @@ async function saveBatch() {
|
||||
floorTo,
|
||||
countPerFloor,
|
||||
typeId,
|
||||
seatCount: seatCount ?? 0,
|
||||
namePrefix: namePrefix.trim() || undefined,
|
||||
equipments: toEquipmentItems(equipmentIds, equipmentQty),
|
||||
})
|
||||
@@ -723,7 +725,6 @@ const editForm = ref({
|
||||
roomCode: "",
|
||||
typeId: null as number | null,
|
||||
status: "open" as "open" | "closed",
|
||||
capacity: 0,
|
||||
seatCount: 0,
|
||||
equipmentIds: [] as number[],
|
||||
/** 设备 id → 每间教室数量(回填已有关联,勾选新设备默认 1) */
|
||||
@@ -737,7 +738,6 @@ function openEdit(row: Classroom) {
|
||||
roomCode: row.roomCode,
|
||||
typeId: row.typeId,
|
||||
status: row.status,
|
||||
capacity: row.capacity ?? 0,
|
||||
seatCount: row.seatCount ?? 0,
|
||||
equipmentIds: [...(row.equipmentIds ?? [])],
|
||||
equipmentQty: {},
|
||||
@@ -773,7 +773,6 @@ async function saveEdit() {
|
||||
roomCode: editForm.value.roomCode.trim(),
|
||||
typeId: editForm.value.typeId,
|
||||
status: editForm.value.status,
|
||||
capacity: editForm.value.capacity,
|
||||
seatCount: editForm.value.seatCount,
|
||||
equipments: toEquipmentItems(editForm.value.equipmentIds, editForm.value.equipmentQty),
|
||||
})
|
||||
@@ -1208,10 +1207,6 @@ onMounted(async () => {
|
||||
<span class="detail-row__label">座位数</span>
|
||||
<span class="detail-row__value">{{ focusRoom.seatCount ?? 0 }}</span>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-row__label">容纳人数</span>
|
||||
<span class="detail-row__value">{{ focusRoom.capacity ?? 0 }}</span>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-row__label">类型</span>
|
||||
<span class="detail-row__value">{{ focusRoom.typeName || "—" }}</span>
|
||||
@@ -1337,6 +1332,10 @@ onMounted(async () => {
|
||||
<Option v-for="t in enabledTypes" :key="t.serID" :value="t.serID">{{ t.typeName }}</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem label="座位数">
|
||||
<InputNumber v-model="batch.seatCount" :min="0" :max="100000" style="width: 150px" />
|
||||
<span class="hint inline">本次生成的每间教室(选填)</span>
|
||||
</FormItem>
|
||||
<FormItem label="编号前缀">
|
||||
<Input
|
||||
v-model="batch.namePrefix"
|
||||
@@ -1391,9 +1390,6 @@ onMounted(async () => {
|
||||
<Radio label="closed">关闭</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem label="教室容纳人数">
|
||||
<InputNumber v-model="editForm.capacity" :min="0" :max="100000" style="width: 150px" />
|
||||
</FormItem>
|
||||
<FormItem label="座位数">
|
||||
<InputNumber v-model="editForm.seatCount" :min="0" :max="100000" style="width: 150px" />
|
||||
</FormItem>
|
||||
|
||||
Reference in New Issue
Block a user