浏览代码

个人工作台照片查看优化

xieqy 2 年之前
父节点
当前提交
bf479c0697
共有 1 个文件被更改,包括 14 次插入5 次删除
  1. 14 5
      src/widgets/PersonWorkbench/Widget.ts

+ 14 - 5
src/widgets/PersonWorkbench/Widget.ts

@@ -798,12 +798,12 @@ class PersonWorkbench extends BaseWidget {
         var gcdhArr=[];
         var gjcd=[];
         result.sharpDataCount.forEach(item => {
-            gxsg.push(-item.buildTotal)//加负号是为了让其横向左侧显示
-            gcdh.push(item.deliverTotal)
-            gjcd.push(item.sharpdata?item.sharpdata:0)
+            gxsg.push(-this.setNullAndUndefinedEmpty(item.buildTotal))//加负号是为了让其横向左侧显示
+            gcdh.push(this.setNullAndUndefinedEmpty(item.deliverTotal))
+            gjcd.push(this.setNullAndUndefinedEmpty(item.sharpdata))
 
-            gxsgArr.push(item.buildTotal)//加负号是为了让其横向左侧显示
-            gcdhArr.push(item.deliverTotal)
+            gxsgArr.push(this.setNullAndUndefinedEmpty(item.buildTotal))//加负号是为了让其横向左侧显示
+            gcdhArr.push(this.setNullAndUndefinedEmpty(item.deliverTotal))
         })
         gxsgArr.sort(function (a, b) {
             return a-b;
@@ -1312,6 +1312,7 @@ class PersonWorkbench extends BaseWidget {
         }
         pictureHtml = "<ul class='picList' style='height:100%;width:100%;margin:0;padding:0;'>" + pictureHtml + "</ul>";
         this.domObj.find('.photoList').empty().append(pictureHtml);
+        this.domObj.find('.photoList').viewer('destroy');
         this.domObj.find('.photoList').viewer({
             url:'data-original'
         });
@@ -1409,6 +1410,14 @@ class PersonWorkbench extends BaseWidget {
         }
         return count;
     }
+    //数据检查公共方法(针对数字)
+    setNullAndUndefinedEmpty(input) {
+        if (input === "Null"||input === "null"||input === "NULL"||input === null || input === undefined || input === "") {
+            return 0
+        } else {
+            return input
+        }
+    }
     /**
      * 销毁对象
      */