Forráskód Böngészése

Merge branch 'uiUpdate0507' into test

reaper 4 éve
szülő
commit
4bc25a98c9

+ 143 - 29
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,13 +39,39 @@
     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;
+  }
+  .my_error {
+    position: absolute;
+    top: 0;
+    left: -16px;
+    img {
+      width: 12px;
+      height: 12px;
+      cursor: pointer;
+    }
   }
 }
 </style>
+<style lang="less">
+.popper_class {
+  // background: #fff !important;
+  border: 1px solid #ffa0a0 !important;
+  color: #999999 !important;
+  padding: 3px 50px 3px 10px !important;
+  margin-left: -10px;
+}
+.popper__arrow {
+  border-top-color: #ffa0a0 !important;
+}
+</style>
 <template>
   <div>
     <crumbs
@@ -92,6 +118,19 @@
                 >
                 </el-option>
               </el-select>
+              <template slot="error" slot-scope="scope">
+                <div class="my_error">
+                  <el-tooltip
+                    class="item"
+                    effect="light"
+                    :content="scope.error"
+                    placement="top-start"
+                    popper-class="popper_class"
+                  >
+                    <img src="../../images/exclamationpoint.png" alt="" />
+                  </el-tooltip>
+                </div>
+              </template>
               <div class="tip_text">
                 注:更改规则类型,将会清空已填写的规则内容~
               </div>
@@ -105,6 +144,19 @@
               :rules="rules.parLenCode"
               prop="parLenCode"
             >
+              <template slot="error" slot-scope="scope">
+                <div class="my_error">
+                  <el-tooltip
+                    class="item"
+                    effect="light"
+                    :content="scope.error"
+                    placement="top-start"
+                    popper-class="popper_class"
+                  >
+                    <img src="../../images/exclamationpoint.png" alt="" />
+                  </el-tooltip>
+                </div>
+              </template>
               <el-select
                 v-model="form.parLenCode"
                 placeholder="请选择"
@@ -188,6 +240,7 @@
         </div>
         <!-- 表格 -->
         <AddNewRuleTable
+          ref="tableView"
           v-if="form.parHasSub && tableShow"
           :klRuleByIdSub="form.klRuleByIdSub"
           :maxNum="subRuleMaxNum"
@@ -197,6 +250,12 @@
           @delGroup="delGroup"
           @delGroupChild="delGroupChild"
           @setFormData="setFormData"
+          @editKlRuleByIdSub="editKlRuleByIdSub"
+          @clearValidate="clearValidate"
+          @childClearConcept="childClearConcept"
+          @childClearNumText="childClearNumText"
+          @ChildDataTypeChange="ChildDataTypeChange"
+          @childSubCodeChange="childSubCodeChange"
         />
         <el-form-item>
           <div class="form_btn">
