Parcourir la source

fix: add course teacher

DESKTOP-USV654P\pc il y a 6 jours
Parent
commit
6d18d37e6a
2 fichiers modifiés avec 70 ajouts et 1 suppressions
  1. 69 0
      src/views/course/teacher/data.config.ts
  2. 1 1
      src/views/course/teacher/index.vue

+ 69 - 0
src/views/course/teacher/data.config.ts

@@ -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;
+    },
+  },
+];

+ 1 - 1
src/views/course/teacher/index.vue

@@ -22,7 +22,7 @@
   import { onMounted } from 'vue';
   import { PageWrapper } from '/@/components/Page';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
-  import { tableColumns, searchFormSchema } from '../statistics/data.config';
+  import { tableColumns, searchFormSchema } from './data.config';
 
   import { useModal } from '/@/components/Modal';
   import { getClassTimeStatisticsTeacherRecordPage } from '/@/services/apis/ClassTimeStatisticsController';