Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
daisybaicai opened this issue Jul 12, 2024 · 1 comment

Comments

@daisybaicai
Copy link

提问前先看看:

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} />

© 版本信息

  • ProComponents 版本: [e.g. 4.0.0] 2.5.0
  • umi 版本 4.0.68
  • 浏览器环境 chrome
  • 开发环境 [e.g. mac OS] mac

🚑 其他信息

@ZouJingyang
Copy link

遇到了类似的问题,目前看来BetaSchemaForm对formList的支持不是很好,只能自己renderFormItem来控制当前行的数据

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants