import { MyButtons, MyColumns, MyPageContainer, MyProTableProps, } from '@/common'; import { Selects } from '@/components/Selects'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import Create from './modals/Create'; import CreateCounters from './modals/CreateCounters'; import Update from './modals/Update'; import UpdateCounters from './modals/UpdateCounters'; export default function Index({ title = '商户' }) { const ExpandedRowRender = (e: any) => { const columns = [ { title: 'id', dataIndex: 'id' }, { title: '上游', dataIndex: ['market', 'name'] }, { title: '名称', dataIndex: 'name' }, { title: '上游商家编号', dataIndex: 'up_merchant_no' }, { title: '平台商户号', dataIndex: 'plat_merchant_no' }, { title: '平台柜台号', dataIndex: 'plat_counter_no' }, MyColumns.Option({ render: (_, item: any, index, action) => ( Apis.MerchantCounters.Delete({ id: item.id }).then(() => action?.reload(), ) } /> ), }), ]; return ( MyProTableProps.request( { ...params, merchants_id: e?.id }, sort, Apis.MerchantCounters.List, ) } toolBarRender={(action) => [ , ]} headerTitle="柜台信息" search={false} /> ); }; return ( MyProTableProps.request(params, sort, Apis.Merchants.List) } toolBarRender={(action) => [ , ]} expandable={{ expandedRowRender: ExpandedRowRender, }} columns={[ MyColumns.ID(), Selects.Agents({ dataIndex: 'agents_name' }), Selects.Bosses({ dataIndex: 'bosses_name' }), Selects.Factories({ dataIndex: 'factories_name' }), Selects.Platforms({ dataIndex: 'platforms_name' }), // { // title: '代理', // dataIndex: 'agents_name', // search: false, // }, // { // title: '厂家', // dataIndex: 'factories_name', // search: false, // }, // { // title: '平台', // dataIndex: 'platforms_name', // search: false, // }, // { // title: '老板', // dataIndex: 'bosses_name', // search: false, // }, { title: '简称', dataIndex: 'name', }, { title: '全称', dataIndex: 'full_name', }, { title: '平台商户号', dataIndex: 'plat_merchant_no', }, MyColumns.CreatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( Apis.Merchants.Delete({ id: item.id }).then(() => action?.reload(), ) } /> ), }), ]} /> ); }