浏览代码

fixbug 7747

reaper 4 年之前
父节点
当前提交
4cecc5880c
共有 2 个文件被更改,包括 24 次插入11 次删除
  1. 5 0
      src/components/knowledgeExtra/AddNewRule.vue
  2. 19 11
      src/components/knowledgeExtra/AddNewRuleTable.vue

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

@@ -197,6 +197,7 @@
           @delGroup="delGroup"
           @delGroupChild="delGroupChild"
           @setFormData="setFormData"
+          @editKlRuleByIdSub="editKlRuleByIdSub"
         />
         <el-form-item>
           <div class="form_btn">
@@ -460,6 +461,7 @@ export default {
         if (!init) {
           this.form.parConceptId = ""; //医学标准术语清空
           this.conceptList = []; //下拉列表清空
+          this.firstPlace = null;
         }
         this.tableShow = true;
       });
@@ -496,6 +498,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 }) {
       /**

+ 19 - 11
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -441,7 +441,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 +472,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="[
                 {
@@ -633,14 +633,20 @@ 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 +675,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);
     },
     // 处理要合并相同行的列