|
@@ -11,7 +11,7 @@
|
|
|
:defaultFullscreen="true"
|
|
|
:show-cancel-btn="false"
|
|
|
>
|
|
|
- <div style="height: 100%">
|
|
|
+ <div class="h-full">
|
|
|
<BasicTable @register="registerTable">
|
|
|
<template #toolbar>
|
|
|
<div class="flex-1 flex">
|
|
@@ -64,10 +64,14 @@
|
|
|
</BasicModal>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
- import { ref, computed, unref, h, reactive } from 'vue';
|
|
|
+ import { ref, computed, unref, h, reactive, nextTick } from 'vue';
|
|
|
import { Space } from 'ant-design-vue';
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
import { useTable, BasicTable, BasicColumn } from '/@/components/Table';
|
|
|
+ import { getClassTimeStatisticsRecordDetailInfo } from '/@/services/apis/ClassTimeStatisticsController';
|
|
|
+ import { useLoading } from '/@/components/Loading';
|
|
|
+ import { formatToDate } from '/@/utils/dateUtil';
|
|
|
+ import { set } from 'nprogress';
|
|
|
|
|
|
const isUpdate = ref(true);
|
|
|
const modelRef = ref<Recordable>({});
|
|
@@ -76,8 +80,11 @@
|
|
|
index: 0,
|
|
|
});
|
|
|
const emit = defineEmits(['success', 'register']);
|
|
|
+ const [openFullLoading, closeFullLoading] = useLoading({
|
|
|
+ tip: '处理中...',
|
|
|
+ });
|
|
|
|
|
|
- const [registerTable, { setTableData, setColumns }] = useTable({
|
|
|
+ const [registerTable, { setTableData, setColumns, redoHeight }] = useTable({
|
|
|
title: '课时统计表',
|
|
|
rowKey: 'id',
|
|
|
columns: [
|
|
@@ -89,7 +96,7 @@
|
|
|
},
|
|
|
],
|
|
|
useSearchForm: false,
|
|
|
- showTableSetting: false,
|
|
|
+ showTableSetting: true,
|
|
|
bordered: true,
|
|
|
immediate: false,
|
|
|
canResize: true,
|
|
@@ -109,8 +116,9 @@
|
|
|
|
|
|
const loadData = async () => {
|
|
|
setModalProps({ confirmLoading: true });
|
|
|
+ openFullLoading();
|
|
|
modelRef.value = dataSoruce.data[dataSoruce.index];
|
|
|
- // const resData = await getClassTimeStatisticsInfo({ id: data.baseData.id });
|
|
|
+ const resData = await getClassTimeStatisticsRecordDetailInfo({ id: unref(modelRef).id });
|
|
|
|
|
|
const columns: BasicColumn[] = [
|
|
|
{
|
|
@@ -119,79 +127,73 @@
|
|
|
align: 'left',
|
|
|
width: 120,
|
|
|
},
|
|
|
- {
|
|
|
- title: '6.3',
|
|
|
- dataIndex: 'day1',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '6.4',
|
|
|
- dataIndex: 'day2',
|
|
|
- width: 120,
|
|
|
- customRender: formatDay,
|
|
|
- },
|
|
|
];
|
|
|
+ const dataList: Recordable[] = [];
|
|
|
+ if (resData) {
|
|
|
+ const { rowTitle, columnTitle, data, allClassTime } = JSON.parse(resData);
|
|
|
+
|
|
|
+ const totalRow: Recordable = { timeName: '合计课时' };
|
|
|
+
|
|
|
+ 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,
|
|
|
+ };
|
|
|
+
|
|
|
+ rowTitle.forEach((item, index) => {
|
|
|
+ const filter = data.filter(
|
|
|
+ (f) =>
|
|
|
+ formatToDate(f.scheduleDate, 'MM.DD') === `${item.scheduleDate}` &&
|
|
|
+ f.type === col.type,
|
|
|
+ );
|
|
|
+
|
|
|
+ const colName = `day${index}`;
|
|
|
+
|
|
|
+ totalRow[colName] = { courseName: item.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];
|
|
|
+ }
|
|
|
+
|
|
|
+ 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';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ dataList.push(row);
|
|
|
+ });
|
|
|
+
|
|
|
+ totalRow['total'] = allClassTime;
|
|
|
+ dataList.push(totalRow);
|
|
|
+
|
|
|
+ // console.log('dataList', dataList);
|
|
|
+ }
|
|
|
|
|
|
columns.push({
|
|
|
title: '合计(课时)',
|
|
@@ -200,17 +202,14 @@
|
|
|
});
|
|
|
|
|
|
setColumns(columns);
|
|
|
+ setTableData(dataList);
|
|
|
|
|
|
- const resData = [
|
|
|
- {
|
|
|
- timeName: '早自习(0)',
|
|
|
- total: 15,
|
|
|
- day1: { courseName: '语文', className: '23会计2', color: '#facd91' },
|
|
|
- },
|
|
|
- ];
|
|
|
+ setTimeout(() => {
|
|
|
+ redoHeight();
|
|
|
+ }, 500);
|
|
|
|
|
|
- setTableData(resData);
|
|
|
setModalProps({ confirmLoading: false });
|
|
|
+ closeFullLoading();
|
|
|
};
|
|
|
|
|
|
const formatDay = ({ text }) => {
|