<script setup lang="ts">
import { Page } from '@vben/common-ui';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import type { VxeGridProps } from '#/adapter/vxe-table';
import type { AdminLog } from '#/model/admin.user';
import { getAdminLogListApi } from '#/api/core/admin.user';

const gridOptions: VxeGridProps<AdminLog> = {
  columns: [
    { field: 'admin', title: '用户名', },
    { field: 'action', title: '操作' },
    { field: 'params', title: '参数' },
    { field: 'ip', title: 'IP' },
    { field: 'createTime', title: '时间' },
  ],
  height: 'auto',
  pagerConfig: {},
  proxyConfig: {
    response: {
      total: 'total',
      result: 'data',
    },
    ajax: {
      query: async () => {
        return await getAdminLogListApi();
      },
    },
  },

  rowConfig: {
    isHover: true,
  },
};

const [Grid] = useVbenVxeGrid({ gridOptions });


</script>

<template>
  <Page auto-content-height>
    <Grid />
  </Page>
</template>
