Skip to content

Commit 675dff7

Browse files
author
liyuan-meng
committed
feat: 表格支持配置列的展示和隐藏(复杂模式,支持拖拽和重置)
1 parent ec35eb2 commit 675dff7

6 files changed

Lines changed: 10 additions & 14 deletions

File tree

src/components/c-table/css/business.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@
478478
display: flex;
479479
align-items: center;
480480
gap: 4px;
481+
margin-left: 4px;
481482

482483
i {
483484
color: @gray-6;

src/components/c-table/demos/config-column-basic.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export default function CTableDemo() {
132132
style={{ height: 500, marginTop: 20 }}
133133
ref={tableRef}
134134
supportPage
135-
supportCheckbox
136135
columnData={columns}
137136
supportConfigColumn
138137
defaultShowColumns={columns.slice(0, 4).map(item => item.dataIndex)}

src/components/c-table/demos/config-column.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export default function CTableDemo() {
132132
style={{ height: 500, marginTop: 20 }}
133133
ref={tableRef}
134134
supportPage
135-
supportCheckbox
136135
columnData={columns}
137136
supportConfigColumn
138137
defaultShowColumns={columns.slice(0, 4).map(item => item.dataIndex)}

src/components/c-table/index.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -374,28 +374,25 @@ this.tableRef.current.setColumn(columnData, isReloadGrid?);
374374

375375
<embed src="@components/c-table/demos/splitTable.md" />
376376

377-
### 标准化表格-数值类型
377+
### 标准化列表格
378378

379+
#### 数值类型
379380
<embed src="@components/c-table/demos/uniform_number.md" />
380381

381-
### 标准化表格-时间类型
382-
382+
#### 时间类型
383383
<embed src="@components/c-table/demos/uniform_time.md" />
384384

385-
### 标准化表格-时间范围类型
386-
385+
#### 时间范围类型
387386
<embed src="@components/c-table/demos/uniform_time_range.md" />
388387

389-
### 标准化表格-文本类型
388+
#### 文本类型
390389

391390
<embed src="@components/c-table/demos/uniform_text.md" />
392391

393-
### 标准化表格-标签类型
394-
392+
#### 标签类型
395393
<embed src="@components/c-table/demos/uniform_tag.md" />
396394

397-
### 标准化表格-使用列模板形式
398-
395+
#### 使用列模板形式
399396
<embed src="@components/c-table/demos/uniform_tpl.md" />
400397

401398
### 解决方案

src/components/c-table/js/columnConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class ColumnConfig extends Component {
8787
return (
8888
<section className={`${tablePrefixCls}-tooltip-complex`}>
8989
<p className={`${tablePrefixCls}-tooltip-complex-title`}>配置列的显示状态</p>
90-
<div style={{ maxHeight: columnConfigPanelHeight - 92 - 24, overflow: 'auto' }}>
90+
<div style={{ maxHeight: columnConfigPanelHeight - 128, overflow: 'auto' }}>
9191
<ReactDragListView
9292
onDragEnd={this.onDragEnd}
9393
handleSelector={`.${dragSelector}`}

src/components/popover/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function Popover(props) {
4646
&& (ele.classList.contains(cancelBtnClass)
4747
|| ele.classList.contains(confirmBtnClass)
4848
|| ele.classList.contains(closeIconClass)
49-
|| ignoreClassList.find(c => ele.classList.contains(c))),
49+
|| ignoreClassList?.find(c => ele.classList.contains(c))),
5050
);
5151

5252
const handleCancelClick = () => {

0 commit comments

Comments
 (0)