@@ -798,6 +798,9 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
798798 this . rowHierarchyType === 'grid-tree'
799799 ? this . _getRowHeaderTreeExpandedMaxLevelCount ( ) || this . rowHeaderLevelCount
800800 : this . rowHeaderLevelCount ;
801+ if ( colLevelCount === 0 || rowLevelCount === 0 ) {
802+ return results ;
803+ }
801804 if ( this . cornerSetting . titleOnDimension === 'all' ) {
802805 if ( this . indicatorsAsCol ) {
803806 if ( colDimensionKeys ) {
@@ -1581,7 +1584,10 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
15811584 ! this . dataset . customColTree ?. length //根据情况来加的判断条件 之前是只兼容没有设置两个自定义树的情况 现在对有自定义树的情况也处理出现角头
15821585 // && !this.dataset.customRowTree?.length
15831586 ) {
1584- if ( this . cornerSetting . titleOnDimension === 'row' && this . cornerSetting . forceShowHeader ) {
1587+ if (
1588+ ( this . cornerSetting . titleOnDimension === 'row' || this . cornerSetting . titleOnDimension === 'all' ) &&
1589+ this . cornerSetting . forceShowHeader
1590+ ) {
15851591 count = 1 ;
15861592 } else if (
15871593 ! this . _table . isPivotChart ( ) &&
@@ -1658,7 +1664,10 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
16581664 // && !this.dataset.customColTree
16591665 ! this . dataset . customRowTree ?. length //根据情况来加的判断条件 之前是只兼容没有设置两个自定义树的情况 现在对有自定义树的情况也处理出现角头
16601666 ) {
1661- if ( this . cornerSetting . titleOnDimension === 'column' && this . cornerSetting . forceShowHeader ) {
1667+ if (
1668+ ( this . cornerSetting . titleOnDimension === 'column' || this . cornerSetting . titleOnDimension === 'all' ) &&
1669+ this . cornerSetting . forceShowHeader
1670+ ) {
16621671 count = 1 ;
16631672 } else if (
16641673 ! this . _table . isPivotChart ( ) &&
@@ -1714,17 +1723,20 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
17141723 this . _rowHeaderLevelCount = count ;
17151724 }
17161725 get colCount ( ) : number {
1717- return (
1718- ( this . _getColumnHeaderTreeExpandedMaxLevelCount ( ) > 0 ||
1726+ let bodyColCount ;
1727+ if (
1728+ this . _getColumnHeaderTreeExpandedMaxLevelCount ( ) > 0 ||
17191729 this . _table . isPivotChart ( ) ||
17201730 ( this . dataset . records as Array < any > ) ?. length > 0 ||
17211731 ( this . dataset . records && ! Array . isArray ( this . dataset . records ) )
1722- ? this . _columnHeaderCellIds [ 0 ] ?. length ?? this . columnDimensionTree . tree . size
1723- : 0 ) +
1724- this . rowHeaderLevelCount +
1725- this . rightHeaderColCount +
1726- this . leftRowSeriesNumberColumnCount
1727- ) ; // 小心rightFrozenColCount和colCount的循环引用 造成调用栈溢出
1732+ ) {
1733+ bodyColCount =
1734+ ( this . _columnHeaderCellIds [ 0 ] ?. length ?? this . columnDimensionTree . tree . size ) ||
1735+ ( this . _indicators ?. length > 0 ? 1 : 0 ) ;
1736+ } else {
1737+ bodyColCount = 0 ;
1738+ }
1739+ return bodyColCount + this . rowHeaderLevelCount + this . rightHeaderColCount + this . leftRowSeriesNumberColumnCount ; // 小心rightFrozenColCount和colCount的循环引用 造成调用栈溢出
17281740 }
17291741 get rowCount ( ) : number {
17301742 return (
@@ -1740,7 +1752,6 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
17401752 this . columnHeaderLevelCount +
17411753 this . bottomHeaderRowCount // 小心bottomFrozenRowCount和rowCount的循环引用 造成调用栈溢出
17421754 ) ;
1743- // return (this._rowHeaderCellIds?.length ?? 0) + this.columnHeaderLevelCount + this.bottomFrozenRowCount;
17441755 }
17451756 get bodyRowSpanCount ( ) {
17461757 return this . rowDimensionTree . tree . size ;
0 commit comments