Explorar o código

是否显示判断

wyq %!s(int64=3) %!d(string=hai) anos
pai
achega
d29c7a9a66

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

@@ -205,6 +205,7 @@
           :klRuleByIdSub="form.klRuleByIdSub"
           :maxNum="subRuleMaxNum"
           :showMsg="showMsg"
+          :showMsg2="showMsg2"
           :ruleTermCodeStr="ruleTermCodeStr"
           @subTypeChange="subTypeChange"
           @searchConcept="searchConcept"
@@ -733,6 +734,13 @@ 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) {
@@ -746,6 +754,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 - 2
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -157,7 +157,7 @@
         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 +165,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"
           >
@@ -888,6 +888,9 @@ export default {
     showMsg: {
       default: null
     },
+    showMsg2: {
+      default: null
+    },
     ruleTermCodeStr: {
       default: null
     }