NotifyDetail.vue 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <Dialog v-model="dialogVisible" title="通知详情" width="50%">
  3. <el-descriptions :column="2">
  4. <el-descriptions-item label="商户订单编号">
  5. <el-tag>{{ detailData.merchantOrderId }}</el-tag>
  6. </el-descriptions-item>
  7. <el-descriptions-item label="通知状态">
  8. <dict-tag :type="DICT_TYPE.PAY_NOTIFY_STATUS" :value="detailData.status" />
  9. </el-descriptions-item>
  10. <el-descriptions-item label="应用编号">{{ detailData.appId }}</el-descriptions-item>
  11. <el-descriptions-item label="应用名称">{{ detailData.appName }}</el-descriptions-item>
  12. <el-descriptions-item label="关联编号">{{ detailData.dataId }}</el-descriptions-item>
  13. <el-descriptions-item label="通知类型">
  14. <dict-tag :type="DICT_TYPE.PAY_NOTIFY_TYPE" :value="detailData.type" />
  15. </el-descriptions-item>
  16. <el-descriptions-item label="通知次数">{{ detailData.notifyTimes }}</el-descriptions-item>
  17. <el-descriptions-item label="最大通知次数">
  18. {{ detailData.maxNotifyTimes }}
  19. </el-descriptions-item>
  20. <el-descriptions-item label="最后通知时间">
  21. {{ formatDate(detailData.lastExecuteTime) }}
  22. </el-descriptions-item>
  23. <el-descriptions-item label="下次通知时间">
  24. {{ formatDate(detailData.nextNotifyTime) }}
  25. </el-descriptions-item>
  26. <el-descriptions-item label="创建时间">
  27. {{ formatDate(detailData.createTime) }}
  28. </el-descriptions-item>
  29. <el-descriptions-item label="更新时间">
  30. {{ formatDate(detailData.updateTime) }}
  31. </el-descriptions-item>
  32. </el-descriptions>
  33. <!-- 分割线 -->
  34. <el-divider />
  35. <el-descriptions :column="1" direction="vertical" border>
  36. <el-descriptions-item label="回调日志">
  37. <el-table :data="detailData.logs">
  38. <el-table-column label="日志编号" align="center" prop="id" />
  39. <el-table-column label="通知状态" align="center" prop="status">
  40. <template #default="scope">
  41. <dict-tag :type="DICT_TYPE.PAY_NOTIFY_STATUS" :value="scope.row.status" />
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="通知次数" align="center" prop="notifyTimes" />
  45. <el-table-column label="通知时间" align="center" prop="lastExecuteTime" width="180">
  46. <template #default="scope">
  47. <span>{{ formatDate(scope.row.createTime) }}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="响应结果" align="center" prop="response" />
  51. </el-table>
  52. </el-descriptions-item>
  53. </el-descriptions>
  54. </Dialog>
  55. </template>
  56. <script lang="ts" setup>
  57. import { DICT_TYPE } from '@/utils/dict'
  58. import * as PayNotifyApi from '@/api/pay/notify'
  59. import { formatDate } from '@/utils/formatTime'
  60. defineOptions({ name: 'PayNotifyDetail' })
  61. const dialogVisible = ref(false) // 弹窗的是否展示
  62. const detailLoading = ref(false) // 表单的加载中
  63. const detailData = ref({})
  64. /** 打开弹窗 */
  65. const open = async (id: number) => {
  66. dialogVisible.value = true
  67. // 设置数据
  68. detailLoading.value = true
  69. try {
  70. detailData.value = await PayNotifyApi.getNotifyTaskDetail(id)
  71. } finally {
  72. detailLoading.value = false
  73. }
  74. }
  75. defineExpose({ open }) // 提供 open 方法,用于打开弹窗
  76. </script>