11 changed files with 32874 additions and 129 deletions
File diff suppressed because it is too large
@ -0,0 +1,75 @@ |
|||||
|
import { FormSchema } from '/@/components/Table'; |
||||
|
import { BasicColumn } from '/@/components/Table'; |
||||
|
import { useI18n } from '/@/hooks/web/useI18n'; |
||||
|
const { t } = useI18n(); |
||||
|
import moment from 'moment'; |
||||
|
import { AuditLogsServiceProxy, PagingAuditLogListInput } from '/@/services/ServiceProxies'; |
||||
|
export const searchFormSchema: FormSchema[] = [ |
||||
|
{ |
||||
|
field: 'userName', |
||||
|
label: '用户', |
||||
|
component: 'Input', |
||||
|
colProps: { span: 8 }, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'time', |
||||
|
component: 'RangePicker', |
||||
|
label: '执行时间', |
||||
|
colProps: { |
||||
|
span: 6, |
||||
|
}, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
export const tableColumns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: '租户', |
||||
|
dataIndex: 'tenantName', |
||||
|
width: 100, |
||||
|
}, |
||||
|
{ |
||||
|
title: '用户', |
||||
|
dataIndex: 'userName', |
||||
|
width: 100, |
||||
|
}, |
||||
|
{ |
||||
|
title: 'HttpMethod', |
||||
|
dataIndex: 'httpMethod', |
||||
|
width: 100, |
||||
|
}, |
||||
|
{ |
||||
|
title: 'HttpStatusCode', |
||||
|
dataIndex: 'httpStatusCode', |
||||
|
width: 120, |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Url', |
||||
|
dataIndex: 'url', |
||||
|
width: 250, |
||||
|
}, |
||||
|
{ |
||||
|
title: 'ExecutionTime', |
||||
|
dataIndex: 'executionTime', |
||||
|
width: 150, |
||||
|
customRender: ({ text }) => { |
||||
|
return moment(text).format('YYYY-MM-DD HH:mm:ss'); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
title: 'BrowserInfo', |
||||
|
dataIndex: 'browserInfo', |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Exceptions', |
||||
|
dataIndex: 'exceptions', |
||||
|
}, |
||||
|
]; |
||||
|
/** |
||||
|
* 分页列表 |
||||
|
* @param params |
||||
|
* @returns |
||||
|
*/ |
||||
|
export async function getTableListAsync(params: PagingAuditLogListInput) { |
||||
|
const _auditLogsServiceProxy = new AuditLogsServiceProxy(); |
||||
|
return _auditLogsServiceProxy.page(params); |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<BasicTable @register="registerTable" size="small"> </BasicTable> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { defineComponent } from 'vue'; |
||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
||||
|
import { tableColumns, searchFormSchema, getTableListAsync } from './AuditLog'; |
||||
|
import { Tag } from 'ant-design-vue'; |
||||
|
import { useI18n } from '/@/hooks/web/useI18n'; |
||||
|
export default defineComponent({ |
||||
|
name: 'AuditLog', |
||||
|
components: { |
||||
|
BasicTable, |
||||
|
TableAction, |
||||
|
Tag, |
||||
|
}, |
||||
|
setup() { |
||||
|
const { t } = useI18n(); |
||||
|
// table配置 |
||||
|
const [registerTable, { reload }] = useTable({ |
||||
|
columns: tableColumns, |
||||
|
formConfig: { |
||||
|
labelWidth: 70, |
||||
|
schemas: searchFormSchema, |
||||
|
fieldMapToTime: [ |
||||
|
['time', ['executionBeginTime', 'executionEndTime'], 'YYYY-MM-DD HH:mm:ss'], |
||||
|
], |
||||
|
}, |
||||
|
api: getTableListAsync, |
||||
|
showTableSetting: true, |
||||
|
useSearchForm: true, |
||||
|
bordered: true, |
||||
|
canResize: true, |
||||
|
showIndexColumn: true, |
||||
|
}); |
||||
|
|
||||
|
return { |
||||
|
registerTable, |
||||
|
reload, |
||||
|
t, |
||||
|
}; |
||||
|
}, |
||||
|
}); |
||||
|
</script> |
||||
Loading…
Reference in new issue