liyongli 3 年之前
父節點
當前提交
b51635630c
共有 4 個文件被更改,包括 51 次插入41 次删除
  1. 12 0
      src/api/index.js
  2. 36 38
      src/components/maincomponents.vue
  3. 1 1
      src/config/apiUrl.js
  4. 2 2
      src/view/main.vue

+ 12 - 0
src/api/index.js

@@ -160,3 +160,15 @@ export function bumenList() {
     method: "GET",
   });
 }
+
+/**
+ * 爆点数据
+ * @param {}
+ * @returns {AxiosPromise}
+ */
+ export function baodianList(topic) {
+    return request({
+      url: "/charts/hot-topic?topic=" + topic,
+      method: "GET",
+    });
+  }

+ 36 - 38
src/components/maincomponents.vue

@@ -78,19 +78,20 @@
       <canvas id="barChart" style="width: 100%; height: 70vw" class=""></canvas>
     </div>
 
-    <!-- <div class="card">
-      <div class="cardtit">发稿统计</div>
+    <div class="card">
+      <div class="cardtit">爆款热点</div>
       <div style="padding: 10px">
         <el-table :data="platformList" style="width: 100%">
-          <el-table-column prop="depName" label="部门"> </el-table-column>
-          <el-table-column prop="total" label="发稿量">
+          <el-table-column prop="host" label="部门"> </el-table-column>
+          <el-table-column prop="subTopic" label="热点名称"> </el-table-column>
+          <el-table-column prop="playCount" label="传播量">
             <template slot-scope="scope">
-              {{ scope.row.total | numform }}
+              {{ scope.row.playCount | numform }}
             </template>
           </el-table-column>
         </el-table>
       </div>
-    </div> -->
+    </div>
 
     <div class="card">
       <div class="cardtit">
@@ -128,12 +129,13 @@
           <el-table-column prop="depName" label="部门"> </el-table-column>
           <el-table-column prop="name" label="账号"> </el-table-column>
           <el-table-column prop="platform" label="平台"> </el-table-column>
-          <el-table-column prop="publishTime" label="发稿时间"> </el-table-column>
+          <el-table-column prop="publishTime" label="发稿时间">
+          </el-table-column>
         </el-table>
         <el-pagination
           style="margin-top: 5px"
           background
-          layout="prev, pager, next"
+           layout="total, prev, pager, next"
           :total="usertotal"
           :current-page="page"
           @current-change="pagechange"
@@ -151,7 +153,8 @@ import {
   platformData,
   qushiData,
   bumenData,
-//   pingtaiData,
+  //   pingtaiData,
+  baodianList,
   zhanghaoData,
   bumenList,
 } from "@/api/index.js";
@@ -166,7 +169,7 @@ export default {
       playT: 0,
       plays: [],
       loading: false,
-    //   platformList: [],
+        platformList: [],
       dep: "全部",
       T: [],
       userlist: [],
@@ -204,13 +207,15 @@ export default {
   computed: {},
   methods: {
     init() {
-      console.log("--");
       linechart && linechart.destroy();
       barchart && barchart.destroy();
       piechart && piechart.destroy();
       linechart = null;
       barchart = null;
       piechart = null;
+      baodianList(this.topic).then(r=>{
+          this.platformList = r || []
+      })
       platformData(this.topic).then(r => {
         let platform = {},
           pli = [];
@@ -251,13 +256,13 @@ export default {
         });
       });
       this.bmGet();
-    //   pingtaiData({
-    //     depRange: "ALL",
-    //     title: this.topic,
-    //   }).then(r => {
-    //       console.log(r)
-    //     this.platformList = (r || []).sort((a, b) => b.readTotal - a.readTotal);
-    //   });
+      //   pingtaiData({
+      //     depRange: "ALL",
+      //     title: this.topic,
+      //   }).then(r => {
+      //       console.log(r)
+      //     this.platformList = (r || []).sort((a, b) => b.readTotal - a.readTotal);
+      //   });
       this.grtzhData();
       bumenList().then(r => {
         let options = (r || []).map(v => {
@@ -339,24 +344,9 @@ export default {
           tickCount: 5,
         },
       });
-      linechart.axis("playCount", {
-        label: function label(text) {
-          const textCfg = {};
-          textCfg.text = that.numform(text);
-          return textCfg;
-        },
-        grid: null,
-      });
-
-      linechart.axis("dt", {
-        label: function label(text, index, total) {
-          const textCfg = {};
-          if (index === 0) {
-            textCfg.textAlign = "left";
-          } else if (index === total - 1) {
-            textCfg.textAlign = "right";
-          }
-          return textCfg;
+      linechart.scale("playCount", {
+        formatter(text) {
+          return that.numform(text);
         },
       });
       linechart.tooltip({
@@ -364,7 +354,6 @@ export default {
         onShow: function onShow(ev) {
           const items = ev.items;
           items[0].name = items[0].title;
-          items[0].value = that.numform(items[0].title);
           items[1].name = null;
           items[1].value = 0;
         },
@@ -394,7 +383,7 @@ export default {
       barchart = new F2.Chart({
         id: "barChart",
         pixelRatio: window.devicePixelRatio,
-        padding: [10, 50, 30, 110],
+        padding: [10, 50, 30, 140],
       });
 
       barchart.source(li, {
@@ -410,6 +399,15 @@ export default {
         },
         grid: null,
       });
+      barchart.axis("depName", {
+        label: function label(text) {
+          const textCfg = {};
+          textCfg.text = text;
+          textCfg.fontSize = 12;
+          return textCfg;
+        },
+        grid: null,
+      });
 
       barchart.coord({
         transposed: true,

+ 1 - 1
src/config/apiUrl.js

@@ -9,7 +9,7 @@ if (process.env.NODE_ENV !== "development") {
       useApiUrl = "http://topic.smcic.net";
       break;
     default:
-      useApiUrl = "http://topic.smcic.net";
+      useApiUrl = "https://topic.smcic.net";
       isRelease = true;
       break;
   }

+ 2 - 2
src/view/main.vue

@@ -20,7 +20,7 @@
     <div class="aside">
       <div class="son hd">
         <div class="tit">
-          活动列表
+          事件(活动)列表
           <i class="el-icon-circle-plus-outline iconright" @click="addhd"></i>
         </div>
         <div class="tbody">
@@ -40,7 +40,7 @@
                 }
               "
             >
-              {{ item.name }}
+              {{ item.alias }}
             </span>
           </div>
         </div>