|
@@ -14,7 +14,7 @@
|
|
|
<div class="h-full">
|
|
|
<BasicTable @register="registerTable">
|
|
|
<template #toolbar>
|
|
|
- <div class="flex-1 flex">
|
|
|
+ <div class="flex-1 flex items-center">
|
|
|
<div class="flex flex-1 items-center justify-center text-lg font-bold">
|
|
|
<a-button
|
|
|
type="primary"
|
|
@@ -40,6 +40,7 @@
|
|
|
</div>
|
|
|
<div class="flex items-center">
|
|
|
<Space>
|
|
|
+ <a-button type="primary" @click="handleExport">导出</a-button>
|
|
|
<div class="flex items-center">
|
|
|
<div
|
|
|
style="width: 10px; height: 10px; border-radius: 50%; background-color: #facd91"
|
|
@@ -64,14 +65,17 @@
|
|
|
</BasicModal>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
- import { ref, computed, unref, h, reactive, nextTick } from 'vue';
|
|
|
+ import { ref, computed, unref, h, reactive } 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 {
|
|
|
+ getClassTimeStatisticsRecordDetailExportQuery,
|
|
|
+ getClassTimeStatisticsRecordDetailInfo,
|
|
|
+ } from '/@/services/apis/ClassTimeStatisticsController';
|
|
|
import { useLoading } from '/@/components/Loading';
|
|
|
import { formatToDate } from '/@/utils/dateUtil';
|
|
|
- import { set } from 'nprogress';
|
|
|
+ import { downloadByData } from '/@/utils/file/download';
|
|
|
|
|
|
const isUpdate = ref(true);
|
|
|
const modelRef = ref<Recordable>({});
|
|
@@ -246,6 +250,15 @@
|
|
|
}
|
|
|
await loadData();
|
|
|
};
|
|
|
+
|
|
|
+ const handleExport = async () => {
|
|
|
+ setModalProps({ loading: true, confirmLoading: true });
|
|
|
+ downloadByData(
|
|
|
+ (await getClassTimeStatisticsRecordDetailExportQuery({ id: unref(modelRef).id })).data,
|
|
|
+ `课时明细统计表${formatToDate(new Date())}.xlsx`,
|
|
|
+ );
|
|
|
+ setModalProps({ loading: false, confirmLoading: false });
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less"></style>
|