|
@@ -0,0 +1,69 @@
|
|
|
|
+import { BasicColumn, FormSchema } from '/@/components/Table';
|
|
|
|
+import { formatToDate } from '/@/utils/dateUtil';
|
|
|
|
+
|
|
|
|
+export const statusOptions = [
|
|
|
|
+ { label: '数据统计中', value: 0 },
|
|
|
|
+ { label: '统计完成', value: 1 },
|
|
|
|
+ { label: '已解锁', value: 2 },
|
|
|
|
+ { label: '已锁定', value: 3 },
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+export const searchFormSchema: FormSchema[] = [
|
|
|
|
+ {
|
|
|
|
+ field: 'date',
|
|
|
|
+ label: '年月',
|
|
|
|
+ component: 'DatePicker',
|
|
|
|
+ colProps: { span: 8 },
|
|
|
|
+ componentProps: {
|
|
|
|
+ showTime: false,
|
|
|
|
+ format: 'YYYY-MM',
|
|
|
|
+ valueFormat: 'YYYY-MM',
|
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+export const tableColumns: BasicColumn[] = [
|
|
|
|
+ {
|
|
|
|
+ title: '年月',
|
|
|
|
+ dataIndex: 'year',
|
|
|
|
+ align: 'left',
|
|
|
|
+ width: 100,
|
|
|
|
+ customRender: ({ record }) => {
|
|
|
|
+ return `${record.year}年${record.month}月`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '时间',
|
|
|
|
+ dataIndex: 'startDate',
|
|
|
|
+ align: 'left',
|
|
|
|
+ // width: 180,
|
|
|
|
+ customRender: ({ record }) => {
|
|
|
|
+ return `${formatToDate(record.startDate)}~${formatToDate(record.endDate)}`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '总课时',
|
|
|
|
+ dataIndex: 'allClassTime',
|
|
|
|
+ align: 'left',
|
|
|
|
+ width: 100,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '更新时间',
|
|
|
|
+ dataIndex: 'modifyDate',
|
|
|
|
+ align: 'left',
|
|
|
|
+ width: 120,
|
|
|
|
+ customRender: ({ record }) => {
|
|
|
|
+ return `${formatToDate(record.modifyDate)}`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '状态',
|
|
|
|
+ dataIndex: 'status',
|
|
|
|
+ align: 'left',
|
|
|
|
+ width: 90,
|
|
|
|
+ customRender: ({ text }) => {
|
|
|
|
+ return statusOptions.find((item) => item.value === text)?.label;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+];
|