zy-react-library 1.0.46 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,7 +11,9 @@ export type TableProProps<DataSource, U, ValueType> = Omit<TableProps, 'columns'
|
|
|
11
11
|
/** 是否禁用内容区滚动,默认 false */
|
|
12
12
|
disabledResizer?: boolean;
|
|
13
13
|
/** 是否显示索引列,默认 true */
|
|
14
|
-
|
|
14
|
+
showIndexColumn?: boolean;
|
|
15
|
+
/** 索引列是否固定,默认 left */
|
|
16
|
+
indexColumnFixed?: "left" | "right" | boolean;
|
|
15
17
|
/** 是否使用居中布局,默认 true */
|
|
16
18
|
useAlignCenter?: boolean;
|
|
17
19
|
}
|
|
@@ -5,15 +5,16 @@ import "./index.less";
|
|
|
5
5
|
function TablePro(props) {
|
|
6
6
|
const {
|
|
7
7
|
columns = [],
|
|
8
|
-
|
|
8
|
+
showIndexColumn = true,
|
|
9
9
|
useAlignCenter = true,
|
|
10
|
+
indexColumnFixed = "left",
|
|
10
11
|
rowKey = "id",
|
|
11
12
|
...restProps
|
|
12
13
|
} = props;
|
|
13
14
|
|
|
14
15
|
const storeIndex = props.storeIndex || `${window.process.env.app.antd["ant-prefix"]}_${Math.random().toString(36).substring(2)}`;
|
|
15
16
|
function calcColumns() {
|
|
16
|
-
|
|
17
|
+
showIndexColumn && columns.unshift({...getIndexColumn(props.pagination), fixed: indexColumnFixed});
|
|
17
18
|
return columns.map(item => ({ align: useAlignCenter ? "center" : "left", ...item }));
|
|
18
19
|
}
|
|
19
20
|
return <Table rowKey={rowKey} storeIndex={storeIndex} columns={calcColumns()} {...restProps} />;
|