refactor: remove unused classroom fields

This commit is contained in:
2026-07-13 09:34:15 +08:00
parent a266d450e1
commit b9b295c997
14 changed files with 374 additions and 53 deletions

View File

@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest';
import { CLASSROOM_VISIBLE_FIELDS } from './classroom-fields';
describe('classroom visible fields', () => {
it('excludes obsolete course and supervisor metadata', () => {
expect(CLASSROOM_VISIBLE_FIELDS).toEqual([
'name',
'building',
'floor',
'roomType',
'capacity',
'status',
'notes',
]);
});
});

View File

@@ -0,0 +1,9 @@
export const CLASSROOM_VISIBLE_FIELDS = [
'name',
'building',
'floor',
'roomType',
'capacity',
'status',
'notes',
] as const;

View File

@@ -154,8 +154,6 @@ const ClassroomsPage: React.FC = () => {
render: (v: string) => <Tag color={typeColor[v] || 'default'}>{v || '-'}</Tag>,
},
{ title: '容量', dataIndex: 'capacity', width: 80 },
{ title: '课程类型', dataIndex: 'courseType', width: 100, render: (v: string) => v || '-' },
{ title: '负责人', dataIndex: 'supervisor', width: 100, render: (v: string) => v || '-' },
{
title: '状态', width: 100,
dataIndex: 'status',
@@ -325,12 +323,6 @@ const ClassroomsPage: React.FC = () => {
<Form.Item name="capacity" label="容量">
<InputNumber min={1} max={500} style={{ width: '100%' }} />
</Form.Item>
<Form.Item name="courseType" label="课程类型" tooltip="如:尊享培优班 / 专业课集训班">
<Input />
</Form.Item>
<Form.Item name="supervisor" label="负责人/班主任">
<Input />
</Form.Item>
<Form.Item name="notes" label="备注">
<Input.TextArea rows={2} />
</Form.Item>