admin_web/apps/web-antd/src/component/modal/event.vue
hahwu e52eb2ca64
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
版本更新
2025-07-17 15:07:34 +08:00

67 lines
1.6 KiB
Vue

<script setup lang="ts">
import { getUserlogEventApi } from '#/api/core/log';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { inject } from 'vue';
import { globalState } from '#/store/globalState';
import { $t } from '#/locales';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {useVbenModal } from '@vben/common-ui';
const state = inject('globalState', globalState);
interface RowType {
Uid: string;
Event: string;
Param: string;
Timestamp: string;
}
const [Modal, modalApi] = useVbenModal({});
const gridOptions: VxeGridProps<RowType> = {
columns: [
{ field: 'Uid', title: 'Uid' },
{ field: 'Event', title: '事件类型', formatter: ({ cellValue }) => $t('page.log.event.' + `${cellValue}`) || cellValue },
{ field: 'Label', title: 'Label'},
{ field: 'Param', title: '参数' },
{ field: 'Timestamp', title: '时间', formatter: ({ cellValue }) => new Date(cellValue*1000).toLocaleString()},
],
stripe: true,
height: 'auto',
pagerConfig: {
enabled:true
},
proxyConfig: {
response: {
total: "total",
result: "data"
},
ajax: {
query: async () => {
return await getUserlogEventApi({
Id: state.uid,
Event: '',
StartTime: modalApi.getData()?.StartTime || "2025-03-17T16:00:00.000Z",
EndTime: modalApi.getData()?.EndTime || "2025-03-17T16:00:00.000Z",
CurrentPage: 1,
PageSize: 100,
});
},
},
},
rowConfig: {
isHover: true,
},
};
const [Grid] = useVbenVxeGrid({gridOptions });
</script>
<template>
<Modal>
<Grid style="height: 500px;" />
</Modal>
</template>