@@ -261,6 +320,9 @@ export default {
     }
   },
   methods: {
+    clearValidate(data) {
+      this.$refs.ruleForm.clearValidate(data);
+    },
     // 编辑初始化
     async initEdidData() {
       // 规则术语类型初始化
@@ -325,6 +387,7 @@ export default {
     },
     // 提交
     submitForm(formName) {
+      console.log(this.form);
       this.$refs[formName].validate((valid) => {
         if (valid) {
           let params = JSON.parse(JSON.stringify(this.form));
@@ -361,7 +424,7 @@ export default {
     },
     // 子集修改父级的数组
     setFormData(index, data) {
-      this.form.klRuleByIdSub[index].conceptList = data;
+      this.$set(this.form.klRuleByIdSub[index], "conceptList", data);
     },
     // table_form 规则类型选中
     ruleTypeChange(val) {
@@ -460,6 +523,7 @@ export default {
         if (!init) {
           this.form.parConceptId = ""; //医学标准术语清空
           this.conceptList = []; //下拉列表清空
+          this.firstPlace = null;
         }
         this.tableShow = true;
       });
@@ -476,25 +540,35 @@ export default {
     subTypeChange(val, index) {
       // index
       const obj = this.baseTypeList.find((it) => it.type === val);
-      this.form.klRuleByIdSub[index].baseTermTypeList = obj.subMenuList;
-      this.form.klRuleByIdSub[index].subLenCode = "";
-      this.form.klRuleByIdSub[index].dataType = "";
+
+      this.$set(
+        this.form.klRuleByIdSub[index],
+        "baseTermTypeList",
+        obj.subMenuList
+      );
+      this.$set(this.form.klRuleByIdSub[index], "subLenCode", "");
+      this.$set(this.form.klRuleByIdSub[index], "dataType", "");
+
       this.clearConcept(index);
       this.clearNumText(index);
     },
     clearConcept(index) {
-      this.form.klRuleByIdSub[index].subConceptId = "";
+      this.$set(this.form.klRuleByIdSub[index], "subConceptId", "");
       this.conceptList = [];
     },
     clearNumText(index) {
-      this.form.klRuleByIdSub[index].subMaxOperator = "";
-      this.form.klRuleByIdSub[index].subMaxValue = "";
-      this.form.klRuleByIdSub[index].subMaxUnit = "";
-      this.form.klRuleByIdSub[index].subMinOperator = "";
-      this.form.klRuleByIdSub[index].subMinValue = "";
-      this.form.klRuleByIdSub[index].subMinUnit = "";
-      this.form.klRuleByIdSub[index].subEqValue = "";
-      this.form.klRuleByIdSub[index].subEqOperator = "";
+      this.$set(this.form.klRuleByIdSub[index], "subMaxOperator", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMaxValue", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMaxUnit", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMinOperator", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMinValue", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMinUnit", "");
+      this.$set(this.form.klRuleByIdSub[index], "subEqValue", "");
+      this.$set(this.form.klRuleByIdSub[index], "subEqOperator", "");
+    },
+    editKlRuleByIdSub(data) {
+      this.$set(this.form, "klRuleByIdSub", data);
+      // this.form.klRuleByIdSub = data;
     },
     // 添加分组 || 规则
     addGroup(date, arg = { index: null, groupId: null }) {
@@ -557,6 +631,9 @@ export default {
         });
         this.form.klRuleByIdSub.splice(i + 1, 0, obj);
       }
+      this.$nextTick(() => {
+        this.$refs.tableView.scrollFun();
+      });
     },
     // 删除分组
     delGroup(groupId) {
@@ -626,6 +703,54 @@ export default {
           });
         }
       });
+    },
+    /**
+     * 子组件调用方法
+     */
+    childClearConcept(index) {
+      this.$set(this.form.klRuleByIdSub[index], "subConceptId", "");
+      this.$set(this.form.klRuleByIdSub[index], "conceptList", []);
+    },
+    childClearNumText(index) {
+      let obj = JSON.parse(JSON.stringify(this.form.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);
+      this.editKlRuleByIdSub(obj);
+    },
+    ChildDataTypeChange(val, index) {
+      // this.form.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
+      this.$set(
+        this.form.klRuleByIdSub[index],
+        "subEqOperator",
+        val === "2" ? "=" : ""
+      );
+
+      this.childClearNumText(index);
+      // TODO 新增的内容追踪不到
+      this.form.klRuleByIdSub.forEach((item, i) => {
+        if (index === i) {
+          this.$set(item, "dataType", val);
+        }
+      });
+    },
+    childSubCodeChange(val, index, numTypes) {
+      if ((numTypes + ",").indexOf(val + ",") > -1) {
+        this.$set(this.form.klRuleByIdSub[index], "dataType", "1");
+      } else {
+        this.$set(this.form.klRuleByIdSub[index], "dataType", "1");
+      }
+      this.childClearConcept(index);
+      this.childClearNumText(index);
     }
   },
   watch: {
@@ -642,16 +767,6 @@ export default {
         });
       },
       deep: true
-    },
-    "form.parHasSub"(val) {
-      console.log(val);
-      console.log(this.form);
-      // if (!val || val == 0) {
-      //   // this.form.klRuleByIdSub = [];
-      //   this.$set(this.form, "klRuleByIdSub", []);
-
-      //   console.log(this.form);
-      // }
     }
   },
   computed: {
@@ -666,7 +781,6 @@ export default {
       return str;
     },
     showMsg: function () {
-      console.log(this.ruleTermCodeStr, "???", this.msgDict);
       return (
         this.ruleTermCodeStr.length > 2 &&
         this.msgDict.indexOf(this.ruleTermCodeStr) > -1

+ 202 - 100
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -1,5 +1,5 @@
 <style lang="less" scoped>
-.AddNewRuleTable {
+#AddNewRuleTable {
   width: 100%;
   background: #fff;
   margin-top: 10px;
@@ -75,9 +75,6 @@
       margin-right: 4px;
     }
   }
-  // ::v-deep .el-table tbody tr:hover > td {
-  //   // background-color: transparent;
-  // }
   /deep/ .el-table th {
     background: transparent;
   }
@@ -87,9 +84,6 @@
   .table_cell_cls {
     vertical-align: top;
   }
-  // /deep/ .el-table__body .el-table__row.hover-row td {
-  //   // background-color: transparent;
-  // }
   /deep/ .el-form-item__label {
     font-size: 12px;
   }
@@ -97,15 +91,15 @@
     font-size: 14px;
     font-weight: 400;
   }
-  // /deep/ .el-table__body tr.current-row>td{
-  //   background: #fff;
-  // }
+  /deep/ .el-select{
+    font-size: 12px;
+  }
 }
 </style>
 
 <template>
   <!-- :prop="`klRuleByIdSub[${scope.$index}].subDescription`" -->
