| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- import type { VbenFormProps, VxeGridProps } from '#/adapter';
- import { LogApi } from '#/api';
- export const searchFormOptions: VbenFormProps = {
- schema: [
- {
- component: 'RangePicker',
- fieldName: '__date',
- label: '日期',
- componentProps: {
- format: 'YYYY-MM-DD HH:mm:ss',
- placeholder: ['开始时间', '结束时间'],
- showTime: { format: 'HH:mm:ss' },
- },
- },
- ],
- };
- export const gridOptions: VxeGridProps<LogApi.RecordItem> = {
- toolbarConfig: {
- refresh: true,
- print: false,
- export: false,
- zoom: true,
- custom: true,
- },
- columns: [
- { title: '序号', type: 'seq', width: 50 },
- { align: 'left', field: 'tableName', title: '表名', width: 120 },
- { align: 'left', field: 'columnName', title: '列名', width: 120 },
- { align: 'left', field: 'newValue', title: '新值', width: 100 },
- { align: 'left', field: 'oldValue', title: '旧值', width: 100 },
- { align: 'left', field: 'operate', title: '操作方式', width: 80 },
- { align: 'left', field: 'auditTime', title: '审计时间', width: 150 },
- { align: 'left', field: 'account', title: '账号', width: 100 },
- { align: 'left', field: 'realName', title: '姓名' },
- {
- field: 'action',
- fixed: 'right',
- slots: { default: 'action' },
- title: '操作',
- width: 100,
- },
- ],
- height: 'auto',
- keepSource: true,
- proxyConfig: {
- ajax: {
- query: async ({ page }, formValues) => {
- const postData = { ...formValues };
- if (postData.__date) {
- postData.startTime = postData.__date[0];
- postData.endTime = postData.__date[1];
- delete postData.__date;
- }
- return await LogApi.getAuditPage({
- pageIndex: page.currentPage,
- pageSize: page.pageSize,
- ...postData,
- });
- },
- },
- },
- };
- export const gridDifferenceOptions: VxeGridProps<LogApi.RecordItem> = {
- toolbarConfig: {
- refresh: true,
- print: false,
- export: false,
- zoom: true,
- custom: true,
- },
- columns: [
- { title: '序号', type: 'seq', width: 50 },
- {
- align: 'left',
- field: 'beforeData',
- title: '操作前记录',
- width: 150,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'afterData',
- title: '操作后记录',
- width: 150,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'sql',
- title: 'SQL',
- width: 100,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'parameters',
- title: '参数',
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'businessData',
- title: '业务对象',
- width: 100,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'diffType',
- title: '差异操作',
- width: 80,
- },
- {
- align: 'left',
- field: 'elapsed',
- title: '耗时',
- width: 80,
- },
- ],
- height: 'auto',
- keepSource: true,
- proxyConfig: {
- ajax: {
- query: async ({ page }, formValues) => {
- const postData = { ...formValues };
- if (postData.__date) {
- postData.startTime = postData.__date[0];
- postData.endTime = postData.__date[1];
- delete postData.__date;
- }
- return await LogApi.getDifferencePage({
- pageIndex: page.currentPage,
- pageSize: page.pageSize,
- ...postData,
- });
- },
- },
- },
- };
- export const gridExceptionOptions: VxeGridProps<LogApi.RecordItem> = {
- toolbarConfig: {
- refresh: true,
- print: false,
- export: false,
- zoom: true,
- custom: true,
- },
- columns: [
- { title: '序号', type: 'seq', width: 50 },
- {
- align: 'left',
- field: 'httpMethod',
- title: '请求方式',
- width: 80,
- },
- {
- align: 'left',
- field: 'requestUrl',
- title: '请求地址',
- width: 250,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'requestParam',
- title: '请求参数',
- width: 100,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'returnResult',
- title: '返回结果',
- showOverflow: true,
- width: 200,
- },
- {
- align: 'left',
- field: 'exception',
- title: '异常信息',
- width: 150,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'message',
- title: '日志消息',
- showOverflow: true,
- },
- ],
- height: 'auto',
- keepSource: true,
- proxyConfig: {
- ajax: {
- query: async ({ page }, formValues) => {
- const postData = { ...formValues };
- if (postData.__date) {
- postData.startTime = postData.__date[0];
- postData.endTime = postData.__date[1];
- delete postData.__date;
- }
- return await LogApi.getExceptionPage({
- pageIndex: page.currentPage,
- pageSize: page.pageSize,
- ...postData,
- });
- },
- },
- },
- };
- export const gridOperateOptions: VxeGridProps<LogApi.RecordItem> = {
- toolbarConfig: {
- refresh: true,
- print: false,
- export: false,
- zoom: true,
- custom: true,
- },
- columns: [
- { title: '序号', type: 'seq', width: 50 },
- {
- align: 'left',
- field: 'httpMethod',
- title: '请求方式',
- width: 80,
- },
- {
- align: 'left',
- field: 'requestUrl',
- title: '请求地址',
- width: 250,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'requestParam',
- title: '请求参数',
- width: 100,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'returnResult',
- title: '返回结果',
- showOverflow: true,
- width: 200,
- },
- {
- align: 'left',
- field: 'exception',
- title: '异常信息',
- width: 150,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'message',
- title: '日志消息',
- showOverflow: true,
- },
- ],
- height: 'auto',
- keepSource: true,
- proxyConfig: {
- ajax: {
- query: async ({ page }, formValues) => {
- const postData = { ...formValues };
- if (postData.__date) {
- postData.startTime = postData.__date[0];
- postData.endTime = postData.__date[1];
- delete postData.__date;
- }
- return await LogApi.getOperatePage({
- pageIndex: page.currentPage,
- pageSize: page.pageSize,
- ...postData,
- });
- },
- },
- },
- };
- export const gridVisitOptions: VxeGridProps<LogApi.RecordItem> = {
- toolbarConfig: {
- refresh: true,
- print: false,
- export: false,
- zoom: true,
- custom: true,
- },
- columns: [
- { title: '序号', type: 'seq', width: 50 },
- {
- align: 'left',
- field: 'controllerName',
- title: '模块名称',
- width: 120,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'actionName',
- title: '方法名称',
- width: 120,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'displayTitle',
- title: '显示名称',
- width: 100,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'status',
- title: '执行状态',
- showOverflow: true,
- width: 80,
- },
- {
- align: 'left',
- field: 'remoteIp',
- title: 'IP地址',
- width: 80,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'location',
- title: '登录地点',
- width: 100,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'browser',
- title: '浏览器',
- showOverflow: true,
- width: 100,
- },
- {
- align: 'left',
- field: 'elapsed',
- title: '操作用时',
- width: 80,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'logDateTime',
- title: '日志时间',
- width: 120,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'account',
- title: '账号',
- width: 120,
- showOverflow: true,
- },
- {
- align: 'left',
- field: 'realName',
- title: '姓名',
- width: 120,
- },
- ],
- height: 'auto',
- keepSource: true,
- proxyConfig: {
- ajax: {
- query: async ({ page }, formValues) => {
- const postData = { ...formValues };
- if (postData.__date) {
- postData.startTime = postData.__date[0];
- postData.endTime = postData.__date[1];
- delete postData.__date;
- }
- return await LogApi.getVisitPage({
- pageIndex: page.currentPage,
- pageSize: page.pageSize,
- ...postData,
- });
- },
- },
- },
- };
|