liyongli vor 3 Jahren
Ursprung
Commit
4775992c9a
3 geänderte Dateien mit 22 neuen und 41 gelöschten Zeilen
  1. 0 2
      src/api/index.js
  2. 14 14
      src/views/Activity/Activity.vue
  3. 8 25
      src/views/Activity/views/defaultComponent.vue

+ 0 - 2
src/api/index.js

@@ -752,7 +752,6 @@ export function guijiBumenList() {
  * @return {AxjxPromise}
  */
 export function guijiFagao(data) {
-    console.log(data)
   return ajaxAxios({
     url: "/topic/detail",
     method: "POST",
@@ -765,7 +764,6 @@ export function guijiFagao(data) {
  * @return {AxjxPromise}
  */
 export function leverAudience(data) {
-    console.log(data)
   return ajax({
     urlType: "leverAudience",
     url: "/cxzx-program/flow/channels",

+ 14 - 14
src/views/Activity/Activity.vue

@@ -79,20 +79,20 @@ export default {
         this.init();
       });
     },
-    getTab() {
-    // getTab(topic) {
+    // getTab() {
+    getTab(topic) {
       let activitys = [];
-    //   (topic || []).map(v => {
-    //     activitys.push({
-    //       isCollectPlatform: v.isCollectPlatform,
-    //       component: "defaultComponent",
-    //       componentReal: "defaultComponent" + v.activityId,
-    //       activityId: v.activityId,
-    //       realName: v.name,
-    //       sortNo: v.sortNo,
-    //       name: v.alias,
-    //     });
-    //   });
+      (topic || []).map(v => {
+        activitys.push({
+          isCollectPlatform: v.isCollectPlatform,
+          component: "defaultComponent",
+          componentReal: "defaultComponent" + v.activityId,
+          activityId: v.activityId,
+          realName: v.name,
+          sortNo: v.sortNo,
+          name: v.alias,
+        });
+      });
       activitys = activitys.concat([
         {
           name: "德润三秦",
@@ -135,7 +135,7 @@ export default {
         this.select = this.activitys[tab.index].componentReal;
         this.selectA[this.select] = true;
       } catch (err) {
-        console.log(err);
+        console.error(err);
       }
     },
   },

+ 8 - 25
src/views/Activity/views/defaultComponent.vue

@@ -178,28 +178,9 @@ import {
   guijiFagao,
 } from "@/api/index";
 
-import * as echarts from "echarts/core";
-import { LineChart } from "echarts/charts";
-import {
-  GridComponent,
-  ToolboxComponent,
-  VisualMapComponent,
-  LegendComponent,
-} from "echarts/components";
-import { LabelLayout, UniversalTransition } from "echarts/features";
-import { CanvasRenderer } from "echarts/renderers";
+import * as echarts from "echarts";
 const ElLoading = require("element-plus/lib/el-loading/index");
 import "element-plus/lib/theme-chalk/el-loading.css";
-echarts.use([
-  GridComponent,
-  LineChart,
-  CanvasRenderer,
-  ToolboxComponent,
-  VisualMapComponent,
-  LabelLayout,
-  UniversalTransition,
-  LegendComponent,
-]);
 let lineH = 0;
 export default {
   name: "defaultComponent",
@@ -309,9 +290,9 @@ export default {
       });
     },
     trendChart(li) {
-      this.chart1 = echarts.init(this.$refs.trendChartEle);
+      let chart1 = echarts.init(this.$refs.trendChartEle);
       lineH = (this.$refs.trendChartEle.offsetWidth * 9) / 16;
-      this.chart1.resize({
+      chart1.resize({
         height: (this.$refs.trendChartEle.offsetWidth * 9) / 16,
       });
       const keys = [],
@@ -320,11 +301,12 @@ export default {
         keys.push(v.dt);
         val.push(v.playCount);
       });
-      this.chart1.setOption({
+      chart1.setOption({
         tooltip: {
-          trigger: "item",
+          trigger: "axis",
           formatter: v => {
-            return v.name + ":" + this.numform(v.data);
+            const item = v[0] || {};
+            return (item.name || "") + "<br />" + this.numform(item.value || "");
           },
         },
         legend: {
@@ -344,6 +326,7 @@ export default {
         },
         series: [
           {
+            symbol: "none",
             data: val,
             type: "line",
             smooth: true,