index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <script setup lang="tsx">
  2. import { NImage } from 'naive-ui';
  3. import { fetchGetUserList } from '@/service/api/user-management/user-list';
  4. import { useTable } from '@/components/zt/Table/hooks/useTable';
  5. const columns: NaiveUI.TableColumn<Api.userManagement.userList>[] = [
  6. {
  7. key: 'nickName',
  8. title: '用户昵称',
  9. align: 'center'
  10. },
  11. {
  12. key: 'pic',
  13. title: '头像',
  14. align: 'center',
  15. render: row => <NImage src={row.pic} class="h-[80px] min-w-80px w-[80px]" lazy />
  16. },
  17. {
  18. key: 'userMobile',
  19. title: '手机号码',
  20. align: 'center'
  21. },
  22. {
  23. key: 'name',
  24. title: '渠道',
  25. align: 'center'
  26. },
  27. {
  28. key: 'userRegtime',
  29. title: '创建时间',
  30. align: 'center'
  31. }
  32. ];
  33. const [registerTable] = useTable({
  34. searchFormConfig: {
  35. schemas: [
  36. {
  37. field: 'nickName',
  38. label: '用户昵称',
  39. component: 'NInput'
  40. }
  41. ],
  42. inline: false,
  43. size: 'small',
  44. labelPlacement: 'left',
  45. isFull: false
  46. },
  47. tableConfig: {
  48. keyField: 'id',
  49. title: '用户列表',
  50. showAddButton: false
  51. }
  52. });
  53. </script>
  54. <template>
  55. <LayoutTable>
  56. <ZTable :columns="columns" :api="fetchGetUserList" :show-table-action="false" @register="registerTable"></ZTable>
  57. </LayoutTable>
  58. </template>
  59. <style scoped></style>