You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
<template> |
|
<div> |
|
<BasicTable @register="registerTable"> |
|
<template #toolbar> |
|
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> |
|
</template> |
|
</BasicTable> |
|
</div> |
|
</template> |
|
<script lang="ts" setup name="ApiErrorLog"> |
|
import { useI18n } from '@/hooks/web/useI18n' |
|
import { useMessage } from '@/hooks/web/useMessage' |
|
import { BasicTable, useTable } from '@/components/Table' |
|
import { getApiAccessLogPage, exportApiAccessLog, ApiAccessLogExportReqVO } from '@/api/infra/apiAccessLog' |
|
import { columns, searchFormSchema } from './apiAccessLog.data' |
|
|
|
const { t } = useI18n() |
|
const { createConfirm, createMessage } = useMessage() |
|
const [registerTable, { getForm }] = useTable({ |
|
title: '访问日志列表', |
|
api: getApiAccessLogPage, |
|
columns, |
|
formConfig: { |
|
labelWidth: 120, |
|
schemas: searchFormSchema |
|
}, |
|
useSearchForm: true, |
|
showTableSetting: true, |
|
showIndexColumn: false |
|
}) |
|
|
|
async function handleExport() { |
|
createConfirm({ |
|
title: t('common.exportTitle'), |
|
iconType: 'warning', |
|
content: t('common.exportMessage'), |
|
async onOk() { |
|
await exportApiAccessLog(getForm().getFieldsValue() as ApiAccessLogExportReqVO) |
|
createMessage.success(t('common.exportSuccessText')) |
|
} |
|
}) |
|
} |
|
</script>
|
|
|