瀏覽代碼

input滚动bug

11wqe1 1 年之前
父節點
當前提交
279c48cabd

+ 16 - 6
src/components/pages/test/examine/conpoments/personPage.vue

@@ -154,7 +154,7 @@
             <div>考核分数:{{ computedSco }}</div>
           </div>
         </div>
-        <div style="height:100%;overflow: hidden;padding-bottom: 80px;">
+        <div style="height:100%;overflow: auto;padding-bottom: 80px;">
           <div class="sBox_table">
             <div class="table_title">
               <div style="width: 150px;">一级指标</div>
@@ -214,7 +214,8 @@
                               color: k.sco1 == k.sco2 ? '#000' : 'red'
                             }"
                             @blur="
-                              saveTab(k.id,
+                              saveTab(
+                                k.id,
                                 k.sco2 > k.score
                                   ? (k.sco2 = k.score)
                                   : '' || k.sco2 < 0
@@ -224,6 +225,7 @@
                             "
                             type="number"
                             v-model="k.sco2"
+                            @wheel.prevent="handleWheel"
                           />
                         </div>
                       </div>
@@ -446,6 +448,10 @@ export default {
     this.getTeaList();
   },
   methods: {
+    // 禁用滚轮事件
+    handleWheel(event) {
+      event.preventDefault();
+    },
     // 获取页面数据
     getData() {
       this.tabLoading = true;
@@ -678,7 +684,7 @@ export default {
       let b = { sco2: 0, cogSum: "" };
       this.PageBaseData.forEach(e => {
         e.children.forEach(i => {
-          if ((i.id == id)) {
+          if (i.id == id) {
             a.sco2 = i.sco2;
             a.cogSum = i.cogSum;
           }
@@ -687,15 +693,19 @@ export default {
 
       this.PageBaseDataTwo.forEach(e => {
         e.children.forEach(i => {
-          if ((i.id == id)) {
+          if (i.id == id) {
             b.sco2 = i.sco2;
             b.cogSum = i.cogSum;
           }
         });
       });
 
-      console.log(a,b,id);
-      if (a.sco2 == b.sco2 && JSON.stringify(a.cogSum) === JSON.stringify(b.cogSum)) return;
+      console.log(a, b, id);
+      if (
+        a.sco2 == b.sco2 &&
+        JSON.stringify(a.cogSum) === JSON.stringify(b.cogSum)
+      )
+        return;
 
       let PageBaseDataCopy = JSON.parse(JSON.stringify(this.PageBaseData));
 

+ 8 - 2
src/components/pages/test/examine/conpoments/targetPage.vue

@@ -239,9 +239,11 @@
                 <input
                   type="number"
                   v-if="scope.row.judge == 1"
-                  style=" color :#A7AAB2;"
+                  style=" color
+                :#A7AAB2;"
                   @blur="Submit(scope.row)"
                   v-model="scope.row.cogSco"
+                  @wheel.prevent="handleWheel"
                 />
                 <input
                   type="number"
@@ -251,6 +253,7 @@
                   }"
                   @blur="Submit(scope.row)"
                   v-model="scope.row.cogSco"
+                  @wheel.prevent="handleWheel"
                 />
               </div>
             </template>
@@ -1343,6 +1346,10 @@ export default {
   },
 
   methods: {
+    // 禁用滚轮事件
+    handleWheel(event) {
+      event.preventDefault();
+    },
     // 获取教研室
     getTeaList() {
       let params = {
@@ -1705,7 +1712,6 @@ export default {
 
     // 概述提交
     Submit2(val) {
-
       // 用来判断修改分数是否等于原先分数,如果相等就不提交
       let judgeSubmit = 0;
 

+ 5 - 0
src/components/pages/testPerson/examine/index.vue

@@ -81,6 +81,7 @@
                           )
                         "
                         v-model="k.sco1"
+                        @wheel.prevent="handleWheel"
                       />
                       <div v-else>{{ k.sco1 }}</div>
                     </div>
@@ -213,6 +214,10 @@ export default {
     // console.log(JSON.stringify(this.TeaTabJson));
   },
   methods: {
+    // 禁用滚轮事件
+    handleWheel(event) {
+      event.preventDefault();
+    },
     goFillIn(val) {
       this.$router.push(
         `/doTest?cid=${val}&org=${this.org}&type=3&role=${this.role}&isN=&oid=${this.oid}&userid=${this.userid}`