Explorar o código

Merge remote-tracking branch 'origin/knowledgePlat' into test

zhouna %!s(int64=4) %!d(string=hai) anos
pai
achega
1d5c5ef391

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

@@ -45,10 +45,10 @@
                             </el-option>
                         </el-select>
                     </el-form-item>
-                    <!--<el-form-item label="有无子条件:" prop="parHasSub">
+                    <el-form-item v-if="showHasSub" label="有无子条件:" prop="parHasSub">
                         <el-select v-model="form.parHasSub"
                                    placeholder="请选择"
-                                   size="small">
+                                   size="small" @change="hasSubChange">
                             <el-option
                                     v-for="item in hasSub"
                                     :key="item.id"
@@ -56,7 +56,7 @@
                                     :value="item.id">
                             </el-option>
                         </el-select>
-                    </el-form-item>-->
+                    </el-form-item>
                     <el-form-item v-if="showMsg" label="附加信息:" prop="parMsg" class="parMsg">
                         <el-input type="textarea" :rows="3" placeholder="请输入附加信息" v-model.trim="form.parMsg"></el-input>
                     </el-form-item>
@@ -184,6 +184,9 @@
                 if(val&&this.checkFirstPlace&&this.conceptList) {
                     this.firstPlace = this.conceptList.find((it) => it.conceptId === val);
                     this.firstPlace['checkedType']=this.ruleTermCodeStr;
+                }else if(!val){
+                    this.setInitGroupData();
+                    this.firstPlace =null;
                 }else{
                     this.firstPlace =null;
                 }
@@ -201,12 +204,21 @@
             },
             showMsg:function(){
                 return this.ruleTermCodeStr.length>1&&this.msgDict.indexOf(this.ruleTermCodeStr)>-1;
+            },
+            showHasSub:function(){
+                return this.subDict.indexOf(this.ruleTermCodeStr)>-1;
             }
         },
         methods:{
+            hasSubChange(val){
+                if(val){
+                    this.setInitGroupData();
+                }
+            },
             setDict(){
                 this.dict = localStorage.getItem("zskDicts");
                 this.msgDict = localStorage.getItem("zskMsgDict");
+                this.subDict = localStorage.getItem("zskSubDict");
             },
             showConfirmDialog(msg,resolve){
                 this.$alert(msg, '提示', {

+ 2 - 1
src/components/knowledgeExtra/RuleManager.vue

@@ -122,7 +122,7 @@
                 </el-table-column>
                 <el-table-column
                         label="操作"
-                        width="180">
+                        width="180" fixed="right">
                     <template slot-scope="scope">
                         <el-button type="text" size="small" @click="editData(scope.row.parId)">修改</el-button>
                         <span style="margin:0 3px;">|</span>
@@ -219,6 +219,7 @@
                         localStorage.setItem("zskDicts",arr.join(","));
                         localStorage.setItem("zskMsgDict",(data['21'].map((it)=>it.val)||[]).join(","));
                         localStorage.setItem("zskNumDict",data['22'][0].val);
+                        localStorage.setItem("zskSubDict",data['23'][0].val);
                     }
                 }).catch((error) => {
                     console.log(error);

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

@@ -240,7 +240,7 @@
                     const sub = this.baseTypes.find((it) => it.ruleType === +types[0] && it.type === +types[2]);
                     this.groupData.subType = sub.type;
                     this.baseTermTypeList = sub.subMenuList;
-                    this.groupData.subLenCode = this.baseTermTypeList.find((it) => it.ruleType === +types[0]).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;
@@ -266,10 +266,10 @@
         },
         methods:{
             dataTypeChange(val){
-                this.groupData.dataType=val;
                 this.groupData.subEqOperator=(val==='2'?'=':'');
-                this.clearNumText();console.log(322,this.groupData)
-                this.$emit("changeVal",this.groupData,this.ind);
+                this.clearNumText();
+                delete this.groupData.dataType;     //触发更新
+                this.$set(this.groupData,'dataType',val);
             },
             subTypeChange(val){        //基础规则类型修改
                 this.groupData.subLenCode='';
@@ -305,6 +305,7 @@
                 this.groupData.subMinValue='';
                 this.groupData.subMinUnit='';
                 this.groupData.subEqValue='';
+                this.groupData.subEqOperator='';
             },
             searchConcept(val){
                 const param = {