liyongli пре 3 година
родитељ
комит
fb0cce1574

+ 2 - 1
src/config/index.js

@@ -14,7 +14,8 @@ export default {
     url2: useApiUrl1,
     url3: "",
     kuyunApi,
-    adAPI:"https://topic.smcic.net",
+    adAPI:"http://topic.smcic.net",
+    // adAPI:"https://topic.smcic.net",
     // adAPI:"http://172.16.101.11:9000",
     timeout: 60000,
     // isRelease,

+ 18 - 16
src/views/AdvertisingEye/components/distributionB.vue

@@ -121,16 +121,16 @@ export default {
       tableList: [],
       soft_planting_act: 0,
       soft_planting_list: [
-        {
-          text: "时长",
-          proportionType: "timeSize",
-          type: 2,
-        },
         {
           text: "频次",
           proportionType: "pinci",
           type: 1,
         },
+        {
+          text: "时长",
+          proportionType: "timeSize",
+          type: 2,
+        },
         {
           text: "客户数",
           proportionType: "custom",
@@ -194,18 +194,19 @@ export default {
       });
       let k = [],
         item = [],
-        max =
-          list[0][
-            this.soft_planting_list[this.soft_planting_act].proportionType
-          ] || 0;
+        total = 0;
       list.map(v => {
-        k.push({ name: v.programType, max });
-        let val =
-          (
-            v[this.soft_planting_list[this.soft_planting_act].proportionType] -
-            0
-          ).toFixed(2) - 0;
+         total +=
+          (v[this.soft_planting_list[this.soft_planting_act].proportionType] ||
+            0) - 0;
+      });
+      list.map(v => {
+         let value =
+          v[this.soft_planting_list[this.soft_planting_act].proportionType] - 0;
+        let val = ((value / total) * 100).toFixed(2) - 0;
         item.push(val);
+      console.log(v)
+        k.push({ name: v.programType, max: item[0] + 10 });
       });
       const buildSeries = function(data) {
         const helper = data.map((item, index) => {
@@ -233,7 +234,8 @@ export default {
             tooltip: {
               show: index === 0 ? false : true,
               formatter: function() {
-                return k[index - 1].name + ":" + item[index - 1];
+
+                return k[index - 1].name + ":" + item[index - 1] + '%';
               },
             },
             z: index === 0 ? 1 : 2,

+ 101 - 76
src/views/AdvertisingEye/components/focus.vue

@@ -81,12 +81,12 @@
                 </span>
               </template>
               <template #default="scope">
-                {{ numFor(scope.row.fee) }}
+                {{ numFor(scope.row.fee, 2) }}
               </template>
             </el-table-column>
             <el-table-column align="center" property="fee" label="环比">
               <template #default="scope">
-                 <svg
+                <svg
                   t="1646702687390"
                   class="icon"
                   viewBox="0 0 1024 1024"
@@ -94,13 +94,15 @@
                   xmlns="http://www.w3.org/2000/svg"
                   p-id="2028"
                   width="20"
-                  v-if="scope.row[
-                    hard_important_list[hard_important_act].proportionType
-                  ] -
-                    scope.row.compare[
+                  v-if="
+                    scope.row[
                       hard_important_list[hard_important_act].proportionType
-                    ] <
-                    0"
+                    ] -
+                      scope.row.compare[
+                        hard_important_list[hard_important_act].proportionType
+                      ] <
+                      0
+                  "
                   height="20"
                   xmlns:xlink="http://www.w3.org/1999/xlink"
                 >
@@ -118,13 +120,15 @@
                   xmlns="http://www.w3.org/2000/svg"
                   p-id="2299"
                   width="20"
-                  v-if="scope.row[
-                    hard_important_list[hard_important_act].proportionType
-                  ] -
-                    scope.row.compare[
+                  v-if="
+                    scope.row[
                       hard_important_list[hard_important_act].proportionType
-                    ] >
-                    0"
+                    ] -
+                      scope.row.compare[
+                        hard_important_list[hard_important_act].proportionType
+                      ] >
+                      0
+                  "
                   height="20"
                 >
                   <path
@@ -202,12 +206,12 @@
                 </span>
               </template>
               <template #default="scope">
-                {{ numFor(scope.row.fee) }}
+                {{ numFor(scope.row.fee, 2) }}
               </template>
             </el-table-column>
             <el-table-column align="center" property="fee" label="环比">
               <template #default="scope">
-                 <svg
+                <svg
                   t="1646702687390"
                   class="icon"
                   viewBox="0 0 1024 1024"
@@ -215,13 +219,15 @@
                   xmlns="http://www.w3.org/2000/svg"
                   p-id="2028"
                   width="20"
-                  v-if="scope.row[
-                    hard_important_list[hard_important_act].proportionType
-                  ] -
-                    scope.row.compare[
+                  v-if="
+                    scope.row[
                       hard_important_list[hard_important_act].proportionType
-                    ] <
-                    0"
+                    ] -
+                      scope.row.compare[
+                        hard_important_list[hard_important_act].proportionType
+                      ] <
+                      0
+                  "
                   height="20"
                   xmlns:xlink="http://www.w3.org/1999/xlink"
                 >
@@ -239,13 +245,15 @@
                   xmlns="http://www.w3.org/2000/svg"
                   p-id="2299"
                   width="20"
-                  v-if="scope.row[
-                    hard_important_list[hard_important_act].proportionType
-                  ] -
-                    scope.row.compare[
+                  v-if="
+                    scope.row[
                       hard_important_list[hard_important_act].proportionType
-                    ] >
-                    0"
+                    ] -
+                      scope.row.compare[
+                        hard_important_list[hard_important_act].proportionType
+                      ] >
+                      0
+                  "
                   height="20"
                 >
                   <path
@@ -296,36 +304,36 @@
               property="name"
               label="栏目主名称"
             />
-            <el-table-column align="center" property="pinci">
+            <el-table-column align="center" property="timeSize">
               <template #header>
                 <span
                   :style="
-                    soft_important_list[soft_important_act].type === 1
+                    soft_important_list[soft_important_act].type === 2
                       ? 'color: red'
                       : ''
                   "
                 >
-                  频次(次)
+                  时长(秒)
                 </span>
               </template>
               <template #default="scope">
-                {{ numFor(scope.row.pinci) }}
+                {{ numFor(scope.row.timeSize) }}
               </template>
             </el-table-column>
-            <el-table-column align="center" property="timeSize">
+            <el-table-column align="center" property="pinci">
               <template #header>
                 <span
                   :style="
-                    soft_important_list[soft_important_act].type === 2
+                    soft_important_list[soft_important_act].type === 1
                       ? 'color: red'
                       : ''
                   "
                 >
-                  时长(秒)
+                  频次(次)
                 </span>
               </template>
               <template #default="scope">
-                {{ numFor(scope.row.timeSize) }}
+                {{ numFor(scope.row.pinci) }}
               </template>
             </el-table-column>
             <el-table-column align="center" property="fee" label="环比">
@@ -338,13 +346,17 @@
                   xmlns="http://www.w3.org/2000/svg"
                   p-id="2028"
                   width="20"
-                  v-if="scope.row[
-                   soft_important_list[this.soft_important_act].proportionType
-                  ] -
-                    scope.row.compare[
-                      soft_important_list[this.soft_important_act].proportionType
-                    ] <
-                    0"
+                  v-if="
+                    scope.row[
+                      soft_important_list[this.soft_important_act]
+                        .proportionType
+                    ] -
+                      scope.row.compare[
+                        soft_important_list[this.soft_important_act]
+                          .proportionType
+                      ] <
+                      0
+                  "
                   height="20"
                   xmlns:xlink="http://www.w3.org/1999/xlink"
                 >
@@ -362,13 +374,17 @@
                   xmlns="http://www.w3.org/2000/svg"
                   p-id="2299"
                   width="20"
-                  v-if="scope.row[
-                    soft_important_list[this.soft_important_act].proportionType
-                  ] -
-                    scope.row.compare[
-                      soft_important_list[this.soft_important_act].proportionType
-                    ] >
-                    0"
+                  v-if="
+                    scope.row[
+                      soft_important_list[this.soft_important_act]
+                        .proportionType
+                    ] -
+                      scope.row.compare[
+                        soft_important_list[this.soft_important_act]
+                          .proportionType
+                      ] >
+                      0
+                  "
                   height="20"
                 >
                   <path
@@ -401,36 +417,36 @@
               property="name"
               label="品牌名称"
             />
-            <el-table-column align="center" property="pinci">
+            <el-table-column align="center" property="timeSize">
               <template #header>
                 <span
                   :style="
-                    soft_important_list[soft_important_act].type === 1
+                    soft_important_list[soft_important_act].type === 2
                       ? 'color: red'
                       : ''
                   "
                 >
-                  频次(次)
+                  时长(秒)
                 </span>
               </template>
               <template #default="scope">
-                {{ numFor(scope.row.pinci) }}
+                {{ numFor(scope.row.timeSize) }}
               </template>
             </el-table-column>
-            <el-table-column align="center" property="timeSize">
+            <el-table-column align="center" property="pinci">
               <template #header>
                 <span
                   :style="
-                    soft_important_list[soft_important_act].type === 2
+                    soft_important_list[soft_important_act].type === 1
                       ? 'color: red'
                       : ''
                   "
                 >
-                  时长(秒)
+                  频次(次)
                 </span>
               </template>
               <template #default="scope">
-                {{ numFor(scope.row.timeSize) }}
+                {{ numFor(scope.row.pinci) }}
               </template>
             </el-table-column>
             <el-table-column align="center" label="环比">
@@ -443,13 +459,17 @@
                   xmlns="http://www.w3.org/2000/svg"
                   p-id="2028"
                   width="20"
-                  v-if="scope.row[
-                    soft_important_list[this.soft_important_act].proportionType
-                  ] -
-                    scope.row.compare[
-                      soft_important_list[this.soft_important_act].proportionType
-                    ] <
-                    0"
+                  v-if="
+                    scope.row[
+                      soft_important_list[this.soft_important_act]
+                        .proportionType
+                    ] -
+                      scope.row.compare[
+                        soft_important_list[this.soft_important_act]
+                          .proportionType
+                      ] <
+                      0
+                  "
                   height="20"
                   xmlns:xlink="http://www.w3.org/1999/xlink"
                 >
