rapid-spreadjs 1.0.33 → 1.0.35

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
@@ -636,7 +636,7 @@ const BusinessUtils = {
636
636
  sheet.setRowHeight(totalRowCount, addRowHeight, gc.Spread.Sheets.SheetArea.viewport);
637
637
  // 获取添加这一行的区域范围
638
638
  const addRowRange = sheet.getRange(totalRowCount, 1, contentColStartIndex, contentTotalColCount, gc.Spread.Sheets.SheetArea.viewport);
639
- // 设置添加这一行区域中的边框样式(最左边和最后边边框样式为粗线、中间的为细边框样式)
639
+ // 设置添加这一行区域中的边框样式(上下左右边框样式为粗线、中间的为细边框样式)
640
640
  addRowRange.setBorder(new gc.Spread.Sheets.LineBorder('#000', gc.Spread.Sheets.LineStyle.thin), { all: true });
641
641
  addRowRange.setBorder(new gc.Spread.Sheets.LineBorder('#000', gc.Spread.Sheets.LineStyle.medium), {
642
642
  left: true,
@@ -18553,6 +18553,56 @@ const FormulaUtils = {
18553
18553
  return tdz;
18554
18554
  },
18555
18555
  },
18556
+ {
18557
+ funName: 'YJSXS',
18558
+ funDesc: '水温查表',
18559
+ funDefaultVal: null,
18560
+ // isContainNullUndefinedVal: true,
18561
+ funParams: [
18562
+ {
18563
+ name: '温度',
18564
+ repeatable: false,
18565
+ optional: false,
18566
+ },
18567
+ ],
18568
+ funCallback: (spread, sheet, retData) => {
18569
+ //如果传递的参数小于1个,则返回空字符串
18570
+ if (retData.allCellVals.length < 1) {
18571
+ return '';
18572
+ }
18573
+ let a = retData.allCellVals[0] + '';
18574
+ var sw; //最后输出的值
18575
+ var arr = new Array('15-0.002', '16-0.003', '17-0.003', '18-0.004', '19-0.004', '20-0.005', '21-0.005', '22-0.006', '23-0.006', '24-0.007', '25-0.008');
18576
+ for (var i = 0; i < arr.length; i++) {
18577
+ var ret = arr[i].split('-');
18578
+ if (a == ret[0]) {
18579
+ sw = ret[1];
18580
+ }
18581
+ }
18582
+ if (a.length > 2) {
18583
+ var sw = a;
18584
+ sw = sw.substring(0, sw.indexOf('.'));
18585
+ var j = 0;
18586
+ for (var i = 0; i < arr.length; i++) {
18587
+ var ret = arr[i].split('-');
18588
+ if (sw == ret[0]) {
18589
+ j = i;
18590
+ }
18591
+ }
18592
+ if (j == arr.length - 1) {
18593
+ var arr1 = arr[j].split('-');
18594
+ var arr2 = arr[j - 1].split('-');
18595
+ sw = FormulaUtils.commFun.GetDataOddIncreaseEvenDecrease(FormulaUtils.commFun.InterpolationMethod_y(arr1[0], arr2[0], arr1[1], arr2[1], a), -3);
18596
+ }
18597
+ else {
18598
+ var arr1 = arr[j].split('-');
18599
+ var arr2 = arr[j + 1].split('-');
18600
+ sw = FormulaUtils.commFun.GetDataOddIncreaseEvenDecrease(FormulaUtils.commFun.InterpolationMethod_y(arr1[0], arr2[0], arr1[1], arr2[1], a), -3);
18601
+ }
18602
+ }
18603
+ return sw;
18604
+ },
18605
+ },
18556
18606
  ],
18557
18607
  };
18558
18608
 
@@ -18748,12 +18798,13 @@ const WorkbookUtils = {
18748
18798
  * @param isExcel 是否导出为Excel文件,默认为true(如果为false,则导出为PDF)
18749
18799
  * @param exportName 导出的文件名称,不传则为第一个Sheet的名称
18750
18800
  * @param regFonts 注册的字体集合,默认注册宋体和Arial字体
18801
+ * @param contentColEndIndex 内容列结束的索引,默认为:77(用于导出PDF文件的时候,只导出内容列到索引contentColEndIndex的位置,超过contentColEndIndex索引列后续的内容其实不需要导出)
18751
18802
  * @returns 合并后的工作簿实例
18752
18803
  */
18753
18804
  mergeWorkbooksToExcelOrPdf: (GC_1, spreads_1, ...args_1) => __awaiter(void 0, [GC_1, spreads_1, ...args_1], void 0, function* (GC, spreads, isExcel = true, exportName, regFonts = [
18754
18805
  { name: '宋体', type: 'normal', url: '/spreadJsFonts/simsun.ttf' },
18755
18806
  { name: 'Arial', type: 'normal', url: '/spreadJsFonts/arial.ttf' },
18756
- ]) {
18807
+ ], contentColEndIndex = 77) {
18757
18808
  if (!spreads || spreads.length == 0) {
18758
18809
  return;
18759
18810
  }
@@ -18836,6 +18887,7 @@ const WorkbookUtils = {
18836
18887
  const pdfSheet = mainWorkbook.getSheet(mainWorkbook.getSheetCount() - 1);
18837
18888
  let printInfo = pdfSheet.printInfo();
18838
18889
  printInfo.margin({ top: 0, bottom: 0, left: 0, right: 0, header: 0, footer: 0 });
18890
+ printInfo.columnEnd(contentColEndIndex);
18839
18891
  printInfo.showBorder(false);
18840
18892
  printInfo.showGridLine(false);
18841
18893
  printInfo.blackAndWhite(false);