TableRender 在使用搜索栏是否折叠的时候,当展开折叠,Select 组件里的 options 会丢失
a850835125 opened this issue · comments
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