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);
|
// const trStyle = headerHeight&&!fixed ? { height: headerHeight } : (fixed ? this.getHeaderRowStyle(columns, rows) : null);
|
||||||
var trStyle = fixed ? this.getHeaderRowStyle(columns, rows) : headerHeight ? { height: headerHeight } : null;
|
var trStyle = fixed ? this.getHeaderRowStyle(columns, rows) : headerHeight ? { height: headerHeight } : null;
|
||||||
if (!fixed && tableSizeConf && tableSizeConf.headerHeight) {
|
if (tableSizeConf && tableSizeConf.headerHeight) {
|
||||||
trStyle = {
|
trStyle = {
|
||||||
height: tableSizeConf.headerHeight,
|
height: tableSizeConf.headerHeight,
|
||||||
fontSize: tableSizeConf.fontSize
|
fontSize: tableSizeConf.fontSize
|
||||||
|
@ -849,7 +849,7 @@ var Table = function (_Component) {
|
||||||
height = fixedColumnsBodyRowsHeight[fixedIndex];
|
height = fixedColumnsBodyRowsHeight[fixedIndex];
|
||||||
}
|
}
|
||||||
// 如果切换了配置,以自定义配置的高度为准
|
// 如果切换了配置,以自定义配置的高度为准
|
||||||
if (!fixed && !props.heightConsistent && tableSizeConf && tableSizeConf.headerHeight) {
|
if (tableSizeConf && tableSizeConf.headerHeight) {
|
||||||
height = tableSizeConf.height;
|
height = tableSizeConf.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import React, { Component } from "react";
|
||||||
import Table from "../../src";
|
import Table from "../../src";
|
||||||
|
|
||||||
const columns = [
|
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: "org", key: "org", width: 200 },
|
||||||
{ title: "供应商", dataIndex: "supplier", key: "supplier", width: 100 },
|
{ title: "供应商", dataIndex: "supplier", key: "supplier", width: 100 },
|
||||||
{ title: "订单日期", dataIndex: "orderDate", key: "orderDate", width: 150 },
|
{ title: "订单日期", dataIndex: "orderDate", key: "orderDate", width: 150 },
|
||||||
|
@ -16,7 +16,7 @@ const columns = [
|
||||||
{ title: "单据状态", dataIndex: "status", key: "status", width: 100 },
|
{ title: "单据状态", dataIndex: "status", key: "status", width: 100 },
|
||||||
{ title: "提交人", dataIndex: "submitter", key: "submitter", width: 100 },
|
{ title: "提交人", dataIndex: "submitter", key: "submitter", width: 100 },
|
||||||
{ title: "单位", dataIndex: "unit", key: "unit", 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 = [
|
const data = [
|
||||||
|
@ -79,6 +79,8 @@ class Demo0 extends Component {
|
||||||
<Table
|
<Table
|
||||||
canConfigureTableSize={true}
|
canConfigureTableSize={true}
|
||||||
getToolbarContainer={this.getToolbarContainer}
|
getToolbarContainer={this.getToolbarContainer}
|
||||||
|
height={30}
|
||||||
|
headerHeight={35}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={data}
|
data={data}
|
||||||
onRowClick={(record, index, indent) => {
|
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",
|
"name": "bee-table",
|
||||||
"version": "2.0.8-nc.10",
|
"version": "2.0.8-nc.11",
|
||||||
"description": "Table ui component for react",
|
"description": "Table ui component for react",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
|
|
|
@ -378,7 +378,7 @@ class Table extends Component {
|
||||||
|
|
||||||
// const trStyle = headerHeight&&!fixed ? { height: headerHeight } : (fixed ? this.getHeaderRowStyle(columns, rows) : null);
|
// const trStyle = headerHeight&&!fixed ? { height: headerHeight } : (fixed ? this.getHeaderRowStyle(columns, rows) : null);
|
||||||
let trStyle = fixed ? this.getHeaderRowStyle(columns, rows) : ( headerHeight ? { height: headerHeight } : null );
|
let trStyle = fixed ? this.getHeaderRowStyle(columns, rows) : ( headerHeight ? { height: headerHeight } : null );
|
||||||
if( !fixed && tableSizeConf && tableSizeConf.headerHeight ){
|
if( tableSizeConf && tableSizeConf.headerHeight ){
|
||||||
trStyle = {
|
trStyle = {
|
||||||
height : tableSizeConf.headerHeight,
|
height : tableSizeConf.headerHeight,
|
||||||
fontSize : tableSizeConf.fontSize
|
fontSize : tableSizeConf.fontSize
|
||||||
|
@ -614,7 +614,7 @@ class Table extends Component {
|
||||||
height = fixedColumnsBodyRowsHeight[fixedIndex];
|
height = fixedColumnsBodyRowsHeight[fixedIndex];
|
||||||
}
|
}
|
||||||
// 如果切换了配置,以自定义配置的高度为准
|
// 如果切换了配置,以自定义配置的高度为准
|
||||||
if( !fixed && !props.heightConsistent && tableSizeConf && tableSizeConf.headerHeight ){
|
if( tableSizeConf && tableSizeConf.headerHeight ){
|
||||||
height = tableSizeConf.height;
|
height = tableSizeConf.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue