Jelajahi Sumber

Merge branch 'uiUpdate0507' into test

reaper 4 tahun lalu
induk
melakukan
2ac90d4a37

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

@@ -1,5 +1,5 @@
 <style lang="less" scoped>
-@import "../../less/admin.less";
+// @import "../../less/admin.less";
 #AddRuleContent {
   width: 100%;
   min-width: 1000px;
@@ -39,10 +39,14 @@
     text-align: center;
   }
   /deep/ .el-form-item.is-success .el-input__inner,
-  .el-form-item.is-success .el-input__inner:focus,
-  .el-form-item.is-success .el-textarea__inner,
-  .el-form-item.is-success .el-textarea__inner:focus {
-    border-color: #c9c9c9;
+  .el-form-item.is-success .el-textarea__inner {
+    border-color: #c9c9c9 !important;
+  }
+  /deep/ .el-form-item.is-success .el-textarea__inner{
+    border-color: #c9c9c9 !important;
+  }
+  /deep/ .el-form-item.is-success .el-textarea__inner{
+    border-color: #c9c9c9 !important;
   }
 }
 </style>
@@ -197,6 +201,8 @@
           @delGroup="delGroup"
           @delGroupChild="delGroupChild"
           @setFormData="setFormData"
+          @editKlRuleByIdSub="editKlRuleByIdSub"
+          @clearValidate="clearValidate"
         />
         <el-form-item>
           <div class="form_btn">
