index.tsx 1.5 KB

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