gaoluyang
2026-06-24 bfdc0e0e6d5e47aa501f9b6fadd143d9c97cf00a
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
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 
import { computed, ref } from 'vue';
 
import { useVbenModal } from '../../../../../../packages/effects/common-ui/src';
 
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getCombinationRecordPage } from '#/api/mall/promotion/combination/combinationRecord';
 
import { useUserGridColumns } from '../data';
 
defineOptions({ name: 'CombinationUserList' });
 
const headId = ref<number>();
 
const [Modal, modalApi] = useVbenModal({
  async onOpenChange(isOpen: boolean) {
    if (!isOpen) {
      headId.value = undefined;
      return;
    }
    const data = modalApi.getData<{ headId: number }>();
    if (data?.headId) {
      headId.value = data.headId;
    }
  },
});
 
const [Grid] = useVbenVxeGrid({
  gridOptions: {
    columns: useUserGridColumns(),
    height: 600,
    keepSource: true,
    proxyConfig: {
      ajax: {
        query: async ({ page }) => {
          // 暂时返回空数据,待API实现后替换
          return await getCombinationRecordPage({
            pageNo: page.currentPage,
            pageSize: page.pageSize,
            headId: headId.value,
          });
        },
      },
    },
    rowConfig: {
      keyField: 'id',
      isHover: true,
    },
  } as VxeTableGridOptions,
});
 
const getTitle = computed(() => {
  return `拼团成员列表 (拼团ID: ${headId.value || ''})`;
});
</script>
 
<template>
  <Modal class="w-2/5" :title="getTitle">
    <Grid class="mx-4" />
  </Modal>
</template>