浏览代码

是否显示判断

wyq 4 年之前
父节点
当前提交
1e269dfc34
共有 2 个文件被更改,包括 20 次插入8 次删除
  1. 15 0
      src/components/knowledgeExtra/AddNewRule.vue
  2. 5 8
      src/components/knowledgeExtra/AddNewRuleTable.vue

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

@@ -220,6 +220,7 @@
           :klRuleByIdSub="form.klRuleByIdSub"
           :maxNum="subRuleMaxNum"
           :showMsg="showMsg"
+          :showMsg2="showMsg2"
           :ruleTermCodeStr="ruleTermCodeStr"
           @subTypeChange="subTypeChange"
           @searchConcept="searchConcept"
@@ -747,6 +748,14 @@ export default {
       }
       return str;
     },
+    ruleTermCodeStr2: function() {
+      const str = this.form.parRuleType + '-' + this.form.parLenCode + '-' + 0;
+      if (str.length <= 1) {
+        return '';
+      }
+      
+      return str;
+    },
     ruleTermCodeStrs: function() {
       const str = this.form.parRuleType + '-' + this.form.parLenCode;
       if (str.length <= 1) {
@@ -760,6 +769,12 @@ export default {
         this.msgDict.indexOf(this.ruleTermCodeStr) > -1
       );
     },
+    showMsg2: function() {
+      return (
+        this.ruleTermCodeStr2.length > 2 &&
+        this.msgDict.indexOf(this.ruleTermCodeStr2) > -1
+      );
+    },
     showHasSub() {
       if (this.ruleTermCodeStrs.length > 2) {
         return this.subDict.indexOf(this.ruleTermCodeStrs) != -1;

+ 5 - 8
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -156,8 +156,7 @@
       <el-table-column
         width="170px"
         label="附加信息"
-        prop="subMsg"
-        v-if="ruleTermCodeStr!='2-106-1' && ruleTermCodeStr!='3-108-1' && ruleTermCodeStr!='3-112-1' && ruleTermCodeStr!='4-108-1'"
+        v-if="showMsg || showMsg2"
       >
         <template slot="header" slot-scope="scope">
           <div :class="showMsg?'custom_table_header':''">附加信息</div>
@@ -165,7 +164,7 @@
         <template slot-scope="scope">
           <el-form-item
             :prop="`klRuleByIdSub[${scope.$index}].subMsg`"
-            :rules="showMsg?rules.subMsg:rules.subMsgs"
+            :rules="showMsg?rules.subMsg:showMsg2?[]:rules.subMsgs"
             :class="scope.row.subMsg?'form-texarea':''"
             class="texarea-form"
           >
@@ -710,13 +709,10 @@ export default {
     isMax(id) {
       const typeNum = this.klRuleByIdSub.filter(item => item.groupId === id)
         .length;
-      console.log(typeNum);
-      console.log(this.maxNum);
       return typeNum >= this.maxNum;
     },
     // 基础规则类型选择
     subTypeChange(e, index) {
-      console.log(e);
       this.$emit('subTypeChange', e, index);
     },
     //
@@ -829,8 +825,6 @@ export default {
         : '正则表达式';
     },
     blurRef() {
-      console.log('scroll');
-      console.log(this.$refs[this.theRef]);
       if (this.theRef) {
         this.$refs[this.theRef].blur();
         // console.log(document.getElementById(this.theRef).blur,'hehehe');
@@ -887,6 +881,9 @@ export default {
     showMsg: {
       default: null
     },
+    showMsg2:{
+      default: null
+    },
     ruleTermCodeStr: {
       default: null
     }