提交 | 用户 | 时间
|
314507
|
1 |
<template> |
H |
2 |
<Dialog v-model="dialogVisible" 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 |
<dict-tag :type="DICT_TYPE.SYSTEM_LOGIN_TYPE" :value="detailData.logType" /> |
|
9 |
</el-descriptions-item> |
|
10 |
<el-descriptions-item label="用户名称"> |
|
11 |
{{ detailData.username }} |
|
12 |
</el-descriptions-item> |
|
13 |
<el-descriptions-item label="登录地址"> |
|
14 |
{{ detailData.userIp }} |
|
15 |
</el-descriptions-item> |
|
16 |
<el-descriptions-item label="浏览器"> |
|
17 |
{{ detailData.userAgent }} |
|
18 |
</el-descriptions-item> |
|
19 |
<el-descriptions-item label="登陆结果"> |
|
20 |
<dict-tag :type="DICT_TYPE.SYSTEM_LOGIN_RESULT" :value="detailData.result" /> |
|
21 |
</el-descriptions-item> |
|
22 |
<el-descriptions-item label="登录日期"> |
|
23 |
{{ formatDate(detailData.createTime) }} |
|
24 |
</el-descriptions-item> |
|
25 |
</el-descriptions> |
|
26 |
</Dialog> |
|
27 |
</template> |
|
28 |
<script lang="ts" setup> |
|
29 |
import { DICT_TYPE } from '@/utils/dict' |
|
30 |
import { formatDate } from '@/utils/formatTime' |
|
31 |
import * as LoginLogApi from '@/api/system/loginLog' |
|
32 |
|
|
33 |
defineOptions({ name: 'SystemLoginLogDetail' }) |
|
34 |
|
|
35 |
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
36 |
const detailLoading = ref(false) // 表单的加载中 |
|
37 |
const detailData = ref({} as LoginLogApi.LoginLogVO) // 详情数据 |
|
38 |
|
|
39 |
/** 打开弹窗 */ |
|
40 |
const open = async (data: LoginLogApi.LoginLogVO) => { |
|
41 |
dialogVisible.value = true |
|
42 |
// 设置数据 |
|
43 |
detailLoading.value = true |
|
44 |
try { |
|
45 |
detailData.value = data |
|
46 |
} finally { |
|
47 |
detailLoading.value = false |
|
48 |
} |
|
49 |
} |
|
50 |
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
51 |
</script> |