index.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { useAjax } from '@/Hook/useAjax';
  2. import { apiLongBookCoinChangeLogOfPage } from '@/services/distribution/payLog';
  3. import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
  4. import { useRef } from 'react';
  5. import { columns } from './tableConfig';
  6. type DataItem = {
  7. name: string;
  8. state: string;
  9. };
  10. const Page: React.FC = () => {
  11. const actionRef = useRef<ActionType>();
  12. let LongBookCoinChangeLogOfPage = useAjax((params) => apiLongBookCoinChangeLogOfPage(params), {
  13. type: 'table',
  14. }); //订单
  15. return (
  16. <PageContainer>
  17. <ProTable<any, any>
  18. headerTitle={'长篇小说书币变更列表'}
  19. actionRef={actionRef}
  20. rowKey={(r) => r.id}
  21. search={{
  22. labelWidth: 120,
  23. }}
  24. request={async (params) => {
  25. if (params.time) {
  26. params.startTime = params.time[0];
  27. params.endTime = params.time[1];
  28. }
  29. delete params.time;
  30. return await LongBookCoinChangeLogOfPage.run(params);
  31. }}
  32. columns={columns()}
  33. scroll={{ x: 'max-content' }}
  34. // bordered
  35. />
  36. </PageContainer>
  37. );
  38. };
  39. export default Page;