提交 | 用户 | 时间
|
820397
|
1 |
<template> |
H |
2 |
<Dialog v-model="dialogVisible" :max-height="500" :scroll="true" title="详情" width="800"> |
|
3 |
<el-descriptions :column="1" border> |
|
4 |
<el-descriptions-item label="日志主键" min-width="120"> |
|
5 |
{{ detailData.id }} |
|
6 |
</el-descriptions-item> |
|
7 |
<el-descriptions-item label="链路追踪"> |
|
8 |
{{ detailData.traceId }} |
|
9 |
</el-descriptions-item> |
|
10 |
<el-descriptions-item label="应用名"> |
|
11 |
{{ detailData.applicationName }} |
|
12 |
</el-descriptions-item> |
|
13 |
<el-descriptions-item label="用户编号"> |
|
14 |
{{ detailData.userId }} |
|
15 |
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="detailData.userType" /> |
|
16 |
</el-descriptions-item> |
|
17 |
<el-descriptions-item label="用户 IP"> |
|
18 |
{{ detailData.userIp }} |
|
19 |
</el-descriptions-item> |
|
20 |
<el-descriptions-item label="用户 UA"> |
|
21 |
{{ detailData.userAgent }} |
|
22 |
</el-descriptions-item> |
|
23 |
<el-descriptions-item label="请求信息"> |
|
24 |
{{ detailData.requestMethod }} {{ detailData.requestUrl }} |
|
25 |
</el-descriptions-item> |
|
26 |
<el-descriptions-item label="请求参数"> |
|
27 |
{{ detailData.requestParams }} |
|
28 |
</el-descriptions-item> |
|
29 |
<el-descriptions-item label="异常时间"> |
|
30 |
{{ formatDate(detailData.exceptionTime) }} |
|
31 |
</el-descriptions-item> |
|
32 |
<el-descriptions-item label="异常名"> |
|
33 |
{{ detailData.exceptionName }} |
|
34 |
</el-descriptions-item> |
|
35 |
<el-descriptions-item v-if="detailData.exceptionStackTrace" label="异常堆栈"> |
|
36 |
<el-input |
|
37 |
v-model="detailData.exceptionStackTrace" |
|
38 |
:autosize="{ maxRows: 20 }" |
|
39 |
:readonly="true" |
|
40 |
type="textarea" |
|
41 |
/> |
|
42 |
</el-descriptions-item> |
|
43 |
<el-descriptions-item label="处理状态"> |
|
44 |
<dict-tag |
|
45 |
:type="DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS" |
|
46 |
:value="detailData.processStatus" |
|
47 |
/> |
|
48 |
</el-descriptions-item> |
|
49 |
<el-descriptions-item v-if="detailData.processUserId" label="处理人"> |
|
50 |
{{ detailData.processUserId }} |
|
51 |
</el-descriptions-item> |
|
52 |
<el-descriptions-item v-if="detailData.processTime" label="处理时间"> |
|
53 |
{{ formatDate(detailData.processTime) }} |
|
54 |
</el-descriptions-item> |
|
55 |
</el-descriptions> |
|
56 |
</Dialog> |
|
57 |
</template> |
|
58 |
<script lang="ts" setup> |
|
59 |
import { DICT_TYPE } from '@/utils/dict' |
|
60 |
import { formatDate } from '@/utils/formatTime' |
|
61 |
import * as ApiErrorLog from '@/api/infra/apiErrorLog' |
|
62 |
|
|
63 |
defineOptions({ name: 'ApiErrorLogDetail' }) |
|
64 |
|
|
65 |
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
66 |
const detailLoading = ref(false) // 表单的加载中 |
|
67 |
const detailData = ref({} as ApiErrorLog.ApiErrorLogVO) // 详情数据 |
|
68 |
|
|
69 |
/** 打开弹窗 */ |
|
70 |
const open = async (data: ApiErrorLog.ApiErrorLogVO) => { |
|
71 |
dialogVisible.value = true |
|
72 |
// 设置数据 |
|
73 |
detailLoading.value = true |
|
74 |
try { |
|
75 |
detailData.value = data |
|
76 |
} finally { |
|
77 |
detailLoading.value = false |
|
78 |
} |
|
79 |
} |
|
80 |
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
81 |
</script> |