Explorar el Código

Merge branch 'uiUpdate0507' into test

reaper hace 4 años
padre
commit
0ef605ce4e

+ 31 - 0
src/components/knowledgeExtra/AddDiagBase.vue

@@ -97,6 +97,7 @@
                   :rules="rules.conditionType"
                 >
                   <el-select
+                  ref="aa"
                     v-model="form.klDiagnoseTypeVO[scope.$index].conditionType"
                     @change="(val)=>basTypeChange(val,scope.$index)"
                   >
@@ -732,7 +733,37 @@ export default {
       return dest;
     }
   },
+  // mounted() {
+  //   this.onscroll();
+  // },
   methods: {
+    // onscroll() {
+    //   this.$nextTick(function() {
+    //     // 监听当前组件的滚动事件
+    //     this.box = this.$refs.tableList.bodyWrapper;
+    //     this.box.addEventListener(
+    //       'scroll',
+    //       () => {
+    //         // select组件层级太高,滚动隐藏
+    //         if (this.$refs.tableList.bodyWrapper.scrollLeft > 0) {
+    //           console.log(this.$refs.aa.handleClose)
+    //           // this.$refs.aa.handleClose()
+    //           // this.$refs.aa.blur()
+    //           // const SELECTWRAP_BODY = document.body; // body
+    //           // const SELECTWRAP_DOWNALL = document.querySelectorAll(
+    //           //   '.el-select-dropdown'
+    //           // ); // select下拉框
+    //           // SELECTWRAP_BODY.click();
+
+    //           // SELECTWRAP_DOWNALL.forEach(item => {
+    //           //   item.blur();
+    //           // });
+    //         }
+    //       },
+    //       false
+    //     );
+    //   });
+    // },
     // 最大值 选择rule
     maxOperator(items, rule, value, callback) {
       const { maxVal, minOperator, minVal } = items;

+ 40 - 21
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -91,9 +91,14 @@
     font-size: 14px;
     font-weight: 400;
   }
-  /deep/ .el-select{
+  /deep/ .el-select {
     font-size: 12px;
   }
+  /deep/ .el-table--mini,
+  .el-table--small,
+  .el-table__expand-icon {
+    font-size: 14px;
+  }
 }
 </style>
 
@@ -444,7 +449,6 @@
                 <el-col :span="6">
                   <el-form-item
                     :prop="`klRuleByIdSub[${scope.$index}].subMinUnit`"
-                    :rules="[{ required: true, trigger: 'blur' }]"
                   >
                     <el-input
                       type="text"
@@ -492,10 +496,7 @@
             </div>
 
             <!-- v-if="groupData.subType === 6" -->
-            <div
-              style="flex: 2"
-              v-if="scope.row.subType == 6"
-            >
+            <div style="flex: 2" v-if="scope.row.subType == 6">
               <el-form-item
                 class="type_content_item"
                 label="正则表达式:"
@@ -800,25 +801,26 @@ export default {
         : "正则表达式";
     },
     blurRef() {
-      console.log("11111");
-      this.$nextTick(() => {
-        console.log("???", this.$refs[this.theRef]);
-        this.$refs[this.theRef].handleClose();
-      });
+      console.log("scroll");
+      console.log(this.$refs[this.theRef]);
+      if (this.theRef) {
+        this.$refs[this.theRef].blur();
+        // console.log(document.getElementById(this.theRef).blur,'hehehe');
+        // document.getElementById(this.theRef).focus()
+        // document.getElementById(this.theRef).value = 123
+      }
     }
   },
   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();
-      }
-    });
+    // console.log('mounted');
+    // let that = this;
+    // this.$refs.table.bodyWrapper.addEventListener(
+    //   "scroll",
+    //   that.blurRef,
+    //   false
+    // );
   },
   created() {
     this.numTypes = localStorage.getItem("zskNumDict");
@@ -828,7 +830,24 @@ export default {
     this.getSpanArr(this.klRuleByIdSub);
   },
 
-  updated() {},
+  updated() {
+    // let that = this;
+    // this.$nextTick(() => {
+    //   // FIX 滚动添加事件
+    //   this.$refs.table.bodyWrapper.removeEventListener(
+    //     "scroll",
+    //     that.blurRef,
+    //     false
+    //   );
+    //   setTimeout(() => {
+    //     that.$refs.table.bodyWrapper.addEventListener(
+    //       "scroll",
+    //       that.blurRef,
+    //       false
+    //     );
+    //   }, 300);
+    // });
+  },
   props: {
     klRuleByIdSub: {
       type: Array,