liyongli 2 years ago
parent
commit
ba5681d4dc
2 changed files with 23 additions and 11 deletions
  1. 8 4
      src/views/report/SilkRoadData/index.vue
  2. 15 7
      src/views/report/SilkRoadDetail/index.vue

+ 8 - 4
src/views/report/SilkRoadData/index.vue

@@ -7,7 +7,7 @@
         @load="load"
         :src="isOnlyDay"
       />
-      <span class="days">{{ times.join(' 到 ') }}</span>
+      <span class="days" :style="'font-size:' + fontSizeFunc() + 'px'">{{ times.join(' 到 ') }}</span>
     </div>
 
     <van-cell-group inset>
@@ -20,7 +20,7 @@
       >
         <div class="headTitle" v-text="item.centerName"></div>
         <div class="label">
-          <div class="label-left">
+          <div class="label-left" :style="'font-size:' + fontSizeFunc() + 'px'">
             <van-row>
               <van-col span="8"> 实发 / 应发(件) </van-col>
               <van-col span="8">完成率</van-col>
@@ -104,6 +104,7 @@ export default {
       });
       // this.$route.params.date --> default 日期可选  orther  根据传入日期
       this.width = document.body.clientWidth;
+      console.log(this.width/20);
       this.height = (this.width / 16) * 9;
       let times = (this.$route.params.time || '').split('+');
       if (times.length > 1 && times[0] === times[1]) times = [times[0]];
@@ -131,6 +132,11 @@ export default {
         path: `/SilkRoadDetail/${item.centerName}/${this.$route.params.time}?auto=${this.$route.query.auto}`,
       });
     },
+    fontSizeFunc(){
+        let size =  this.width/25;
+        if(size > 18) return 18;
+        return size;
+    }
   },
   beforeUnmount() {},
   components: {
@@ -165,7 +171,6 @@ export default {
 }
 
 .SilkRoadData .label {
-  font-size: 14px;
   line-height: 1.5em;
   text-align: center;
   color: #969799;
@@ -186,6 +191,5 @@ export default {
   left: 5%;
   top: 72%;
   color: #ffffff;
-  font-size: 14px;
 }
 </style>

+ 15 - 7
src/views/report/SilkRoadDetail/index.vue

@@ -8,7 +8,9 @@
         @load="load"
         :src="isOnlyDay"
       />
-      <span class="days">{{ times.join(' 到 ') }}</span>
+      <span class="days" :style="'font-size:' + fontSizeFunc() + 'px'">{{
+        times.join(' 到 ')
+      }}</span>
     </div>
 
     <van-cell-group inset v-for="pitem in centerList" :key="pitem.platform">
@@ -20,7 +22,7 @@
         :key="item.nickName + 'c'"
       >
         <div class="headTitle" v-text="item.nickName"></div>
-        <div class="label">
+        <div class="label" :style="'font-size:' + fontSizeFunc() + 'px'">
           <van-row>
             <van-col span="6"> 实发 / 应发(件) </van-col>
             <van-col span="6">完成率</van-col>
@@ -57,7 +59,7 @@ import {
   Row as VanRow,
   NavBar as VanNavBar,
 } from 'vant';
-import "vant/lib/nav-bar/style/index";
+import 'vant/lib/nav-bar/style/index';
 import 'vant/lib/image/style/index';
 import 'vant/lib/col/style/index';
 import 'vant/lib/row/style/index';
@@ -100,7 +102,8 @@ export default {
       let times = (this.$route.params.time || '').split('+');
       if (times.length > 1 && times[0] === times[1]) times = [times[0]];
       this.times = times;
-      this.title = document.title + (this.times.length > 1 ? "累计报表" : "日报表");
+      this.title =
+        document.title + (this.times.length > 1 ? '累计报表' : '日报表');
       document.title = this.title;
       if (this.times.length > 1)
         this.isOnlyDay = require('@/assets/image/2023slcw.jpg');
@@ -117,7 +120,14 @@ export default {
       const ele = e.path[0];
       this.height = this.width * (ele.naturalHeight / ele.naturalWidth);
     },
-    onClickLeft(){ this.$router.go(-1) }
+    fontSizeFunc() {
+      let size = this.width / 30;
+      if (size > 18) return 18;
+      return size;
+    },
+    onClickLeft() {
+      this.$router.go(-1);
+    },
   },
   beforeUnmount() {},
   components: {
@@ -152,7 +162,6 @@ export default {
 }
 
 .SilkRoadDetail .label {
-  font-size: 14px;
   line-height: 1.5em;
   text-align: center;
   color: #969799;
@@ -172,6 +181,5 @@ export default {
   left: 5%;
   top: 72%;
   color: #ffffff;
-  font-size: 14px;
 }
 </style>