gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayNotifyApi } from '#/api/pay/notify';
 
import { ref } from 'vue';
 
import { useVbenModal } from '..\..\..\..\packages\effects\common-ui\src';
 
import { Divider } from 'ant-design-vue';
 
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getNotifyTaskDetail } from '#/api/pay/notify';
import { useDescription } from '#/components/description';
 
import { useDetailLogColumns, useDetailSchema } from '../data';
 
const formData = ref<PayNotifyApi.NotifyTask>();
 
const [Description] = useDescription({
  bordered: true,
  column: 2,
  schema: useDetailSchema(),
});
 
const [LogGrid, logGridApi] = useVbenVxeGrid({
  gridOptions: {
    columns: useDetailLogColumns(),
    height: 'auto',
    keepSource: true,
    rowConfig: {
      keyField: 'id',
      isHover: true,
    },
    pagerConfig: {
      enabled: false,
    },
    toolbarConfig: {
      enabled: true,
      refresh: true,
    },
  } as VxeTableGridOptions,
});
 
const [Modal, modalApi] = useVbenModal({
  async onOpenChange(isOpen: boolean) {
    if (!isOpen) {
      formData.value = undefined;
      return;
    }
    // 加载数据
    const data = modalApi.getData<PayNotifyApi.NotifyTask>();
    if (!data || !data.id) {
      return;
    }
    modalApi.lock();
    try {
      formData.value = await getNotifyTaskDetail(data.id);
      logGridApi.grid?.reloadData(formData.value?.logs || []);
    } finally {
      modalApi.unlock();
    }
  },
});
</script>
 
<template>
  <Modal
    title="通知详情"
    class="w-1/2"
    :show-cancel-button="false"
    :show-confirm-button="false"
  >
    <Description :data="formData" />
 
    <Divider />
 
    <LogGrid table-title="支付通知列表" />
  </Modal>
</template>