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.

71 lines
2.1 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>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: IconEnum.VIEW,
label: t('action.detail'),
onClick: handleShowInfo.bind(null, record)
}
]"
/>
</template>
</template>
2 years ago
</BasicTable>
<OperLogInfoModal @register="registerModal" />
2 years ago
</div>
</template>
<script lang="ts" setup>
2 years ago
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { OperateLogPageReqVO, exportOperateLog, getOperateLogPage } from '@/api/system/operatelog'
2 years ago
import { columns, searchFormSchema } from './operateLog.data'
import { useModal } from '@/components/Modal'
import OperLogInfoModal from './LogInfoModal.vue'
2 years ago
defineOptions({ name: 'SystemOperateLog' })
2 years ago
const { t } = useI18n()
const { createConfirm, createMessage } = useMessage()
const [registerTable, { getForm }] = useTable({
title: '操作日志列表',
api: getOperateLogPage,
2 years ago
columns,
formConfig: { labelWidth: 120, schemas: searchFormSchema },
2 years ago
useSearchForm: true,
showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 140,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right'
}
2 years ago
})
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 exportOperateLog(getForm().getFieldsValue() as OperateLogPageReqVO)
2 years ago
createMessage.success(t('common.exportSuccessText'))
}
})
}
const [registerModal, { openModal }] = useModal()
function handleShowInfo(record: Recordable) {
openModal(true, record)
}
2 years ago
</script>