瀏覽代碼

兼容分辨率

wy 1 年之前
父節點
當前提交
a55a0b045b

+ 12 - 2
src/views/manage-log/battery-charger.vue

@@ -243,16 +243,26 @@ export default {
     /* 设置初始视窗高度*/
     onLoadHeight() {
       this.$nextTick(() => {
-        this.tableheight = document.body.clientHeight - 350;
+        let actual = this.getFontSize()
+        this.tableheight = document.body.clientHeight - actual;
       });
     },
     /* 设置窗口变化高度*/
     changeWindow() {
       window.onresize = () => {
         return (() => {
-          this.tableheight = document.body.clientHeight - 350;
+          let actual = this.getFontSize()
+          this.tableheight = document.body.clientHeight - actual;
         })();
       };
+    },
+      //得到根标签的值
+      getFontSize(){
+      let num = getComputedStyle(window.document.documentElement)[
+            "font-size"
+          ]; //得到html中fontSize的值
+          let size = num.substring(0, num.length - 2); //去除px
+         return (350 / 80) * size;
     },
     // 获取充电机ID
     getChargeCode() {

+ 12 - 2
src/views/manage-log/bms.vue

@@ -234,16 +234,26 @@ export default {
     /* 设置初始视窗高度*/
     onLoadHeight() {
       this.$nextTick(() => {
-        this.tableheight = document.body.clientHeight - 350;
+        let actual = this.getFontSize()
+        this.tableheight = document.body.clientHeight - actual;
       });
     },
     /* 设置窗口变化高度*/
     changeWindow() {
       window.onresize = () => {
         return (() => {
-          this.tableheight = document.body.clientHeight - 350;
+          let actual = this.getFontSize()
+          this.tableheight = document.body.clientHeight - actual;
         })();
       };
+    },
+      //得到根标签的值
+      getFontSize(){
+      let num = getComputedStyle(window.document.documentElement)[
+            "font-size"
+          ]; //得到html中fontSize的值
+          let size = num.substring(0, num.length - 2); //去除px
+         return (350 / 80) * size;
     },
     selectAll() {
       if (this.robotValue.length < this.logOptions.length) {

+ 12 - 2
src/views/manage-log/data-export.vue

@@ -232,16 +232,26 @@ export default {
     /* 设置初始视窗高度*/
     onLoadHeight() {
       this.$nextTick(() => {
-        this.tableheight = document.body.clientHeight - 290;
+        let actual = this.getFontSize()
+        this.tableheight = document.body.clientHeight - actual;
       });
     },
     /* 设置窗口变化高度*/
     changeWindow() {
       window.onresize = () => {
         return (() => {
-          this.tableheight = document.body.clientHeight - 290;
+          let actual = this.getFontSize()
+          this.tableheight = document.body.clientHeight - actual;
         })();
       };
+    },
+     //得到根标签的值
+     getFontSize(){
+      let num = getComputedStyle(window.document.documentElement)[
+            "font-size"
+          ]; //得到html中fontSize的值
+          let size = num.substring(0, num.length - 2); //去除px
+         return (290 / 80) * size;
     },
     // 清空表单数据
     dialogClose() {},

+ 14 - 5
src/views/manage-log/robot.vue

@@ -120,7 +120,7 @@
               ></el-input>
             </el-form-item>
             <el-form-item>
-              <el-button type="primary"  @click="AddExport">生成</el-button>
+              <el-button type="primary" @click="AddExport">生成</el-button>
             </el-form-item>
           </el-form>
           <div class="descript">
@@ -218,17 +218,27 @@ export default {
     /* 设置初始视窗高度*/
     onLoadHeight() {
       this.$nextTick(() => {
-        this.tableheight = document.body.clientHeight - 350;
+        let actual = this.getFontSize()
+        this.tableheight = document.body.clientHeight - actual;
       });
     },
     /* 设置窗口变化高度*/
     changeWindow() {
       window.onresize = () => {
         return (() => {
-          this.tableheight = document.body.clientHeight - 350;
+          let actual = this.getFontSize()
+          this.tableheight = document.body.clientHeight - actual;
         })();
       };
     },
+    //得到根标签的值
+    getFontSize(){
+      let num = getComputedStyle(window.document.documentElement)[
+            "font-size"
+          ]; //得到html中fontSize的值
+          let size = num.substring(0, num.length - 2); //去除px
+         return (350 / 80) * size;
+    },
     selectAll() {
       if (this.robotValue.length < this.logOptions.length) {
         this.robotValue = [];
@@ -407,7 +417,7 @@ export default {
 ::v-deep .el-table__fixed {
   height: calc(100% - 10px) !important;
 }
-::v-deep .el-table th.is-leaf{
+::v-deep .el-table th.is-leaf {
   font-size: 15px !important;
   height: 36px !important;
   line-height: 36px !important;
@@ -417,5 +427,4 @@ export default {
   width: 70px; 
   height: 40px; 
 } */
-
 </style>