提交 | 用户 | 时间
|
314507
|
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 |
{{ channelList.find((channel) => channel.id === detailData.channelId)?.signature }} |
|
9 |
<dict-tag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="detailData.channelCode" /> |
|
10 |
</el-descriptions-item> |
|
11 |
<el-descriptions-item label="短信模板"> |
|
12 |
{{ detailData.templateId }} | {{ detailData.templateCode }} |
|
13 |
<dict-tag :type="DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE" :value="detailData.templateType" /> |
|
14 |
</el-descriptions-item> |
|
15 |
<el-descriptions-item label="API 的模板编号"> |
|
16 |
{{ detailData.apiTemplateId }} |
|
17 |
</el-descriptions-item> |
|
18 |
<el-descriptions-item label="用户信息"> |
|
19 |
{{ detailData.mobile }} |
|
20 |
<span v-if="detailData.userType && detailData.userId"> |
|
21 |
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="detailData.userType" /> |
|
22 |
({{ detailData.userId }}) |
|
23 |
</span> |
|
24 |
</el-descriptions-item> |
|
25 |
<el-descriptions-item label="短信内容"> |
|
26 |
{{ detailData.templateContent }} |
|
27 |
</el-descriptions-item> |
|
28 |
<el-descriptions-item label="短信参数"> |
|
29 |
{{ detailData.templateParams }} |
|
30 |
</el-descriptions-item> |
|
31 |
<el-descriptions-item label="创建时间"> |
|
32 |
{{ formatDate(detailData.createTime) }} |
|
33 |
</el-descriptions-item> |
|
34 |
<el-descriptions-item label="发送状态"> |
|
35 |
<dict-tag :type="DICT_TYPE.SYSTEM_SMS_SEND_STATUS" :value="detailData.sendStatus" /> |
|
36 |
</el-descriptions-item> |
|
37 |
<el-descriptions-item label="发送时间"> |
|
38 |
{{ formatDate(detailData.sendTime) }} |
|
39 |
</el-descriptions-item> |
|
40 |
<el-descriptions-item label="API 发送结果"> |
|
41 |
{{ detailData.apiSendCode }} | {{ detailData.apiSendMsg }} |
|
42 |
</el-descriptions-item> |
|
43 |
<el-descriptions-item label="API 短信编号"> |
|
44 |
{{ detailData.apiSerialNo }} |
|
45 |
</el-descriptions-item> |
|
46 |
<el-descriptions-item label="API 请求编号"> |
|
47 |
{{ detailData.apiRequestId }} |
|
48 |
</el-descriptions-item> |
|
49 |
<el-descriptions-item label="API 接收状态"> |
|
50 |
<dict-tag :type="DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS" :value="detailData.receiveStatus" /> |
|
51 |
{{ formatDate(detailData.receiveTime) }} |
|
52 |
</el-descriptions-item> |
|
53 |
<el-descriptions-item label="API 接收结果"> |
|
54 |
{{ detailData.apiReceiveCode }} | {{ detailData.apiReceiveMsg }} |
|
55 |
</el-descriptions-item> |
|
56 |
</el-descriptions> |
|
57 |
</Dialog> |
|
58 |
</template> |
|
59 |
<script lang="ts" setup> |
|
60 |
import { DICT_TYPE } from '@/utils/dict' |
|
61 |
import { formatDate } from '@/utils/formatTime' |
|
62 |
import * as SmsLogApi from '@/api/system/sms/smsLog' |
|
63 |
import * as SmsChannelApi from '@/api/system/sms/smsChannel' |
|
64 |
|
|
65 |
defineOptions({ name: 'SystemSmsLogDetail' }) |
|
66 |
|
|
67 |
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
68 |
const detailLoading = ref(false) // 表单的加载中 |
|
69 |
const detailData = ref() // 详情数据 |
|
70 |
const channelList = ref([]) // 短信渠道列表 |
|
71 |
|
|
72 |
/** 打开弹窗 */ |
|
73 |
const open = async (data: SmsLogApi.SmsLogVO) => { |
|
74 |
dialogVisible.value = true |
|
75 |
// 设置数据 |
|
76 |
detailLoading.value = true |
|
77 |
try { |
|
78 |
detailData.value = data |
|
79 |
} finally { |
|
80 |
detailLoading.value = false |
|
81 |
} |
|
82 |
// 加载渠道列表 |
|
83 |
channelList.value = await SmsChannelApi.getSimpleSmsChannelList() |
|
84 |
} |
|
85 |
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
86 |
</script> |