refactor: remove unused classroom fields
This commit is contained in:
@@ -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',
|
||||
]);
|
||||
});
|
||||
});
|
||||
9
apps/admin/src/pages/Classrooms/classroom-fields.ts
Normal file
9
apps/admin/src/pages/Classrooms/classroom-fields.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const CLASSROOM_VISIBLE_FIELDS = [
|
||||
'name',
|
||||
'building',
|
||||
'floor',
|
||||
'roomType',
|
||||
'capacity',
|
||||
'status',
|
||||
'notes',
|
||||
] as const;
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user