-  <div class="AddNewRuleTable">
+  <div id="AddNewRuleTable">
     <h4 style="margin-bottom: 24px">规则内容:</h4>
     <!-- 隔行换色  :row-style="rowStyle" -->
     <el-table
@@ -113,7 +107,7 @@
       :data="klRuleByIdSub"
       size="mini"
       style="min-height: 200px"
-      height="calc(100vh - 383px)"
+      height="calc(100vh - 393px)"
       :header-row-style="{ background: '#E3EAF4' }"
       :cell-style="cellStyle"
       :span-method="ObjectSpanMethod"
@@ -169,8 +163,8 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column width="170px" prop="subDescription">
-        <template slot="header">
+      <el-table-column width="170px" prop="subDescription" label="基础规则名称">
+        <template slot="header" slot-scope="scope">
           <div class="custom_table_header">基础规则名称</div>
         </template>
         <template slot-scope="scope">
@@ -189,8 +183,8 @@
           </el-form-item>
         </template>
       </el-table-column>
-      <el-table-column width="170px" prop="subType">
-        <template slot="header">
+      <el-table-column width="170px" prop="subType" label="基础规则类型">
+        <template slot="header" slot-scope="scope">
           <div class="custom_table_header">基础规则类型</div>
         </template>
         <template slot-scope="scope">
@@ -204,6 +198,10 @@
               :disabled="scope.row.disabled"
               placeholder="请选择"
               @change="subTypeChange($event, scope.$index)"
+              @focus="
+                setTheRef($event, `klRuleByIdSub[${scope.$index}].subType`)
+              "
+              :ref="`klRuleByIdSub[${scope.$index}].subType`"
             >
               <el-option
                 v-for="item in scope.row.baseTypes"
@@ -216,8 +214,8 @@
           </el-form-item>
         </template>
       </el-table-column>
-      <el-table-column width="170px" prop="subLenCode">
-        <template slot="header">
+      <el-table-column width="170px" prop="subLenCode" label="基础规则术语类型">
+        <template slot="header" slot-scope="scope">
           <div class="custom_table_header">基础规则术语类型</div>
         </template>
         <template slot-scope="scope">
@@ -230,7 +228,11 @@
               :disabled="scope.row.disabled"
               v-model="scope.row.subLenCode"
               placeholder="请选择"
+              :ref="`klRuleByIdSub[${scope.$index}].subLenCode`"
               @change="subCodeChange($event, scope.$index)"
