diff --git a/src/api/infra/apiAccessLog/index.ts b/src/api/infra/apiAccessLog/index.ts index b46199e4b39021b17bf4b6218a19896924eafb38..11cff1caf6498782cd03f7245d6b92c7d353683c 100644 --- a/src/api/infra/apiAccessLog/index.ts +++ b/src/api/infra/apiAccessLog/index.ts @@ -40,11 +40,11 @@ export interface ApiAccessLogExportReqVO { } // 查询列表API 访问日志 -export const getApiAccessLogPageApi = (params: ApiAccessLogPageReqVO) => { +export const getApiAccessLogPageApi = (params: PageParam) => { return request.get({ url: '/infra/api-access-log/page', params }) } // 导出API 访问日志 -export const exportApiAccessLogApi = (params: ApiAccessLogExportReqVO) => { +export const exportApiAccessLogApi = (params) => { return request.download({ url: '/infra/api-access-log/export-excel', params }) } diff --git a/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue b/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue new file mode 100644 index 0000000000000000000000000000000000000000..d70c7ec73c706692ba29cf4a85f11c1fd58f9064 --- /dev/null +++ b/src/views/infra/apiAccessLog/ApiAccessLogDetail.vue @@ -0,0 +1,66 @@ + + + + + {{ detailData.id }} + + + {{ detailData.traceId }} + + + {{ detailData.applicationName }} + + + {{ detailData.userId }} | + + | {{ detailData.userIp }} | {{ detailData.userAgent }} + + + {{ detailData.requestMethod }} | {{ detailData.requestUrl }} + + + {{ detailData.requestParams }} + + + {{ formatDate(detailData.beginTime, 'YYYY-MM-DD HH:mm:ss') }} ~ + {{ formatDate(detailData.endTime, 'YYYY-MM-DD HH:mm:ss') }} | {{ detailData.duration }} ms + + + 正常 + 失败 | {{ detailData.resultCode }} | {{ detailData.resultMsg }} + + + + + + diff --git a/src/views/infra/apiAccessLog/apiAccessLog.data.ts b/src/views/infra/apiAccessLog/apiAccessLog.data.ts deleted file mode 100644 index cb9e97a7e3aec4eca0160aeab9eff31532c18b2b..0000000000000000000000000000000000000000 --- a/src/views/infra/apiAccessLog/apiAccessLog.data.ts +++ /dev/null @@ -1,74 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'id', - primaryTitle: '日志编号', - action: true, - actionWidth: '80px', - columns: [ - { - title: '链路追踪', - field: 'traceId', - isTable: false - }, - { - title: '用户编号', - field: 'userId', - isSearch: true - }, - { - title: '用户类型', - field: 'userType', - dictType: DICT_TYPE.USER_TYPE, - dictClass: 'number', - isSearch: true - }, - { - title: '应用名', - field: 'applicationName', - isSearch: true - }, - { - title: '请求方法名', - field: 'requestMethod' - }, - { - title: '请求地址', - field: 'requestUrl', - isSearch: true - }, - { - title: '请求时间', - field: 'beginTime', - formatter: 'formatDate', - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: '执行时长', - field: 'duration', - table: { - slots: { - default: 'duration_default' - } - } - }, - { - title: '操作结果', - field: 'resultCode', - isSearch: true, - table: { - slots: { - default: 'resultCode_default' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/apiAccessLog/index.vue b/src/views/infra/apiAccessLog/index.vue index 6a09927d761899dc83207bef0f6300cdcc56d0bf..aedb5570bd987c0c35b20533d01ac4ff7140b62e 100644 --- a/src/views/infra/apiAccessLog/index.vue +++ b/src/views/infra/apiAccessLog/index.vue @@ -1,62 +1,220 @@ - - - - - {{ row.duration + 'ms' }} - - - {{ row.resultCode === 0 ? '成功' : '失败(' + row.resultMsg + ')' }} - - - - + + + + - - - - - - - - {{ row.duration + 'ms' }} - - - {{ row.resultCode === 0 ? '成功' : '失败(' + row.resultMsg + ')' }} - - - - - - - + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + 导出 + + + + + + + + + + + + + + + + + + + + {{ formatDate(scope.row.beginTime, 'YYYY-MM-DD HH:mm:ss') }} + + + + + {{ scope.row.duration }} ms + + + + + {{ + scope.row.resultCode === 0 ? '成功' : '失败(' + scope.row.resultMsg + ')' + }} + + + + + + 详细 + + + + + + + + + + + + diff --git a/src/views/infra/apiErrorLog/ApiErrorLogDetail.vue b/src/views/infra/apiErrorLog/ApiErrorLogDetail.vue index 479c4c4be099346209c97d1d2111732babb87b67..b1991de35e55126ce5f2ad0b5ec0217b1948527e 100644 --- a/src/views/infra/apiErrorLog/ApiErrorLogDetail.vue +++ b/src/views/infra/apiErrorLog/ApiErrorLogDetail.vue @@ -1,5 +1,5 @@ - + {{ detailData.id }} @@ -10,18 +10,13 @@ {{ detailData.applicationName }} - - {{ detailData.userId }} + + {{ detailData.userId }} | - - - {{ detailData.userIp }} - - - {{ detailData.userAgent }} + | {{ detailData.userIp }} | {{ detailData.userAgent }} - {{ detailData.requestMethod }} {{ detailData.requestUrl }} + {{ detailData.requestMethod }} | {{ detailData.requestUrl }} {{ detailData.requestParams }} @@ -32,7 +27,7 @@ {{ detailData.exceptionName }} - + + diff --git a/src/views/infra/apiErrorLog/index.vue b/src/views/infra/apiErrorLog/index.vue index 1108651aa4cdafcbded4c5156d58096485b9fa9f..7164d5494fe7319fe26956a49aad10081ef72fb9 100644 --- a/src/views/infra/apiErrorLog/index.vue +++ b/src/views/infra/apiErrorLog/index.vue @@ -1,5 +1,5 @@ - + @@ -53,17 +53,12 @@ /> - + @@ -81,10 +76,9 @@ - - + - + @@ -93,17 +87,15 @@ - - - - - + + + + + + {{ formatDate(scope.row.exceptionTime, 'YYYY-MM-DD HH:mm:ss') }} + + + - + 详细 @@ -126,7 +118,9 @@ link type="primary" v-if="scope.row.processStatus === InfraApiErrorLogProcessStatusEnum.INIT" - @click="handleProcess(scope.row.id, InfraApiErrorLogProcessStatusEnum.DONE)" + @click=" + handleProcessClick(InfraApiErrorLogProcessStatusEnum.DONE, '已处理', scope.row.id) + " v-hasPermi="['infra:api-error-log:update-status']" > 已处理 @@ -134,8 +128,11 @@ 已忽略 @@ -143,6 +140,7 @@ + - + - +