File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed
pages/MainPage/pages/VizPage/ChartPreview Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,14 @@ const ChartDrillContextMenu: FC<{}> = memo(({ children }) => {
5757 { ! ! currentDrillLevel && (
5858 < Menu . Item key = { 'rollUp' } > { t ( 'rollUp' ) } </ Menu . Item >
5959 ) }
60- { drillOption ?. mode !== DrillMode . Expand && (
61- < Menu . Item key = { DrillMode . Drill } > { t ( 'showNextLevel' ) } </ Menu . Item >
62- ) }
63- { drillOption ?. mode !== DrillMode . Drill && (
64- < Menu . Item key = { DrillMode . Expand } > { t ( 'expandNextLevel' ) } </ Menu . Item >
65- ) }
60+ { drillOption ?. mode !== DrillMode . Expand &&
61+ ! drillOption ?. isBottomLevel && (
62+ < Menu . Item key = { DrillMode . Drill } > { t ( 'showNextLevel' ) } </ Menu . Item >
63+ ) }
64+ { drillOption ?. mode !== DrillMode . Drill &&
65+ ! drillOption ?. isBottomLevel && (
66+ < Menu . Item key = { DrillMode . Expand } > { t ( 'expandNextLevel' ) } </ Menu . Item >
67+ ) }
6668 { drillOption ?. mode !== DrillMode . Expand && (
6769 < Menu . Item key = "selectDrillStatus" >
6870 < MenuSwitch
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ export class ChartDrillOption implements IChartDrillOption {
5959 return this . isSelected ;
6060 }
6161
62+ public get isBottomLevel ( ) {
63+ return this . cursor + 2 === this . drillFields . length ;
64+ }
65+
6266 public get canSelect ( ) {
6367 return isEmptyArray ( this . expandDownFields ) ;
6468 }
Original file line number Diff line number Diff line change @@ -159,7 +159,10 @@ const ChartPreviewBoard: FC<{
159159 {
160160 name : 'click' ,
161161 callback : param => {
162- if ( drillOptionRef . current ?. isSelectedDrill ) {
162+ if (
163+ drillOptionRef . current ?. isSelectedDrill &&
164+ ! drillOptionRef . current . isBottomLevel
165+ ) {
163166 const option = drillOptionRef . current ;
164167 option . drillDown ( param . data . rowData ) ;
165168 drillOptionRef . current = option ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { ChartDataSectionField } from 'app/types/ChartConfig';
2121export interface IChartDrillOption {
2222 mode : DrillMode ;
2323 isSelectedDrill : boolean ;
24+ isBottomLevel : boolean ;
2425 canSelect : boolean ;
2526 toggleSelectedDrill ( enable ?: boolean ) : void ;
2627 getAllFields ( ) : ChartDataSectionField [ ] ;
You can’t perform that action at this time.
0 commit comments