diff --git a/apps/web-antd/src/views/infra/apiErrorLog/data.ts b/apps/web-antd/src/views/infra/apiErrorLog/data.ts
index 201c8911f..89f886ee3 100644
--- a/apps/web-antd/src/views/infra/apiErrorLog/data.ts
+++ b/apps/web-antd/src/views/infra/apiErrorLog/data.ts
@@ -77,14 +77,17 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'id',
title: '日志编号',
+ minWidth: 100,
},
{
field: 'userId',
title: '用户编号',
+ minWidth: 100,
},
{
field: 'userType',
title: '用户类型',
+ minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.USER_TYPE },
@@ -93,27 +96,33 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'applicationName',
title: '应用名',
+ minWidth: 150,
},
{
field: 'requestMethod',
title: '请求方法',
+ minWidth: 80,
},
{
field: 'requestUrl',
title: '请求地址',
+ minWidth: 200,
},
{
field: 'exceptionTime',
title: '异常发生时间',
+ minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'exceptionName',
title: '异常名',
+ minWidth: 180,
},
{
field: 'processStatus',
title: '处理状态',
+ minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS },
@@ -121,7 +130,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
},
{
title: '操作',
- width: 200,
+ minWidth: 200,
fixed: 'right',
slots: { default: 'actions' },
},
diff --git a/apps/web-antd/src/views/infra/apiErrorLog/index.vue b/apps/web-antd/src/views/infra/apiErrorLog/index.vue
index fc4215a7c..c84d0d44e 100644
--- a/apps/web-antd/src/views/infra/apiErrorLog/index.vue
+++ b/apps/web-antd/src/views/infra/apiErrorLog/index.vue
@@ -25,7 +25,7 @@ const [DetailModal, detailModalApi] = useVbenModal({
});
/** 刷新表格 */
-function onRefresh() {
+function handleRefresh() {
gridApi.query();
}
@@ -42,14 +42,20 @@ function handleDetail(row: InfraApiErrorLogApi.ApiErrorLog) {
/** 处理已处理 / 已忽略的操作 */
async function handleProcess(id: number, processStatus: number) {
- confirm({
+ await confirm({
content: `确认标记为${InfraApiErrorLogProcessStatusEnum.DONE ? '已处理' : '已忽略'}?`,
- }).then(async () => {
- await updateApiErrorLogStatus(id, processStatus);
- // 关闭并提示
- message.success($t('ui.actionMessage.operationSuccess'));
- onRefresh();
});
+ const hideLoading = message.loading({
+ content: '正在处理中...',
+ duration: 0,
+ });
+ try {
+ await updateApiErrorLogStatus(id, processStatus);
+ message.success($t('ui.actionMessage.operationSuccess'));
+ handleRefresh();
+ } finally {
+ hideLoading();
+ }
}
const [Grid, gridApi] = useVbenVxeGrid({
@@ -73,6 +79,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
+ isHover: true,
},
toolbarConfig: {
refresh: true,
@@ -88,7 +95,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
-
+
(
- onActionClick: OnActionClickFn,
-): VxeTableGridOptions['columns'] {
+export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
{
field: 'id',
@@ -127,46 +121,10 @@ export function useGridColumns(
},
},
{
- field: 'operation',
title: '操作',
minWidth: 200,
- align: 'center',
fixed: 'right',
- cellRender: {
- attrs: {
- nameField: 'id',
- nameTitle: 'API错误日志',
- onClick: onActionClick,
- },
- name: 'CellOperation',
- options: [
- {
- code: 'detail',
- text: '详情',
- show: hasAccessByCodes(['infra:api-error-log:query']),
- },
- {
- code: 'done',
- text: '已处理',
- show: (row: InfraApiErrorLogApi.ApiErrorLog) => {
- return (
- row.processStatus === InfraApiErrorLogProcessStatusEnum.INIT &&
- hasAccessByCodes(['infra:api-error-log:update-status'])
- );
- },
- },
- {
- code: 'ignore',
- text: '已忽略',
- show: (row: InfraApiErrorLogApi.ApiErrorLog) => {
- return (
- row.processStatus === InfraApiErrorLogProcessStatusEnum.INIT &&
- hasAccessByCodes(['infra:api-error-log:update-status'])
- );
- },
- },
- ],
- },
+ slots: { default: 'actions' },
},
];
}
diff --git a/apps/web-ele/src/views/infra/apiErrorLog/index.vue b/apps/web-ele/src/views/infra/apiErrorLog/index.vue
index 40a0d7135..964217c5d 100644
--- a/apps/web-ele/src/views/infra/apiErrorLog/index.vue
+++ b/apps/web-ele/src/views/infra/apiErrorLog/index.vue
@@ -1,18 +1,14 @@