mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-02 19:15:26 +08:00
导出excel总提示格式不匹配和日志大数据导出示例
This commit is contained in:
@ -1,11 +1,19 @@
|
||||
<template>
|
||||
<BasicTable :ellipsis="true" @register="registerTable" :searchInfo="searchInfo" :columns="logColumns" :expand-column-width="16">
|
||||
<template #tableTitle>
|
||||
<a-tabs defaultActiveKey="4" @change="tabChange" size="small">
|
||||
<a-tab-pane tab="异常日志" key="4"></a-tab-pane>
|
||||
<a-tab-pane tab="登录日志" key="1"></a-tab-pane>
|
||||
<a-tab-pane tab="操作日志" key="2"></a-tab-pane>
|
||||
</a-tabs>
|
||||
<div class="table-title-bar">
|
||||
<a-tabs defaultActiveKey="4" @change="tabChange" size="small">
|
||||
<a-tab-pane tab="异常日志" key="4"></a-tab-pane>
|
||||
<a-tab-pane tab="登录日志" key="1"></a-tab-pane>
|
||||
<a-tab-pane tab="操作日志" key="2"></a-tab-pane>
|
||||
</a-tabs>
|
||||
<span class="export-btn" v-if="searchInfo.logType == 2">
|
||||
<a-tooltip>
|
||||
<template #title>导出</template>
|
||||
<a-button type="text" preIcon="ant-design:download-outlined" shape="circle" @click="onExportXls" />
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #expandedRowRender="{ record }">
|
||||
<div v-if="searchInfo.logType == 2">
|
||||
@ -30,7 +38,7 @@
|
||||
<script lang="ts" name="monitor-log" setup>
|
||||
import { ref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { getLogList } from './log.api';
|
||||
import { getLogList, getExportUrl } from './log.api';
|
||||
import {
|
||||
columns,
|
||||
searchFormSchema,
|
||||
@ -47,7 +55,7 @@
|
||||
const searchSchema = ref<any>(searchFormSchema);
|
||||
const searchInfo = { logType: '4' };
|
||||
// 列表页面公共参数、方法
|
||||
const { prefixCls, tableContext } = useListPage({
|
||||
const { prefixCls, tableContext, onExportXls } = useListPage({
|
||||
designScope: 'user-list',
|
||||
tableProps: {
|
||||
title: '日志列表',
|
||||
@ -62,6 +70,11 @@
|
||||
fieldMapToTime: [['fieldTime', ['createTime_begin', 'createTime_end'], 'YYYY-MM-DD']],
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name:"操作日志",
|
||||
url: getExportUrl,
|
||||
params: searchInfo,
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload }] = tableContext;
|
||||
@ -95,4 +108,16 @@
|
||||
.error-box {
|
||||
white-space: break-spaces;
|
||||
}
|
||||
.table-title-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
.export-btn {
|
||||
margin-left: auto;
|
||||
}
|
||||
:deep(.jeecg-basic-table-header__toolbar){
|
||||
width:100px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -2,6 +2,7 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/sys/log/list',
|
||||
exportXls = '/sys/log/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
@ -11,3 +12,10 @@ enum Api {
|
||||
export const getLogList = (params) => {
|
||||
return defHttp.get({ url: Api.list, params });
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
Reference in New Issue
Block a user