liyongli 2 лет назад
Родитель
Сommit
780a121b2c
3 измененных файлов с 22 добавлено и 56 удалено
  1. 1 1
      src/router/index.js
  2. 20 54
      src/views/Content/index.vue
  3. 1 1
      src/views/RealOnline/index.vue

+ 1 - 1
src/router/index.js

@@ -89,7 +89,7 @@ const routes = [
   {
     path: "/content",
     name: "Content",
-    component: () => import(/* webpackChunkName: "region" */ "../views/Content/index.vue")
+    component: () => import(/* webpackChunkName: "content" */ "../views/Content/index.vue")
   },
   
   countryRouter // 全国数据

+ 20 - 54
src/views/Content/index.vue

@@ -289,7 +289,7 @@
           <template #default="scope">
             <countTo
               :startVal="0"
-              :endVal="scope.row.cshare || 0"
+              :endVal="scope.row.cuser || 0"
               :duration="100"
             ></countTo>
           </template>
@@ -340,7 +340,7 @@ echarts.use([
   LegendComponent,
 ]);
 
-// import config from "@/config/index";
+import config from "@/config/index";
 let chart = undefined;
 export default {
   name: "Content",
@@ -372,15 +372,7 @@ export default {
     };
     this.cycle = this.verifyList(appli, source, keys, false);
     this.version = this.verifyList(appVLi, appV, keys, true);
-    this.content = this.verifyList(
-      contentli,
-      contentV,
-      {
-        value: "mcode",
-        label: "mname",
-      },
-      true
-    );
+    this.content = this.verifyList(contentli, contentV, keys, true);
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
       app: "起点新闻",
@@ -396,11 +388,11 @@ export default {
   computed: {},
   methods: {
     tableChange(e) {
+      this.form.page = 1;
       this.form.sortBy = e.column ? e.column.property : "";
       this.lastParams.sortBy = e.column ? e.column.property : "";
-      getContentPage(this.lastParams).then(r => {
-        this.table = r || {};
-      });
+      this.lastParams.page = 1;
+      getContentPage(this.lastParams).then(r => (this.table = r || {}));
     },
     verifyList(list, verify, obj, more) {
       if (!obj) return;
@@ -427,21 +419,19 @@ export default {
         start: this.FormData(this.form.date[0]),
         end: this.FormData(this.form.date[1]),
         version: this.form.version == -1 ? undefined : this.form.version,
-        lib: this.form.content == -1 ? undefined : this.form.content,
+        contentType: this.form.content == -1 ? undefined : this.form.content,
         page: this.form.page,
         pageSize: this.form.size,
         match: this.match,
         sortBy: this.form.sortBy,
       };
-      getContentPage(this.lastParams).then(r => {
-        this.table = r || {};
-      });
+      getContentPage(this.lastParams).then(r => (this.table = r || {}));
       getContentTop10({
         app: this.form.app,
         start: this.FormData(this.form.date[0]),
         end: this.FormData(this.form.date[1]),
         version: this.form.version == -1 ? undefined : this.form.version,
-        lib: this.form.content == -1 ? undefined : this.form.content,
+        contentType: this.form.content == -1 ? undefined : this.form.content,
       })
         .then(r => {
           this.top = r || [];
@@ -450,7 +440,8 @@ export default {
             start: this.FormData(this.form.date[0]),
             end: this.FormData(this.form.date[1]),
             version: this.form.version == -1 ? undefined : this.form.version,
-            lib: this.form.content == -1 ? undefined : this.form.content,
+            contentType:
+              this.form.content == -1 ? undefined : this.form.content,
           }).then(resChart => {
             let keyList = [],
               valueList = [],
@@ -691,40 +682,15 @@ export default {
       const E = this.form.date[1]
         ? this.FormData(this.form.date[1])
         : undefined;
-      let p = this.lastParams.app
-        ? this.lastParams
-        : {
-            app: this.form.app,
-            start: S,
-            end: E,
-            version: this.form.version == -1 ? undefined : this.form.version,
-          };
-      getContentPage(p).then(r => {
-        // 生成数据
-        let strcsv =
-          "data:text/csv;charset=utf-8,日期,活跃用户,新增用户,累计用户,人均使用时长,次均使用时长\r\n";
-        (r.list || []).map(v => {
-          strcsv += [
-            v.dt,
-            v.activeUser,
-            v.newUser,
-            v.totalUser,
-            this.timeFormat(v.durationUser),
-            this.timeFormat(v.durationTimes),
-            "\r\n",
-          ].join(",");
-        });
-        // 导出
-        let link = document.createElement("a");
-        link.id = "download-csv";
-        link.setAttribute("href", encodeURI(strcsv));
-        link.setAttribute(
-          "download",
-          p.app + "用户趋势" + S + "_" + E + ".csv"
-        );
-        // document.body.appendChild(link);
-        link.click();
-      });
+      const app = this.lastParams.app || this.form.app;
+      const version =
+        this.form.version == -1 ? undefined : this.form.version.join(",");
+      const contentType = this.lastParams.contentType || this.form.contentType;
+      let url =
+        config.base.leverAudience + "/cxzx-program/new-media/content/export?start=" + S + "&end=" + E +"&app=" + app;
+      version && (url += "&version=" + version);
+      contentType && (url += "&contentType=" + contentType);
+      window.open(url);
     },
   },
   components: {

+ 1 - 1
src/views/RealOnline/index.vue

@@ -140,7 +140,7 @@ export default {
       this.form = {
         // app: (this.cycle[0] || { value: "" }).value,
         app: '起点新闻',
-        lidu: (this.lidu[0] || { value: "" }).value,
+        lidu: '60',
       };
       this.regularData();
     },