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

TableRender 在使用搜索栏是否折叠的时候,当展开折叠,Select 组件里的 options 会丢失 #1512

Open
a850835125 opened this issue Apr 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working form form-render

Comments

@a850835125
Copy link

1.依赖仓库的版本(Dependencies versions)

  • react:18.2.0
  • form-render:2.4.4
  • table-render: 2.1.4
  • antd:5.4.0

2.问题描述(Bug description)
在使用 TableRender 的时候,添加了 collapsed: true ,当折叠展开的时候,Select 组件里的 options 会丢失
3.出现问题的 schema demo(Reproduction schema demo)

export const schema = {
  type: 'object',
  properties: {
    handleNumber: {
      title: '受理号码',
      type: 'string',
    },
    managerPhone: {
      title: '客户经理号码',
      type: 'string',
    },
    agencyName: {
      title: '企业名称',
      type: 'string',
    },
    linkMan: {
      title: '企业联系人',
      type: 'string',
    },
    productCode: {
      title: '受理类型',
      type: 'string',
      widget: 'select',
    },
  }
}

4.最小复现 demo(Reproduction demo)
export default () => {
const tableHeight = useTableScroll({});
const tableRef = useRef()
const onMount = async () => {
const { data: productList } = await getProductList()
const tags = tagList.map(m => ({ label: m.tagsName, value: m.tagsId }))
const channels = channelList.map((m: any) => ({ label: m.channelName, value: m.channelId }))
tableRef.current.form.setSchema({
productCode: {
props: {
options: [...productList]
}
}
})
}

return (
<TableRender
ref={tableRef}
search={{ schema, onMount, collapsed: true, defaultCollapsed: true, widgets: { AreaSelect }, column: 3}}
columns={columns}
request={getOrderList}
scroll={{
y: tableHeight,
}}
rowKey="orderId"
/>
);
};

form-render demo https://codesandbox.io/s/unruffled-flower-jl78h
table-render demo https://codesandbox.io/s/sweet-euler-bdoty
fr-generator demo https://codesandbox.io/s/s13sh

@lhbxs lhbxs closed this as completed May 17, 2024
@lhbxs lhbxs added bug Something isn't working form form-render labels May 17, 2024
@lhbxs lhbxs reopened this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working form form-render
Projects
None yet
Development

No branches or pull requests

2 participants