瀏覽代碼

解决滚动条问题

谢杰标 3 年之前
父節點
當前提交
5f9eed3b6f

+ 3 - 14
src/views/education/classManageMent/classHoursReview/component/StudyTables.vue

@@ -409,10 +409,6 @@ export default {
           this.disabledBtn = false;
         });
     },
-    setBomHeight() {
-      let box = document.querySelector(".tablesBoxs");
-      box.style.height = window.innerHeight - box.offsetTop - 190 + "px";
-    },
     backToAudit() {
       this.$confirm("此操作将打回审核状态, 是否继续?", "提示", {
         confirmButtonText: "确定",
@@ -435,12 +431,7 @@ export default {
         });
     },
   },
-  mounted() {
-    let that = this;
-    window.onresize = function () {
-      that.setBomHeight();
-    };
-  },
+
   created() {
     this.keys = {
       1: "ModulTable",
@@ -448,9 +439,6 @@ export default {
       5: "ChapterTable",
       6: "LessonTable",
     };
-    this.$nextTick(() => {
-      this.setBomHeight();
-    });
   },
   components: { ModulTable, LessonTable, ChapterTable, CheatDialog },
   watch: {
@@ -527,7 +515,8 @@ export default {
     }
   }
   .tablesBoxs {
-    overflow-x: auto;
+    height: calc(100% - 56px);
+    overflow: auto;
   }
 }
 </style>

+ 8 - 6
src/views/education/classManageMent/classHoursReview/studyTimes.vue

@@ -1,7 +1,8 @@
 <template>
   <div id="studyTimes">
-    <StudentInfo :userData="userData" @change="packUp"></StudentInfo>
+    <StudentInfo :userData="userData"></StudentInfo>
     <Study-tables
+      class="box"
       ref="study"
       v-if="tablesData"
       :tablesData="tablesData"
@@ -66,11 +67,6 @@ export default {
     this.getUserInfo(true);
   },
   methods: {
-    packUp() {
-      this.$nextTick(() => {
-        this.$refs.study.setBomHeight();
-      });
-    },
     /**
      * 每10秒调用一次 锁定页面
      */
@@ -351,6 +347,8 @@ export default {
 
 #studyTimes {
   height: calc(100vh - 190px);
+  display: flex;
+  flex-direction: column;
 }
 .imgBox {
   width: 100%;
@@ -398,4 +396,8 @@ export default {
     margin: 5px 0px;
   }
 }
+.box {
+  flex: 1;
+  overflow: hidden;
+}
 </style>