pro-components
pro-components copied to clipboard
🧐[问题]表头分组后,如何展示二级表头的搜索项
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🧐 问题描述
colums中我使用children来进行表头分组,但是我需要的是二级表头作为搜索项,现在似乎只展示一级表头的。
💻 示例代码
const columns: ProColumns<QihangTrainingVO>[] = [ { title: '基本信息', search: false, children: [ { title: '期次', dataIndex: 'planId', key: 'planId', renderFormItem: () => ( <PlanSelect list={list ?? []} loading={loading} type={PlanEnum.NEWBIE_TRAINING} /> ), valueEnum: getValueEnumByIdNameModel(list ?? []), colSize: 4, search: { transform: (value) => ({ planId: value }), // 自定义搜索参数 }, }, { title: '参培人', dataIndex: 'trainee', key: 'name', proFieldProps: { placeholder: '请输入ldap或姓名, 多个以英文 , 分割', }, renderText: (trainee: TraineeVO) => { return trainee.name; }, search: { transform: (value: string) => { return { traineeLdaps: value?.split(','), }; }, }, }, { title: '性别', dataIndex: 'trainee', key: 'gender', renderText: (trainee: TraineeVO) => { return trainee.gender; }, valueEnum: getValueEnumByIdNameModel(genderEnum), hideInSearch: true, }, getRegionProColumn({ hideInSearch: true }), getPhaseProColumn({ hideInSearch: true }), getBusinessLineProColumn({ hideInSearch: true }), { title: '用工形式', dataIndex: 'employmentType', key: 'employmentType', valueEnum: getValueEnumByIdNameModel(employmentTypeEnum), hideInSearch: true, }, { title: '学历', dataIndex: 'eduBg', key: 'eduBg', valueEnum: getValueEnumByIdNameModel(eduBgEnum), hideInSearch: true, }, ], }, { title: '启航营', search:false, children: [ { title: '来源', dataIndex: 'source', key: 'source', hideInSearch: true, render: (, record) => { return ( <TdHoverEdit value={getNameFromIdNameModel(sourceEnum, record.source)} content={ record.source === 2 ? getDeferTextById( record.planId, PlanEnum.QIHANG_TRAINING, list, ) : '' } /> ); }, }, { title: '培训师', dataIndex: 'trainerName', key: 'trainerName', render: (, record) => { return ( <TdHoverEdit value={record.trainerName || '待分配'} hoverBtn={{ onClick: () => {}, }} /> ); }, hideInSearch: true, }, { title: '成单数', dataIndex: 'dealCnt', key: 'dealCnt', hideInSearch: true, }, { title: '培训状态', dataIndex: 'status', key: 'status', hideInSearch: true, render: (_, record) => { return ( <TdHoverEdit value={getNameFromIdNameModel(statusEnum, record.status)} content={getNewbieStatusContent(record, list)} /> ); }, }, ], }, ];