|
@@ -73,7 +73,6 @@
|
|
postClassTimeStatisticsRecordDetailExportQuery,
|
|
postClassTimeStatisticsRecordDetailExportQuery,
|
|
getClassTimeStatisticsRecordDetailInfo,
|
|
getClassTimeStatisticsRecordDetailInfo,
|
|
} from '/@/services/apis/ClassTimeStatisticsController';
|
|
} from '/@/services/apis/ClassTimeStatisticsController';
|
|
- import { useLoading } from '/@/components/Loading';
|
|
|
|
import { formatToDate } from '/@/utils/dateUtil';
|
|
import { formatToDate } from '/@/utils/dateUtil';
|
|
import { downloadByData } from '/@/utils/file/download';
|
|
import { downloadByData } from '/@/utils/file/download';
|
|
|
|
|
|
@@ -84,9 +83,6 @@
|
|
index: 0,
|
|
index: 0,
|
|
});
|
|
});
|
|
const emit = defineEmits(['success', 'register']);
|
|
const emit = defineEmits(['success', 'register']);
|
|
- const [openFullLoading, closeFullLoading] = useLoading({
|
|
|
|
- tip: '处理中...',
|
|
|
|
- });
|
|
|
|
|
|
|
|
const [registerTable, { setTableData, setColumns, redoHeight }] = useTable({
|
|
const [registerTable, { setTableData, setColumns, redoHeight }] = useTable({
|
|
title: '课时统计表',
|
|
title: '课时统计表',
|
|
@@ -119,8 +115,7 @@
|
|
});
|
|
});
|
|
|
|
|
|
const loadData = async () => {
|
|
const loadData = async () => {
|
|
- setModalProps({ confirmLoading: true });
|
|
|
|
- openFullLoading();
|
|
|
|
|
|
+ setModalProps({ confirmLoading: true, loading: true });
|
|
modelRef.value = dataSoruce.data[dataSoruce.index];
|
|
modelRef.value = dataSoruce.data[dataSoruce.index];
|
|
const resData = await getClassTimeStatisticsRecordDetailInfo({ id: unref(modelRef).id });
|
|
const resData = await getClassTimeStatisticsRecordDetailInfo({ id: unref(modelRef).id });
|
|
|
|
|
|
@@ -133,87 +128,88 @@
|
|
},
|
|
},
|
|
];
|
|
];
|
|
const dataList: Recordable[] = [];
|
|
const dataList: Recordable[] = [];
|
|
- if (resData) {
|
|
|
|
- const { rowTitle, columnTitle, data, allClassTime } = JSON.parse(resData);
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (resData) {
|
|
|
|
+ const { rowTitle, columnTitle, data, allClassTime } = resData;
|
|
|
|
|
|
- const totalRow: Recordable = { timeName: '合计课时' };
|
|
|
|
|
|
+ const totalRow: Recordable = { timeName: '合计课时' };
|
|
|
|
|
|
- rowTitle.forEach((item, index) => {
|
|
|
|
- columns.push({
|
|
|
|
- title: item.scheduleDate,
|
|
|
|
- dataIndex: `day${index}`,
|
|
|
|
- width: 120,
|
|
|
|
- customRender: formatDay,
|
|
|
|
|
|
+ rowTitle.forEach((item, index) => {
|
|
|
|
+ columns.push({
|
|
|
|
+ title: item.scheduleDate,
|
|
|
|
+ dataIndex: `day${index}`,
|
|
|
|
+ width: 120,
|
|
|
|
+ customRender: formatDay,
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
|
|
- columnTitle.forEach((col) => {
|
|
|
|
- let row: Recordable = {
|
|
|
|
- timeName: col.type,
|
|
|
|
- };
|
|
|
|
|
|
+ columnTitle.forEach((col) => {
|
|
|
|
+ let row: Recordable = {
|
|
|
|
+ timeName: col.type,
|
|
|
|
+ };
|
|
|
|
|
|
- rowTitle.forEach((item, index) => {
|
|
|
|
- const filter = data.filter(
|
|
|
|
- (f) =>
|
|
|
|
- formatToDate(f.scheduleDate, 'MM.DD') === `${item.scheduleDate}` &&
|
|
|
|
- f.type === col.type,
|
|
|
|
- );
|
|
|
|
|
|
+ rowTitle.forEach((item, index) => {
|
|
|
|
+ const filter = data.filter(
|
|
|
|
+ (f) =>
|
|
|
|
+ formatToDate(f.scheduleDate, 'MM.DD') === `${item.scheduleDate}` &&
|
|
|
|
+ f.type === col.type,
|
|
|
|
+ );
|
|
|
|
|
|
- const colName = `day${index}`;
|
|
|
|
|
|
+ const colName = `day${index}`;
|
|
|
|
|
|
- totalRow[colName] = { courseName: item.content };
|
|
|
|
|
|
+ totalRow[colName] = { courseName: item.content };
|
|
|
|
|
|
- row[colName] = {};
|
|
|
|
- row['total'] = col.content === 0 ? '' : col.content;
|
|
|
|
|
|
+ row[colName] = {};
|
|
|
|
+ row['total'] = col.content === 0 ? '' : col.content;
|
|
|
|
|
|
- if (filter.length > 0) {
|
|
|
|
- // console.log('filter', filter);
|
|
|
|
- const filterItem = filter[0];
|
|
|
|
- if (filterItem.content) {
|
|
|
|
- const contents = filterItem.content.split(',');
|
|
|
|
- const courseName = contents[0];
|
|
|
|
- let className = '';
|
|
|
|
- if (contents.length > 1) {
|
|
|
|
- className = contents[1];
|
|
|
|
- }
|
|
|
|
|
|
+ if (filter.length > 0) {
|
|
|
|
+ // console.log('filter', filter);
|
|
|
|
+ const filterItem = filter[0];
|
|
|
|
+ if (filterItem.content) {
|
|
|
|
+ const contents = filterItem.content.split(',');
|
|
|
|
+ const courseName = contents[0];
|
|
|
|
+ let className = '';
|
|
|
|
+ if (contents.length > 1) {
|
|
|
|
+ className = contents[1];
|
|
|
|
+ }
|
|
|
|
|
|
- row[colName]['courseName'] = courseName;
|
|
|
|
- row[colName]['className'] = className;
|
|
|
|
|
|
+ row[colName]['courseName'] = courseName;
|
|
|
|
+ row[colName]['className'] = className;
|
|
|
|
|
|
- if (filterItem.adjustType === 'course_exchange') {
|
|
|
|
- row[colName]['color'] = '#facd91';
|
|
|
|
- }
|
|
|
|
- if (filterItem.adjustType === 'course_substitute') {
|
|
|
|
- row[colName]['color'] = '#ec808d';
|
|
|
|
|
|
+ if (filterItem.adjustType === 'course_exchange') {
|
|
|
|
+ row[colName]['color'] = '#facd91';
|
|
|
|
+ }
|
|
|
|
+ if (filterItem.adjustType === 'course_substitute') {
|
|
|
|
+ row[colName]['color'] = '#ec808d';
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
|
|
- dataList.push(row);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- totalRow['total'] = allClassTime;
|
|
|
|
- dataList.push(totalRow);
|
|
|
|
|
|
+ dataList.push(row);
|
|
|
|
+ });
|
|
|
|
|
|
- // console.log('dataList', dataList);
|
|
|
|
- }
|
|
|
|
|
|
+ totalRow['total'] = allClassTime;
|
|
|
|
+ dataList.push(totalRow);
|
|
|
|
|
|
- columns.push({
|
|
|
|
- title: '合计(课时)',
|
|
|
|
- dataIndex: 'total',
|
|
|
|
- width: 90,
|
|
|
|
- });
|
|
|
|
|
|
+ // console.log('dataList', dataList);
|
|
|
|
+ }
|
|
|
|
|
|
- setColumns(columns);
|
|
|
|
- setTableData(dataList);
|
|
|
|
|
|
+ columns.push({
|
|
|
|
+ title: '合计(课时)',
|
|
|
|
+ dataIndex: 'total',
|
|
|
|
+ width: 90,
|
|
|
|
+ });
|
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
- redoHeight();
|
|
|
|
- }, 500);
|
|
|
|
|
|
+ setColumns(columns);
|
|
|
|
+ setTableData(dataList);
|
|
|
|
|
|
- setModalProps({ confirmLoading: false });
|
|
|
|
- closeFullLoading();
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ redoHeight();
|
|
|
|
+ }, 500);
|
|
|
|
+ } finally {
|
|
|
|
+ setModalProps({ confirmLoading: false, loading: false });
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
const formatDay = ({ text }) => {
|
|
const formatDay = ({ text }) => {
|