liyongli 2 år sedan
förälder
incheckning
0ae0b3174b
1 ändrade filer med 33 tillägg och 16 borttagningar
  1. 33 16
      src/views/report/SilkRoadData/index.vue

+ 33 - 16
src/views/report/SilkRoadData/index.vue

@@ -7,7 +7,9 @@
         @load="load"
         :src="isOnlyDay"
       />
-      <span class="days" :style="'font-size:' + fontSizeFunc() + 'px'">{{ times.join(' 到 ') }}</span>
+      <span class="days" :style="'font-size:' + fontSizeFunc() + 'px'">{{
+        times.join(' 到 ')
+      }}</span>
     </div>
 
     <van-cell-group inset>
@@ -15,26 +17,39 @@
       <div
         class="mainCell"
         style="margin-top: 0.5em"
-        v-for="item in centerList"
-        :key="item.centerName + 'c'"
+        v-for="(item, index) in centerList"
+        :key="item.centerName + 'c' + index"
       >
         <div class="headTitle" v-text="item.centerName"></div>
         <div class="label">
           <div class="label-left" :style="'font-size:' + fontSizeFunc() + 'px'">
             <van-row>
-              <van-col span="8"> 实发 / 应发(件) </van-col>
-              <van-col span="8">完成率</van-col>
-              <van-col span="8">传播量(次)</van-col>
+              <van-col span="9"> 及时实发/应发(件) </van-col>
+              <van-col span="9"> 实发/应发(件) </van-col>
+              <van-col span="6">传播量(次)</van-col>
             </van-row>
             <van-row>
-              <van-col span="8">
+              <van-col span="9">
+                {{ item.publishNum | formmate }} /
+                {{ item.taskNum | formmate }}
+              </van-col>
+              <van-col span="9">
                 {{ item.onTimeNum | formmate }} /
                 {{ item.taskNum | formmate }}
               </van-col>
-              <van-col span="8">
+              <van-col span="6">{{ item.readNum | formmate }}</van-col>
+            </van-row>
+            <van-row>
+              <van-col span="9">及时完成率</van-col>
+              <van-col span="9">完成率</van-col>
+            </van-row>
+            <van-row>
+              <van-col span="9">
                 {{ ((item.onTimeNum / item.taskNum).toFixed(2) - 0) * 100 }}%
               </van-col>
-              <van-col span="8">{{ item.readNum | formmate }}</van-col>
+              <van-col span="9">
+                {{ ((item.publishNum / item.taskNum).toFixed(2) - 0) * 100 }}%
+              </van-col>
             </van-row>
           </div>
           <van-button
@@ -104,7 +119,7 @@ export default {
       });
       // this.$route.params.date --> default 日期可选  orther  根据传入日期
       this.width = document.body.clientWidth;
-      console.log(this.width/20);
+      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]];
@@ -112,7 +127,7 @@ export default {
       this.title =
         document.title + (this.times.length > 1 ? '累计报表' : '日报表');
       document.title = this.title;
-      console.log(window.matchMedia('(prefers-color-scheme: dark)'));
+      //   console.log(window.matchMedia('(prefers-color-scheme: dark)'));
       if (this.times.length > 1)
         this.isOnlyDay = require('@/assets/image/2023slcw.jpg');
       else this.isOnlyDay = require('@/assets/image/2023slcw-day.jpg');
@@ -124,6 +139,7 @@ export default {
       });
     },
     load(e) {
+      if (!e.path || !e.path.length) return;
       const ele = e.path[0];
       this.height = this.width * (ele.naturalHeight / ele.naturalWidth);
     },
@@ -132,11 +148,12 @@ 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;
-    }
+    fontSizeFunc() {
+      let size = this.width / 30;
+      if (size > 18) return 18;
+      if (size < 12) return 12;
+      return size;
+    },
   },
   beforeUnmount() {},
   components: {