|
@@ -1,6 +1,6 @@
|
|
import type { CreateCrudOptionsProps, CreateCrudOptionsRet } from '@fast-crud/fast-crud';
|
|
import type { CreateCrudOptionsProps, CreateCrudOptionsRet } from '@fast-crud/fast-crud';
|
|
import { dict } from '@fast-crud/fast-crud';
|
|
import { dict } from '@fast-crud/fast-crud';
|
|
-import { addAttendance, updateAttendance, getStudentList } from './api';
|
|
|
|
|
|
+import { updateAttendance, getStudentList } from './api';
|
|
|
|
|
|
function curd({ context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
function curd({ context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
return {
|
|
return {
|
|
@@ -12,14 +12,18 @@ function curd({ context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
show: false
|
|
show: false
|
|
},
|
|
},
|
|
request: {
|
|
request: {
|
|
- pageRequest: async ({ page }) => {
|
|
|
|
- const { data } = await getStudentList(context?.route.query.scheduleId ?? 0);
|
|
|
|
|
|
+ pageRequest: async ({ page, query }) => {
|
|
|
|
+ const queryBody = {
|
|
|
|
+ id: context?.route.query.scheduleId ?? 9999999
|
|
|
|
+ };
|
|
|
|
+ const { data } = await getStudentList(Object.assign(queryBody, query));
|
|
return { records: data, total: 0, currentPage: page.offset, pageSize: page.limit };
|
|
return { records: data, total: 0, currentPage: page.offset, pageSize: page.limit };
|
|
},
|
|
},
|
|
- addRequest: ({ form }) => {
|
|
|
|
- return addAttendance(form);
|
|
|
|
|
|
+ addRequest: () => {
|
|
|
|
+ return Promise.resolve();
|
|
},
|
|
},
|
|
editRequest: ({ form }) => {
|
|
editRequest: ({ form }) => {
|
|
|
|
+ form.scheduleId = form.id;
|
|
updateAttendance(form);
|
|
updateAttendance(form);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -37,7 +41,23 @@ function curd({ context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
columns: {
|
|
columns: {
|
|
- scheduleId: {
|
|
|
|
|
|
+ startTime: {
|
|
|
|
+ title: '上课时间',
|
|
|
|
+ type: 'easDateTime',
|
|
|
|
+ sortable: true,
|
|
|
|
+ column: {
|
|
|
|
+ width: 160
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ endTime: {
|
|
|
|
+ title: '下课时间',
|
|
|
|
+ type: 'easDateTime',
|
|
|
|
+ sortable: true,
|
|
|
|
+ column: {
|
|
|
|
+ width: 160
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ id: {
|
|
title: '排课ID',
|
|
title: '排课ID',
|
|
type: 'text',
|
|
type: 'text',
|
|
column: {
|
|
column: {
|
|
@@ -49,7 +69,7 @@ function curd({ context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
type: 'easDateTime',
|
|
type: 'easDateTime',
|
|
sortable: true,
|
|
sortable: true,
|
|
column: {
|
|
column: {
|
|
- width: 180
|
|
|
|
|
|
+ show: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
morning: {
|
|
morning: {
|
|
@@ -66,8 +86,7 @@ function curd({ context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
]
|
|
]
|
|
}),
|
|
}),
|
|
column: {
|
|
column: {
|
|
- resizable: true,
|
|
|
|
- width: 180
|
|
|
|
|
|
+ resizable: true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
afternoon: {
|
|
afternoon: {
|
|
@@ -84,15 +103,21 @@ function curd({ context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
]
|
|
]
|
|
}),
|
|
}),
|
|
column: {
|
|
column: {
|
|
- resizable: true,
|
|
|
|
- width: 180
|
|
|
|
|
|
+ resizable: true
|
|
}
|
|
}
|
|
},
|
|
},
|
|
studentName: {
|
|
studentName: {
|
|
title: '学生姓名',
|
|
title: '学生姓名',
|
|
type: 'text',
|
|
type: 'text',
|
|
|
|
+ sortable: true
|
|
|
|
+ },
|
|
|
|
+ type: {
|
|
|
|
+ title: '类别',
|
|
|
|
+ type: 'text',
|
|
sortable: true,
|
|
sortable: true,
|
|
- width: 100
|
|
|
|
|
|
+ form: {
|
|
|
|
+ show: false
|
|
|
|
+ }
|
|
},
|
|
},
|
|
studentNumber: {
|
|
studentNumber: {
|
|
title: '学生学号',
|
|
title: '学生学号',
|
|
@@ -102,32 +127,42 @@ function curd({ context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
width: 280
|
|
width: 280
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- createUid: {
|
|
|
|
- title: '录入用户',
|
|
|
|
|
|
+ teacherName: {
|
|
|
|
+ title: '授课老师',
|
|
type: 'text',
|
|
type: 'text',
|
|
sortable: true,
|
|
sortable: true,
|
|
width: 60,
|
|
width: 60,
|
|
|
|
+ search: {
|
|
|
|
+ show: false
|
|
|
|
+ },
|
|
form: {
|
|
form: {
|
|
show: false
|
|
show: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- createTime: {
|
|
|
|
- title: '创建时间',
|
|
|
|
- type: 'easDateTime',
|
|
|
|
|
|
+ categoryName: {
|
|
|
|
+ title: '类别',
|
|
|
|
+ type: 'text',
|
|
sortable: true,
|
|
sortable: true,
|
|
width: 100,
|
|
width: 100,
|
|
form: {
|
|
form: {
|
|
show: false
|
|
show: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- modifyTime: {
|
|
|
|
- title: '修改时间',
|
|
|
|
- type: 'easDateTime',
|
|
|
|
|
|
+ subjectsName: {
|
|
|
|
+ title: '系列',
|
|
|
|
+ type: 'text',
|
|
sortable: true,
|
|
sortable: true,
|
|
width: 100,
|
|
width: 100,
|
|
form: {
|
|
form: {
|
|
show: false
|
|
show: false
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ roomName: {
|
|
|
|
+ title: '教室',
|
|
|
|
+ type: 'text',
|
|
|
|
+ form: {
|
|
|
|
+ show: false
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|