|
@@ -0,0 +1,78 @@
|
|
|
|
+<template>
|
|
|
|
+ <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
|
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
|
+ <template #toolbar> </template>
|
|
|
|
+ <template #action="{ record }">
|
|
|
|
+ <TableAction
|
|
|
|
+ :actions="[
|
|
|
|
+ {
|
|
|
|
+ label: '查看',
|
|
|
|
+ disabled: record.status === 0,
|
|
|
|
+ onClick: handleView.bind(null, record),
|
|
|
|
+ },
|
|
|
|
+ ]"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
|
|
+ </BasicTable>
|
|
|
|
+ <FormEdit @register="registerModal" @success="handleSuccess" />
|
|
|
|
+ </PageWrapper>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup lang="ts">
|
|
|
|
+ import { onMounted } from 'vue';
|
|
|
|
+ import { PageWrapper } from '/@/components/Page';
|
|
|
|
+ import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
|
+ import { tableColumns, searchFormSchema } from '../statistics/data.config';
|
|
|
|
+
|
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
|
|
+ import { getClassTimeStatisticsPage } from '/@/services/apis/ClassTimeStatisticsController';
|
|
|
|
+ import { formatToDate } from '/@/utils/dateUtil';
|
|
|
|
+ import FormEdit from '../statistics/components/edit.vue';
|
|
|
|
+ const [registerModal, { openModal }] = useModal();
|
|
|
|
+
|
|
|
|
+ const [registerTable, { reload }] = useTable({
|
|
|
|
+ api: getClassTimeStatisticsPage,
|
|
|
|
+ title: '课时统计记录',
|
|
|
|
+ rowKey: 'id',
|
|
|
|
+ columns: tableColumns,
|
|
|
|
+ formConfig: {
|
|
|
|
+ labelWidth: 120,
|
|
|
|
+ schemas: searchFormSchema,
|
|
|
|
+ },
|
|
|
|
+ useSearchForm: true,
|
|
|
|
+ showTableSetting: true,
|
|
|
|
+ bordered: true,
|
|
|
|
+ immediate: true,
|
|
|
|
+ canResize: true,
|
|
|
|
+ actionColumn: {
|
|
|
|
+ width: 120,
|
|
|
|
+ title: '操作',
|
|
|
|
+ dataIndex: 'action',
|
|
|
|
+ slots: { customRender: 'action' },
|
|
|
|
+ fixed: 'right',
|
|
|
|
+ },
|
|
|
|
+ beforeFetch: async (params) => {
|
|
|
|
+ if (params['date']) {
|
|
|
|
+ params['year'] = formatToDate(params['date'], 'YYYY');
|
|
|
|
+ params['month'] = formatToDate(params['date'], 'MM');
|
|
|
|
+ delete params['date'];
|
|
|
|
+ }
|
|
|
|
+ return params;
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ const handleView = (record: any) => {
|
|
|
|
+ openModal(true, {
|
|
|
|
+ isUpdate: true,
|
|
|
|
+ baseData: { ...record },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const handleSuccess = () => {
|
|
|
|
+ reload();
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ onMounted(async () => {});
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped lang="less"></style>
|