From 897faa2d11f5a64d0c5e0f3d802e363430f8bdc0 Mon Sep 17 00:00:00 2001
From: gaoluyang <gaoluyang@rengu.cc>
Date: 星期五, 28 六月 2024 13:36:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/util/excelFountion.js |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/util/excelFountion.js b/src/util/excelFountion.js
index 406c872..d879f8f 100644
--- a/src/util/excelFountion.js
+++ b/src/util/excelFountion.js
@@ -12,6 +12,7 @@
 function MAX(...val){
   let max = 0;
   if(val&&val.length>0){
+    val = val.filter(item=>item!=null&&item!=='')
     max = Math.max(...val)
   }
   return max;
@@ -19,6 +20,7 @@
 function MIN(...val){
   let min = 0;
   if(val&&val.length>0){
+    val = val.filter(item=>item!=null&&item!=='')
     min = Math.min(...val)
   }
   return min;
@@ -26,12 +28,16 @@
 
 function AVERAGE(...val){
   let num = 0;
+  let arr = [];
   if(val&&val.length>0){
-    val.forEach(item=>{
+    arr = val.filter(item=>item!=null&&item!=='')
+    arr.forEach(item=>{
       num+=item;
     })
+    return num/arr.length;
+  }else{
+    return 0;
   }
-  return num/val.length;
 }
 
 function APS(val){
@@ -157,7 +163,7 @@
   // 鑾峰彇鍗曞厓鏍煎搴斿��
   let arr = getAllCell(f)
   for (var a in comValue) {
-    if(comValue[a]){
+    if(comValue[a]!=='undefine'&&comValue[a]!=='null'&&comValue[a]!==undefined){
       arr[a] = comValue[a]
     }
   }

--
Gitblit v1.9.3