Skip to content

Commit

Permalink
feat: 发布
Browse files Browse the repository at this point in the history
  • Loading branch information
lhbxs committed Jan 24, 2024
1 parent 78d84cb commit 789a791
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
3 changes: 3 additions & 0 deletions packages/form-render/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 更新日志

### 2.3.9
- [+] TableList 增加 hideEmptyTable 属性

### 2.3.8
- [!] 修复 schema 多层嵌套下,getSchemaByPath 获取异常

Expand Down
2 changes: 1 addition & 1 deletion packages/form-render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "form-render",
"version": "2.3.8",
"version": "2.3.9",
"description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成",
"keywords": [
"Form",
Expand Down
2 changes: 1 addition & 1 deletion packages/form-render/src/widgets/listTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface ListTableProps {
/*
* 没有数据时是否隐藏表格
*/
emptyHiddenTable?: boolean;
hideEmptyTable?: boolean;
[key: string]: any;
};

Expand Down
27 changes: 18 additions & 9 deletions packages/form-render/src/widgets/listVirtual/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ interface ListVirtualProps {
delConfirmProps: any;
renderCore: any;
rootPath: any;
/*
* 没有数据时是否隐藏表格
*/
hideEmptyTable?: boolean;
[key: string]: any;
};

Expand Down Expand Up @@ -58,6 +62,7 @@ const VirtualList: React.FC<ListVirtualProps> = (props) => {
hideMove,
hideAdd,
hideOperate,
hideEmptyTable,

addItem,
copyItem,
Expand Down Expand Up @@ -180,17 +185,21 @@ const VirtualList: React.FC<ListVirtualProps> = (props) => {
});
}

const showTable = fields.length > 0 ? true : !hideEmptyTable;

return (
<>
<Table
className={classnames('fr-virtual-list', { 'fr-virtual-list-no-popover': !islidatePopover })}
size='middle'
columns={columns}
dataSource={fields}
pagination={false}
scroll={{ y: scrollY }}
components={vt}
/>
{showTable && (
<Table
className={classnames('fr-virtual-list', { 'fr-virtual-list-no-popover': !islidatePopover })}
size='middle'
columns={columns}
dataSource={fields}
pagination={false}
scroll={{ y: scrollY }}
components={vt}
/>
)}
{(!schema.max || fields.length < schema.max) && !hideAdd && (
<Button
icon={<PlusOutlined />}
Expand Down

0 comments on commit 789a791

Please sign in to comment.