@@ -467,13 +487,17 @@
                   xmlns="http://www.w3.org/2000/svg"
                   p-id="2299"
                   width="20"
-                  v-if="scope.row[
-                    soft_important_list[this.soft_important_act].proportionType
-                  ] -
-                    scope.row.compare[
-                      soft_important_list[this.soft_important_act].proportionType
-                    ] >
-                    0"
+                  v-if="
+                    scope.row[
+                      soft_important_list[this.soft_important_act]
+                        .proportionType
+                    ] -
+                      scope.row.compare[
+                        soft_important_list[this.soft_important_act]
+                          .proportionType
+                      ] >
+                      0
+                  "
                   height="20"
                 >
                   <path
@@ -558,12 +582,13 @@ export default {
   },
   filter: {},
   methods: {
-    numFor(num) {
+    numFor(num, ws) {
       if (!num) return 0;
       if (isNaN(num)) return 0;
-    //   if (num >= 100000000) return ((num / 100000000).toFixed(2) -0 ) + "亿";
-    //   if (num >= 10000) return ((num / 10000).toFixed(2) -0) + "万";
-      return Number(num).toFixed(2) -0;
+      //   if (num >= 100000000) return ((num / 100000000).toFixed(2) -0 ) + "亿";
+      //   if (num >= 10000) return ((num / 10000).toFixed(2) -0) + "万";
+      if (ws) return Number(num).toFixed(2);
+      return Number(num).toFixed(2) - 0;
     },
     init() {
       this.getHard();

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

@@ -41,32 +41,32 @@
                 {{ scope.row.brand || '--' }}
               </template>
             </el-table-column>
-            <el-table-column align="center" property="pinci">
+            <el-table-column align="center" property="timeSize">
               <template #header>
                 <span
                   :style="
-                    important_list[important_act].type === 1 ? 'color: red' : ''
+                    important_list[important_act].type === 2 ? 'color: red' : ''
                   "
                 >
-                  频次(次)
+                  时长(秒)
                 </span>
               </template>
               <template #default="scope">
-                {{ numFor(scope.row.pinci) }}
+                {{ numFor(scope.row.timeSize) }}
               </template>
             </el-table-column>
-            <el-table-column align="center" property="timeSize">
+            <el-table-column align="center" property="pinci">
               <template #header>
                 <span
                   :style="
-                    important_list[important_act].type === 2 ? 'color: red' : ''
+                    important_list[important_act].type === 1 ? 'color: red' : ''
                   "
                 >
-                  时长(秒)
+                  频次(次)
                 </span>
               </template>
               <template #default="scope">
-                {{ numFor(scope.row.timeSize) }}
+                {{ numFor(scope.row.pinci) }}
               </template>
             </el-table-column>
             <el-table-column align="center" property="fee" label="环比">
@@ -125,6 +125,20 @@
               label="序号"
               width="50"
             />
+            <el-table-column align="center" property="timeSize">
+              <template #header>
+                <span
+                  :style="
+                    important_list[important_act].type === 2 ? 'color: red' : ''
+                  "
+                >
+                  时长(秒)
+                </span>
+              </template>
+              <template #default="scope">
+                {{ numFor(scope.row.timeSize) }}
+              </template>
+            </el-table-column>
             <el-table-column
               show-overflow-tooltip
               align="center"
@@ -149,20 +163,6 @@
                 {{ numFor(scope.row.pinci) }}
               </template>
             </el-table-column>
-            <el-table-column align="center" property="timeSize">
-              <template #header>
-                <span
-                  :style="
-                    important_list[important_act].type === 2 ? 'color: red' : ''
-                  "
-                >
-                  时长(秒)
-                </span>
-              </template>
-              <template #default="scope">
-                {{ numFor(scope.row.timeSize) }}
-              </template>
-            </el-table-column>
             <el-table-column align="center" label="环比">
               <template #default="scope">
                 <svg