Peak.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {ActionType, PageContainer, ProTable,} from '@ant-design/pro-components';
  2. import {Card} from 'antd';
  3. import React, {useRef} from 'react';
  4. import {getPeakListApi} from '@/services/swagger/peakAdmin';
  5. const Peak: React.FC = () => {
  6. const ref = useRef<ActionType>();
  7. return (
  8. <PageContainer content={''}>
  9. <Card>
  10. <ProTable<SectApi.StaffVO>
  11. rowKey={'id'}
  12. request={async (_) => {
  13. const res = await getPeakListApi();
  14. return {
  15. success: res.success,
  16. data: res.data,
  17. };
  18. }}
  19. columns={[
  20. {
  21. title: 'ID',
  22. dataIndex: 'id',
  23. },
  24. {
  25. title: '名称',
  26. dataIndex: 'name',
  27. },
  28. {
  29. title: '等级',
  30. dataIndex: 'name',
  31. },
  32. {
  33. title: '人数',
  34. dataIndex: 'mobile',
  35. },
  36. {
  37. title: '经验值',
  38. dataIndex: 'nickname',
  39. },
  40. {
  41. title: '操作',
  42. valueType: 'option',
  43. render: () => [
  44. <a key={'stat'}>查看数据</a>,
  45. <a key={'details'}>基础信息</a>,
  46. ],
  47. },
  48. ]
  49. }
  50. pagination={false}
  51. search={false}
  52. form={{
  53. ignoreRules: false,
  54. }}
  55. actionRef={ref}
  56. ></ProTable>
  57. </Card>
  58. </PageContainer>
  59. );
  60. };
  61. export default Peak;