rapid-spreadjs 1.0.162 → 1.0.164
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 +27 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +27 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/utils/business.d.ts +6 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1392,12 +1392,14 @@ const BusinessUtils = {
|
|
|
1392
1392
|
* @param dynamicLoadRangeJson 动态加载的“试验结果”JSON数组范围,格式如:[{row: 1, col: 1, rowCount: 1, colCount: 1}]
|
|
1393
1393
|
* @param headerRangeHeight 表头区域总高度
|
|
1394
1394
|
* @param footerRangeHeight 表尾区域总高度
|
|
1395
|
+
* @param isEnable 是否启用动态加载行,默认为:true(true:启用动态加载行,false:不启用动态加载行)
|
|
1396
|
+
* @param ended 绘制完成后的回调函数,返回一个参数rowIndex,格式如:{hasValueIndex: [1, 2, 3], noValueIndex: [4, 5, 6]},hasValueIndex代表所有显示的行索引,noValueIndex代表所有隐藏的行索引
|
|
1395
1397
|
* @param remainingHeight 剩余高度(针对纵表情况,工作表总高度-表头和表尾总高度>=remainingHeight,空白行不显示;<remainingHeight,空白行显示)
|
|
1396
1398
|
* @param pageDir 页面方向(1:纵向、2:横向)
|
|
1397
1399
|
* @param blankRowCellValue 空白行单元格值,默认为:空白
|
|
1398
1400
|
* @returns 返回所有需要显示和隐藏的行索引结果对象,格式如:{hasValueIndex: [1, 2, 3], noValueIndex: [4, 5, 6]},hasValueIndex代表所有显示的行索引,noValueIndex代表所有隐藏的行索引
|
|
1399
1401
|
*/
|
|
1400
|
-
dynamicLoadRows: (GC, spread, dynamicLoadRangeJson, headerRangeHeight, footerRangeHeight, remainingHeight = 500, pageDir = 1, blankRowCellValue = '空白') => {
|
|
1402
|
+
dynamicLoadRows: (GC, spread, dynamicLoadRangeJson, headerRangeHeight, footerRangeHeight, isEnable = true, ended = null, remainingHeight = 500, pageDir = 1, blankRowCellValue = '空白') => {
|
|
1401
1403
|
const sheet = spread.getActiveSheet();
|
|
1402
1404
|
// 暂停绘制
|
|
1403
1405
|
sheet.suspendPaint();
|
|
@@ -1544,7 +1546,7 @@ const BusinessUtils = {
|
|
|
1544
1546
|
}
|
|
1545
1547
|
if (!isShowBlankRow) {
|
|
1546
1548
|
// 设置行不可见
|
|
1547
|
-
if (createBlackRowIndex != -1) {
|
|
1549
|
+
if (!isEnable && createBlackRowIndex != -1) {
|
|
1548
1550
|
sheet.setRowVisible(createBlackRowIndex, false);
|
|
1549
1551
|
}
|
|
1550
1552
|
return;
|
|
@@ -1582,15 +1584,20 @@ const BusinessUtils = {
|
|
|
1582
1584
|
else {
|
|
1583
1585
|
// 设置添加这一行的行高
|
|
1584
1586
|
sheet.setRowHeight(lastRowIndex + 1, sheetTotalHeight - allRowHeight);
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
+
if (!isEnable) {
|
|
1588
|
+
sheet.setRowVisible(lastRowIndex + 1, false);
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1591
|
+
// 显示空白行单元格
|
|
1592
|
+
sheet.setRowVisible(lastRowIndex + 1, true);
|
|
1593
|
+
}
|
|
1587
1594
|
}
|
|
1588
1595
|
}
|
|
1589
1596
|
// 隐藏空白行单元格
|
|
1590
1597
|
else {
|
|
1591
1598
|
const blankRowCell = sheet.getTag(lastRowIndex + 1, 1);
|
|
1592
1599
|
// 如果空白行单元格标签存在,则隐藏
|
|
1593
|
-
if (blankRowCell && blankRowCell == 'BlankCell') {
|
|
1600
|
+
if (!isEnable && blankRowCell && blankRowCell == 'BlankCell') {
|
|
1594
1601
|
sheet.setRowVisible(lastRowIndex + 1, false);
|
|
1595
1602
|
}
|
|
1596
1603
|
}
|
|
@@ -1606,8 +1613,23 @@ const BusinessUtils = {
|
|
|
1606
1613
|
// top: false,
|
|
1607
1614
|
// bottom: false,
|
|
1608
1615
|
// });
|
|
1616
|
+
// 没有启用动态加载行的时候,将所有的行都显示出来
|
|
1617
|
+
if (!isEnable) {
|
|
1618
|
+
hasValueRows.forEach((rowIndex, index) => {
|
|
1619
|
+
// 设置行可见
|
|
1620
|
+
sheet.setRowVisible(rowIndex, true);
|
|
1621
|
+
});
|
|
1622
|
+
noValueRows.forEach((rowIndex) => {
|
|
1623
|
+
// 设置行可见
|
|
1624
|
+
sheet.setRowVisible(rowIndex, true);
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1609
1627
|
// 恢复绘制
|
|
1610
1628
|
sheet.resumePaint();
|
|
1629
|
+
// 执行绘制完成后的回调函数
|
|
1630
|
+
if (ended != null && ended != undefined && typeof ended === 'function') {
|
|
1631
|
+
ended({ hasValueIndex: hasValueRows, noValueIndex: noValueRows });
|
|
1632
|
+
}
|
|
1611
1633
|
return { hasValueIndex: hasValueRows, noValueIndex: noValueRows };
|
|
1612
1634
|
},
|
|
1613
1635
|
/**
|