Selaa lähdekoodia

规则内容禁止修改规则

zhouna 4 vuotta sitten
vanhempi
commit
7aa451e54e

+ 3 - 2
src/components/knowledgeExtra/AddNewRule.vue

@@ -178,6 +178,7 @@
             'form.parConceptId':function(val){
                 if(this.checkFirstPlace) {
                     this.firstPlace = this.conceptList.find((it) => it.conceptId === val);
+                    this.firstPlace['checkedType']=this.form.parRuleType+"-"+this.form.parLenCode;
                 }else{
                     this.firstPlace =null;
                 }
@@ -188,8 +189,8 @@
         },
         computed:{
             checkFirstPlace:function(){
-                const str=this.form.parRuleType+this.form.parLenCode;
-                return this.dict.indexOf(str);
+                const str=this.form.parRuleType+"-"+this.form.parLenCode;
+                return this.dict.indexOf(str)>-1;
             }
         },
         methods:{

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

@@ -183,13 +183,11 @@
             },
             'firstPlace':function(val){
                 if(!val)return;
-                const str=localStorage.getItem("zskDicts");
-                const arr=str.split(",");
-                //arr
-                const sub = this.baseTypes.find((it)=>it.ruleType===3);
+                const types= val.checkedType.split("-");
+                const sub = this.baseTypes.find((it)=>it.ruleType===+types[0]&&it.type===2);
                 this.groupData.subType=sub.type;
                 this.baseTermTypeList =sub.subMenuList;
-                this.groupData.subLenCode=this.baseTermTypeList.find((it)=>it.ruleType===3).code;
+                this.groupData.subLenCode=this.baseTermTypeList.find((it)=>it.ruleType===+types[0]).code;
                 this.conceptList=[val];
                 this.groupData.subDescription=val.conceptName;
                 this.groupData.subConceptId = val.conceptId;