liyongli 3 gadi atpakaļ
vecāks
revīzija
ae8c3b8678

+ 1 - 1
src/views/AdvertisingEye/AdvertisingEye.vue

@@ -214,7 +214,7 @@ export default {
   -khtml-user-select: none; /*早期浏览器*/
   user-select: none;
 }
-.AdvertisingEye .colTime:not(:first-child) {
+.AdvertisingEye .colTime {
   border-left: 1px solid #fff;
 }
 .AdvertisingEye .colTime:hover,

+ 80 - 17
src/views/HardAdvertisement/HardAdvertisement.vue

@@ -465,7 +465,10 @@
 
 <script>
 // @ is an alias to /src
-let launch_chart = undefined, trend_chart= undefined, proportion_chart= undefined, saturation_chart= undefined;
+let launch_chart = undefined,
+  trend_chart = undefined,
+  proportion_chart = undefined,
+  saturation_chart = undefined;
 import {
   adChannelList,
   launchList,
@@ -532,7 +535,6 @@ export default {
           type: 1,
         },
       ],
-      saturation_chart: undefined,
 
       proportionData: [],
       advantageous: [],
@@ -563,8 +565,9 @@ export default {
       adChannelList().then(r => {
         this.channleList = r || [];
         let sel = this.timeSelect[this.active];
+        console.log(sel);
         launchList({
-          channelId: this.channleList[this.active].channelId,
+          channelId: this.channleList[this.channel_act].channelId,
           start: sel.startDate,
           end: sel.endDate,
         }).then(launch => {
@@ -572,7 +575,7 @@ export default {
         });
 
         trendList({
-          channelId: this.channleList[this.active].channelId,
+          channelId: this.channleList[this.channel_act].channelId,
           start: sel.startDate,
           end: sel.endDate,
         }).then(trend => {
@@ -580,7 +583,7 @@ export default {
         });
 
         proportionList({
-          channelId: this.channleList[this.active].channelId,
+          channelId: this.channleList[this.channel_act].channelId,
           start: sel.startDate,
           end: sel.endDate,
           order: this.launch_list[this.proportion_act].type,
@@ -596,7 +599,7 @@ export default {
         });
 
         customerList({
-          channelId: this.channleList[this.active].channelId,
+          channelId: this.channleList[this.channel_act].channelId,
           start: sel.startDate,
           end: sel.endDate,
           order: this.customer_list[this.customer_act].type,
@@ -605,7 +608,7 @@ export default {
         });
 
         advantageousList({
-          channelId: this.channleList[this.active].channelId,
+          channelId: this.channleList[this.channel_act].channelId,
           start: sel.startDate,
           end: sel.endDate,
         }).then(advantageous => {
@@ -613,7 +616,7 @@ export default {
         });
 
         potentialList({
-          channelId: this.channleList[this.active].channelId,
+          channelId: this.channleList[this.channel_act].channelId,
           start: sel.startDate,
           end: sel.endDate,
         }).then(potential => {
@@ -621,7 +624,7 @@ export default {
         });
 
         saturationList({
-          channelId: this.channleList[this.active].channelId,
+          channelId: this.channleList[this.channel_act].channelId,
           start: sel.startDate,
           end: sel.endDate,
         }).then(saturation => {
@@ -675,7 +678,7 @@ export default {
       this.customer_act = i;
       let sel = this.timeSelect[this.active];
       customerList({
-        channelId: this.channleList[this.active].channelId,
+        channelId: this.channleList[this.channel_act].channelId,
         start: sel.startDate,
         end: sel.endDate,
         order: this.customer_list[this.customer_act].type,
@@ -687,7 +690,7 @@ export default {
       this.launch_act = i;
       let sel = this.timeSelect[this.active];
       launchList({
-        channelId: this.channleList[this.active].channelId,
+        channelId: this.channleList[this.channel_act].channelId,
         start: sel.startDate,
         end: sel.endDate,
       }).then(launch => {
@@ -698,7 +701,7 @@ export default {
       this.trend_act = i;
       let sel = this.timeSelect[this.active];
       trendList({
-        channelId: this.channleList[this.active].channelId,
+        channelId: this.channleList[this.channel_act].channelId,
         start: sel.startDate,
         end: sel.endDate,
       }).then(trend => {
@@ -709,7 +712,7 @@ export default {
       this.proportion_act = i;
       let sel = this.timeSelect[this.active];
       proportionList({
-        channelId: this.channleList[this.active].channelId,
+        channelId: this.channleList[this.channel_act].channelId,
         start: sel.startDate,
         end: sel.endDate,
         order: this.launch_list[this.proportion_act].type,
@@ -764,6 +767,13 @@ export default {
         value,
       };
     },
+    numFor(num) {
+      if (!num) return 0;
+      if (isNaN(num)) return 0;
+      if (num >= 100000000) return (num / 100000000).toFixed(0) - 0 + "亿";
+      if (num >= 10000) return (num / 10000).toFixed(0) - 0 + "万";
+      return num;
+    },
     launchChart(list) {
       if (!this.$refs.launch) return;
       if (launch_chart && launch_chart.dispose) {
@@ -793,9 +803,31 @@ export default {
         yAxis: {
           type: "value",
           scale: true,
+          axisLabel: {
+            formatter: arr => {
+              return this.numFor(arr);
+            },
+          },
         },
         tooltip: {
-          trigger: "item",
+          trigger: "axis",
+          formatter: item => {
+            let bf = list.before || [],
+              no = list.now || [];
+            let vb = this.numFor(
+                bf[item[0].dataIndex][
+                  this.launch_list[this.launch_act].proportionType
+                ] || 0
+              ),
+              vn = this.numFor(
+                no[item[0].dataIndex][
+                  this.launch_list[this.launch_act].proportionType
+                ] || 0
+              );
+            return `${this.launch_list[this.launch_act].text} <br /> ${
+              bf[item[0].dataIndex].dt
+            } ${vb} <br />${no[item[0].dataIndex].dt} ${vn}`;
+          },
         },
         grid: [{ left: 150, top: "10%", buttom: 0, right: 100 }],
         series: chartData.value.map((data, i) => {
@@ -830,11 +862,34 @@ export default {
           data: chartData.keys,
         },
         tooltip: {
-          trigger: "item",
+          trigger: "axis",
+          formatter: item => {
+            let bf = list.before || [],
+              no = list.now || [];
+            console.log(item);
+            let vb = this.numFor(
+                bf[item[0].dataIndex][
+                  this.launch_list[this.trend_act].proportionType
+                ] || 0
+              ),
+              vn = this.numFor(
+                no[item[0].dataIndex][
+                  this.launch_list[this.trend_act].proportionType
+                ] || 0
+              );
+            return `${this.launch_list[this.trend_act].text} <br /> ${
+              item[0].name
+            }时 ${vb} <br />${item[0].name}时 ${vn}`;
+          },
         },
         yAxis: {
           type: "value",
           scale: true,
+          axisLabel: {
+            formatter: arr => {
+              return this.numFor(arr);
+            },
+          },
         },
         grid: [{ left: 150, top: "10%", buttom: 0, right: 100 }],
         series: chartData.value.map((v, i) => {
@@ -874,17 +929,25 @@ export default {
           axisPointer: {
             type: "shadow",
           },
+          formatter: item => {
+            return item.name + "时:" + item.value.toFixed(2) + "%";
+          },
         },
         yAxis: {
           type: "value",
           scale: true,
+          axisLabel: {
+            formatter: arr => {
+              return this.numFor(arr);
+            },
+          },
         },
-        grid: [{ left: 150, top: "10%", buttom: 0, right: 100 }],
+        grid: [{ left: 50, top: "10%", buttom: 0, right: 100 }],
         series: [
           {
             name: "饱和度",
             data: chartData.value,
-            type: "line",
+            type: "bar",
             smooth: true,
             markLine: {
               data: [