123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- import { attendanceModeOptions, outintStatusOptions, timeIntervalOptions } from '../data.config';
- import { getDataOption } from '/@/api/system/dic';
- import { BasicColumn, FormSchema } from '/@/components/Table';
- import { dateUtil, formatToDate } from '/@/utils/dateUtil';
- export const tableColumns: BasicColumn[] = [
- // {
- // title: '时间段',
- // dataIndex: 'timeInterval',
- // align: 'left',
- // width: 80,
- // customRender: ({ record }) => {
- // return timeIntervalOptions.find((item) => item.value === record.timeInterval)?.label;
- // },
- // },
- {
- title: '教师姓名',
- dataIndex: 'teacherName',
- align: 'left',
- },
- {
- title: '手机号码',
- dataIndex: 'mobile',
- align: 'left',
- // width: 120,
- },
- {
- title: '考勤状态',
- dataIndex: 'status',
- align: 'left',
- // width: 80,
- },
- {
- title: '考勤时间',
- dataIndex: 'recordTime',
- align: 'left',
- // width: 150,
- },
- {
- title: '考勤方式',
- dataIndex: 'attendanceMode',
- align: 'left',
- // width: 80,
- customRender: ({ record }) => {
- return attendanceModeOptions.find((item) => item.value === record.attendanceMode)?.label;
- },
- },
- {
- title: '车牌号',
- dataIndex: 'carNumber',
- align: 'left',
- // width: 120,
- },
- ];
- export const tableRecordColumns: BasicColumn[] = [
- {
- title: '教师姓名',
- dataIndex: 'name',
- align: 'left',
- },
- {
- title: '性别',
- dataIndex: 'gender',
- align: 'left',
- width: 70,
- },
- {
- title: '手机号码',
- dataIndex: 'phone',
- align: 'left',
- width: 120,
- },
- {
- title: '记录时间',
- dataIndex: 'recordTime',
- align: 'left',
- width: 150,
- // customRender: ({ record }) => {
- // return `${formatToDate(record.recordTime)}`;
- // },
- },
- {
- title: '记录照片',
- dataIndex: 'facePhoto',
- align: 'left',
- width: 140,
- },
- {
- title: '进出属性',
- dataIndex: 'status',
- align: 'left',
- width: 80,
- customRender: ({ record }) => {
- return outintStatusOptions.find((item) => item.value === record.status)?.label;
- },
- },
- ];
- export const searchFormSchema: FormSchema[] = [
- {
- field: 'date',
- label: '日期',
- component: 'DatePicker',
- colProps: { span: 8 },
- defaultValue: formatToDate(new Date()),
- componentProps: {
- showTime: false,
- format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD',
- getPopupContainer: () => document.body,
- disabledDate: (current) => {
- return current && current > dateUtil().endOf('day');
- },
- },
- },
- {
- field: 'timePeriod',
- label: '时间段',
- component: 'Select',
- defaultValue: 1,
- componentProps: {
- getPopupContainer: () => document.body,
- options: timeIntervalOptions.filter((row) => row.value === 1 || row.value === 2),
- },
- colProps: { span: 8 },
- },
- {
- field: 'attendanceStatus',
- label: '考勤状态',
- component: 'ApiSelect',
- componentProps: {
- getPopupContainer: () => document.body,
- api: getDataOption,
- params: { code: 'attendance_status' },
- },
- colProps: { span: 8 },
- },
- {
- field: 'name',
- label: '姓名',
- component: 'Input',
- colProps: { span: 8 },
- },
- {
- field: 'attendanceMode',
- label: '考勤方式',
- component: 'Select',
- componentProps: {
- getPopupContainer: () => document.body,
- options: attendanceModeOptions,
- },
- colProps: { span: 8 },
- },
- {
- field: 'carNumber',
- label: '车牌号',
- component: 'Input',
- colProps: { span: 8 },
- },
- ];
- export const searchRecordFormSchema: FormSchema[] = [
- {
- field: 'startTime',
- label: '日期',
- component: 'DatePicker',
- colProps: { span: 8 },
- defaultValue: formatToDate(new Date()),
- componentProps: {
- showTime: false,
- format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD',
- getPopupContainer: () => document.body,
- disabledDate: (current) => {
- return current && current > dateUtil().endOf('day');
- },
- },
- },
- {
- field: 'name',
- label: '姓名',
- component: 'Input',
- colProps: { span: 8 },
- },
- {
- field: 'status',
- label: '进出属性',
- component: 'Select',
- componentProps: {
- getPopupContainer: () => document.body,
- options: outintStatusOptions,
- },
- colProps: { span: 8 },
- },
- ];
|