+              @focus="
+                setTheRef($event, `klRuleByIdSub[${scope.$index}].subLenCode`)
+              "
             >
               <el-option
                 v-for="item in scope.row.baseTermTypeList"
@@ -244,7 +246,7 @@
         </template>
       </el-table-column>
       <el-table-column width="170px" label="医学标准术语" prop="subConceptId">
-        <template slot="header">
+        <template slot="header" slot-scope="scope">
           <div class="custom_table_header">医学标准术语</div>
         </template>
         <template slot-scope="scope">
@@ -261,6 +263,7 @@
               @focus="subConceptIdfocus(scope.$index)"
               :remote-method="searchConcept"
               v-model.trim="scope.row.subConceptId"
+              :ref="`klRuleByIdSub[${scope.$index}].subConceptId`"
             >
               <el-option
                 v-for="item in scope.row.conceptList"
@@ -286,6 +289,10 @@
                 v-model="scope.row.dataType"
                 placeholder="选择类型"
                 @change="dataTypeChange($event, scope.$index)"
+                @focus="
+                  setTheRef($event, `klRuleByIdSub[${scope.$index}].dataType`)
+                "
+                :ref="`klRuleByIdSub[${scope.$index}].dataType`"
               >
                 <el-option label="数值类型" value="1"> </el-option>
                 <el-option label="文本类型" value="2"> </el-option>
