|
@@ -24,13 +24,14 @@
|
|
|
import { tableColumns } from './data.config';
|
|
|
import {
|
|
|
getScheduleCourseTable,
|
|
|
+ getScheduleWeekList,
|
|
|
postScheduleScheduleWeekExportQuery,
|
|
|
} from '/@/services/apis/ScheduleController';
|
|
|
import { requestMagicApi } from '/@/api/magicApi';
|
|
|
import { BasicOptionModel } from '/@/api/model/baseModel';
|
|
|
import { orderBy } from 'lodash-es';
|
|
|
import { downloadByData } from '/@/utils/file/download';
|
|
|
- import { formatToDateTime } from '/@/utils/dateUtil';
|
|
|
+ import { formatToDate, formatToDateTime } from '/@/utils/dateUtil';
|
|
|
|
|
|
const tableText = reactive({
|
|
|
semesterName: '',
|
|
@@ -38,7 +39,6 @@
|
|
|
week: '',
|
|
|
classHour: '',
|
|
|
});
|
|
|
-
|
|
|
const reloadApi = async (data) => {
|
|
|
const resData = await getScheduleCourseTable(data);
|
|
|
|
|
@@ -107,15 +107,6 @@
|
|
|
|
|
|
const tabTitle = ref<string>('课表');
|
|
|
|
|
|
- const getWeeks = () => {
|
|
|
- const weeks: BasicOptionModel[] = [];
|
|
|
- for (let i = 0; i < 23; i++) {
|
|
|
- const week = `${i + 1}`;
|
|
|
- weeks.push({ label: week, value: week });
|
|
|
- }
|
|
|
- return weeks;
|
|
|
- };
|
|
|
-
|
|
|
const [registerTable, { getForm }] = useTable({
|
|
|
api: reloadApi,
|
|
|
title: tabTitle,
|
|
@@ -167,11 +158,23 @@
|
|
|
{
|
|
|
field: 'week',
|
|
|
label: '周次',
|
|
|
- component: 'Select',
|
|
|
+ component: 'ApiSelect',
|
|
|
required: true,
|
|
|
colProps: { span: 8 },
|
|
|
componentProps: {
|
|
|
- options: getWeeks(),
|
|
|
+ api: async () => {
|
|
|
+ const data = await getScheduleWeekList({});
|
|
|
+
|
|
|
+ return data.map((item) => {
|
|
|
+ return {
|
|
|
+ label: `${item.weekCn}(${formatToDate(item.startDate, 'MM.DD')}~${formatToDate(
|
|
|
+ item.endDate,
|
|
|
+ 'MM.DD',
|
|
|
+ )})`,
|
|
|
+ value: item.week,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
getPopupContainer: () => document.body,
|
|
|
},
|
|
|
},
|