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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

45 lines
1.3 KiB

<template>
2 years ago
<div>
<BasicTable @register="registerTable">
<template #toolbar>
2 years ago
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
2 years ago
</template>
</BasicTable>
</div>
</template>
2 years ago
<script lang="ts" setup name="OperateLog">
2 years ago
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { IconEnum } from '@/enums/appEnum'
2 years ago
import { BasicTable, useTable } from '@/components/Table'
import { OperateLogPageReqVO, exportOperateLogApi, getOperateLogPageApi } from '@/api/system/operatelog'
import { columns, searchFormSchema } from './operateLog.data'
const { t } = useI18n()
const { createConfirm, createMessage } = useMessage()
const [registerTable, { getForm }] = useTable({
title: '操作日志列表',
api: getOperateLogPageApi,
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema
},
useSearchForm: true,
showTableSetting: true,
showIndexColumn: false
})
async function handleExport() {
createConfirm({
2 years ago
title: t('common.exportTitle'),
2 years ago
iconType: 'warning',
2 years ago
content: t('common.exportMessage'),
2 years ago
async onOk() {
await exportOperateLogApi(getForm().getFieldsValue() as OperateLogPageReqVO)
createMessage.success(t('common.exportSuccessText'))
}
})
}
</script>