Browse Source

7369,7406,7418,7422

zhouna 4 years ago
parent
commit
5c2a971b15

+ 29 - 18
src/components/knowledgeExtra/AddNewRule.vue

@@ -118,6 +118,7 @@
                     parRuleType:'',
                     parConceptId:'',
                     parlibName:'',
+                    parLenName:'',
                     parHasSub:undefined,
                     parLenCode:'',
                     parMsg:'',
@@ -152,7 +153,7 @@
         },
         created(){
             this.getTypeList();
-            this.getDict();
+            this.setDict();
             const param = this.$route.params;
             let info = param.data;
             if(info){
@@ -203,18 +204,9 @@
             }
         },
         methods:{
-            getDict(){
-                api.zskgetDict().then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        const arr =data['20'].map((it)=>it.val);
-                        this.dict = arr.join(",");
-                        this.msgDict=(data['21'].map((it)=>it.val)||[]).join(",");
-                        localStorage.setItem("zskDicts",arr.join(","));
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
+            setDict(){
+                this.dict = localStorage.getItem("zskDicts");
+                this.msgDict = localStorage.getItem("zskMsgDict");
             },
             showConfirmDialog(msg,resolve){
                 this.$alert(msg, '提示', {
@@ -291,11 +283,12 @@
               this.conceptList=[];  //下拉列表清空
             },
             addGroup(){
-                this.subGroups.push([{
+                let temp = {
                     subDescription:'',
-                    parRuleType:'',
                     subConceptId:'',
                     subType:'',
+                    subLenCode:'',
+                    dataType:'',
                     subMaxOperator:'',
                     subMaxUnit:'',
                     subMaxValue:'',
@@ -303,9 +296,27 @@
                     subMinUnit:'',
                     subMinValue:'',
                     subEqValue:'',
-                    subLenCode:'',
-                    dataType:'',
-                }]);
+                };
+                if(this.checkFirstPlace){
+                    temp = {
+                        subDescription:this.form.parlibName,
+                        subConceptId:this.form.parConceptId,
+                        subConceptName:this.form.parlibName,
+                        subLenCode:this.form.parLenCode,
+                        subLenName: this.form.parLenName,
+                        subLibName: this.form.parlibName,
+                        subType:2,
+                        dataType:'',
+                        subMaxOperator:'',
+                        subMaxUnit:'',
+                        subMaxValue:'',
+                        subMinOperator:'',
+                        subMinUnit:'',
+                        subMinValue:'',
+                        subEqValue:'',
+                    };
+                }
+                this.subGroups.push([temp]);
             },
             delGroup(i){
                 this.subGroups.splice(i,1);

+ 31 - 4
src/components/knowledgeExtra/RuleManager.vue

@@ -52,12 +52,18 @@
                 <el-table-column
                         prop="parDescription"
                         label="规则名称"
-                        width="160">
+                        width="180">
+                    <template slot-scope="scope">
+                        <el-tooltip v-if="scope.row.parDescription.length>10" class="item" effect="dark" :content="scope.row.parDescription" placement="top">
+                            <span>{{scope.row.parDescription.slice(0,10)+'...'}}</span>
+                        </el-tooltip>
+                        <span v-if="scope.row.parDescription.length<11">{{scope.row.parDescription}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column
                         prop="parRuleType"
                         label="规则类型"
-                        width="100">
+                        width="150">
                     <template slot-scope="scope">
                         {{statusTrans(scope.row.parRuleType)}}
                     </template>
@@ -65,12 +71,18 @@
                 <el-table-column
                         prop="parConceptName"
                         label="医学标准术语"
-                        width="160">
+                        width="180">
+                    <template slot-scope="scope">
+                        <el-tooltip v-if="scope.row.parConceptName.length>10" class="item" effect="dark" :content="scope.row.parConceptName" placement="top">
+                            <span>{{scope.row.parConceptName.slice(0,10)+'...'}}</span>
+                        </el-tooltip>
+                        <span v-if="scope.row.parConceptName.length<11">{{scope.row.parConceptName}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column
                         prop="parLibTypeName"
                         label="术语类型"
-                        width="130">
+                        width="150">
                 </el-table-column>
                 <el-table-column
                         prop="parHasSub"
@@ -168,6 +180,7 @@
             setTimeout(function(){
                 that.getDataList();
             });
+            this.getDict();
         },
         watch: {
             'filter': {
@@ -185,6 +198,20 @@
             })
         },
         methods: {
+            getDict(){
+                api.zskgetDict().then((res) => {
+                    if (res.data.code == '0') {
+                        const data = res.data.data;
+                        const arr =data['20'].map((it)=>it.val);
+                        //this.dict = arr.join(",");
+                        //this.msgDict=(data['21'].map((it)=>it.val)||[]).join(",");
+                        localStorage.setItem("zskDicts",arr.join(","));
+                        localStorage.setItem("zskMsgDict",(data['21'].map((it)=>it.val)||[]).join(","));
+                    }
+                }).catch((error) => {
+                    console.log(error);
+                });
+            },
             statusTrans(type){
                 const obj = this.ruleTypeList.find((it)=>it.type===type);
                 return obj&&obj.name;

+ 22 - 21
src/components/knowledgeExtra/SubConditions.vue

@@ -170,7 +170,7 @@
                                 callback();
                             }}, trigger: 'blur'
                     }],
-                    subEqValue:[{ required: true, message: '请输入医学内容',trigger: ['blur'] }],
+                    subEqValue:[{ required: true, message: '请输入'+this.groupData.subType===6?"正则表达式":"医学内容",trigger: ['blur'] }],
                 },
             }
         },
