提交 | 用户 | 时间
|
820397
|
1 |
<template> |
H |
2 |
<Dialog v-model="dialogVisible" title="任务详细" width="700px"> |
|
3 |
<el-descriptions :column="1" border> |
|
4 |
<el-descriptions-item label="日志编号" min-width="60"> |
|
5 |
{{ detailData.id }} |
|
6 |
</el-descriptions-item> |
|
7 |
<el-descriptions-item label="任务编号"> |
|
8 |
{{ detailData.jobId }} |
|
9 |
</el-descriptions-item> |
|
10 |
<el-descriptions-item label="处理器的名字"> |
|
11 |
{{ detailData.handlerName }} |
|
12 |
</el-descriptions-item> |
|
13 |
<el-descriptions-item label="处理器的参数"> |
|
14 |
{{ detailData.handlerParam }} |
|
15 |
</el-descriptions-item> |
|
16 |
<el-descriptions-item label="第几次执行"> |
|
17 |
{{ detailData.executeIndex }} |
|
18 |
</el-descriptions-item> |
|
19 |
<el-descriptions-item label="执行时间"> |
|
20 |
{{ formatDate(detailData.beginTime) + ' ~ ' + formatDate(detailData.endTime) }} |
|
21 |
</el-descriptions-item> |
|
22 |
<el-descriptions-item label="执行时长"> |
|
23 |
{{ detailData.duration + ' 毫秒' }} |
|
24 |
</el-descriptions-item> |
|
25 |
<el-descriptions-item label="任务状态"> |
|
26 |
<dict-tag :type="DICT_TYPE.INFRA_JOB_LOG_STATUS" :value="detailData.status" /> |
|
27 |
</el-descriptions-item> |
|
28 |
<el-descriptions-item label="执行结果"> |
|
29 |
{{ detailData.result }} |
|
30 |
</el-descriptions-item> |
|
31 |
</el-descriptions> |
|
32 |
</Dialog> |
|
33 |
</template> |
|
34 |
<script lang="ts" setup> |
|
35 |
import { DICT_TYPE } from '@/utils/dict' |
|
36 |
import { formatDate } from '@/utils/formatTime' |
|
37 |
import * as JobLogApi from '@/api/infra/jobLog' |
|
38 |
|
|
39 |
defineOptions({ name: 'JobLogDetail' }) |
|
40 |
|
|
41 |
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
42 |
const detailLoading = ref(false) // 表单的加载中 |
|
43 |
const detailData = ref({} as JobLogApi.JobLogVO) // 详情数据 |
|
44 |
|
|
45 |
/** 打开弹窗 */ |
|
46 |
const open = async (id: number) => { |
|
47 |
dialogVisible.value = true |
|
48 |
// 查看,设置数据 |
|
49 |
if (id) { |
|
50 |
detailLoading.value = true |
|
51 |
try { |
|
52 |
detailData.value = await JobLogApi.getJobLog(id) |
|
53 |
} finally { |
|
54 |
detailLoading.value = false |
|
55 |
} |
|
56 |
} |
|
57 |
} |
|
58 |
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
59 |
</script> |