liyongli 2 лет назад
Родитель
Сommit
c8227b8fcd

+ 2 - 2
src/router/report.js

@@ -80,7 +80,7 @@ export default [
       path: "/SilkRoadData/:type/:time",
       name: "SilkRoadData",
       meta: {
-        title: "陕西新媒体大数据发布",
+        title: "丝路春晚互联网平台宣发工作执行情况",
       },
       component: () =>
         import(
@@ -91,7 +91,7 @@ export default [
       path: "/SilkRoadDetail/:name/:time",
       name: "SilkRoadDetail",
       meta: {
-        title: "陕西新媒体大数据发布",
+        title: "丝路春晚互联网平台宣发工作执行情况",
       },
       component: () =>
         import(

+ 2 - 0
src/views/report/SilkRoadData/index.vue

@@ -105,6 +105,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 ? "累计报表" : "日报表");
+      document.title = this.title;
       console.log(window.matchMedia('(prefers-color-scheme: dark)'))
       if (this.times.length > 1)
         this.isOnlyDay = require('@/assets/image/2023slcw.jpg');

+ 27 - 33
src/views/report/SilkRoadDetail/index.vue

@@ -1,8 +1,14 @@
 <template>
   <div class="SilkRoadDetail">
+    <van-nav-bar :title="title" left-arrow @click-left="onClickLeft" />
     <div class="topImg" v-if="width">
-        <van-image :width="width" :height="height" @load="load" :src="isOnlyDay" />
-        <span class="days">{{ times.join(" 到 ") }}</span>
+      <van-image
+        :width="width"
+        :height="height"
+        @load="load"
+        :src="isOnlyDay"
+      />
+      <span class="days">{{ times.join(' 到 ') }}</span>
     </div>
 
     <van-cell-group inset v-for="pitem in centerList" :key="pitem.platform">
@@ -16,9 +22,7 @@
         <div class="headTitle" v-text="item.nickName"></div>
         <div class="label">
           <van-row>
-            <van-col span="6">
-              实发 / 应发(件)
-            </van-col>
+            <van-col span="6"> 实发 / 应发(件) </van-col>
             <van-col span="6">完成率</van-col>
             <van-col span="6">传播量(次)</van-col>
             <van-col span="6">超时发稿量(件)</van-col>
@@ -29,7 +33,7 @@
               {{ item.taskNum | formmate }}
             </van-col>
             <van-col span="6">
-                {{ ((item.onTimeNum / item.taskNum).toFixed(2) - 0) * 100 }}%
+              {{ ((item.onTimeNum / item.taskNum).toFixed(2) - 0) * 100 }}%
             </van-col>
             <van-col span="6">{{ item.readNum | formmate }}</van-col>
             <van-col span="6">
@@ -51,7 +55,9 @@ import {
   CellGroup as VanCellGroup,
   Col as VanCol,
   Row as VanRow,
+  NavBar as VanNavBar,
 } from 'vant';
+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';
@@ -92,8 +98,10 @@ export default {
       this.width = document.body.clientWidth;
       this.height = (this.width / 16) * 9;
       let times = (this.$route.params.time || '').split('+');
-      if(times.length > 1 && times[0] === times[1]) times = [times[0]];
+      if (times.length > 1 && times[0] === times[1]) times = [times[0]];
       this.times = times;
+      this.title = document.title + (this.times.length > 1 ? "累计报表" : "日报表");
+      document.title = this.title;
       if (this.times.length > 1)
         this.isOnlyDay = require('@/assets/image/2023slcw.jpg');
       else this.isOnlyDay = require('@/assets/image/2023slcw-day.jpg');
@@ -102,35 +110,21 @@ export default {
         end: this.times.length > 1 ? this.times[1] : this.times[0],
         center: this.$route.params.name,
       }).then(r => {
-        const centerList = r || [];
-        // const obj = {};
-        // const out = [];
-        // centerList.map(v => {
-        //   if (obj[v.platform] >= 0) {
-        //     out[obj[v.platform]].data.push(v);
-        //   } else {
-        //     out.push({
-        //       platform: v.platform,
-        //       centerName: v.centerName,
-        //       depName: v.depName,
-        //       data: [v],
-        //     });
-        //     obj[v.platform] = out.length - 1;
-        //   }
-        // });
-        this.centerList = centerList;
+        this.centerList = r || [];
       });
     },
     load(e) {
       const ele = e.path[0];
       this.height = this.width * (ele.naturalHeight / ele.naturalWidth);
     },
+    onClickLeft(){ this.$router.go(-1) }
   },
   beforeUnmount() {},
   components: {
     VanCol,
     VanRow,
     VanImage,
+    VanNavBar,
     VanCellGroup,
   },
 };
@@ -143,7 +137,7 @@ export default {
   font-size: 16px;
   overflow-y: auto;
   background-color: #eee;
-  padding-bottom: .5em;
+  padding-bottom: 0.5em;
 }
 
 .SilkRoadDetail .mainCell {
@@ -167,14 +161,14 @@ export default {
   color: #000;
 }
 
-.SilkRoadDetail .topImg{
-    position: relative;
+.SilkRoadDetail .topImg {
+  position: relative;
 }
-.SilkRoadDetail .days{
-    position: absolute;
-    left: 5%;
-    top: 72%;
-    color: #ffffff;
-    font-size: 14px;
+.SilkRoadDetail .days {
+  position: absolute;
+  left: 5%;
+  top: 72%;
+  color: #ffffff;
+  font-size: 14px;
 }
 </style>