@@ -94,10 +94,6 @@ function updateComponent(
9494 computeRectCellRangeStartCol ,
9595 computeRectCellRangeStartRow
9696 ) . globalAABBBounds ;
97- const lastCellBound = scene . highPerformanceGetCell (
98- computeRectCellRangeEndCol ,
99- computeRectCellRangeEndRow
100- ) . globalAABBBounds ;
10197
10298 selectComp . rect . setAttributes ( {
10399 x : firstCellBound . x1 - scene . tableGroup . attribute . x , //坐标xy在下面的逻辑中会做适当调整
@@ -107,12 +103,50 @@ function updateComponent(
107103 visible : true
108104 } ) ;
109105 if ( selectComp . fillhandle ) {
106+ const fillHandle = scene . table . options . excelOptions ?. fillHandle ;
107+ let visible = true ;
108+ if ( typeof fillHandle === 'function' ) {
109+ visible = fillHandle ( { selectRanges : scene . table . stateManager . select . ranges , table : scene . table } ) ;
110+ }
111+ //#region 计算填充柄小方块的位置
112+
113+ let lastCellBound ;
114+ //当选择区域没有到到最后一列时
115+ if ( computeRectCellRangeEndCol < table . colCount - 1 ) {
116+ lastCellBound = scene . highPerformanceGetCell (
117+ computeRectCellRangeEndCol ,
118+ computeRectCellRangeEndRow
119+ ) . globalAABBBounds ;
120+ } else {
121+ // 最后一列
122+ lastCellBound = scene . highPerformanceGetCell (
123+ computeRectCellRangeStartCol - 1 ,
124+ computeRectCellRangeEndRow
125+ ) . globalAABBBounds ;
126+ }
127+ const handlerX = lastCellBound . x2 - scene . tableGroup . attribute . x - 3 ;
128+ //当选择区域没有到到最后一行时
129+ if ( computeRectCellRangeEndRow < table . rowCount - 1 ) {
130+ lastCellBound = scene . highPerformanceGetCell (
131+ computeRectCellRangeEndCol ,
132+ computeRectCellRangeEndRow
133+ ) . globalAABBBounds ;
134+ } else {
135+ // 最后一行
136+ lastCellBound = scene . highPerformanceGetCell (
137+ computeRectCellRangeEndCol ,
138+ computeRectCellRangeStartRow - 1
139+ ) . globalAABBBounds ;
140+ }
141+ const handlerY = lastCellBound . y2 - scene . tableGroup . attribute . y - 3 ;
142+ //#endregion
143+
110144 selectComp . fillhandle ?. setAttributes ( {
111- x : lastCellBound . x2 - scene . tableGroup . attribute . x - 3 , // 调整小方块位置
112- y : lastCellBound . y2 - scene . tableGroup . attribute . y - 3 , // 调整小方块位置
145+ x : handlerX , // 调整小方块位置
146+ y : handlerY , // 调整小方块位置
113147 width : 6 ,
114148 height : 6 ,
115- visible : true
149+ visible
116150 } ) ;
117151 }
118152
0 commit comments