rapid-spreadjs 1.0.119 → 1.0.120
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 +15 -3
- 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 +15 -3
- 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 +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -965,9 +965,9 @@ const BusinessUtils = {
|
|
|
965
965
|
* @param lastDefaultPointCount 上次默认点数,默认为:0(0代表首次创建)
|
|
966
966
|
* @param isAutoFillFirstCellNumber 是否自动填充第一个单元格为序号数字,默认为:false
|
|
967
967
|
* @param created 创建完成后的回调函数,第一个参数为循环后的所有单元格范围对象(格式为:{row:0, col:0, rowCount:10, colCount:5}),第二个参数为所有循环行的单元格二维数组对象
|
|
968
|
-
* @param rowHeight 创建的行高度,默认为:
|
|
968
|
+
* @param rowHeight 创建的行高度,默认为:undefined(如果传了该参数,则新复制的行高为该参数指定的高度,否则为原始循环的行高)
|
|
969
969
|
*/
|
|
970
|
-
dynamicCreateCyclicRows: (GC, spread, cellRange, curDefaultPointCount, lastDefaultPointCount = 0, isAutoFillFirstCellNumber = false, created = null, rowHeight
|
|
970
|
+
dynamicCreateCyclicRows: (GC, spread, cellRange, curDefaultPointCount, lastDefaultPointCount = 0, isAutoFillFirstCellNumber = false, created = null, rowHeight) => {
|
|
971
971
|
// 不进行动态创建行
|
|
972
972
|
if ((curDefaultPointCount <= 1 && lastDefaultPointCount == 0) || (curDefaultPointCount == lastDefaultPointCount && lastDefaultPointCount > 0)) {
|
|
973
973
|
return;
|
|
@@ -976,6 +976,11 @@ const BusinessUtils = {
|
|
|
976
976
|
const sheet = spread.getActiveSheet();
|
|
977
977
|
// 判断要循环的单元格最后一行是否为表格的末尾行,如果是,则在循环创建单元行的最后一行的时候,下边框线位细线样式
|
|
978
978
|
const isCyclicLastRowIsSheetLastRow = cellRange.row + cellRange.rowCount == sheet.getRowCount();
|
|
979
|
+
// 循环行的每一行原始高度
|
|
980
|
+
let oldRowHeights = [];
|
|
981
|
+
for (let i = cellRange.row; i <= cellRange.row + cellRange.rowCount - 1; i++) {
|
|
982
|
+
oldRowHeights.push(sheet.getRowHeight(i));
|
|
983
|
+
}
|
|
979
984
|
/**
|
|
980
985
|
* 添加行
|
|
981
986
|
* @param addRowIndex 添加行的索引位置
|
|
@@ -987,8 +992,15 @@ const BusinessUtils = {
|
|
|
987
992
|
// 添加需要循环的总行数
|
|
988
993
|
sheet.addRows(addRowIndex, addRowCount);
|
|
989
994
|
// 设置添加行的行高
|
|
995
|
+
let rowHeightIndex = 0;
|
|
990
996
|
for (let i = addRowIndex; i <= addRowIndex + addRowCount; i++) {
|
|
991
|
-
sheet.setRowHeight(i, rowHeight, GC.Spread.Sheets.SheetArea.viewport);
|
|
997
|
+
sheet.setRowHeight(i, rowHeight != null && rowHeight != undefined ? rowHeight : oldRowHeights[rowHeightIndex], GC.Spread.Sheets.SheetArea.viewport);
|
|
998
|
+
if (rowHeightIndex < oldRowHeights.length - 1) {
|
|
999
|
+
rowHeightIndex++;
|
|
1000
|
+
}
|
|
1001
|
+
else {
|
|
1002
|
+
rowHeightIndex = 0;
|
|
1003
|
+
}
|
|
992
1004
|
}
|
|
993
1005
|
// 复制次数,每次复制到下方相邻位置
|
|
994
1006
|
for (let i = 1; i <= copyPointCount; i++) {
|