|
| 1 | +<template> |
| 2 | + <Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="500" width="800"> |
| 3 | + <el-descriptions border :column="1"> |
| 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 | + | {{ detailData.userIp }} | {{ detailData.userAgent }} |
| 17 | + </el-descriptions-item> |
| 18 | + <el-descriptions-item label="请求信息"> |
| 19 | + {{ detailData.requestMethod }} | {{ detailData.requestUrl }} |
| 20 | + </el-descriptions-item> |
| 21 | + <el-descriptions-item label="请求参数"> |
| 22 | + {{ detailData.requestParams }} |
| 23 | + </el-descriptions-item> |
| 24 | + <el-descriptions-item label="异常时间"> |
| 25 | + {{ formatDate(detailData.exceptionTime, 'YYYY-MM-DD HH:mm:ss') }} |
| 26 | + </el-descriptions-item> |
| 27 | + <el-descriptions-item label="异常名"> |
| 28 | + {{ detailData.exceptionName }} |
| 29 | + </el-descriptions-item> |
| 30 | + <el-descriptions-item label="异常名" v-if="detailData.exceptionStackTrace"> |
| 31 | + <el-input |
| 32 | + type="textarea" |
| 33 | + :readonly="true" |
| 34 | + :autosize="{ maxRows: 20 }" |
| 35 | + v-model="detailData.exceptionStackTrace" |
| 36 | + /> |
| 37 | + </el-descriptions-item> |
| 38 | + <el-descriptions-item label="处理状态"> |
| 39 | + <dict-tag |
| 40 | + :type="DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS" |
| 41 | + :value="detailData.processStatus" |
| 42 | + /> |
| 43 | + </el-descriptions-item> |
| 44 | + <el-descriptions-item label="处理人" v-if="detailData.processUserId"> |
| 45 | + {{ detailData.processUserId }} |
| 46 | + </el-descriptions-item> |
| 47 | + <el-descriptions-item label="处理时间" v-if="detailData.processTime"> |
| 48 | + {{ formatDate(detailData.processTime, 'YYYY-MM-DD HH:mm:ss') }} |
| 49 | + </el-descriptions-item> |
| 50 | + </el-descriptions> |
| 51 | + </Dialog> |
| 52 | +</template> |
| 53 | + |
| 54 | +<script setup lang="ts"> |
| 55 | +import { DICT_TYPE } from '@/utils/dict' |
| 56 | +import { formatDate } from '@/utils/formatTime' |
| 57 | +import * as ApiErrorLog from '@/api/infra/apiErrorLog' |
| 58 | +
|
| 59 | +const modelVisible = ref(false) // 弹窗的是否展示 |
| 60 | +const detailLoading = ref(false) // 表单的加载中 |
| 61 | +const detailData = ref() // 详情数据 |
| 62 | +
|
| 63 | +/** 打开弹窗 */ |
| 64 | +const openModal = async (data: ApiErrorLog.ApiErrorLogVO) => { |
| 65 | + modelVisible.value = true |
| 66 | + // 设置数据 |
| 67 | + detailLoading.value = true |
| 68 | + try { |
| 69 | + detailData.value = data |
| 70 | + } finally { |
| 71 | + detailLoading.value = false |
| 72 | + } |
| 73 | +} |
| 74 | +
|
| 75 | +defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗 |
| 76 | +</script> |
0 commit comments