Преглед изворни кода

Merge branch 'dragTerm1025' into test

# Conflicts:
#	src/components/knowledgeExtra/AddNewRuleTable.vue
1178232204@qq.com пре 3 година
родитељ
комит
a32b5cbe11
2 измењених фајлова са 494 додато и 352 уклоњено
  1. 459 320
      src/components/knowledgeExtra/AddNewRule.vue
  2. 35 32
      src/components/knowledgeExtra/AddNewRuleTable.vue

Разлика између датотеке није приказан због своје велике величине
+ 459 - 320
src/components/knowledgeExtra/AddNewRule.vue


+ 35 - 32
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -196,12 +196,10 @@
                 alt
               />
             </div>
-            <div
-              class="btn_div"
-              v-if="klRuleByIdSub.length > 1 && !scope.row.disabled"
-            >
+            
+            <div class="btn_div" v-if="klRuleByIdSub.length > 1 && !scope.row.disabled">
               <img
-                @click="$emit('delGroupChild', scope.row.groupChildId)"
+                @click="$emit('delGroupChild', scope.row.groupChildId,scope.$index,scope.row.groupId,scope.row.del,scope.row.key,scope.row.baseTermTypeList.length)"
                 src="../../images/add-new-rule-del.png"
                 alt
               />
@@ -243,9 +241,9 @@
               v-model="scope.row.subType"
               :disabled="scope.row.disabled"
               placeholder="请选择"
-              @change="subTypeChange($event, scope.$index)"
+              @change="subTypeChange($event, scope.$index,scope.row.groupId,scope.row.key)"
               @focus="
-                setTheRef($event, `klRuleByIdSub[${scope.$index}].subType`)
+                setTheRef($event, `klRuleByIdSub[${scope.$index}].subType`,'')
               "
               :ref="`klRuleByIdSub[${scope.$index}].subType`"
             >
@@ -274,9 +272,9 @@
               v-model="scope.row.subLenCode"
               placeholder="请选择"
               :ref="`klRuleByIdSub[${scope.$index}].subLenCode`"
-              @change="subCodeChange($event, scope.$index)"
+              @change="subCodeChange($event, scope.$index,scope.row.groupId,scope.row.key,scope.row.baseTermTypeList.length)"
               @focus="
-                setTheRef($event, `klRuleByIdSub[${scope.$index}].subLenCode`)
+                setTheRef($event, `klRuleByIdSub[${scope.$index}].subLenCode`,scope.row.subLenCode,true)
               "
             >
               <el-option
@@ -334,7 +332,7 @@
                 placeholder="选择类型"
                 @change="dataTypeChange($event, scope.$index)"
                 @focus="
-                  setTheRef($event, `klRuleByIdSub[${scope.$index}].dataType`)
+                  setTheRef($event, `klRuleByIdSub[${scope.$index}].dataType`,'')
                 "
                 :ref="`klRuleByIdSub[${scope.$index}].dataType`"
               >
@@ -372,7 +370,7 @@
                         setTheRef(
                           $event,
                           `klRuleByIdSub[${scope.$index}].subMaxOperator`
-                        )
+                        ),''
                       "
                       :ref="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
                     >
@@ -450,7 +448,7 @@
                         setTheRef(
                           $event,
                           `klRuleByIdSub[${scope.$index}].subMinOperator`
-                        )
+                        ),''
                       "
                     >
                       <el-option
@@ -579,16 +577,11 @@ export default {
     return {
       numTypes: "",
       subConceptIdIndex: "",
-      operMaxList: [
-        { name: "<=", key: "<=" },
-        { name: "<", key: "<" },
-      ],
-      operMinList: [
-        { name: ">", key: ">" },
-        { name: ">=", key: ">=" },
-      ],
+      operMaxList: [{ name: "<=", key: "<=" }, { name: "<", key: "<" }],
+      operMinList: [{ name: ">", key: ">" }, { name: ">=", key: ">=" }],
       rules: tableRules,
       theRef: null,
+      code: "",
     };
   },
   methods: {
@@ -643,11 +636,11 @@ export default {
       this.setScrollRight();
     },
     addGroup(scope) {
-      this.$emit("addGroup", null, { groupId: scope.row.groupId });
+      this.$emit("addGroup", null,scope.row.key, { groupId: scope.row.groupId });
       this.$refs.table.bodyWrapper.scrollLeft = 0;
     },
     addChildGroup(scope) {
-      this.$emit("addGroup", scope.row.groupId, { index: scope.$index });
+      this.$emit("addGroup", scope.row.groupId,scope.row.key, { index: scope.$index });
       this.$refs.table.bodyWrapper.scrollLeft = 0;
     },
     scrollFun() {
@@ -733,23 +726,34 @@ export default {
     },
     // 是否超出最大规则数
     isMax(id) {
-      const typeNum = this.klRuleByIdSub.filter(
-        (item) => item.groupId === id
-      ).length;
+      const typeNum = this.klRuleByIdSub.filter((item) => item.groupId === id)
+        .length;
       return typeNum >= this.maxNum;
     },
     // 基础规则类型选择
-    subTypeChange(e, index) {
-      this.$emit("subTypeChange", e, index);
+    subTypeChange(e, index, groupId, key) {
+      this.$emit("subTypeChange", e, index, groupId, key);
     },
     //
-    setTheRef(e, val) {
+    setTheRef(e, val, code, type) {
       this.theRef = val;
+      if (type) {
+        this.code = code ? code : "";
+      }
     },
     // 规则术语类型
-    subCodeChange(val, index) {
+    subCodeChange(val, index, groupId, key,lens) {
       //基础规则术语类型修改
-      this.$emit("childSubCodeChange", val, index, this.numTypes);
+      this.$emit(
+        "childSubCodeChange",
+        val,
+        index,
+        this.numTypes,
+        groupId,
+        key,
+        this.code,
+        lens
+      );
     },
     clearConcept(index) {
       this.$emit("childClearConcept", index);
@@ -761,7 +765,7 @@ export default {
     subConceptIdfocus(index) {
       this.subConceptIdIndex = "";
       this.subConceptIdIndex = index;
-      this.setTheRef(1, `klRuleByIdSub[${index}].subConceptId`);
+      this.setTheRef(1, `klRuleByIdSub[${index}].subConceptId`, "");
     },
     // 医学标准术语
     searchConcept(val) {
@@ -917,4 +921,3 @@ export default {
   },
 };
 </script>
-