import { defineComponent, onMounted, reactive } from 'vue'; import { NAvatar, NButton, NForm, NFormItem, NSpace, NTag } from 'naive-ui'; import Pagination from '@/components/pagination'; import { courseSchedulePage } from '../api'; import { useRoute } from 'vue-router'; import CDatePicker from '/src/components/CDatePicker'; import styles from './classRecord.module.less'; import teacherIcon from '@components/layout/images/teacherIcon.png'; import dayjs from 'dayjs'; import { getTimes } from '/src/utils'; export default defineComponent({ name: 'class-record', setup() { const nowTime = dayjs().format('YYYY-MM-DD'); const state = reactive({ searchForm: { createTimer: [ dayjs(nowTime).subtract(1, 'month').valueOf(), dayjs(nowTime).valueOf() ] as any }, loading: false, pagination: { page: 1, rows: 10, pageTotal: 0 }, tableList: [] as any }); const route = useRoute(); const search = () => { state.pagination.page = 1; getList(); }; const onReset = () => { state.searchForm = { createTimer: null as any }; search(); }; const getList = async () => { state.loading = true; try { const res = await courseSchedulePage({ classGroupId: route.query.id, ...getTimes( state.searchForm.createTimer, ['startTime', 'endTime'], 'YYYY-MM-DD' ), ...state.pagination }); state.tableList = res.data.rows; state.pagination.pageTotal = res.data.total; state.loading = false; } catch (e) { state.loading = false; console.log(e); } }; onMounted(() => { getList(); }); return () => (
人教版二年级上册 | 第二十一单元 |【歌表演】我和我的祖国一刻也不能分割