liyongli 3 vuotta sitten
vanhempi
commit
e631b8c86b

+ 7 - 3
src/views/AdvertisingEye/AdvertisingEye.vue

@@ -206,9 +206,13 @@ export default {
   background: #fff;
 }
 .AdvertisingEye .headStyle .cell,
-.AdvertisingEye .headStyle .cell * {
-    color: #000;
-    font-weight: 600;
+.AdvertisingEye .headStyle .cell *,
+.AdvertisingEye .cell {
+  color: #000;
+}
+.AdvertisingEye .headStyle .cell *,
+.AdvertisingEye .headStyle .cell{
+    font-weight: 600
 }
 .AdvertisingEye .el-card__body {
   padding: 0 0 20px 0;

+ 1 - 3
src/views/AdvertisingEye/components/allTrend.vue

@@ -189,9 +189,7 @@ export default {
       for (let i = 0; i < len; i++) {
         let o = old[i] || {},
           n = now[i] || {};
-        this.industryRang + 1 > 2
-          ? keys.push(n.name)
-          : keys.push(`第${i + 1}天`);
+        keys.push(n.name ? n.name : o.name)
         o.dt && realKey[0].push(o.dt);
         n.dt && realKey[1].push(n.dt);
         o[key] >= 0 && value[0].push(o[key]);

+ 1 - 3
src/views/AdvertisingEye/components/allTrendB.vue

@@ -179,9 +179,7 @@ export default {
       for (let i = 0; i < len; i++) {
         let o = old[i] || {},
           n = now[i] || {};
-        this.industryRang + 1 > 1
-          ? keys.push(n.startTime)
-          : keys.push(`第${i + 1}天`);
+        keys.push(n.startTime ? n.startTime : o.startTime);
         o.dt && realKey[0].push(o.dt);
         n.dt && realKey[1].push(n.dt);
         o[key] >= 0 && value[0].push(o[key]);

+ 13 - 13
src/views/AdvertisingEye/components/comTrendWeek.vue

@@ -27,7 +27,7 @@
 // import config from "@/config/index";
 import * as echarts from "echarts";
 import { LastWeekTrend } from "@/api/index.js";
-
+let week_chart = undefined;
 export default {
   name: "AdvertisingEye_week",
   data() {
@@ -53,7 +53,6 @@ export default {
           type: 3,
         },
       ],
-      week_chart: undefined,
     };
   },
   props: {
@@ -70,6 +69,7 @@ export default {
     },
   },
   mounted() {
+    week_chart = undefined;
     this.init();
   },
   computed: {},
@@ -92,19 +92,19 @@ export default {
     },
     shareChart(list) {
       if (!this.$refs.share) return;
-      if (this.week_chart && this.week_chart.dispose) {
-        this.week_chart.dispose();
-        this.week_chart = undefined;
+      if (week_chart && week_chart.dispose) {
+        week_chart.dispose();
+        week_chart = undefined;
       }
-      this.week_chart = echarts.init(this.$refs.share);
-      this.week_chart.resize({
+      week_chart = echarts.init(this.$refs.share);
+      week_chart.resize({
         height: (this.$refs.share.offsetWidth * 6) / 16,
       });
       let o = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
       let k = list[0].map(item => {
         return o[item.week];
       });
-      let key = this.week_list[this.week_act].proportionType || ''
+      let key = this.week_list[this.week_act].proportionType || "";
       var option = {
         tooltip: {
           trigger: "item",
@@ -116,7 +116,7 @@ export default {
               "<br />" +
               obj.name +
               "<br />" +
-              (v.toFixed(2)-0) +
+              (v.toFixed(2) - 0) +
               this.week_list[this.week_act].unit
             );
           },
@@ -145,16 +145,16 @@ export default {
             labelLine: {
               show: false,
             },
-            data: v.map(item=> item[key] || 0),
+            data: v.map(item => item[key] || 0),
           };
         }),
       };
-      option && this.week_chart.setOption(option);
+      option && week_chart.setOption(option);
     },
   },
   beforeUnmount: function() {
-    this.week_chart && this.week_chart.dispose();
-    this.week_chart && (this.week_chart = undefined);
+    week_chart && week_chart.dispose();
+    week_chart && (week_chart = undefined);
   },
   components: {},
 };

+ 27 - 23
src/views/AdvertisingEye/components/tranche.vue

@@ -28,6 +28,8 @@
 import * as echarts from "echarts";
 import { industryList } from "@/api/index.js";
 
+let share1_chart = undefined,
+  share_chart = undefined;
 export default {
   name: "AdvertisingEye_tranche",
   data() {
@@ -59,8 +61,6 @@ export default {
           type: 4,
         },
       ],
-      share_chart: undefined,
-      share1_chart: undefined,
     };
   },
   props: {
@@ -77,6 +77,8 @@ export default {
     },
   },
   mounted() {
+    share1_chart = undefined;
+    share_chart = undefined;
     this.init();
   },
   computed: {},
@@ -147,12 +149,12 @@ export default {
     },
     shareChart(list) {
       if (!this.$refs.share) return;
-      if (this.share_chart && this.share_chart.dispose) {
-        this.share_chart.dispose();
-        this.share_chart = undefined;
+      if (share_chart && share_chart.dispose) {
+        share_chart.dispose();
+        share_chart = undefined;
       }
-      this.share_chart = echarts.init(this.$refs.share);
-      this.share_chart.resize({
+      share_chart = echarts.init(this.$refs.share);
+      share_chart.resize({
         height: (this.$refs.share.offsetWidth * 6) / 16,
       });
       var option = {
@@ -165,7 +167,7 @@ export default {
         ],
         tooltip: {
           trigger: "item",
-          formatter: '{b} {d}%'
+          formatter: "{b} {d}%",
         },
         legend: {
           left: "center",
@@ -196,16 +198,16 @@ export default {
         }),
       };
 
-      option && this.share_chart.setOption(option);
+      option && share_chart.setOption(option);
     },
     share1Chart(list) {
       if (!this.$refs.share1) return;
-      if (this.share1_chart && this.share1_chart.dispose) {
-        this.share1_chart.dispose();
-        this.share1_chart = undefined;
+      if (share1_chart && share1_chart.dispose) {
+        share1_chart.dispose();
+        share1_chart = undefined;
       }
-      this.share1_chart = echarts.init(this.$refs.share1);
-      this.share1_chart.resize({
+      share1_chart = echarts.init(this.$refs.share1);
+      share1_chart.resize({
         height: (this.$refs.share1.offsetWidth * 6) / 25,
       });
       var option = {
@@ -243,6 +245,7 @@ export default {
         },
         series: list.map(v => {
           const item = v[0] || {};
+          console.log(item);
           return {
             name: item.name,
             type: "bar",
@@ -253,22 +256,23 @@ export default {
             emphasis: {
               focus: "series",
             },
-            data: v.map(o =>
-              (
-                (o[this.share_list[this.share_act].proportionType] || 0) * 100
-              ).toFixed(2) -0 
+            data: v.map(
+              o =>
+                (
+                  (o[this.share_list[this.share_act].proportionType] || 0) * 100
+                ).toFixed(2) - 0
             ),
           };
         }),
       };
-      option && this.share1_chart.setOption(option);
+      option && share1_chart.setOption(option);
     },
   },
   beforeUnmount: function() {
-    this.share1_chart && this.share1_chart.dispose();
-    this.share_chart && this.share_chart.dispose();
-    this.share1_chart && (this.share1_chart = undefined);
-    this.share_chart && (this.share_chart = undefined);
+    share1_chart && share1_chart.dispose();
+    share_chart && share_chart.dispose();
+    share1_chart && (share1_chart = undefined);
+    share_chart && (share_chart = undefined);
   },
   components: {},
 };

+ 10 - 10
src/views/AdvertisingEye/components/trancheB.vue

@@ -27,7 +27,7 @@
 // import config from "@/config/index";
 import * as echarts from "echarts";
 import { MediaShare } from "@/api/index.js";
-
+let share1_chart = undefined;
 export default {
   name: "AdvertisingEye_tranche",
   data() {
@@ -59,7 +59,6 @@ export default {
           type: 4,
         },
       ],
-      share1_chart: undefined,
     };
   },
   props: {
@@ -76,6 +75,7 @@ export default {
     },
   },
   mounted() {
+    share1_chart = undefined;
     this.init();
   },
   computed: {},
@@ -128,12 +128,12 @@ export default {
     },
     share1Chart(list) {
       if (!this.$refs.share1) return;
-      if (this.share1_chart && this.share1_chart.dispose) {
-        this.share1_chart.dispose();
-        this.share1_chart = undefined;
+      if (share1_chart && share1_chart.dispose) {
+        share1_chart.dispose();
+        share1_chart = undefined;
       }
-      this.share1_chart = echarts.init(this.$refs.share1);
-      this.share1_chart.resize({
+      share1_chart = echarts.init(this.$refs.share1);
+      share1_chart.resize({
         height: (this.$refs.share1.offsetWidth * 6) / 25,
       });
       var option = {
@@ -171,12 +171,12 @@ export default {
         },
         series: list,
       };
-      option && this.share1_chart.setOption(option);
+      option && share1_chart.setOption(option);
     },
   },
   beforeUnmount: function() {
-    this.share1_chart && this.share1_chart.dispose();
-    this.share1_chart && (this.share1_chart = undefined);
+    share1_chart && share1_chart.dispose();
+    share1_chart && (share1_chart = undefined);
   },
   components: {},
 };

+ 21 - 19
src/views/AdvertisingEye/components/trancheB2.vue

@@ -28,6 +28,8 @@
 import * as echarts from "echarts";
 import { ChannelDistribution } from "@/api/index.js";
 
+let share_chart = undefined,
+  share1_chart = undefined;
 export default {
   name: "AdvertisingEye_tranche",
   data() {
@@ -53,8 +55,6 @@ export default {
           type: 3,
         },
       ],
-      share_chart: undefined,
-      share1_chart: undefined,
     };
   },
   props: {
@@ -71,6 +71,8 @@ export default {
     },
   },
   mounted() {
+    share_chart = undefined;
+    share1_chart = undefined;
     this.init();
   },
   computed: {},
@@ -94,12 +96,12 @@ export default {
     },
     shareChart(list) {
       if (!this.$refs.share) return;
-      if (this.share_chart && this.share_chart.dispose) {
-        this.share_chart.dispose();
-        this.share_chart = undefined;
+      if (share_chart && share_chart.dispose) {
+        share_chart.dispose();
+        share_chart = undefined;
       }
-      this.share_chart = echarts.init(this.$refs.share);
-      this.share_chart.resize({
+      share_chart = echarts.init(this.$refs.share);
+      share_chart.resize({
         height: (this.$refs.share.offsetWidth * 6) / 16,
       });
       let k = [],
@@ -107,7 +109,7 @@ export default {
       list.map(item => {
         let value = item[this.share_list[this.share_act].proportionType] || 0;
         if (this.share_list[this.share_act].proportionType === "timeSize")
-          value = (value / 60).toFixed(2) -0 ;
+          value = (value / 60).toFixed(2) - 0;
         k.push(item.channelName);
         v.push(value);
       });
@@ -156,16 +158,16 @@ export default {
         ],
       };
 
-      option && this.share_chart.setOption(option);
+      option && share_chart.setOption(option);
     },
     share1Chart(list) {
       if (!this.$refs.share) return;
-      if (this.share1_chart && this.share1_chart.dispose) {
-        this.share1_chart.dispose();
-        this.share1_chart = undefined;
+      if (share1_chart && share1_chart.dispose) {
+        share1_chart.dispose();
+        share1_chart = undefined;
       }
-      this.share1_chart = echarts.init(this.$refs.share1);
-      this.share1_chart.resize({
+      share1_chart = echarts.init(this.$refs.share1);
+      share1_chart.resize({
         height: (this.$refs.share.offsetWidth * 6) / 16,
       });
       let k = [],
@@ -222,14 +224,14 @@ export default {
         ],
       };
 
-      option && this.share1_chart.setOption(option);
+      option && share1_chart.setOption(option);
     },
   },
   beforeUnmount: function() {
-    this.share1_chart && this.share1_chart.dispose();
-    this.share_chart && this.share_chart.dispose();
-    this.share1_chart && (this.share1_chart = undefined);
-    this.share_chart && (this.share_chart = undefined);
+    share1_chart && share1_chart.dispose();
+    share_chart && share_chart.dispose();
+    share1_chart && (share1_chart = undefined);
+    share_chart && (share_chart = undefined);
   },
   components: {},
 };

+ 45 - 27
src/views/HardAdvertisement/HardAdvertisement.vue

@@ -151,12 +151,12 @@
                 prop="industry"
                 label="大行业名称"
               />
+                      <!-- 逗号 .replace(/(?=(\B)(\d{3})+\.)/g, ",") -->
               <el-table-column align="center" label="费用(万元)">
                 <template #default="scope">
                   <span>{{
                     (scope.row.fee / 10000)
                       .toFixed(2)
-                      .replace(/(?=(\B)(\d{3})+\.)/g, ",")
                   }}</span>
                 </template>
               </el-table-column>
@@ -165,7 +165,7 @@
                   <span>{{
                     (scope.row.timeSize / 1000)
                       .toFixed(2)
-                      .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                      
                   }}</span>
                 </template>
               </el-table-column>
@@ -174,7 +174,7 @@
                   <span>{{
                     scope.row.pinci
                       .toFixed(0)
-                      .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                      
                   }}</span>
                 </template>
               </el-table-column>
@@ -183,7 +183,7 @@
                   <span>{{
                     scope.row.customer
                       .toFixed(0)
-                      .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                      
                   }}</span>
                 </template>
               </el-table-column>
@@ -244,7 +244,7 @@
                           >{{
                             (item.fee / 10000)
                               .toFixed(2)
-                              .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                              
                           }}</span
                         >
                         <span
@@ -255,7 +255,7 @@
                           >{{
                             (item.timeSize / 1000)
                               .toFixed(2)
-                              .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                              
                           }}</span
                         >
                         <span
@@ -265,7 +265,7 @@
                           >{{
                             item.pinci
                               .toString()
-                              .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                              
                           }}</span
                         >
                       </td>
@@ -313,7 +313,7 @@
                           >{{
                             (item.fee / 10000)
                               .toFixed(2)
-                              .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                              
                           }}</span
                         >
                         <span
@@ -324,7 +324,7 @@
                           >{{
                             (item.timeSize / 1000)
                               .toFixed(2)
-                              .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                              
                           }}</span
                         >
                         <span
@@ -334,7 +334,7 @@
                           >{{
                             item.pinci
                               .toString()
-                              .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                              
                           }}</span
                         >
                       </td>
@@ -390,7 +390,7 @@
               <span>{{
                 (scope.row.fee / 10000)
                   .toFixed(2)
-                  .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                  
               }}</span>
             </template>
           </el-table-column>
@@ -406,7 +406,7 @@
               <span>{{
                 (scope.row.timeSize / 1000)
                   .toFixed(2)
-                  .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                  
               }}</span>
             </template>
           </el-table-column>
@@ -420,7 +420,7 @@
             </template>
             <template #default="scope">
               <span>{{
-                scope.row.pinci.toFixed(0).replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                scope.row.pinci.toFixed(0)
               }}</span>
             </template>
           </el-table-column>
@@ -467,7 +467,7 @@
               <span>{{
                 (scope.row.fee / 10000)
                   .toFixed(2)
-                  .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                  
               }}</span>
             </template>
           </el-table-column>
@@ -483,7 +483,7 @@
               <span>{{
                 (scope.row.timeSize / 1000)
                   .toFixed(2)
-                  .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                  
               }}</span>
             </template>
           </el-table-column>
@@ -497,7 +497,7 @@
             </template>
             <template #default="scope">
               <span>{{
-                scope.row.pinci.toFixed(0).replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                scope.row.pinci.toFixed(0)
               }}</span>
             </template>
           </el-table-column>
@@ -506,7 +506,7 @@
               <span>{{
                 scope.row.customer
                   .toFixed(0)
-                  .replace(/(?=(\B)(\d{3})+\.)/g, ",")
+                  
               }}</span>
             </template>
           </el-table-column>
@@ -788,6 +788,14 @@ export default {
         this.proportionChart();
       });
     },
+    getDate(date, i) {
+        const org = new Date(date);
+      const d = new Date(org + i * 86400000);
+      let m = d.getMonth()+1,day =d.getDate();
+      m > 9 ? '' : m ="0" + m;
+      day > 9 ? '' : day ="0" + day;
+      return [d.getFullYear(), m, day].join("-")
+    },
     launchtrendData(list = { before: [], now: [] }, keyName) {
       const org = list;
       let old = org.before || [];
@@ -802,7 +810,7 @@ export default {
         let o = old[i] || {},
           n = now[i] || {},
           realItem = o.dt ? o : n;
-        if (keyName === "launch") keys.push(`第${i + 1}天`);
+        if (keyName === "launch") keys.push(this.getDate(realItem.dt, i));
         if (keyName === "trend") keys.push(realItem.hour);
         o.dt && realKey[0].push(o.dt);
         n.dt && realKey[1].push(n.dt);
@@ -811,13 +819,16 @@ export default {
         n[key] >= 0 &&
           value[1].push(key === "timeSize" ? n[key] / 60000 : n[key]);
       }
+      
       if (old && old.length) {
-        if (old[0].dts === old[old.length - 1].dte) lendata.push(`${old[0].dt}`);
-        else lendata.push(`${old[0].dts}到${old[old.length - 1].dte}`);
+        if (old[0].dts && old[0].dts === old[old.length - 1].dte)
+          lendata.push(`${old[0].dt}`);
+        else lendata.push(`${old[0].dts || old[0].dt}到${old[old.length - 1].dte || old[old.length - 1].dt}`);
       }
       if (now && now.length) {
-        if (now[0].dts === now[now.length - 1].dte) lendata.push(`${now[0].dt}`);
-        else lendata.push(`${now[0].dts}到${now[now.length - 1].dte}`);
+        if (now[0].dts && now[0].dts === now[now.length - 1].dte)
+          lendata.push(`${now[0].dt}`);
+        else lendata.push(`${now[0].dts || now[0].dt}到${now[now.length - 1].dte || now[now.length - 1].dt}`);
       }
       return {
         keys,
@@ -875,7 +886,11 @@ export default {
         },
         yAxis: {
           type: "value",
-          name: this.launch_list[this.launch_act].text + '(' + this.launch_list[this.launch_act].unit + ')',
+          name:
+            this.launch_list[this.launch_act].text +
+            "(" +
+            this.launch_list[this.launch_act].unit +
+            ")",
           scale: true,
           axisLabel: {
             formatter: arr => {
@@ -1187,8 +1202,8 @@ export default {
 }
 .hardAdvertisement .headStyle .cell,
 .hardAdvertisement .headStyle .cell * {
-    color: #000;
-    font-weight: 600;
+  color: #000;
+  font-weight: 600;
 }
 .hardAdvertisement .el-card__body {
   padding: 0 0 20px 0;
@@ -1288,10 +1303,13 @@ export default {
   font-size: 18px;
   background-color: #d9efff;
 }
-.hardAdvertisement .headStyle .cell {
-  font-weight: 600;
+.hardAdvertisement .headStyle .cell,
+.hardAdvertisement .cell {
   color: #000;
 }
+.hardAdvertisement .headStyle .cell{
+    font-weight: 600
+}
 .hardAdvertisement .titleHead {
   text-align: center;
   position: relative;