zhouna 4 år sedan
förälder
incheckning
0102011976
1 ändrade filer med 5 tillägg och 3 borttagningar
  1. 5 3
      src/components/knowledgeExtra/DiagBaseItem.vue

+ 5 - 3
src/components/knowledgeExtra/DiagBaseItem.vue

@@ -160,7 +160,7 @@
             },
         },
         created(){
-            this.dicts=JSON.parse(localStorage.getItem("zskDiagDicts"));
+            this.dicts=JSON.parse(localStorage.getItem("zskDiagDicts")||'{}');
             if(this.groupData.maxOperator||this.groupData.minOperator){
                 this.groupData.dataType='1';
             }else if(this.groupData.eqValue){
@@ -178,12 +178,14 @@
                 return (this.baseTypes.find((it)=>it.type===this.groupData.basType)||{}).name;
             },
             onlyNum:function(){
-                const codes=this.dicts['onlyNum']+',';
+                const onlyNum =this.dicts['onlyNum']||'&';
+                const codes=onlyNum+',';
                 const type=this.groupData.basLibType;
                 return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
             },
             onlyTxt:function(){
-                const codes=this.dicts['onlyTxt']+',';
+                const onlyTxt =this.dicts['onlyTxt']||'&';
+                const codes=onlyTxt+',';
                 const type=this.groupData.basLibType;
                 return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
             },