rapid-spreadjs 1.0.63 → 1.0.65

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
@@ -12856,7 +12856,6 @@ const FormulaUtils = {
12856
12856
  //自定义函数逻辑
12857
12857
  cusFun.prototype.evaluate = function () {
12858
12858
  // 获取该自定义公式被引用单元格的索引
12859
- console.log('所有参数:', arguments);
12860
12859
  /**
12861
12860
  * 说明:
12862
12861
  * 如果isContext=true,则arguments的第一个参数为上下文参数,后面的参数才是自定义参数真正传入的参数
@@ -19565,6 +19564,55 @@ const FormulaUtils = {
19565
19564
  }
19566
19565
  },
19567
19566
  },
19567
+ {
19568
+ funName: 'YJDLNZXSB',
19569
+ funDesc: '水温修正系数查表',
19570
+ funDefaultVal: null,
19571
+ isAcceptArea: true,
19572
+ funParams: [
19573
+ {
19574
+ name: '温度',
19575
+ repeatable: false,
19576
+ optional: false,
19577
+ },
19578
+ ],
19579
+ funCallback: (spread, sheet, retData) => {
19580
+ //如果传递的参数小于2个,则返回空字符串
19581
+ if (retData.allCellVals.length < 2) {
19582
+ return '/';
19583
+ }
19584
+ const a = retData.allCellVals[0];
19585
+ var sw = '/'; //最后输出的值
19586
+ var arr = new Array('18-1.050', '18.5-1.038', '19-1.025', '19.5-1.012', '20-1.000', '20.5-0.988', '21-0.976', '21.5-0.965', '22-0.953');
19587
+ for (var i = 0; i < arr.length; i++) {
19588
+ var ret = arr[i].split('-');
19589
+ if (a == ret[0]) {
19590
+ sw = ret[1];
19591
+ }
19592
+ }
19593
+ if (a.length > 2) {
19594
+ sw = a;
19595
+ var j = 0;
19596
+ for (var i = 0; i < arr.length; i++) {
19597
+ var ret = arr[i].split('-');
19598
+ if (sw == ret[0]) {
19599
+ j = i;
19600
+ }
19601
+ }
19602
+ if (j == arr.length - 1) {
19603
+ var arr1 = arr[j].split('-');
19604
+ var arr2 = arr[j - 1].split('-');
19605
+ sw = FormulaUtils.commFun.GetDataOddIncreaseEvenDecrease(FormulaUtils.commFun.InterpolationMethod_y(arr1[0], arr2[0], arr1[1], arr2[1], a), -3);
19606
+ }
19607
+ else {
19608
+ var arr1 = arr[j].split('-');
19609
+ var arr2 = arr[j + 1].split('-');
19610
+ sw = FormulaUtils.commFun.GetDataOddIncreaseEvenDecrease(FormulaUtils.commFun.InterpolationMethod_y(arr1[0], arr2[0], arr1[1], arr2[1], a), -3);
19611
+ }
19612
+ }
19613
+ return sw;
19614
+ },
19615
+ },
19568
19616
  {
19569
19617
  funName: 'YJTREND',
19570
19618
  funDesc: '返回线性回归拟合线的一组纵坐标值(y值)',