Skip to content

Commit 5bfd5ca

Browse files
authored
fix: remove Table deadCode (#8966)
1 parent 4c1ac5d commit 5bfd5ca

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

packages/table/src/Table.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ function TableRender<T extends Record<string, any>, U, ValueType>(
213213
rowSelection: rowSelection === false ? undefined : rowSelection,
214214
className: tableClassName,
215215
style: tableStyle,
216-
columns: columns.map((item) =>
217-
item.isExtraColumns ? item.extraColumn : item,
218-
),
216+
columns,
219217
loading: action.loading,
220218
dataSource: editableUtils.newLineRecord
221219
? editableDataSource(action.dataSource)

packages/table/src/utils/genProColumnToColumn.tsx

+1-26
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import { genColumnKey } from './index';
2323

2424
type ColumnToColumnReturnType<T> = (TableColumnType<T> & {
2525
index?: number;
26-
isExtraColumns?: boolean;
27-
extraColumn?: typeof Table.EXPAND_COLUMN | typeof Table.SELECTION_COLUMN;
2826
})[];
2927

3028
type ColumnToColumnParams<T> = {
@@ -84,25 +82,6 @@ export function genProColumnToColumn<T extends AnyObject>(
8482
...columnProps,
8583
};
8684
}
87-
88-
/**
89-
* 是不是展开行和多选按钮
90-
*/
91-
const isExtraColumns =
92-
columnProps === Table.EXPAND_COLUMN ||
93-
columnProps === Table.SELECTION_COLUMN;
94-
95-
if (isExtraColumns) {
96-
return {
97-
index: columnsIndex,
98-
isExtraColumns: true,
99-
hideInSearch: true,
100-
hideInTable: false,
101-
hideInForm: true,
102-
hideInSetting: true,
103-
extraColumn: columnProps,
104-
};
105-
}
10685
const config = counter.columnsMap[columnKey] || {
10786
fixed: columnProps.fixed,
10887
};
@@ -184,9 +163,5 @@ export function genProColumnToColumn<T extends AnyObject>(
184163
};
185164
return omitUndefinedAndEmptyArr(tempColumns);
186165
})
187-
?.filter((item) => !item.hideInTable) as unknown as (TableColumnType<T> & {
188-
index?: number;
189-
isExtraColumns?: boolean;
190-
extraColumn?: typeof Table.EXPAND_COLUMN | typeof Table.SELECTION_COLUMN;
191-
})[];
166+
?.filter((item) => !item.hideInTable) as unknown as ColumnToColumnReturnType<T>;
192167
}

0 commit comments

Comments
 (0)