rapid-spreadjs 1.0.134 → 1.0.135

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1370,11 +1370,13 @@ const BusinessUtils = {
1370
1370
  * @param GC GC对象
1371
1371
  * @param spread 工作簿实例
1372
1372
  * @param dynamicLoadRangeJson 动态加载的“试验结果”JSON数组范围,格式如:[{row: 1, col: 1, rowCount: 1, colCount: 1}]
1373
+ * @param headerRangeHeight 表头区域总高度
1374
+ * @param footerRangeHeight 表尾区域总高度
1373
1375
  * @param pageDir 页面方向(1:纵向、2:横向)
1374
1376
  * @param blankRowCellValue 空白行单元格值,默认为:空白
1375
1377
  * @returns 返回所有需要显示和隐藏的行索引结果对象,格式如:{hasValueIndex: [1, 2, 3], noValueIndex: [4, 5, 6]},hasValueIndex代表所有显示的行索引,noValueIndex代表所有隐藏的行索引
1376
1378
  */
1377
- dynamicLoadRows: (GC, spread, dynamicLoadRangeJson, pageDir = 1, blankRowCellValue = '空白') => {
1379
+ dynamicLoadRows: (GC, spread, dynamicLoadRangeJson, headerRangeHeight, footerRangeHeight, pageDir = 1, blankRowCellValue = '空白') => {
1378
1380
  const sheet = spread.getActiveSheet();
1379
1381
  // 暂停绘制
1380
1382
  sheet.suspendPaint();
@@ -1454,7 +1456,9 @@ const BusinessUtils = {
1454
1456
  /** 创建空白行单元格 */
1455
1457
  const createBlackRowCell = () => {
1456
1458
  // 工作表总高度
1457
- const sheetTotalHeight = pageDir ? 1055 : 615;
1459
+ const sheetTotalHeight = pageDir == 1 ? 1055 : 615;
1460
+ // 之前已经创建的空白行索引
1461
+ let createBlackRowIndex = -1;
1458
1462
  // 获取所有可见行的总高度
1459
1463
  let allRowHeight = 0;
1460
1464
  for (let i = 0; i < sheet.getRowCount(); i++) {
@@ -1463,6 +1467,23 @@ const BusinessUtils = {
1463
1467
  if (curRowVisible && (blankRowCell == null || blankRowCell == undefined || blankRowCell != 'BlankCell')) {
1464
1468
  allRowHeight += sheet.getRowHeight(i);
1465
1469
  }
1470
+ // 设置已创建的空白行索引
1471
+ if (blankRowCell == 'BlankCell') {
1472
+ createBlackRowIndex = i;
1473
+ }
1474
+ }
1475
+ // 针对纵表情况,工作表总高度-表头和表尾总高度>=550,空白行不显示;<550,空白行显示
1476
+ // 是否显示空白行
1477
+ let isShowBlankRow = true;
1478
+ if (pageDir == 1 && allRowHeight - headerRangeHeight - footerRangeHeight >= 550) {
1479
+ isShowBlankRow = false;
1480
+ }
1481
+ if (!isShowBlankRow) {
1482
+ // 设置行不可见
1483
+ if (createBlackRowIndex != -1) {
1484
+ sheet.setRowVisible(createBlackRowIndex, false);
1485
+ }
1486
+ return;
1466
1487
  }
1467
1488
  // 获取到最后一行动态加载区域的行索引
1468
1489
  const lastRowIndex = rowCells[rowCells.length - 1].rows[rowCells[rowCells.length - 1].rows.length - 1].row;