index.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { miniAppList } from "@/services/distributor/miniApp"
  2. import { PageContainer, ProTable } from "@ant-design/pro-components"
  3. import { Table } from "antd"
  4. import { columns, childrenColumns } from "./tableConfig"
  5. import { useAjax } from "@/Hook/useAjax"
  6. const Page: React.FC = () => {
  7. let getList = useAjax((params) => miniAppList(params), { type: 'table' })
  8. return <PageContainer>
  9. <ProTable<any, any>
  10. headerTitle={"微信小程序列表"}
  11. rowKey={(r) => r.id}
  12. search={{
  13. labelWidth: 120,
  14. }}
  15. request={async (params) => {
  16. return await getList.run(params)
  17. }}
  18. columns={columns()}
  19. // showHeader={false}//隐藏标题
  20. // options={false}//隐藏工具栏
  21. // ghost={true}//幽灵模式
  22. // bordered
  23. expandable={{
  24. rowExpandable: (record) => record?.appCarrierList?.length > 0,
  25. expandRowByClick: true,
  26. expandedRowRender: (record) => {
  27. return <Table
  28. columns={childrenColumns}
  29. dataSource={record.appCarrierList}
  30. rowKey={(r) => r.id}
  31. pagination={false}
  32. size='small'
  33. bordered
  34. />
  35. },
  36. }}
  37. />
  38. </PageContainer>
  39. }
  40. export default Page