@@ -261,6 +267,9 @@ export default {
     }
   },
   methods: {
+    clearValidate(data){
+      this.$refs.ruleForm.clearValidate(data)
+    },
     // 编辑初始化
     async initEdidData() {
       // 规则术语类型初始化
@@ -460,6 +469,7 @@ export default {
         if (!init) {
           this.form.parConceptId = ""; //医学标准术语清空
           this.conceptList = []; //下拉列表清空
+          this.firstPlace = null;
         }
         this.tableShow = true;
       });
@@ -496,6 +506,9 @@ export default {
       this.form.klRuleByIdSub[index].subEqValue = "";
       this.form.klRuleByIdSub[index].subEqOperator = "";
     },
+    editKlRuleByIdSub(data) {
+      this.form.klRuleByIdSub = data;
+    },
     // 添加分组 || 规则
     addGroup(date, arg = { index: null, groupId: null }) {
       /**

+ 74 - 15
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -315,7 +315,7 @@
                         validator: (rule, value, callback) => {
                           subMaxOperator(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
@@ -323,6 +323,7 @@
                       v-model="scope.row.subMaxOperator"
                       placeholder="请选择"
                       clearable
+                      @change="maxChange($event, scope.$index, 's')"
                       :ref="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
                     >
                       <el-option
@@ -343,12 +344,14 @@
                         validator: (rule, value, callback) => {
                           subMaxValue(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
                     <el-input
                       type="text"
+                      @input="maxChange($event, scope.$index, 'i')"
+                      :ref="`klRuleByIdSub[${scope.$index}].subMaxValue`"
                       v-model="scope.row.subMaxValue"
                       placeholder="填写数值"
                     />
@@ -384,7 +387,7 @@
                         validator: (rule, value, callback) => {
                           subMinOperatorRule(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
@@ -393,6 +396,7 @@
                       placeholder="请选择"
                       clearable
                       :ref="`klRuleByIdSub[${scope.$index}].subMinOperator`"
+                      @change="minChange($event, scope.$index, 's')"
                     >
                       <el-option
                         v-for="item in operMinList"
@@ -412,12 +416,14 @@
                         validator: (rule, value, callback) => {
                           subMinValueRule(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
                     <el-input
                       type="text"
+                      :ref="`klRuleByIdSub[${scope.$index}].subMinValue`"
+                      @input="minChange($event, scope.$index, 'i')"
                       v-model="scope.row.subMinValue"
                       placeholder="填写数值"
                     />
@@ -441,7 +447,7 @@
             <el-form-item
               class="type_content_item"
               style="flex: 2"
-              v-if="scope.row.subType !== 6 && scope.row.dataType === '2'"
+              v-show="scope.row.subType !== 6 && scope.row.dataType === '2'"
               label="医学内容:"
               label-width="100px"
               :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
@@ -472,7 +478,7 @@
               label="正则表达式:"
               label-width="120px"
               style="flex: 2"
-              v-if="scope.row.subType === 6"
+              v-show="scope.row.subType === 6"
               :prop="`klRuleByIdSub[${scope.$index}].subEqValue1`"
               :rules="[
                 {
@@ -523,6 +529,52 @@ export default {
     };
   },
   methods: {
+    maxChange(e, val, type) {
+      console.log(e);
+      // this.$refs[`klRuleByIdSub[0].subMinValue`].clearValidate()
+      if (
+        type === "i" &&
+        this.klRuleByIdSub[val].subMaxOperator &&
+        this.klRuleByIdSub[val].subMaxOperator != ""
+      ) {
+        this.$emit("clearValidate", [
+          `klRuleByIdSub[${val}].subMinValue`,
+          `klRuleByIdSub[${val}].subMinOperator`
+        ]);
+      } else if (
+        type === "s" &&
+        this.klRuleByIdSub[val].subMaxValue &&
+        this.klRuleByIdSub[val].subMaxValue != ""
+      ) {
+        this.$emit("clearValidate", [
+          `klRuleByIdSub[${val}].subMinValue`,
+          `klRuleByIdSub[${val}].subMinOperator`
+        ]);
+      }
+    },
+    minChange(e, val, type) {
+      console.log(e);
+      // this.$refs[`klRuleByIdSub[0].subMinValue`].clearValidate()
+      if (
+        type === "i" &&
+        this.klRuleByIdSub[val].subMinOperator &&
+        this.klRuleByIdSub[val].subMinOperator != ""
+      ) {
+        this.$emit("clearValidate", [
+          `klRuleByIdSub[${val}].subMaxOperator`,
+          `klRuleByIdSub[${val}].subMaxValue`
+        ]);
+      } else if (
+        type === "s" &&
+        this.klRuleByIdSub[val].subMinValue &&
+        this.klRuleByIdSub[val].subMinValue != ""
+      ) {
+        this.$emit("clearValidate", [
+          `klRuleByIdSub[${val}].subMaxOperator`,
+          `klRuleByIdSub[${val}].subMaxValue`
+        ]);
+      }
+    },
     addGroup(scope) {
       this.$emit("addGroup", null, { groupId: scope.row.groupId });
       this.$refs.table.bodyWrapper.scrollLeft = 0;
@@ -633,14 +685,19 @@ export default {
       this.klRuleByIdSub[index].conceptList = [];
     },
     clearNumText(index) {
-      this.klRuleByIdSub[index].subMaxOperator = "";
-      this.klRuleByIdSub[index].subMaxValue = "";
-      this.klRuleByIdSub[index].subMaxUnit = "";
-      this.klRuleByIdSub[index].subMinOperator = "";
-      this.klRuleByIdSub[index].subMinValue = "";
-      this.klRuleByIdSub[index].subMinUnit = "";
-      this.klRuleByIdSub[index].subEqValue = "";
-      this.klRuleByIdSub[index].subEqOperator = "";
+      let obj = JSON.parse(JSON.stringify(this.klRuleByIdSub));
+
+      obj[index].subMaxOperator = "";
+      obj[index].subMaxValue = "";
+      obj[index].subMaxUnit = "";
+      obj[index].subMinOperator = "";
+      obj[index].subMinValue = "";
+      obj[index].subMinUnit = "";
+      obj[index].subEqValue = "";
+      // this.$set(obj[index], "subEqValue", "");
+      obj[index].subEqOperator = "";
+      // this.klRuleByIdSub = obj;
+      this.$emit("editKlRuleByIdSub", obj);
     },
     //医学标准术语change
     subConceptIdfocus(index) {
@@ -669,9 +726,11 @@ export default {
         });
     },
     dataTypeChange(val, index) {
+      console.log(val, index);
       this.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
       this.clearNumText(index);
-      delete this.klRuleByIdSub[index].dataType; //触发更新
+      // TODO 新增的内容追踪不到
+      //delete this.klRuleByIdSub[index].dataType; //触发更新
       this.$set(this.klRuleByIdSub[index], "dataType", val);
     },
     // 处理要合并相同行的列