rapid-spreadjs 1.0.89 → 1.0.91
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 +49 -9
- 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 +49 -9
- 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/echarts-all.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -872,10 +872,29 @@ const BusinessUtils = {
|
|
|
872
872
|
cellRange.colCount, // 源列数
|
|
873
873
|
GC.Spread.Sheets.CopyToOptions.all // 复制内容类型(值、样式、公式等)
|
|
874
874
|
);
|
|
875
|
+
// 使用命令的方式
|
|
876
|
+
// // 定义源区域
|
|
877
|
+
// var fromRange = [new GC.Spread.Sheets.Range(cellRange.row, cellRange.col, cellRange.rowCount, cellRange.colCount)];
|
|
878
|
+
// // 定义目标区域
|
|
879
|
+
// var toRange = [new GC.Spread.Sheets.Range(targetRow, cellRange.col, cellRange.rowCount, cellRange.colCount)];
|
|
880
|
+
// // 执行复制命令
|
|
881
|
+
// spread.commandManager().execute({
|
|
882
|
+
// cmd: "clipboardPaste",
|
|
883
|
+
// sheetName: sheet.name(), // 目标工作表名称
|
|
884
|
+
// fromSheet: sheet, // 源工作表对象
|
|
885
|
+
// fromRanges: fromRange, // 源区域数组
|
|
886
|
+
// pastedRanges: toRange, // 目标区域数组
|
|
887
|
+
// isCutting: false, // false 表示复制
|
|
888
|
+
// clipboardText: "", // 留空
|
|
889
|
+
// pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all // 粘贴全部内容(数据、样式、公式等)
|
|
890
|
+
// });
|
|
875
891
|
}
|
|
876
892
|
};
|
|
877
|
-
//
|
|
893
|
+
// 暂停绘制、计算、事件
|
|
878
894
|
sheet.suspendPaint();
|
|
895
|
+
sheet.suspendCalcService();
|
|
896
|
+
sheet.suspendDirty();
|
|
897
|
+
sheet.suspendEvent();
|
|
879
898
|
// 当前默认点数<=1并且上一次默认点数>0的时候,则删除所有循环的行
|
|
880
899
|
if (curDefaultPointCount <= 1 && lastDefaultPointCount > 0) {
|
|
881
900
|
sheet.deleteRows(cellRange.row + cellRange.rowCount, (curDefaultPointCount - 1) * cellRange.rowCount);
|
|
@@ -896,7 +915,7 @@ const BusinessUtils = {
|
|
|
896
915
|
addRowsFun(cellRange.row + cellRange.rowCount, (curDefaultPointCount - 1) * cellRange.rowCount, curDefaultPointCount - 1);
|
|
897
916
|
}
|
|
898
917
|
// 循环后的所有单元格范围
|
|
899
|
-
const cyclicCellsRangeObj = sheet.getRange(cellRange.row, cellRange.col, curDefaultPointCount * cellRange.rowCount, cellRange.colCount);
|
|
918
|
+
const cyclicCellsRangeObj = sheet.getRange(cellRange.row, cellRange.col, curDefaultPointCount * cellRange.rowCount, cellRange.colCount > 77 ? 77 : cellRange.colCount);
|
|
900
919
|
// 判断要循环的单元格最后一行是否为表格的末尾行,如果是,则在循环创建单元行的最后一行的时候,下边框线位细线样式
|
|
901
920
|
if (isCyclicLastRowIsSheetLastRow) {
|
|
902
921
|
// 设置所有内边框线为细线样式
|
|
@@ -927,12 +946,15 @@ const BusinessUtils = {
|
|
|
927
946
|
});
|
|
928
947
|
});
|
|
929
948
|
}
|
|
949
|
+
// 恢复事件、计算、绘制
|
|
950
|
+
sheet.resumeDirty();
|
|
951
|
+
sheet.resumeEvent();
|
|
952
|
+
sheet.resumeCalcService();
|
|
953
|
+
sheet.resumePaint();
|
|
930
954
|
// 创建完成后的回调函数
|
|
931
955
|
if (created != null && created != undefined && typeof created === 'function') {
|
|
932
956
|
created(cyclicCellsRange, allCellsByRow);
|
|
933
957
|
}
|
|
934
|
-
// 恢复绘制
|
|
935
|
-
sheet.resumePaint();
|
|
936
958
|
},
|
|
937
959
|
};
|
|
938
960
|
|
|
@@ -8499,9 +8521,10 @@ const EChartsUtilsAll = {
|
|
|
8499
8521
|
{
|
|
8500
8522
|
show: true,
|
|
8501
8523
|
text: title,
|
|
8524
|
+
left: 'center',
|
|
8502
8525
|
top: 2,
|
|
8503
8526
|
textStyle: {
|
|
8504
|
-
fontSize:
|
|
8527
|
+
fontSize: 14,
|
|
8505
8528
|
fontWeight: 'normal',
|
|
8506
8529
|
},
|
|
8507
8530
|
},
|
|
@@ -20032,6 +20055,11 @@ const FormulaUtils = {
|
|
|
20032
20055
|
repeatable: false,
|
|
20033
20056
|
optional: false,
|
|
20034
20057
|
},
|
|
20058
|
+
{
|
|
20059
|
+
name: '是否返回符合或不符合结果的数量(传数字的1或0,0:不返回数量、1:返回数量),默认为:0',
|
|
20060
|
+
repeatable: false,
|
|
20061
|
+
optional: false,
|
|
20062
|
+
},
|
|
20035
20063
|
],
|
|
20036
20064
|
funCallback: (spread, sheet, retData) => {
|
|
20037
20065
|
// 如果传递的参数小于5个,则返回空字符串
|
|
@@ -20039,7 +20067,9 @@ const FormulaUtils = {
|
|
|
20039
20067
|
if (retData.allCellValsEw.length < 5) {
|
|
20040
20068
|
return '/';
|
|
20041
20069
|
}
|
|
20042
|
-
let array1 = retData.allCellValsEw[0], array2 = retData.allCellValsEw[1], operator = retData.allCellValsEw[2], value = retData.allCellValsEw[3], delimiter = retData.allCellValsEw[4], isOpposite = retData.allCellValsEw.length < 6 ? 0 : retData.allCellValsEw[5]
|
|
20070
|
+
let array1 = retData.allCellValsEw[0], array2 = retData.allCellValsEw[1], operator = retData.allCellValsEw[2], value = retData.allCellValsEw[3], delimiter = retData.allCellValsEw[4], isOpposite = retData.allCellValsEw.length < 6 ? 0 : retData.allCellValsEw[5],
|
|
20071
|
+
// 是否返回符合或不符合结果的数量(如最终符合或不符合的结果为“5,6,7”,并且isReturnCount=1,则返回数字3,否则返回“5,6,7”),默认为:0
|
|
20072
|
+
isReturnCount = retData.allCellValsEw.length < 7 ? 0 : retData.allCellValsEw[6];
|
|
20043
20073
|
try {
|
|
20044
20074
|
// 处理array1和array2的默认值
|
|
20045
20075
|
if (array1 == null || array1 == undefined || (typeof array1 == 'string' && array1.trim().length == 0)) {
|
|
@@ -20054,7 +20084,7 @@ const FormulaUtils = {
|
|
|
20054
20084
|
if (typeof array2 == 'string' && array2.trim().length > 0) {
|
|
20055
20085
|
array2 = [array2];
|
|
20056
20086
|
}
|
|
20057
|
-
// 如果operator、value、delimiter、isOpposite为数组,则设置其取第一个值
|
|
20087
|
+
// 如果operator、value、delimiter、isOpposite、isReturnCount为数组,则设置其取第一个值
|
|
20058
20088
|
if (Array.isArray(operator) && operator.length > 0) {
|
|
20059
20089
|
operator = operator[0];
|
|
20060
20090
|
}
|
|
@@ -20067,6 +20097,9 @@ const FormulaUtils = {
|
|
|
20067
20097
|
if (Array.isArray(isOpposite) && isOpposite.length > 0) {
|
|
20068
20098
|
isOpposite = isOpposite[0];
|
|
20069
20099
|
}
|
|
20100
|
+
if (Array.isArray(isReturnCount) && isReturnCount.length > 0) {
|
|
20101
|
+
isReturnCount = isReturnCount[0];
|
|
20102
|
+
}
|
|
20070
20103
|
// 设置isOpposite的默认值
|
|
20071
20104
|
if (isOpposite == '1' || isOpposite == '0') {
|
|
20072
20105
|
isOpposite = parseInt(isOpposite);
|
|
@@ -20074,6 +20107,13 @@ const FormulaUtils = {
|
|
|
20074
20107
|
if (isOpposite != 0 && isOpposite != 1) {
|
|
20075
20108
|
isOpposite = 0;
|
|
20076
20109
|
}
|
|
20110
|
+
// 设置isReturnCount的默认值
|
|
20111
|
+
if (isReturnCount == '1' || isReturnCount == '0') {
|
|
20112
|
+
isReturnCount = parseInt(isReturnCount);
|
|
20113
|
+
}
|
|
20114
|
+
if (isReturnCount != 0 && isReturnCount != 1) {
|
|
20115
|
+
isReturnCount = 0;
|
|
20116
|
+
}
|
|
20077
20117
|
// TODO:暂定此情况
|
|
20078
20118
|
// 第一个参数是否为单值(array1为一个值的时候,此时array2的所有元素可能需要参与计算,满足要求的就返回array2中的值)
|
|
20079
20119
|
const isSingleValue1 = array2.length > array1.length && array1.length == 1;
|
|
@@ -20178,8 +20218,8 @@ const FormulaUtils = {
|
|
|
20178
20218
|
return '';
|
|
20179
20219
|
})
|
|
20180
20220
|
.filter((val) => val !== '' && val != '/' && val != 'null' && val != null && val != undefined); // 过滤空值
|
|
20181
|
-
// 使用指定的分隔符连接结果[2,3,5]
|
|
20182
|
-
return resultValues.join(delimiter);
|
|
20221
|
+
// 使用指定的分隔符连接结果[2,3,5]
|
|
20222
|
+
return isReturnCount == 1 ? resultValues.length : resultValues.join(delimiter);
|
|
20183
20223
|
}
|
|
20184
20224
|
catch (error) {
|
|
20185
20225
|
// 任何错误都返回"/"
|