refactor: vxe
parent
dcd1b5fbba
commit
fd4bc8ccf4
@ -1,14 +0,0 @@
|
|||||||
export type ApiAccessLogVO = {
|
|
||||||
id: number
|
|
||||||
traceId: string
|
|
||||||
userId: string
|
|
||||||
userType: string
|
|
||||||
applicationName: string
|
|
||||||
requestMethod: string
|
|
||||||
requestParams: string
|
|
||||||
requestUrl: string
|
|
||||||
beginTime: string
|
|
||||||
endTIme: string
|
|
||||||
duration: string
|
|
||||||
resultCode: number
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
export type ApiErrorLogVO = {
|
|
||||||
id: number
|
|
||||||
userId: string
|
|
||||||
userIp: string
|
|
||||||
userAgent: string
|
|
||||||
userType: string
|
|
||||||
applicationName: string
|
|
||||||
requestMethod: string
|
|
||||||
requestParams: string
|
|
||||||
requestUrl: string
|
|
||||||
exceptionTime: string
|
|
||||||
exceptionName: string
|
|
||||||
exceptionStackTrace: string
|
|
||||||
processUserId: string
|
|
||||||
processStatus: number
|
|
||||||
resultCode: number
|
|
||||||
}
|
|
||||||
@ -1,88 +1,74 @@
|
|||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
|
||||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
const { t } = useI18n() // 国际化
|
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
|
|
||||||
// CrudSchema
|
// CrudSchema
|
||||||
const crudSchemas = reactive<CrudSchema[]>([
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
{
|
primaryKey: 'id',
|
||||||
label: t('common.index'),
|
primaryType: 'seq',
|
||||||
field: 'id',
|
action: true,
|
||||||
type: 'index'
|
actionWidth: '80px',
|
||||||
},
|
columns: [
|
||||||
{
|
{
|
||||||
label: '链路追踪',
|
title: '链路追踪',
|
||||||
field: 'traceId'
|
field: 'traceId'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '用户编号',
|
title: '用户编号',
|
||||||
field: 'userId',
|
field: 'userId',
|
||||||
search: {
|
isSearch: true
|
||||||
show: true
|
},
|
||||||
}
|
{
|
||||||
},
|
title: '用户类型',
|
||||||
{
|
field: 'userType',
|
||||||
label: '用户类型',
|
dictType: DICT_TYPE.USER_TYPE,
|
||||||
field: 'userType',
|
dictClass: 'number',
|
||||||
dictType: DICT_TYPE.USER_TYPE,
|
isSearch: true
|
||||||
dictClass: 'number',
|
},
|
||||||
search: {
|
{
|
||||||
show: true
|
title: '应用名',
|
||||||
}
|
field: 'applicationName',
|
||||||
},
|
isSearch: true
|
||||||
{
|
},
|
||||||
label: '应用名',
|
{
|
||||||
field: 'applicationName',
|
title: '请求方法名',
|
||||||
search: {
|
field: 'requestMethod'
|
||||||
show: true
|
},
|
||||||
}
|
{
|
||||||
},
|
title: '请求地址',
|
||||||
{
|
field: 'requestUrl',
|
||||||
label: '请求方法名',
|
isSearch: true
|
||||||
field: 'requestMethod'
|
},
|
||||||
},
|
{
|
||||||
{
|
title: '请求时间',
|
||||||
label: '请求地址',
|
field: 'beginTime',
|
||||||
field: 'requestUrl',
|
formatter: 'formatDate',
|
||||||
search: {
|
search: {
|
||||||
show: true
|
show: true,
|
||||||
}
|
itemRender: {
|
||||||
},
|
name: 'XDataTimePicker'
|
||||||
{
|
}
|
||||||
label: '请求时间',
|
|
||||||
field: 'beginTime',
|
|
||||||
search: {
|
|
||||||
show: true,
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
type: 'datetimerange',
|
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '执行时长',
|
|
||||||
field: 'duration'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '操作结果',
|
|
||||||
field: 'resultCode',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('table.action'),
|
|
||||||
field: 'action',
|
|
||||||
width: '300px',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
},
|
||||||
detail: {
|
{
|
||||||
show: false
|
title: '执行时长',
|
||||||
|
field: 'duration',
|
||||||
|
table: {
|
||||||
|
slots: {
|
||||||
|
default: 'duration_default'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作结果',
|
||||||
|
field: 'resultCode',
|
||||||
|
isSearch: true,
|
||||||
|
table: {
|
||||||
|
slots: {
|
||||||
|
default: 'resultCode_default'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
])
|
})
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
|
|||||||
@ -1,97 +1,77 @@
|
|||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
|
||||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
const { t } = useI18n() // 国际化
|
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
|
|
||||||
// CrudSchema
|
// CrudSchema
|
||||||
const crudSchemas = reactive<CrudSchema[]>([
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
{
|
primaryKey: 'id',
|
||||||
label: t('common.index'),
|
primaryType: 'seq',
|
||||||
field: 'id',
|
action: true,
|
||||||
type: 'index'
|
actionWidth: '300',
|
||||||
},
|
columns: [
|
||||||
{
|
{
|
||||||
label: '链路追踪',
|
title: '链路追踪',
|
||||||
field: 'traceId'
|
field: 'traceId',
|
||||||
},
|
isTable: false
|
||||||
{
|
},
|
||||||
label: '用户编号',
|
{
|
||||||
field: 'userId',
|
title: '用户编号',
|
||||||
search: {
|
field: 'userId',
|
||||||
show: true
|
isSearch: true
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
title: '用户类型',
|
||||||
label: '用户类型',
|
field: 'userType',
|
||||||
field: 'userType',
|
dictType: DICT_TYPE.USER_TYPE,
|
||||||
dictType: DICT_TYPE.USER_TYPE,
|
isSearch: true
|
||||||
search: {
|
},
|
||||||
show: true
|
{
|
||||||
}
|
title: '应用名',
|
||||||
},
|
field: 'applicationName',
|
||||||
{
|
isSearch: true
|
||||||
label: '应用名',
|
},
|
||||||
field: 'applicationName',
|
{
|
||||||
search: {
|
title: '请求方法名',
|
||||||
show: true
|
field: 'requestMethod'
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
title: '请求地址',
|
||||||
label: '请求方法名',
|
field: 'requestUrl',
|
||||||
field: 'requestMethod'
|
isSearch: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '请求地址',
|
title: '异常发生时间',
|
||||||
field: 'requestUrl',
|
field: 'exceptionTime',
|
||||||
search: {
|
formatter: 'formatDate',
|
||||||
show: true
|
search: {
|
||||||
}
|
show: true,
|
||||||
},
|
itemRender: {
|
||||||
{
|
name: 'XDataTimePicker'
|
||||||
label: '异常发生时间',
|
}
|
||||||
field: 'exceptionTime',
|
|
||||||
search: {
|
|
||||||
show: true,
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
type: 'datetimerange',
|
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '异常名',
|
|
||||||
field: 'exceptionName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '处理状态',
|
|
||||||
field: 'processStatus',
|
|
||||||
dictType: DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS,
|
|
||||||
dictClass: 'number',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '处理人',
|
|
||||||
field: 'processUserId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '处理时间',
|
|
||||||
field: 'processTime'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('table.action'),
|
|
||||||
field: 'action',
|
|
||||||
width: '300px',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
},
|
||||||
detail: {
|
{
|
||||||
show: false
|
title: '异常名',
|
||||||
|
field: 'exceptionName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '处理状态',
|
||||||
|
field: 'processStatus',
|
||||||
|
dictType: DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS,
|
||||||
|
dictClass: 'number',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '处理人',
|
||||||
|
field: 'processUserId',
|
||||||
|
isTable: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '处理时间',
|
||||||
|
field: 'processTime',
|
||||||
|
formatter: 'formatDate',
|
||||||
|
isTable: false
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
])
|
})
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
|
|||||||
Loading…
Reference in New Issue