fix: table scrollbar issue in non-config mode (#5599)

* fix: unnecessary scrollbar in non-config mode with few columns

* fix: bug

* refactor: table column
This commit is contained in:
Katherine 2024-11-07 17:30:53 +08:00 committed by GitHub
parent 03f5899902
commit 89269ec7a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 6 deletions

View File

@ -2,9 +2,7 @@
"version": "1.4.0-alpha.2",
"npmClient": "yarn",
"useWorkspaces": true,
"npmClientArgs": [
"--ignore-engines"
],
"npmClientArgs": ["--ignore-engines"],
"command": {
"version": {
"forcePublish": true,

View File

@ -164,7 +164,7 @@ const useTableColumns = (props: { showDel?: any; isSubTable?: boolean }, paginat
return columns;
}
const res = [
...columns,
...adjustColumnOrder(columns),
{
title: render(),
dataIndex: 'TABLE_COLUMN_INITIALIZER',
@ -210,7 +210,7 @@ const useTableColumns = (props: { showDel?: any; isSubTable?: boolean }, paginat
});
}
return adjustColumnOrder(res);
return res;
}, [columns, exists, field, render, props.showDel, designable]);
return tableColumns;

View File

@ -65,7 +65,16 @@ const useTableColumns = () => {
{/* fix https://nocobase.height.app/T-3232/description */}
{/* 如果作为关系表格区块,则 parentRecordData 应该有值;如果作为普通表格使用(如数据源管理页面的表格)则应该使用 recordData且 parentRecordData 为空 */}
<RecordProvider record={record} parent={parentRecordData || recordData}>
<span
role="button"
className={css`
.ant-space-gap-col-small {
column-gap: 10px;
}
`}
>
<RecursionField schema={s} name={record.__index || index} onlyRenderProperties />
</span>
</RecordProvider>
</RecordIndexProvider>
);