Sfoglia il codice sorgente

问卷详情左侧章节和右侧表格屏幕高度适应

wangggziwen 8 mesi fa
parent
commit
d9253a3b5d

+ 6 - 1
ruoyi-ui/src/views/rc/chapter/index.vue

@@ -13,7 +13,7 @@
       </div>
       <div class="head-container">
         <el-table
-          height="500"
+          :height="clientHeight"
           ref="chapterList"
           v-loading="loading"
           :data="chapterList"
@@ -38,6 +38,7 @@ export default {
   name: "Chapter",
   data() {
     return {
+      clientHeight:300,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -73,6 +74,10 @@ export default {
     };
   },
   created() {
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    })
     // this.getList();
   },
   methods: {

+ 6 - 1
ruoyi-ui/src/views/rc/questionnaire/index.vue

@@ -96,7 +96,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table border v-loading="loading" :data="questionnaireList" @selection-change="handleSelectionChange" style="font-size: 12px;">
+    <el-table :height="clientHeight" border v-loading="loading" :data="questionnaireList" @selection-change="handleSelectionChange" style="font-size: 12px;">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="年份" align="center" prop="year">
         <template slot-scope="scope">
@@ -439,6 +439,7 @@ export default {
   dicts: ['t_open_item_result', 't_open_item_type', 't_open_item_level', 't_open_item_status','t_sec_sub_chap_completion_status', 't_sec_sub_chap_yes_no_na', 't_sec_sub_chap_type', 't_sec_sub_chap_standard'],
   data() {
     return {
+      clientHeight:300,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -519,6 +520,10 @@ export default {
     };
   },
   created() {
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    })
     // this.getList();
     this.getUserList();
   },