Browse Source

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

zhouna 4 năm trước cách đây
mục cha
commit
e79bf8c164

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

@@ -63,6 +63,7 @@
                     <el-form-item v-if="form.parHasSub===1" label="规则内容:" prop="remind" class="discDesc">
                         <SubRulesGroup v-for="(group,i) in subGroups"
                                        ref="groups"
+                                       :key="i"
                                        :data="group"
                                        :baseTypes="baseTypeList"
                                        :inx="i"
@@ -212,7 +213,21 @@
         methods:{
             hasSubChange(val){
                 if(val){
-                    this.setInitGroupData();
+                    this.subGroups = [[{
+                        subDescription:'',
+                        parRuleType:'',
+                        subConceptId:'',
+                        subType:'',
+                        subMaxOperator:'',
+                        subMaxUnit:'',
+                        subMaxValue:'',
+                        subMinOperator:'',
+                        subMinUnit:'',
+                        subMinValue:'',
+                        subEqValue:'',
+                        subLenCode:'',
+                        dataType:'',
+                    }]];
                 }
             },
             setDict(){
@@ -260,12 +275,14 @@
             ruleTypeChange(val){       //规则类型选中
                 this.form.parRuleType=val;
                 this.form.parLenCode='';
+                this.form.parMsg="";
                 const obj = this.ruleTypeList.find((it)=>it.id===val);//console.log(val)
                 this.ruleTermTypeList = obj.subMenuList;
                 this.setInitGroupData();
             },
             ruleTermChange(val){        //规则术语类型选中
                 this.form.parLenCode=val;
+                this.form.parMsg="";
                 const obj = this.ruleTermTypeList.find((it)=>it.code===val);
                 this.form.parLenName=obj.name;
                 this.baseTypeList = obj.subMenuList;
@@ -334,7 +351,8 @@
                 this.subGroups.push([temp]);
             },
             delGroup(i){
-                this.subGroups.splice(i,1);
+                //this.subGroups.splice(i,1);
+                this.$set(this.subGroups,i,null);
             },
             saveRule(params){
                 api.saveRule(params).then((res)=>{

+ 6 - 11
src/components/knowledgeExtra/RuleManager.vue

@@ -92,17 +92,6 @@
                         {{scope.row.parHasSub === '0'?'无':'有'}}
                     </template>
                 </el-table-column>
-                <el-table-column
-                        prop="parMsg"
-                        label="附加信息"
-                        width="160">
-                    <template slot-scope="scope">
-                        <el-tooltip v-if="scope.row.parMsg.length>8" class="item" effect="dark" :content="scope.row.parMsg" placement="top">
-                            <span>{{scope.row.parMsg.slice(0,8)+'...'}}</span>
-                        </el-tooltip>
-                        <span v-if="scope.row.parMsg.length<9">{{scope.row.parMsg}}</span>
-                    </template>
-                </el-table-column>
                 <el-table-column
                         label="状态">
                     <template slot-scope="scope">
@@ -114,6 +103,12 @@
                 <el-table-column
                         prop="modifierName"
                         label="操作人">
+                    <template slot-scope="scope">
+                        <el-tooltip v-if="scope.row.modifierName.length>8" class="item" effect="dark" :content="scope.row.modifierName" placement="top">
+                            <span>{{scope.row.modifierName.slice(0,8)+'...'}}</span>
+                        </el-tooltip>
+                        <span v-if="scope.row.modifierName.length<9">{{scope.row.modifierName}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column
                         prop="gmtModified"

+ 13 - 17
src/components/knowledgeExtra/SubConditions.vue

@@ -130,7 +130,7 @@
         props:['groupData','ind','isLast','baseTypes','firstPlace','disabled','showAdd'],
         data(){
             return {
-                baseTermTypeList:[],
+                //baseTermTypeList:[],
                 typeList:[],
                 numTypes:'',    //只有数值类型的类型id
                 operMaxList:[
@@ -145,7 +145,7 @@
                 rules:{
                     subDescription:[{ required: true, message: '请输入基础规则名称',trigger: ['blur'] },{
                         validator: (rule,value,callback)=>{
-                            if(value.length>100){
+                            if(value&&value.length>100){
                                 callback(new Error('规则名称不能超过100字'));
                             }else{
                                 callback();
@@ -221,7 +221,7 @@
                 },
                 deep:true
             },
-            'baseTypes':{
+            /*'baseTypes':{
                 handler:function(val){
                     if(!this.groupData.subType){
                         this.baseTermTypeList =[];
@@ -231,16 +231,14 @@
                     this.baseTermTypeList = obj.subMenuList;
                 },
                 deep:true
-            },
+            },*/
             'firstPlace':{
                 handler:function(val) {
                     if (this.ind!==0||!val) return;
                     const dict = localStorage.getItem("zskDicts").match(new RegExp(val.checkedType+'-\\d+','g'))||[];
                     const types = dict[0].split("-");
-                    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.subType = +types[2];
+                    this.groupData.subLenCode = types[1];
                     this.conceptList = [val];
                     this.groupData.subDescription = val.conceptName;
                     this.groupData.subConceptId = val.conceptId;
@@ -252,11 +250,15 @@
         created(){
             this.numTypes = localStorage.getItem("zskNumDict");
             this.conceptList=[{conceptName:this.groupData.subLibName||this.groupData.subConceptName,conceptId:this.groupData.subConceptId}];
-            if(this.groupData.subLenCode){
-                this.baseTermTypeList=[{name:this.groupData.subLenName,code:this.groupData.subLenCode}];
-            }
         },
         computed:{
+            baseTermTypeList:function(){
+                if(!this.baseTypes.length){
+                    return [];
+                }
+                const sub = this.baseTypes.find((it) => it.type === this.groupData.subType)||{};
+                return sub.subMenuList;
+            },
             showDataType:function(){
                return (this.numTypes+',').indexOf(this.groupData.subLenCode+',')===-1;
             },
@@ -276,12 +278,6 @@
                 this.groupData.dataType='';
                 this.clearConcept();
                 this.clearNumText();
-                if(!val){
-                    this.baseTermTypeList =[];
-                    return;
-                }
-                const obj = this.baseTypes.find((it)=>it.type===val);
-                this.baseTermTypeList = obj.subMenuList;
             },
             subCodeChange(val){        //基础规则术语类型修改
                 this.groupData.subLenCode=val;

+ 1 - 1
src/components/knowledgeExtra/SubRulesGroup.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="sub-groups">
+    <div class="sub-groups" v-if="data">
         <SubConditions v-for="(rules,i) in data"
                        ref="group"
                        :groupData="rules"