liyongli 3 years ago
parent
commit
c87b4597da

+ 17 - 1
src/api/index.js

@@ -499,7 +499,7 @@ export function ChannelDistribution(data) {
 }
 
 /**
- * 频道份额
+ * 节目类型
  * @props {string} tableType
  * @props {string} indexTime
  * @props {string} dataType
@@ -514,6 +514,22 @@ export function ProgramTypeDistribution(data) {
   });
 }
 
+/**
+ * 节目类型
+ * @props {string} tableType
+ * @props {string} indexTime
+ * @props {string} dataType
+ * @return {AxjxPromise}
+ */
+export function ProgramTypeDistributionChart(data) {
+  return ajax({
+    urlType: "adAPI",
+    url: "/ad/industry/ProgramTypeDistributionTable",
+    method: "POST",
+    data,
+  });
+}
+
 /**
  * 重点客户
  * @props {string} tableType

+ 0 - 1
src/views/AdvertisingEye/components/comTrendWeek.vue

@@ -91,7 +91,6 @@ export default {
       this.init();
     },
     shareChart(list) {
-        console.log(list)
       if (!this.$refs.share) return;
       if (this.week_chart && this.week_chart.dispose) {
         this.week_chart.dispose();

+ 23 - 13
src/views/AdvertisingEye/components/distributionB.vue

@@ -45,7 +45,7 @@
               label="栏目名称"
             >
               <template #default="scope">
-                {{ scope.row.programName || '--' }}
+                {{ scope.row.programName || "--" }}
               </template>
             </el-table-column>
             <el-table-column align="center" property="pinci">
@@ -108,7 +108,10 @@
 // import config from "@/config/index";
 import * as echarts from "echarts";
 import comTable from "./table.vue";
-import { ProgramTypeDistribution } from "@/api/index.js";
+import {
+  ProgramTypeDistribution,
+  ProgramTypeDistributionChart,
+} from "@/api/index.js";
 
 export default {
   name: "AdvertisingEye_distribution",
@@ -157,15 +160,22 @@ export default {
   filter: {},
   methods: {
     init() {
-      ProgramTypeDistribution({
-        industryId: this.industry,
-        dataType: this.industryRang + 1,
-        type: this.soft_planting_list[this.soft_planting_act].type,
-      }).then(all => {
-        const li = (all || { data: [] }).data || [];
-        this.tableList = li;
+      Promise.all([
+        ProgramTypeDistribution({
+          industryId: this.industry,
+          dataType: this.industryRang + 1,
+          type: this.soft_planting_list[this.soft_planting_act].type,
+        }),
+        ProgramTypeDistributionChart({
+          industryId: this.industry,
+          dataType: this.industryRang + 1,
+          type: this.soft_planting_list[this.soft_planting_act].type,
+        }),
+      ]).then(all => {
+        const li = (all[0] || { data: [] }).data || [];
+        this.tableList = all[1].data || [];
         li.length && (this.titleName = li[0].name || "");
-        this.softAdChart(li || []);
+        this.softAdChart(li);
       });
     },
     soft_planting_change(i) {
@@ -238,9 +248,9 @@ export default {
     },
     numFor(num) {
       if (isNaN(num)) return 0;
-      if (num >= 100000000) return (num / 100000000).toFixed(2) + "亿";
-      if (num >= 10000) return (num / 10000).toFixed(2) + "万";
-      return Number(num).toFixed(2);
+      if (num >= 100000000) return (num / 100000000).toFixed(2) - 0 + "亿";
+      if (num >= 10000) return (num / 10000).toFixed(2) - 0 + "万";
+      return Number(num).toFixed(2) - 0;
     },
   },
   beforeUnmount: function() {

+ 8 - 8
src/views/AdvertisingEye/components/focusB.vue

@@ -20,8 +20,8 @@
       <el-col :span="12">
         <com-table
           title="硬广-品牌投放Top10"
-          v-if="softMarster && softMarster.length"
-          :tableList="softMarster"
+          v-if="softBrand && softBrand.length"
+          :tableList="softBrand"
           :child="true"
         >
           <template #cols>
@@ -34,11 +34,11 @@
             <el-table-column
               show-overflow-tooltip
               align="center"
-              property="companyName"
+              property="brand"
               label="品牌名称"
             >
               <template #default="scope">
-                {{ scope.row.companyName || '--' }}
+                {{ scope.row.brand || '--' }}
               </template>
             </el-table-column>
             <el-table-column align="center" property="pinci">
@@ -114,8 +114,8 @@
       <el-col :span="12">
         <com-table
           title="硬广-品牌投放Top10"
-          v-if="softBrand && softBrand.length"
-          :tableList="softBrand"
+          v-if="softMarster && softMarster.length"
+          :tableList="softMarster"
           :child="true"
         >
           <template #cols>
@@ -128,11 +128,11 @@
             <el-table-column
               show-overflow-tooltip
               align="center"
-              property="companyName"
+              property="brand"
               label="品牌名称"
             >
               <template #default="scope">
-                {{ scope.row.companyName || '--' }}
+                {{ scope.row.brand || '--' }}
               </template>
             </el-table-column>
             <el-table-column align="center" property="pinci">

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

@@ -44,7 +44,7 @@ export default {
         },
         {
           text: "客户数",
-          proportionType: "custom",
+          proportionType: "customer",
           type: 4,
         },
       ],

+ 2 - 2
src/views/AdvertisingEye/components/trancheB2.vue

@@ -48,7 +48,7 @@ export default {
         },
         {
           text: "费用",
-          proportionType: "fee",
+          proportionType: "kanlijia",
           unit: "万",
           type: 3,
         },
@@ -142,7 +142,7 @@ export default {
           {
             name: "硬广",
             type: "bar",
-            barWidth : 30,//柱图宽度
+            barWidth: 30, //柱图宽度
             label: {
               show: false,
               position: "center",