|
@@ -1,10 +1,13 @@
|
|
|
-import type { VbenFormProps } from '#/adapter/form';
|
|
|
|
|
-import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
|
|
|
|
|
+import type {
|
|
|
|
|
+ OnActionClickFn,
|
|
|
|
|
+ VbenFormSchema,
|
|
|
|
|
+ VxeTableGridOptions,
|
|
|
|
|
+} from '#/adapter';
|
|
|
|
|
|
|
|
import { LogApi } from '#/api';
|
|
import { LogApi } from '#/api';
|
|
|
|
|
|
|
|
-export const searchFormOptions: VbenFormProps = {
|
|
|
|
|
- schema: [
|
|
|
|
|
|
|
+export const useSearchSchema = (): VbenFormSchema[] => {
|
|
|
|
|
+ return [
|
|
|
{
|
|
{
|
|
|
component: 'RangePicker',
|
|
component: 'RangePicker',
|
|
|
fieldName: '__date',
|
|
fieldName: '__date',
|
|
@@ -15,18 +18,13 @@ export const searchFormOptions: VbenFormProps = {
|
|
|
showTime: { format: 'HH:mm:ss' },
|
|
showTime: { format: 'HH:mm:ss' },
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- ],
|
|
|
|
|
|
|
+ ];
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-export const gridOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
|
|
- toolbarConfig: {
|
|
|
|
|
- refresh: true,
|
|
|
|
|
- print: false,
|
|
|
|
|
- export: false,
|
|
|
|
|
- zoom: true,
|
|
|
|
|
- custom: true,
|
|
|
|
|
- },
|
|
|
|
|
- columns: [
|
|
|
|
|
|
|
+export function useColumns(
|
|
|
|
|
+ onActionClick?: OnActionClickFn<LogApi.RecordItem>,
|
|
|
|
|
+): VxeTableGridOptions<LogApi.RecordItem>['columns'] {
|
|
|
|
|
+ return [
|
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
|
{ align: 'left', field: 'tableName', title: '表名', width: 120 },
|
|
{ align: 'left', field: 'tableName', title: '表名', width: 120 },
|
|
|
{ align: 'left', field: 'columnName', title: '列名', width: 120 },
|
|
{ align: 'left', field: 'columnName', title: '列名', width: 120 },
|
|
@@ -37,43 +35,34 @@ export const gridOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
{ align: 'left', field: 'account', title: '账号', width: 100 },
|
|
{ align: 'left', field: 'account', title: '账号', width: 100 },
|
|
|
{ align: 'left', field: 'realName', title: '姓名' },
|
|
{ align: 'left', field: 'realName', title: '姓名' },
|
|
|
{
|
|
{
|
|
|
- field: 'action',
|
|
|
|
|
|
|
+ align: 'right',
|
|
|
|
|
+ cellRender: {
|
|
|
|
|
+ attrs: {
|
|
|
|
|
+ nameField: 'tableName',
|
|
|
|
|
+ nameTitle: '表名',
|
|
|
|
|
+ onClick: onActionClick,
|
|
|
|
|
+ },
|
|
|
|
|
+ name: 'CellAction',
|
|
|
|
|
+ options: [
|
|
|
|
|
+ {
|
|
|
|
|
+ code: 'view',
|
|
|
|
|
+ label: '详情',
|
|
|
|
|
+ auth: ['logAudit:edit'],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ field: 'operation',
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
- slots: { default: 'action' },
|
|
|
|
|
|
|
+ headerAlign: 'center',
|
|
|
|
|
+ showOverflow: false,
|
|
|
title: '操作',
|
|
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,
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ width: 50,
|
|
|
},
|
|
},
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ ];
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-export const gridDifferenceOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
|
|
- toolbarConfig: {
|
|
|
|
|
- refresh: true,
|
|
|
|
|
- print: false,
|
|
|
|
|
- export: false,
|
|
|
|
|
- zoom: true,
|
|
|
|
|
- custom: true,
|
|
|
|
|
- },
|
|
|
|
|
- columns: [
|
|
|
|
|
|
|
+export function useDifferenceColumns(): VxeTableGridOptions<LogApi.RecordItem>['columns'] {
|
|
|
|
|
+ return [
|
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
|
{
|
|
{
|
|
|
align: 'left',
|
|
align: 'left',
|
|
@@ -121,44 +110,15 @@ export const gridDifferenceOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
title: '耗时',
|
|
title: '耗时',
|
|
|
width: 80,
|
|
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: [
|
|
|
|
|
|
|
+export function useExceptionColumns(
|
|
|
|
|
+ onActionClick?: OnActionClickFn<LogApi.RecordItem>,
|
|
|
|
|
+): VxeTableGridOptions<LogApi.RecordItem>['columns'] {
|
|
|
|
|
+ return [
|
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
|
- {
|
|
|
|
|
- align: 'left',
|
|
|
|
|
- field: 'httpMethod',
|
|
|
|
|
- title: '请求方式',
|
|
|
|
|
- width: 80,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ { align: 'left', field: 'httpMethod', title: '请求方式', width: 80 },
|
|
|
{
|
|
{
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
field: 'requestUrl',
|
|
field: 'requestUrl',
|
|
@@ -194,43 +154,36 @@ export const gridExceptionOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
showOverflow: true,
|
|
showOverflow: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- field: 'action',
|
|
|
|
|
|
|
+ align: 'right',
|
|
|
|
|
+ cellRender: {
|
|
|
|
|
+ attrs: {
|
|
|
|
|
+ nameField: 'requestUrl',
|
|
|
|
|
+ nameTitle: '请求地址',
|
|
|
|
|
+ onClick: onActionClick,
|
|
|
|
|
+ },
|
|
|
|
|
+ name: 'CellAction',
|
|
|
|
|
+ options: [
|
|
|
|
|
+ {
|
|
|
|
|
+ code: 'view',
|
|
|
|
|
+ label: '详情',
|
|
|
|
|
+ // auth: ['logException:view'],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ field: 'operation',
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
- slots: { default: 'action' },
|
|
|
|
|
|
|
+ headerAlign: 'center',
|
|
|
|
|
+ showOverflow: false,
|
|
|
title: '操作',
|
|
title: '操作',
|
|
|
- width: 60,
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- 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,
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ width: 50,
|
|
|
},
|
|
},
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ ];
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-export const gridOperateOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
|
|
- toolbarConfig: {
|
|
|
|
|
- refresh: true,
|
|
|
|
|
- print: false,
|
|
|
|
|
- export: false,
|
|
|
|
|
- zoom: true,
|
|
|
|
|
- custom: true,
|
|
|
|
|
- },
|
|
|
|
|
- columns: [
|
|
|
|
|
|
|
+export function useOperateColumns(
|
|
|
|
|
+ onActionClick?: OnActionClickFn<LogApi.RecordItem>,
|
|
|
|
|
+): VxeTableGridOptions<LogApi.RecordItem>['columns'] {
|
|
|
|
|
+ return [
|
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
|
{
|
|
{
|
|
|
align: 'left',
|
|
align: 'left',
|
|
@@ -273,43 +226,34 @@ export const gridOperateOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
showOverflow: true,
|
|
showOverflow: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- field: 'action',
|
|
|
|
|
|
|
+ align: 'right',
|
|
|
|
|
+ cellRender: {
|
|
|
|
|
+ attrs: {
|
|
|
|
|
+ nameField: 'requestUrl',
|
|
|
|
|
+ nameTitle: '请求地址',
|
|
|
|
|
+ onClick: onActionClick,
|
|
|
|
|
+ },
|
|
|
|
|
+ name: 'CellAction',
|
|
|
|
|
+ options: [
|
|
|
|
|
+ {
|
|
|
|
|
+ code: 'view',
|
|
|
|
|
+ label: '详情',
|
|
|
|
|
+ // auth: ['logOperate:view'],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ field: 'operation',
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
- slots: { default: 'action' },
|
|
|
|
|
|
|
+ headerAlign: 'center',
|
|
|
|
|
+ showOverflow: false,
|
|
|
title: '操作',
|
|
title: '操作',
|
|
|
- width: 60,
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- 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,
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ width: 50,
|
|
|
},
|
|
},
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ ];
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-export const gridVisitOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
|
|
- toolbarConfig: {
|
|
|
|
|
- refresh: true,
|
|
|
|
|
- print: false,
|
|
|
|
|
- export: false,
|
|
|
|
|
- zoom: true,
|
|
|
|
|
- custom: true,
|
|
|
|
|
- },
|
|
|
|
|
- columns: [
|
|
|
|
|
|
|
+export function useVisitColumns(): VxeTableGridOptions<LogApi.RecordItem>['columns'] {
|
|
|
|
|
+ return [
|
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
{ title: '序号', type: 'seq', width: 50 },
|
|
|
{
|
|
{
|
|
|
align: 'left',
|
|
align: 'left',
|
|
@@ -322,7 +266,6 @@ export const gridVisitOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
field: 'actionName',
|
|
field: 'actionName',
|
|
|
title: '方法名称',
|
|
title: '方法名称',
|
|
|
- width: 120,
|
|
|
|
|
showOverflow: true,
|
|
showOverflow: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -387,24 +330,5 @@ export const gridVisitOptions: VxeGridProps<LogApi.RecordItem> = {
|
|
|
title: '姓名',
|
|
title: '姓名',
|
|
|
width: 120,
|
|
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,
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ ];
|
|
|
|
|
+}
|