ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.3k stars 1.36k forks source link

🐛[BUG]BetaSchemaForm中columns为formList时,title无法拿到formlist的index #8561

Open daisybaicai opened 3 months ago

daisybaicai commented 3 months ago

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

🐛 bug 描述

目前在title部分只暴露了props,type,dom 同时在formItemProps 也没有地方能拿到当前formlist的index image

📷 复现步骤

用复现的代码可以查看

🏞 期望结果

目前的效果是 image

希望能在label前面加上index,能否有地方得到下面的效果 image

💻 复现代码

const columns = [
      {
        valueType: 'formList',
        dataIndex: 'flowNodeApplyReqList',
        fieldProps: {
          alwaysShowItemLabel: true,
          creatorButtonProps: {
            creatorButtonText: '增加一行',
          },
        },
        columns: [
          {
            title: '',
            valueType: 'group',
            rowProps: {
              wrap: false,
              justify: 'space-between',
            },
            columns: [
              {
                title: (props, type, dom) => {
                  console.log('props,type,dom', props, type, dom);
                  return <div>院区名称</div>;
                },
                dataIndex: 'displayName',
                // formItemProps: (...rest) => {
                //   console.log('form', rest);
                //   return {
                //     label: 'test',
                //   };
                // },
                colProps: {
                  span: 12,
                },
              },
              {
                title: '院区名称',
                dataIndex: 'applicationCode',
                params: {},
                colProps: {
                  span: 12,
                },
              },
            ],
          },
        ],
      },
    ]

<BetaSchemaForm columns={columns} />

© 版本信息

🚑 其他信息