@@ -182,44 +182,45 @@
                 deep:true
             },
             'baseTypes':{
-                handler:function(){
+                handler:function(val){
                     if(!this.groupData.subType){
                         this.baseTermTypeList =[];
                         return;
                     }
-                    const obj = this.baseTypes.find((it)=>it.type===this.groupData.subType);
+                    const obj = val.find((it)=>it.type===this.groupData.subType);
                     this.baseTermTypeList = obj.subMenuList;
                 },
                 deep:true
             },
-            'firstPlace':function(val){
-                if(!val)return;
-                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===+types[0]).code;
-                this.conceptList=[val];
-                this.groupData.subDescription=val.conceptName;
-                this.groupData.subConceptId = val.conceptId;
-                this.groupData.subConceptName = val.conceptName;
+            'firstPlace':{
+                handler:function(val) {
+                    if (!val) return;
+                    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 === +types[0]).code;
+                    this.conceptList = [val];
+                    this.groupData.subDescription = val.conceptName;
+                    this.groupData.subConceptId = val.conceptId;
+                    this.groupData.subConceptName = val.conceptName;
+                },
+                deep:true
             }
         },
-        created(){
+        created(){console.log(22)
             this.conceptList=[{conceptName:this.groupData.subLibName,conceptId:this.groupData.subConceptId}];
+            if(this.groupData.subLenCode){
+                this.baseTermTypeList=[{name:this.groupData.subLenName,code:this.groupData.subLenCode}];
+            }
         },
         methods:{
-            minMaxValidate(rule, value, callback){
-                if(this.groupData.dataType==='1'){
-
-                }
-            },
             dataTypeChange(val){
                 this.groupData.subEqOperator=val==='2'?'=':undefined;
                 this.groupData.dataType=val;
                 this.clearNumText();
             },
-            subTypeChange(val){         //基础规则类型修改
+            subTypeChange(val){        //基础规则类型修改
                 this.groupData.subLenCode='';
                 this.groupData.dataType='';
                 this.clearConcept();

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

@@ -29,7 +29,7 @@
         },
         computed:{
           'disable':function(){
-              return Object.keys(this.firstPlace||{}).length>0&&this.inx===0;
+              return Object.keys(this.firstPlace||{}).length>0;
           }
         },
         methods:{