liyongli 2 years ago
parent
commit
f023f868e0

+ 4 - 1
src/main.js

@@ -9,7 +9,10 @@ Vue.use(ElementUI);
 
 router.beforeEach((to, from, next) => {
   if (to.meta.title) document.title = to.meta.title;
-  if (to.path === '/traditional' || to.path === '/advertisement' || to.path === '/Mobile') return next();
+  const traditional = /^\/traditional/g.test(to.path);
+  const advertisement = /^\/advertisement/g.test(to.path);
+  const Mobile = /^\/Mobile/g.test(to.path);
+  if (traditional || advertisement || Mobile) return next();
   if (!localStorage.user) {
     // apply 必须拿到oa用户数据
     getUser(() => next())

+ 3 - 3
src/router/report.js

@@ -3,7 +3,7 @@ export default [
       path: "/advertisement",
       name: "Advertisement",
       meta: {
-        title: "电视广告数据报",
+        title: "电视广告数据报",
       },
       component: () =>
         import(
@@ -22,10 +22,10 @@ export default [
         ),
     },
     {
-      path: "/Mobile",
+      path: "/Mobile/:date",
       name: "Mobile",
       meta: {
-        title: "陕西视听大数据发布",
+        title: "陕西新媒体大数据发布",
       },
       component: () =>
         import(

+ 8 - 15
src/views/report/Advertisement/index.vue

@@ -1,12 +1,12 @@
 <template>
-  <div style="font-size: 0;background-color:#fff ;">
+  <div style="font-size: 0; background-color: #fff">
     <img
       src="https://cxzx.smcic.net/zhoubao/assets/guanggao01.jpg"
       width="100%"
-      style="margin-bottom: 1em;display: block;"
+      style="margin-bottom: 1em; display: block"
       alt=""
     />
-    <div :style="'height: '+ fontSize +'px;'"></div>
+    <div :style="'height: ' + fontSize + 'px;'"></div>
     <div
       v-if="orgin.html"
       :style="'font-size: ' + fontSize + 'px;'"
@@ -141,18 +141,8 @@
           ></p>
         </div>
         <div class="bottom">
-          <span
-            style="
-              display: block;
-              font-size: 0.9rem;
-              vertical-align: middle;
-              padding-left: 5px;
-              font-weight: 600;
-            "
-          >
-            本数据由“陕西广电融媒体集团大数据平台”提供。
-            <p>技术支持 白帆 13325452244;汪朝涵:17302954998</p>
-          </span>
+          本数据由“陕西广电融媒体集团大数据平台”提供。
+          <p>技术支持 白帆 13325452244;陈科:18629350958</p>
         </div>
       </div>
     </div>
@@ -404,5 +394,8 @@ export default {
   border: 4px solid #0983a8;
   margin-top: 1em;
   padding: 10px;
+  font-size: 0.9rem;
+  padding-left: 5px;
+  font-weight: 600;
 }
 </style>

+ 212 - 200
src/views/report/Mobile/index.vue

@@ -1,206 +1,204 @@
 <template>
-  <div class="tv-list" :style="'font-size:' + fontSize + 'px'">
-    <div class="content">
-      <div class="titleTop">
-        {{ valueDate($route.query.date) }}
-      </div>
-      <van-cell-group border title="部门排行">
-        <div class="itemHead">
-          <van-row>
-            <van-col span="3" class="td"> 排名 </van-col>
-            <van-col span="7" class="td"> 部门 </van-col>
-            <van-col span="7" class="td"> 传播量(次) </van-col>
-            <!-- td2 :style="width > 667 ? 'line-height: 2.5em' : 'line-height: 1.5em'" -->
-            <van-col span="5" class="td"> 发稿量(件) </van-col>
-            <van-col span="2" class="td">
-              <img
-                src="../../../assets/image/shou.gif"
-                width="26px"
-                alt=""
-                style="vertical-align: middle"
-              />
-            </van-col>
-          </van-row>
-        </div>
-        <div v-for="(v, o) in dep || []" :key="v.name">
-          <div
-            style="border-bottom: 1px dashed #eee; margin: 11px 0 0 0"
-            v-if="o === 20"
-          ></div>
-          <van-row class="item" @click="() => showPopup(o)">
-            <van-col
-              span="3"
-              :class="{ td: true }"
-              :style="{ color: color[o] || '#000', fontWeight: 600 }"
-            >
-              {{ o + 1 }}
-            </van-col>
-            <van-col span="7" :class="{ td: true }">
-              {{ v.name }}
-            </van-col>
-            <van-col span="7" :class="{ td: true }">
-              {{ timeFormat(v.read_count) }}
-              <van-icon
-                v-if="v.read_count_change !== '相等'"
-                name="down"
-                :color="v.read_count_change === '上升' ? '#f00' : '#0f0'"
-                :class="{ rise: v.read_count_change === '上升' }"
-              />
-            </van-col>
-            <van-col span="5" :class="{ td: true }">
-              {{ timeFormat(v.publish_count) }}
-              <van-icon
-                v-if="v.publish_count_change !== '相等'"
-                name="down"
-                :color="v.publish_count_change === '上升' ? '#f00' : '#0f0'"
-                :class="{ rise: v.publish_count_change === '上升' }"
-              />
-            </van-col>
-            <van-col span="2" class="td" style="cursor: pointer">
-              <van-icon name="arrow" />
-            </van-col>
-          </van-row>
+  <div style="font-size: 0; background-color: #fff">
+    <img
+      src="https://cxzx.smcic.net/zhoubao/assets/moblie01.jpg"
+      width="100%"
+      style="margin-bottom: 1em; display: block"
+      alt=""
+    />
+    <div class="tv-list" :style="'font-size:' + fontSize + 'px'">
+      <div class="content">
+        <div class="titleTop">
+          {{ valueDate($route.params.date) }}
         </div>
-        <van-popup
-          :style="{ height: '100%', width: '100%' }"
-          position="right"
-          v-model="show"
-        >
-          <div class="main">
-            <van-cell
-              title-style="flex: 3"
-              :title="ratios.schedulename"
-              :label="ratios.channelname"
-            >
-              <div
-                @click="show = false"
-                style="color: #5470c6; cursor: pointer"
-              >
-                <van-icon name="revoke" />
-                {{ ratios.name }}
-              </div>
-            </van-cell>
+        <van-cell-group border title="部门排行">
+          <div class="itemHead">
             <van-row>
-              <van-col span="7" class="td"> 发稿量: </van-col>
-              <van-col span="5" class="td">
-                <counto
-                  :startVal="0"
-                  :endVal="ratios.publish_count || 0"
-                  :duration="1000"
-                ></counto>
-                <span v-if="ratios.publish_countP">.</span>
-                {{ (ratios.publish_countP > 0 ? ratios.publish_countP : '') + ratios.publish_countWei }}
+              <van-col span="3" class="td"> 排名 </van-col>
+              <van-col span="7" class="td"> 部门 </van-col>
+              <van-col span="7" class="td"> 传播量(次) </van-col>
+              <!-- td2 :style="width > 667 ? 'line-height: 2.5em' : 'line-height: 1.5em'" -->
+              <van-col span="5" class="td"> 发稿量(条) </van-col>
+              <van-col span="2" class="td">
+                <img
+                  src="../../../assets/image/shou.gif"
+                  width="26px"
+                  alt=""
+                  style="vertical-align: middle"
+                />
+              </van-col>
+            </van-row>
+          </div>
+          <div v-for="(v, o) in dep || []" :key="v.name">
+            <div
+              style="border-bottom: 1px dashed #eee; margin: 11px 0 0 0"
+              v-if="o === 20"
+            ></div>
+            <van-row class="item" @click="() => showPopup(o)">
+              <van-col
+                span="3"
+                :class="{ td: true }"
+                :style="{ color: color[o] || '#000', fontWeight: 600 }"
+              >
+                {{ o + 1 }}
               </van-col>
-              <van-col span="7" class="td"> 阅读量: </van-col>
-              <van-col span="5" class="td">
-                <counto
-                  :startVal="0"
-                  :endVal="ratios.read_count || 0"
-                  :duration="1000"
-                ></counto>
-                <span v-if="ratios.read_countP">.</span>
-                {{ (ratios.read_countP > 0 ? ratios.read_countP : '') + ratios.read_countWei }}
+              <van-col span="7" :class="{ td: true }">
+                {{ v.name }}
+              </van-col>
+              <van-col span="7" :class="{ td: true }">
+                {{ timeFormat(v.read_count) }}
+                <van-icon
+                  v-if="v.read_count_change !== '相等'"
+                  name="down"
+                  :color="v.read_count_change === '上升' ? '#f00' : '#0f0'"
+                  :class="{ rise: v.read_count_change === '上升' }"
+                />
+              </van-col>
+              <van-col span="5" :class="{ td: true }">
+                {{ timeFormat(v.publish_count) }}
+                <van-icon
+                  v-if="v.publish_count_change !== '相等'"
+                  name="down"
+                  :color="v.publish_count_change === '上升' ? '#f00' : '#0f0'"
+                  :class="{ rise: v.publish_count_change === '上升' }"
+                />
+              </van-col>
+              <van-col span="2" class="td" style="cursor: pointer">
+                <van-icon name="arrow" />
               </van-col>
             </van-row>
-            <van-cell-group border title="平台账号">
-              <van-tabs v-model="active">
-                <van-tab
-                  :title="index"
-                  v-for="(item, index) in ratios.detail"
-                  :key="index"
-                >
-                  <van-cell
-                    v-for="(v, i) in item || []"
-                    :key="i + v.nick_name"
-                    title-style="flex: 3"
-                    :title="v.nick_name"
-                    :label="ratios.channelname"
-                  >
-                    <template #label>
-                      <div style="font-size: 14px; color: #000">
-                        发稿量:{{ timeFormat(v.publish_count) }}件 阅读量:{{
-                          timeFormat(v.read_count)
-                        }}次 环比:<counto
-                          :startVal="0"
-                          :endVal="v.huanbi1 || 0"
-                          :duration="1000"
-                        ></counto>
-                        <span v-if="v.huanbi1P">.</span>
-                        {{v.huanbi1P}}%
-                      </div>
-                    </template>
-                  </van-cell>
-                </van-tab>
-              </van-tabs>
-            </van-cell-group>
-            <van-cell-group border title="爆款稿件">
+          </div>
+          <van-popup
+            :style="{ height: '100%', width: '100%' }"
+            position="right"
+            v-model="show"
+          >
+            <div class="main">
               <van-cell
-                v-for="(v, i) in ratios.article"
-                :key="i"
                 title-style="flex: 3"
-                :title="v.title"
+                :title="ratios.schedulename"
+                :label="ratios.channelname"
               >
-                <template #label>
-                  <van-tag size="“large”" type="primary"
-                    >播放量:{{ timeFormat(v.play_count) }}</van-tag
-                  >
-                  {{ v.dep_name + "-" + v.nick_name }}
-                </template>
+                <div
+                  @click="show = false"
+                  style="color: #5470c6; cursor: pointer"
+                >
+                  <van-icon name="revoke" />
+                  {{ ratios.name }}
+                </div>
               </van-cell>
-            </van-cell-group>
-          </div>
-        </van-popup>
-      </van-cell-group>
-      <van-cell-group border title="爆款话题">
-        <van-cell
-          v-for="(v, i) in article"
-          :key="i"
-          title-style="flex: 3"
-          :title="v.title"
-        >
-          <template #label>
-            <van-tag size="“large”" type="primary"
-              >播放量:{{ timeFormat(v.play_count) }}</van-tag
-            >
-            {{ v.dep_name + "-" + v.nick_name }}
-          </template>
-        </van-cell>
-      </van-cell-group>
-      <van-cell-group border title="爆款稿件">
-        <van-cell
-          v-for="(v, i) in article"
-          :key="i"
-          title-style="flex: 3"
-          :title="v.title"
-        >
-          <template #label>
-            <van-tag size="“large”" type="primary"
-              >播放量:{{ timeFormat(v.play_count) }}</van-tag
-            >
-            {{ v.dep_name + "-" + v.nick_name }}
-          </template>
-        </van-cell>
-      </van-cell-group>
-    </div>
-    <div class="bottom content">
-      <!-- <img
-        src="https://djweb.smcic.net/img/202104021135578156.png"
-        width="50%"
-        style="vertical-align: middle"
-        alt=""
-      /> -->
-      <span
-        style="
-          display: block;
-          font-size: 0.9rem;
-          vertical-align: middle;
-          padding-left: 5px;
-          font-weight: 600;
-        "
-      >
+              <van-row>
+                <van-col span="7" class="td"> 发稿量: </van-col>
+                <van-col span="5" class="td">
+                  <counto
+                    :startVal="0"
+                    :endVal="ratios.publish_count || 0"
+                    :duration="1000"
+                  ></counto>
+                  <span v-if="ratios.publish_countP">.</span>
+                  {{
+                    (ratios.publish_countP > 0 ? ratios.publish_countP : "") +
+                    ratios.publish_countWei
+                  }}
+                </van-col>
+                <van-col span="7" class="td"> 阅读量: </van-col>
+                <van-col span="5" class="td">
+                  <counto
+                    :startVal="0"
+                    :endVal="ratios.read_count || 0"
+                    :duration="1000"
+                  ></counto>
+                  <span v-if="ratios.read_countP">.</span>
+                  {{
+                    (ratios.read_countP > 0 ? ratios.read_countP : "") +
+                    ratios.read_countWei
+                  }}
+                </van-col>
+              </van-row>
+              <van-cell-group border title="平台账号">
+                <van-tabs v-model="active">
+                  <van-tab
+                    :title="index"
+                    v-for="(item, index) in ratios.detail"
+                    :key="index"
+                  >
+                    <van-cell
+                      v-for="(v, i) in item || []"
+                      :key="i + v.nick_name"
+                      title-style="flex: 3"
+                      :title="v.nick_name"
+                      :label="ratios.channelname"
+                    >
+                      <template #label>
+                        <div style="font-size: 14px; color: #000">
+                          <van-tag type="success" style="margin-right: 3px">
+                            发稿量:{{ timeFormat(v.publish_count) }}
+                          </van-tag>
+                          <van-tag type="danger" style="margin-right: 3px">
+                            阅读量:{{ timeFormat(v.read_count) }}
+                          </van-tag>
+                          <van-tag type="warning" style="margin-right: 3px">
+                            阅读量环比:{{ v.huanbi || 0 }}%
+                          </van-tag>
+                        </div>
+                      </template>
+                    </van-cell>
+                  </van-tab>
+                </van-tabs>
+              </van-cell-group>
+              <van-cell-group border title="爆款稿件">
+                <van-cell
+                  v-for="(v, i) in ratios.article"
+                  :key="i"
+                  title-style="flex: 3"
+                  :title="v.title"
+                >
+                  <template #label>
+                    <van-tag size="“large”" type="primary"
+                      >播放量:{{ timeFormat(v.play_count) }}</van-tag
+                    >
+                    {{ v.dep_name + "-" + v.nick_name }}
+                  </template>
+                </van-cell>
+              </van-cell-group>
+            </div>
+          </van-popup>
+        </van-cell-group>
+        <van-cell-group border title="热门话题">
+          <van-cell
+            v-for="(v, i) in topic"
+            :key="i"
+            title-style="flex: 3"
+            :title="v.topic"
+          >
+            <template #label>
+              <van-tag size="“large”" type="primary"
+                >传播量:{{ timeFormat(v.read_count) }}</van-tag
+              >
+              {{ v.dep + "-" + v.zhuchiren }}
+            </template>
+          </van-cell>
+        </van-cell-group>
+        <van-cell-group border title="爆款稿件">
+          <van-cell
+            v-for="(v, i) in article"
+            :key="i"
+            title-style="flex: 3"
+            :title="v.title"
+          >
+            <template #label>
+              <van-tag size="“large”" type="primary"
+                >播放量:{{ timeFormat(v.play_count) }}</van-tag
+              >
+              {{ v.dep_name + "-" + v.nick_name }}
+            </template>
+          </van-cell>
+        </van-cell-group>
+      </div>
+      <div class="bottom content">
         本数据由“陕西广电融媒体集团大数据平台”提供。
-        <p>技术支持 白帆 13325452244;汪朝涵:17302954998</p>
-      </span>
+        <p>技术支持 白帆 13325452244;陈科:18629350958</p>
+      </div>
     </div>
   </div>
 </template>
@@ -244,6 +242,7 @@ export default {
       charts: undefined,
       ratios: {},
       article: [],
+      topic: [],
       dep: [],
       color: ["#ff0036", "#ff9b00", "#ffcc00"],
       echarts: undefined,
@@ -253,7 +252,12 @@ export default {
   },
   watch: {},
   mounted() {
-    if (this.$route.query.auto !== '06fd56cdf5a6cfc3a2139cc8514d05aa0439ee8c1fb4d81145bc9647') return;
+    if (
+      this.$route.query.auto !==
+      "06fd56cdf5a6cfc3a2139cc8514d05aa0439ee8c1fb4d81145bc9647"
+    )
+      return;
+    console.log(this.$route.params.date);
     this.fontSize = (document.body.offsetWidth / 24).toFixed(2) - 0;
     if (document.body.offsetWidth > 677) this.fontSize = 22;
     watermark.setWaterMark({
@@ -263,10 +267,11 @@ export default {
       },
     });
     jsonZhouMobile({
-      date: this.$route.query.date,
+      date: this.$route.params.date,
     }).then(res => {
       this.article = res.article || [];
       this.dep = res.dep || [];
+      this.topic = res.topic || [];
     });
   },
   computed: {},
@@ -275,7 +280,7 @@ export default {
       let out = "";
       for (let i = 0; i < v.length; i++) {
         const item = v[i];
-        if (i === 4 || i === 6) out += "-";
+        if (i === 4 || i === 6 || i === 13 || i === 15) out += "/";
         out += item;
       }
       return out;
@@ -322,10 +327,7 @@ export default {
       const new_detail = {};
       for (let i = 0; i < detail.length; i++) {
         const v = detail[i];
-        const huanbi = this.formatType(v.huanbi * 100, 2);
-        v.huanbi1 = huanbi.N;
-        v.huanbi1P = huanbi.P;
-        v.huanbi1Wei = huanbi.wei;
+        v.huanbi = (v.huanbi * 100).toFixed(2) - 0;
         if (new_detail[v.platform]) new_detail[v.platform].push(v);
         else new_detail[v.platform] = [v];
       }
@@ -360,8 +362,11 @@ export default {
 }
 .bottom {
   border: 4px solid #0983a8;
-  padding: 10px;
   margin-top: 1em;
+  padding: 10px;
+  font-size: 0.9rem;
+  padding-left: 5px;
+  font-weight: 600;
 }
 .td {
   text-align: center;
@@ -403,3 +408,10 @@ export default {
   text-align: center;
 }
 </style>
+<style>
+.van-cell-group__title {
+  font-size: 1.1rem;
+  color: #000;
+  font-weight: 600;
+}
+</style>

+ 23 - 48
src/views/report/Traditional/index.vue

@@ -1,16 +1,20 @@
 <template>
-  <div style="font-size: 0;background-color:#fff ;">
+  <div style="font-size: 0; background-color: #fff">
     <img
       src="https://cxzx.smcic.net/zhoubao/assets/tv01.jpg"
       width="100%"
-      style="margin-bottom: 1em;display: block;"
+      style="margin-bottom: 1em; display: block"
       alt=""
     />
-        <p
-          :style="'text-indent: 2em; font-weight: 600; padding: 0.5em 3px;font-size: '+ fontSize +'px;'"
-          v-text="title.desc"
-        ></p>
-    <div :style="'height: '+ fontSize +'px;'"></div>
+    <p
+      :style="
+        'text-indent: 2em; font-weight: 600; padding: 0.5em 3px;font-size: ' +
+        fontSize +
+        'px;'
+      "
+      v-text="title.desc"
+    ></p>
+    <div :style="'height: ' + fontSize + 'px;'"></div>
     <div class="tv-list" :style="'font-size:' + fontSize + 'px'">
       <div class="content">
         <!-- <div class="titleTop">
@@ -66,7 +70,7 @@
             style="border-bottom: 1px dashed #eee; margin: 11px 0 0 0"
             v-if="o === 20"
           ></div>
-          <van-row class="item" @click="() => showPopup(o)">
+          <van-row :style="v.shanxi_channel ? 'background:	#F5DEB3':''" class="item" @click="() => showPopup(o)">
             <van-col
               span="3"
               :class="{ td: true }"
@@ -74,7 +78,7 @@
             >
               {{ v.rank }}
             </van-col>
-            <van-col span="7" :class="{ td: true }">
+            <van-col :style="v.shanxi_channel ? 'font-weight: 600':''" span="7" :class="{ td: true }">
               {{ v.channelname }}
             </van-col>
             <van-col span="5" :class="{ td: true }">
@@ -190,47 +194,16 @@
             <div ref="pie"></div>
             <div ref="day"></div>
           </div>
+
           <div class="bottom content">
-            <!-- <img
-            src="https://djweb.smcic.net/img/smcLogo.png"
-            width="30%"
-            style="vertical-align: middle"
-            alt=""
-          /> -->
-            <span
-              style="
-                display: block;
-                font-size: 0.9rem;
-                vertical-align: middle;
-                padding-left: 5px;
-                font-weight: 600;
-              "
-            >
-              本数据由“陕西广电融媒体集团大数据平台”提供。
-              <p>技术支持 白帆 13325452244;汪朝涵:17302954998</p>
-            </span>
+            本数据由“陕西广电融媒体集团大数据平台”提供。
+            <p>技术支持 白帆 13325452244;陈科:18629350958</p>
           </div>
         </van-popup>
       </div>
       <div class="bottom content">
-        <!-- <img
-        src="https://djweb.smcic.net/img/smcLogo.png"
-        width="30%"
-        style="vertical-align: middle"
-        alt=""
-      /> -->
-        <span
-          style="
-            display: block;
-            font-size: 0.9rem;
-            vertical-align: middle;
-            padding-left: 5px;
-            font-weight: 600;
-          "
-        >
-          本数据由“陕西广电融媒体集团大数据平台”提供。
-          <p>技术支持 白帆 13325452244;汪朝涵:17302954998</p>
-        </span>
+        本数据由“陕西广电融媒体集团大数据平台”提供。
+        <p>技术支持 白帆 13325452244;陈科:18629350958</p>
       </div>
     </div>
   </div>
@@ -362,7 +335,7 @@ export default {
         wei,
       };
     },
-    timeFormat(t,w) {
+    timeFormat(t, w) {
       const Time = t || 0;
       let out = Time.toFixed(w || 0) - 0;
       return out;
@@ -415,7 +388,6 @@ export default {
         title: {
           text: "家庭户收视规模",
           subtext: this.ratios.usrcount_compare
-          
             ? this.ratios.usrcount_compare + " 单位:户"
             : "单位:户",
           textStyle: {
@@ -533,8 +505,11 @@ export default {
 }
 .bottom {
   border: 4px solid #0983a8;
-  padding: 10px;
   margin-top: 1em;
+  padding: 10px;
+  font-size: 0.9rem;
+  padding-left: 5px;
+  font-weight: 600;
 }
 .td {
   text-align: center;