Files
iot-device-management-frontend/apps/web-antd/src/views/system/mail/log/index.vue

81 lines
1.9 KiB
Vue
Raw Normal View History

2025-04-03 23:36:02 +08:00
<script lang="ts" setup>
2025-04-04 17:45:56 +08:00
import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter/vxe-table';
2025-04-03 23:36:02 +08:00
import type { SystemMailLogApi } from '#/api/system/mail/log';
import { Page, useVbenModal } from '@vben/common-ui';
import Detail from './modules/detail.vue';
2025-04-05 17:09:16 +08:00
import { DocAlert } from '#/components/doc-alert';
2025-04-03 23:36:02 +08:00
import { useVbenVxeGrid } from '#/adapter/vxe-table';
2025-04-04 17:45:56 +08:00
import { getMailLogPage } from '#/api/system/mail/log';
2025-04-03 23:36:02 +08:00
import { useGridColumns, useGridFormSchema } from './data';
const [DetailModal, detailModalApi] = useVbenModal({
connectedComponent: Detail,
2025-04-03 23:36:02 +08:00
destroyOnClose: true,
});
/** 刷新表格 */
function onRefresh() {
gridApi.query();
}
2025-04-04 17:45:56 +08:00
/** 查看邮件日志 */
function onDetail(row: SystemMailLogApi.SystemMailLog) {
detailModalApi.setData(row).open();
2025-04-03 23:36:02 +08:00
}
/** 表格操作按钮的回调函数 */
function onActionClick({
code,
row,
2025-04-04 17:45:56 +08:00
}: OnActionClickParams<SystemMailLogApi.SystemMailLog>) {
2025-04-03 23:36:02 +08:00
switch (code) {
case 'detail': {
onDetail(row);
2025-04-03 23:36:02 +08:00
break;
}
}
}
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
},
gridOptions: {
columns: useGridColumns(onActionClick),
height: 'auto',
keepSource: true,
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
return await getMailLogPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
toolbarConfig: {
refresh: { code: 'query' },
search: true,
},
2025-04-04 17:45:56 +08:00
} as VxeTableGridOptions<SystemMailLogApi.SystemMailLog>,
2025-04-03 23:36:02 +08:00
});
</script>
<template>
<Page auto-content-height>
2025-04-06 10:23:57 +08:00
<DocAlert title="邮件配置" url="https://doc.iocoder.cn/mail" />
<DetailModal @success="onRefresh" />
2025-04-03 23:36:02 +08:00
<Grid table-title="邮件日志列表">
<template #toolbar-tools> </template>
</Grid>
</Page>
</template>