@@ -308,7 +315,7 @@
                         validator: (rule, value, callback) => {
                           subMaxOperator(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
@@ -316,6 +323,14 @@
                       v-model="scope.row.subMaxOperator"
                       placeholder="请选择"
                       clearable
+                      @change="maxChange($event, scope.$index, 's')"
+                      @focus="
+                        setTheRef(
+                          $event,
+                          `klRuleByIdSub[${scope.$index}].subMaxOperator`
+                        )
+                      "
+                      :ref="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
                     >
                       <el-option
                         v-for="item in operMaxList"
@@ -335,12 +350,14 @@
                         validator: (rule, value, callback) => {
                           subMaxValue(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
                     <el-input
                       type="text"
+                      @focus="maxChange($event, scope.$index, 'i')"
+                      :ref="`klRuleByIdSub[${scope.$index}].subMaxValue`"
                       v-model="scope.row.subMaxValue"
                       placeholder="填写数值"
                     />
@@ -349,10 +366,10 @@
                 <el-col :span="6">
                   <el-form-item
                     :prop="`klRuleByIdSub[${scope.$index}].subMaxUnit`"
-                    :rules="rules.subMaxUnit"
                   >
                     <el-input
                       type="text"
+                      @focus="setScrollRight"
                       v-model.trim="scope.row.subMaxUnit"
                       placeholder="填写单位"
                     />
@@ -376,7 +393,7 @@
                         validator: (rule, value, callback) => {
                           subMinOperatorRule(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
@@ -384,6 +401,14 @@
                       v-model="scope.row.subMinOperator"
                       placeholder="请选择"
                       clearable
+                      :ref="`klRuleByIdSub[${scope.$index}].subMinOperator`"
+                      @change="minChange($event, scope.$index, 's')"
+                      @focus="
+                        setTheRef(
+                          $event,
+                          `klRuleByIdSub[${scope.$index}].subMinOperator`
+                        )
+                      "
                     >
                       <el-option
                         v-for="item in operMinList"
@@ -403,12 +428,14 @@
                         validator: (rule, value, callback) => {
                           subMinValueRule(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
                     <el-input
                       type="text"
+                      :ref="`klRuleByIdSub[${scope.$index}].subMinValue`"
+                      @focus="minChange($event, scope.$index, 'i')"
                       v-model="scope.row.subMinValue"
                       placeholder="填写数值"
                     />
@@ -417,10 +444,11 @@
                 <el-col :span="6">
                   <el-form-item
                     :prop="`klRuleByIdSub[${scope.$index}].subMinUnit`"
-                    :rules="rules.subMinUnit"
+                    :rules="[{ required: true, trigger: 'blur' }]"
                   >
                     <el-input
                       type="text"
+                      @focus="setScrollRight"
                       v-model.trim="scope.row.subMinUnit"
                       placeholder="填写单位"
                     />
@@ -429,63 +457,74 @@
               </el-row>
             </el-form-item>
             <!-- v-if="klRuleByIdSub[scope.$index].subType !== 6 && klRuleByIdSub[scope.$index].dataType === '2'" -->
-            <el-form-item
-              class="type_content_item"
+            <div
               style="flex: 2"
-              v-if="scope.row.subType !== 6 && scope.row.dataType === '2'"
-              label="医学内容:"
-              label-width="100px"
-              :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
-              :rules="[
-                {
-                  required: true,
-                  message: '请输入' + textName(scope.$index),
-                  trigger: 'blur'
-                },
-                {
-                  validator: (rule, value, callback) => {
-                    subEqValue(scope, rule, value, callback);
-                  },
-                  trigger: 'blur'
-                }
-              ]"
+              v-if="scope.row.subType != 6 && scope.row.dataType == '2'"
             >
-              <el-input
-                type="textarea"
-                rows="1"
-                placeholder="请输入医学内容"
-                v-model.trim="scope.row.subEqValue"
-              ></el-input>
-            </el-form-item>
+              <el-form-item
+                class="type_content_item"
+                style="width: 100%"
+                label="医学内容:"
+                label-width="100px"
+                :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
+                :rules="[
+                  {
+                    required: true,
+                    message: '请输入' + textName(scope.$index),
+                    trigger: 'blur'
+                  },
+                  {
+                    validator: (rule, value, callback) => {
+                      subEqValue(scope, rule, value, callback);
+                    },
+                    trigger: 'blur'
+                  }
+                ]"
+              >
+                <el-input
+                  type="textarea"
+                  rows="1"
+                  placeholder="请输入医学内容"
+                  @focus="setScrollRight"
+                  v-model.trim="scope.row.subEqValue"
+                ></el-input>
+              </el-form-item>
+            </div>
+
             <!-- v-if="groupData.subType === 6" -->
-            <el-form-item
-              class="type_content_item"
-              label="正则表达式:"
-              label-width="120px"
+            <div
               style="flex: 2"
-              v-if="scope.row.subType === 6"
-              :prop="`klRuleByIdSub[${scope.$index}].subEqValue1`"
-              :rules="[
-                {
-                  required: true,
-                  message: '请输入' + textName(scope.$index),
-                  trigger: 'blur'
-                },
-                {
-                  validator: (rule, value, callback) => {
-                    subEqValue(scope, rule, value, callback);
-                  },
-                  trigger: 'blur'
-                }
-              ]"
+              v-if="scope.row.subType == 6"
             >
-              <el-input
-                type="textarea"
-                rows="1"
-                placeholder="请输入正则表达式"
-                v-model.trim="scope.row.subEqValue"
-              ></el-input>
-            </el-form-item>
+              <el-form-item
+                class="type_content_item"
+                label="正则表达式:"
+                label-width="120px"
+                style="width: 100%"
+                :prop="`klRuleByIdSub[${scope.$index}].subEqValue1`"
+                :rules="[
+                  {
+                    required: true,
+                    message: '请输入' + textName(scope.$index),
+                    trigger: 'blur'
+                  },
+                  {
+                    validator: (rule, value, callback) => {
+                      subEqValue(scope, rule, value, callback);
+                    },
+                    trigger: 'blur'
+                  }
+                ]"
+              >
+                <el-input
+                  type="textarea"
+                  rows="1"
+                  placeholder="请输入正则表达式"
+                  @focus="setScrollRight"
+                  v-model.trim="scope.row.subEqValue"
+                ></el-input>
+              </el-form-item>
+            </div>
           </div>
         </template>
       </el-table-column>
@@ -510,10 +549,60 @@ export default {
         { name: ">", key: ">" },
         { name: ">=", key: ">=" }
       ],
-      rules: tableRules
+      rules: tableRules,
+      theRef: null
     };
   },
   methods: {
+    setScrollRight() {
+      this.$nextTick(() => {
+        this.$refs.table.bodyWrapper.scrollLeft = this.$refs.table.bodyWrapper.scrollWidth;
+      });
+    },
+    maxChange(e, val, type) {
+      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`
+        ]);
+      }
+      this.setScrollRight();
+    },
+    minChange(e, val, type) {
+      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`
+        ]);
+      }
+      this.setScrollRight();
+    },
     addGroup(scope) {
       this.$emit("addGroup", null, { groupId: scope.row.groupId });
       this.$refs.table.bodyWrapper.scrollLeft = 0;
@@ -522,6 +611,10 @@ export default {
       this.$emit("addGroup", scope.row.groupId, { index: scope.$index });
       this.$refs.table.bodyWrapper.scrollLeft = 0;
     },
+    scrollFun() {
+      this.$refs.table.bodyWrapper.scrollTop =
+        this.$refs.table.bodyWrapper.scrollTop + 60;
+    },
     // table 隔行换色
     // rowStyle({ row }) {
     //   if (row.rowIndex % 2 == 0) {
@@ -608,35 +701,26 @@ export default {
     subTypeChange(e, index) {
       this.$emit("subTypeChange", e, index);
     },
+    //
+    setTheRef(e, val) {
+      this.theRef = val;
+    },
     // 规则术语类型
     subCodeChange(val, index) {
       //基础规则术语类型修改
-      if ((this.numTypes + ",").indexOf(val + ",") > -1) {
-        this.klRuleByIdSub[index].dataType = "1";
-      } else {
-        this.klRuleByIdSub[index].dataType = "";
-      }
-      this.clearConcept(index);
-      this.clearNumText(index);
+      this.$emit("childSubCodeChange", val, index, this.numTypes);
     },
     clearConcept(index) {
-      this.klRuleByIdSub[index].subConceptId = "";
-      this.klRuleByIdSub[index].conceptList = [];
+      this.$emit("childClearConcept", index);
     },
     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 = "";
+      this.$emit("childClearNumText", index);
     },
     //医学标准术语change
     subConceptIdfocus(index) {
       this.subConceptIdIndex = "";
       this.subConceptIdIndex = index;
+      this.setTheRef(1, `klRuleByIdSub[${index}].subConceptId`);
     },
     // 医学标准术语
     searchConcept(val) {
@@ -660,10 +744,7 @@ export default {
         });
     },
     dataTypeChange(val, index) {
-      this.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
-      this.clearNumText(index);
-      delete this.klRuleByIdSub[index].dataType; //触发更新
-      this.$set(this.klRuleByIdSub[index], "dataType", val);
+      this.$emit("ChildDataTypeChange", val, index);
     },
     // 处理要合并相同行的列
     getSpanArr(data) {
@@ -714,12 +795,31 @@ export default {
     },
     textName(index) {
       return this.klRuleByIdSub[index].subType !== 6 &&
-        this.klRuleByIdSub[index].dataType === "2"
+        this.klRuleByIdSub[index].dataType == "2"
         ? "医学内容"
         : "正则表达式";
+    },
+    blurRef() {
+      console.log("11111");
+      this.$nextTick(() => {
+        console.log("???", this.$refs[this.theRef]);
+        this.$refs[this.theRef].handleClose();
+      });
     }
   },
   components: {},
+  mounted() {
+    // this.theRef
+    // FIXME 滚动问题BUG 暂无解决办法
+    let that = this;
+    this.$refs.table.bodyWrapper.addEventListener("scroll", function () {
+      console.log("scroll");
+      if (that.theRef) {
+        console.log("theRef", that.theRef);
+        that.blurRef();
+      }
+    });
+  },
   created() {
     this.numTypes = localStorage.getItem("zskNumDict");
     this.getSpanArr(this.klRuleByIdSub);
@@ -727,6 +827,8 @@ export default {
   beforeUpdate() {
     this.getSpanArr(this.klRuleByIdSub);
   },
+
+  updated() {},
   props: {
     klRuleByIdSub: {
       type: Array,

BIN
src/images/exclamationpoint.png