fix:配置的行高,优先级大于height
This commit is contained in:
parent
c805b95e7e
commit
04fd93bc4b
|
@ -599,7 +599,7 @@ var Table = function (_Component) {
|
|||
|
||||
// const trStyle = headerHeight&&!fixed ? { height: headerHeight } : (fixed ? this.getHeaderRowStyle(columns, rows) : null);
|
||||
var trStyle = fixed ? this.getHeaderRowStyle(columns, rows) : headerHeight ? { height: headerHeight } : null;
|
||||
if (!fixed && tableSizeConf && tableSizeConf.headerHeight) {
|
||||
if (tableSizeConf && tableSizeConf.headerHeight) {
|
||||
trStyle = {
|
||||
height: tableSizeConf.headerHeight,
|
||||
fontSize: tableSizeConf.fontSize
|
||||
|
@ -849,7 +849,7 @@ var Table = function (_Component) {
|
|||
height = fixedColumnsBodyRowsHeight[fixedIndex];
|
||||
}
|
||||
// 如果切换了配置,以自定义配置的高度为准
|
||||
if (!fixed && !props.heightConsistent && tableSizeConf && tableSizeConf.headerHeight) {
|
||||
if (tableSizeConf && tableSizeConf.headerHeight) {
|
||||
height = tableSizeConf.height;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import React, { Component } from "react";
|
|||
import Table from "../../src";
|
||||
|
||||
const columns = [
|
||||
{ title: "订单编号", dataIndex: "orderNum", key: "orderNum", width: 100 },
|
||||
{ title: "订单编号", dataIndex: "orderNum", key: "orderNum", fixed: 'left',width: 100 },
|
||||
{ title: "采购组织", dataIndex: "org", key: "org", width: 200 },
|
||||
{ title: "供应商", dataIndex: "supplier", key: "supplier", width: 100 },
|
||||
{ title: "订单日期", dataIndex: "orderDate", key: "orderDate", width: 150 },
|
||||
|
@ -16,7 +16,7 @@ const columns = [
|
|||
{ title: "单据状态", dataIndex: "status", key: "status", width: 100 },
|
||||
{ title: "提交人", dataIndex: "submitter", key: "submitter", width: 100 },
|
||||
{ title: "单位", dataIndex: "unit", key: "unit", width: 100 },
|
||||
{ title: "总税价合计", dataIndex: "sum", key: "sum", width: 100 },
|
||||
{ title: "总税价合计", dataIndex: "sum", key: "sum", fixed: 'right', width: 100 },
|
||||
];
|
||||
|
||||
const data = [
|
||||
|
@ -79,6 +79,8 @@ class Demo0 extends Component {
|
|||
<Table
|
||||
canConfigureTableSize={true}
|
||||
getToolbarContainer={this.getToolbarContainer}
|
||||
height={30}
|
||||
headerHeight={35}
|
||||
columns={columns}
|
||||
data={data}
|
||||
onRowClick={(record, index, indent) => {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bee-table",
|
||||
"version": "2.0.8-nc.10",
|
||||
"version": "2.0.8-nc.11",
|
||||
"description": "Table ui component for react",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
|
|
@ -378,7 +378,7 @@ class Table extends Component {
|
|||
|
||||
// const trStyle = headerHeight&&!fixed ? { height: headerHeight } : (fixed ? this.getHeaderRowStyle(columns, rows) : null);
|
||||
let trStyle = fixed ? this.getHeaderRowStyle(columns, rows) : ( headerHeight ? { height: headerHeight } : null );
|
||||
if( !fixed && tableSizeConf && tableSizeConf.headerHeight ){
|
||||
if( tableSizeConf && tableSizeConf.headerHeight ){
|
||||
trStyle = {
|
||||
height : tableSizeConf.headerHeight,
|
||||
fontSize : tableSizeConf.fontSize
|
||||
|
@ -614,7 +614,7 @@ class Table extends Component {
|
|||
height = fixedColumnsBodyRowsHeight[fixedIndex];
|
||||
}
|
||||
// 如果切换了配置,以自定义配置的高度为准
|
||||
if( !fixed && !props.heightConsistent && tableSizeConf && tableSizeConf.headerHeight ){
|
||||
if( tableSizeConf && tableSizeConf.headerHeight ){
|
||||
height = tableSizeConf.height;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue