liyongli 2 年之前
父節點
當前提交
fc16cfccb6
共有 5 個文件被更改,包括 836 次插入114 次删除
  1. 14 14
      src/api/index.js
  2. 134 0
      src/router/country.js
  3. 22 95
      src/router/index.js
  4. 46 5
      src/views/History/index.vue
  5. 620 0
      src/views/Region/index.vue

+ 14 - 14
src/api/index.js

@@ -847,20 +847,20 @@ export function getRule(data) {
  * 获取大数据平台应用列表
  * @return {AxjxPromise}
  */
-export function getAppList(data) {
-  const parent = window.parent.localStorage;
-  let token = parent.token || ""
-  return ajax({
-    urlType: "leverAudience",
-    url: "/rmtrate/sysparam/info",
-    method: "POST",
-    headers: {
-      UserInfo: token,
-      requestid: "tv" + Date.now(),
-    },
-    data,
-  });
-}
+ export function getAppList(data) {
+    const parent = window.parent.localStorage;
+    let token = parent.token || ""
+    return ajax({
+      urlType: "leverAudience",
+      url: "/rmtrate/sysparam/info",
+      method: "POST",
+      headers: {
+        UserInfo: token,
+        requestid: "tv" + Date.now(),
+      },
+      data,
+    });
+  }
 
 
 /**

+ 134 - 0
src/router/country.js

@@ -0,0 +1,134 @@
+const countryRouter = {
+  path: "/country",
+  component: () =>
+    import(/* webpackChunkName: "country" */ "../views/Country/Index.vue"),
+  children: [
+    {
+      path: "", // 频道全天节目
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/ChannelEPG/Channel.vue"
+        ),
+    },
+    {
+      path: "/country/customRanking", // 自定义时间段排行
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/CustomRanking/CustomRanking.vue"
+        ),
+    },
+    {
+      path: "/country/channelList", // 多维度筛选 频道时段排名
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/ChannelList/ChannelList.vue"
+        ),
+    },
+    {
+      path: "/country/singleDay", // 单天频道点分钟
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/SingleDay/SingleDay.vue"
+        ),
+    },
+    {
+      path: "/country/average", // 平均频道点分钟
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/Average/Average.vue"
+        ),
+    },
+    {
+      path: "/country/subRegion", // 频道分地收视(全国)
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/SubRegion/SubRegion.vue"
+        ),
+    },
+    {
+      path: "/country/channelRegion", // 频道分地区收视
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/ChannelRegion/ChannelRegion.vue"
+        ),
+    },
+    {
+      path: "/country/flowChannel", // 频道实时流入流出
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/FlowChannel/FlowChannel.vue"
+        ),
+    },
+
+    {
+      path: "/country/program", // 节目点分钟
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/Program/Program.vue"
+        ),
+    },
+    {
+      path: "/country/compete", // 节目竞争一览
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/Compete/Compete.vue"
+        ),
+    },
+    {
+      path: "/country/specificProgramQuery", // 具体节目剧目查询
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/SpecificProgramQuery/SpecificProgramQuery.vue"
+        ),
+    },
+    {
+      path: "/country/specificProgram", // 具体节目剧目排行
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/SpecificProgram/SpecificProgram.vue"
+        ),
+    },
+    {
+      path: "/country/abstractProgramQuery", // 抽象节目剧目查询
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/AbstractProgramQuery/AbstractProgramQuery.vue"
+        ),
+    },
+    {
+      path: "/country/abstractProgram", // 抽象节目剧目排行
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/AbstractProgram/AbstractProgram.vue"
+        ),
+    },
+    {
+      path: "/country/flow", // 单期节目流入流出
+      component: () =>
+        import(/* webpackChunkName: "country" */ "../views/Flow/Flow.vue"),
+    },
+    {
+      path: "/country/abstract", // 抽象节目剧目分地区收视(全国)
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/Abstract/Abstract.vue"
+        ),
+    },
+    {
+      path: "/country/overlap", // 节目剧目重叠度
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/Overlap/Overlap.vue"
+        ),
+    },
+    {
+      path: "/country/scheduling", // 电视剧排播信息及表现(全国)
+      component: () =>
+        import(
+          /* webpackChunkName: "country" */ "../views/Scheduling/Scheduling.vue"
+        ),
+    },
+  ],
+};
+
+export default countryRouter;

+ 22 - 95
src/router/index.js

@@ -1,166 +1,93 @@
 import { createRouter, createWebHashHistory } from "vue-router";
-
+import countryRouter from "./country";
 const routes = [
   {
     path: "/",
     name: "Program",
-    component: () => import("../views/Program.vue"),
+    component: () => import(/* webpackChunkName: "program" */ "../views/Program.vue"),
   },
   {
     path: "/Channel",
     name: "Channel",
-    component: () => import("../views/Channel.vue"),
+    component: () => import(/* webpackChunkName: "channel" */ "../views/Channel.vue"),
   },
   {
     path: "/heightlight",
     name: "Heightlight",
-    component: () => import("../views/Heightlight.vue"),
+    component: () => import(/* webpackChunkName: "heightlight" */ "../views/Heightlight.vue"),
   },
   {
     path: "/realData",
     name: "RealData",
-    component: () => import("../views/RealData.vue"),
+    component: () => import(/* webpackChunkName: "realData" */ "../views/RealData.vue"),
   },
   {
     path: "/liveChannel",
     name: "LiveChannel",
-    component: () => import("../views/LiveChannel.vue"),
+    component: () => import(/* webpackChunkName: "liveChannel" */ "../views/LiveChannel.vue"),
   },
   {
     path: "/boutiqueColumn",
     name: "boutiqueColumn",
-    component: () => import("../views/BoutiqueColumn/BoutiqueColumn.vue"),
+    component: () => import(/* webpackChunkName: "boutiqueColumn" */ "../views/BoutiqueColumn/BoutiqueColumn.vue"),
   },
   {
     path: "/activity",
     name: "Activity",
-    component: () => import("../views/Activity/Activity.vue"),
+    component: () => import(/* webpackChunkName: "activity" */ "../views/Activity/Activity.vue"),
   },
   {
     path: "/jugou",
     name: "Jugou",
-    component: () => import("../views/Jugou/Jugou.vue"),
+    component: () => import(/* webpackChunkName: "jugou" */ "../views/Jugou/Jugou.vue"),
   },
   {
     path: "/radio",
     name: "Radio",
-    component: () => import("../views/Radio/Radio.vue"),
+    component: () => import(/* webpackChunkName: "radio" */ "../views/Radio/Radio.vue"),
   },
   {
       path: "/hardAdvertisement",
       name: "HardAdvertisement",
-      component: () => import("../views/HardAdvertisement/HardAdvertisement.vue"),
+      component: () => import(/* webpackChunkName: "hardAdvertisement" */ "../views/HardAdvertisement/HardAdvertisement.vue"),
   },
   {
       path: "/advertisingEye",
       name: "AdvertisingEye",
-      component: () => import("../views/AdvertisingEye/AdvertisingEye.vue"),
+      component: () => import(/* webpackChunkName: "advertisingEye" */ "../views/AdvertisingEye/AdvertisingEye.vue"),
   },
   {
       path: "/channelRanking",
       name: "ChannelRanking",
-      component: () => import("../views/ChannelRanking/ChannelRanking.vue"),
+      component: () => import(/* webpackChunkName: "channelRanking" */ "../views/ChannelRanking/ChannelRanking.vue"),
   },
   {
       path: "/reportForm",
       name: "ReportForm",
-      component: () => import("../views/ReportForm/ReportForm.vue"),
+      component: () => import(/* webpackChunkName: "reportForm" */ "../views/ReportForm/ReportForm.vue"),
   },
   {
       path: "/radioBroadcast",
       name: "RadioBroadcast",
-      component: () => import("../views/RadioBroadcast.vue")
+      component: () => import(/* webpackChunkName: "radioBroadcast" */ "../views/RadioBroadcast.vue")
   },
   {
     path: "/realOnline",
     name: "RealOnline",
-    component: () => import("../views/RealOnline/index.vue")
+    component: () => import(/* webpackChunkName: "realOnline" */ "../views/RealOnline/index.vue")
   },
   {
     path: "/history",
     name: "History",
-    component: () => import("../views/History/index.vue")
+    component: () => import(/* webpackChunkName: "history" */ "../views/History/index.vue")
   },
-
   {
-    path: "/country",
-    component: () => import("../views/Country/Index.vue"),
-    children: [
-        {
-            path: "", // 频道全天节目
-            component: ()=> import("../views/ChannelEPG/Channel.vue")
-        },
-        {
-            path: "/country/customRanking", // 自定义时间段排行
-            component: ()=> import("../views/CustomRanking/CustomRanking.vue")
-        },
-        {
-            path: "/country/channelList", // 多维度筛选 频道时段排名
-            component: ()=> import("../views/ChannelList/ChannelList.vue")
-        },
-        {
-            path: "/country/singleDay", // 单天频道点分钟
-            component: ()=> import("../views/SingleDay/SingleDay.vue")
-        },
-        {
-            path: "/country/average", // 平均频道点分钟
-            component: ()=> import("../views/Average/Average.vue")
-        },
-        {
-            path: "/country/subRegion", // 频道分地收视(全国)
-            component: ()=> import("../views/SubRegion/SubRegion.vue")
-        },
-        {
-            path: "/country/channelRegion", // 频道分地区收视
-            component: ()=> import("../views/ChannelRegion/ChannelRegion.vue")
-        },
-        {
-            path: "/country/flowChannel", // 频道实时流入流出
-            component: ()=> import("../views/FlowChannel/FlowChannel.vue")
-        },
-
-        {
-            path: "/country/program", // 节目点分钟
-            component: ()=> import("../views/Program/Program.vue")
-        },
-        {
-            path: "/country/compete", // 节目竞争一览
-            component: ()=> import("../views/Compete/Compete.vue")
-        },
-        {
-            path: "/country/specificProgramQuery", // 具体节目剧目查询
-            component: ()=> import("../views/SpecificProgramQuery/SpecificProgramQuery.vue")
-        },
-        {
-            path: "/country/specificProgram", // 具体节目剧目排行
-            component: ()=> import("../views/SpecificProgram/SpecificProgram.vue")
-        },
-        {
-            path: "/country/abstractProgramQuery", // 抽象节目剧目查询
-            component: ()=> import("../views/AbstractProgramQuery/AbstractProgramQuery.vue")
-        },
-        {
-            path: "/country/abstractProgram", // 抽象节目剧目排行
-            component: ()=> import("../views/AbstractProgram/AbstractProgram.vue")
-        },
-        {
-            path: "/country/flow", // 单期节目流入流出
-            component: ()=> import("../views/Flow/Flow.vue")
-        },
-        {
-            path: "/country/abstract", // 抽象节目剧目分地区收视(全国)
-            component: ()=> import("../views/Abstract/Abstract.vue")
-        },
-        {
-            path: "/country/overlap", // 节目剧目重叠度
-            component: ()=> import("../views/Overlap/Overlap.vue")
-        },
-        {
-            path: "/country/scheduling", // 电视剧排播信息及表现(全国)
-            component: ()=> import("../views/Scheduling/Scheduling.vue")
-        },
-    ],
+    path: "/region",
+    name: "Region",
+    component: () => import(/* webpackChunkName: "region" */ "../views/Region/index.vue")
   },
+  
+  countryRouter // 全国数据
 ];
 // 实时/单期 节目流入流出 共计2个  可以使用同一模块
 // 具体/抽象 节目剧目 查询/排行  共计4个,可以使用一个模块

+ 46 - 5
src/views/History/index.vue

@@ -81,6 +81,23 @@
             </el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="来源">
+          <el-select
+            collapse-tags
+            clearable
+            v-model="form.client"
+            placeholder="请选择来源"
+          >
+            <el-option
+              v-for="item in client"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.disabled"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item style="float: right">
           <el-button type="primary" @click="onSubmit">查询</el-button>
           <el-button type="primary" @click="onExport">导出</el-button>
@@ -110,7 +127,7 @@
             <countTo
               v-if="!item.isNum"
               :startVal="0"
-              :endVal="item.value"
+              :endVal="item.value - 0"
               :duration="1500"
             ></countTo>
             <span v-if="item.isNum" v-text="item.value"></span>
@@ -226,29 +243,37 @@ export default {
         version: [],
         channel: [],
         date: [],
+        client: ""
       },
       cycle: [],
       oriData: {},
       showList: [],
       version: [],
       channel: [],
+      client: []
     };
   },
   async mounted() {
     if (chart && chart.dispose) chart.dispose();
-    const { source, appV, appC, appli, appCLi, appVLi } =
+    const { source, appV, appC, clentV, appli, appCLi, appVLi, clentli } =
       await this.getAppListFunc();
     const keys = {
       value: "mname",
       label: "mname",
     };
+    let client = clentli.find(r=>r.mdefault).mcode.toString();
     this.cycle = this.verifyList(appli, source, keys, false);
     this.channel = this.verifyList(appCLi, appC, keys, true);
     this.version = this.verifyList(appVLi, appV, keys, true);
+    this.client = this.verifyList(clentli, clentV, {
+      value: "mcode",
+      label: "mname",
+    }, true);
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
       app: "起点新闻",
       version: [(this.version[0] || { value: "" }).value],
+      client,
       channel: [(this.channel[0] || { value: "" }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
     };
@@ -292,6 +317,7 @@ export default {
         end: this.FormData(this.form.date[1]),
         manufacturer: this.form.channel == -1 ? undefined : this.form.channel,
         version: this.form.version == -1 ? undefined : this.form.version,
+        lib: this.form.client == -1 ? undefined : this.form.client,
       };
       getHistory(this.lastParams)
         .then(r => {
@@ -308,7 +334,8 @@ export default {
             if (!total[v].value && total[v].value !== 0) continue;
             let isNum = /duration/g.test(v);
             let value = "";
-            if (isNum && typeof total[v].value === 'number') value = this.timeFormat(total[v].value);
+            if (isNum && typeof total[v].value === "number")
+              value = this.timeFormat(total[v].value);
             else value = total[v].value;
             if (!tab && v !== "downloads") {
               tab = v;
@@ -441,13 +468,16 @@ export default {
       });
     },
     async getAppListFunc() {
-      const { r, li, appVersion, channel } = await this.getAppListOri();
+      const { r, li, appVersion, channel, clientList } =
+        await this.getAppListOri();
       let source = { length: 0 },
         appli = [];
       let appV = { length: 0 },
         appVLi = [];
       let appC = { length: 0 },
         appCLi = [];
+      let clentV = { length: 0 },
+        clentli = [];
       let prvList = r.output.data.prvRolectrl || [];
       for (let i = 0; i < prvList.length; i++) {
         const v = prvList[i];
@@ -457,17 +487,22 @@ export default {
           (appV[v.detid] = true), (appV.length = appV.length + 1);
         if (v.controlid == "CHANNEL")
           (appC[v.detid] = true), (appC.length = appC.length + 1);
+        if (v.controlid == "CLIENT_TYPE")
+          (clentV[v.detid] = true), (clentV.length = clentV.length + 1);
       }
       if (li.status === "0") appli = li.output.data || [];
       if (appVersion.length) appVLi = appVersion || [];
       if (channel.length) appCLi = channel || [];
+      if (clientList.length) clentli = clientList || [];
       return {
         source,
         appV,
         appC,
         appli,
+        clentV,
         appVLi,
         appCLi,
+        clentli,
       };
     },
     async getAppListOri() {
@@ -481,6 +516,7 @@ export default {
         roleid,
       });
       //   应用列表
+
       const li = await getAppList({
         exportMark: "0",
         gcode: "SOURCE",
@@ -493,12 +529,17 @@ export default {
         gcode: "APP_VERSION",
         source: defaultAppName,
       });
+      // 端列表
+      const clientList = await getSearchData({
+        gcode: "CLIENT_TYPE",
+        source: defaultAppName,
+      });
       //   应用渠道列表
       const channel = await getSearchData({
         gcode: "CHANNEL",
         source: defaultAppName,
       });
-      return { r, li, appVersion, channel };
+      return { r, li, appVersion, channel, clientList };
     },
     disabledDate(time) {
       const first = new Date("2021-06-21 00:00:00");

+ 620 - 0
src/views/Region/index.vue

@@ -0,0 +1,620 @@
+<template>
+  <div class="RealOnline">
+    <el-breadcrumb separator-class="el-icon-arrow-right">
+      <el-breadcrumb-item>新媒体</el-breadcrumb-item>
+      <el-breadcrumb-item>用户分析</el-breadcrumb-item>
+      <el-breadcrumb-item>地域分析</el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-card class="box-card">
+      <el-form
+        ref="form"
+        :model="form"
+        size="small"
+        :inline="true"
+        label-width="120px"
+        class="demo-form-inline"
+      >
+        <el-form-item label="日期">
+          <el-date-picker
+            v-if="form.date.length"
+            v-model="form.date"
+            type="daterange"
+            :disabled-date="time => disabledDate(time)"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :clearable="false"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="应用">
+          <el-select
+            v-model="form.app"
+            placeholder="请选择时段"
+            @change="change"
+          >
+            <el-option
+              v-for="item in cycle"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.disabled"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="版本">
+          <el-select
+            multiple
+            collapse-tags
+            clearable
+            v-model="form.version"
+            placeholder="请选择版本"
+            @change="changeversion"
+          >
+            <el-option
+              v-for="item in version"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.disabled"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="渠道">
+          <el-select
+            multiple
+            collapse-tags
+            clearable
+            v-model="form.channel"
+            @change="changechannel"
+            placeholder="请选择渠道"
+          >
+            <el-option
+              v-for="item in channel"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.disabled"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="来源">
+          <el-select
+            collapse-tags
+            clearable
+            v-model="form.client"
+            placeholder="请选择来源"
+          >
+            <el-option
+              v-for="item in client"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+              :disabled="item.disabled"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item style="float: right">
+          <el-button type="primary" @click="onSubmit">查询</el-button>
+          <el-button type="primary" @click="onExport">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+    <br />
+    <el-card class="box-card">
+        <div ref="regionChart"></div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+// @ is an alias to /src
+import { getRule, getAppList, getHistory, getSearchData } from "@/api/index";
+
+import * as echarts from "echarts/core";
+import { LineChart } from "echarts/charts";
+import {
+  TitleComponent,
+  TooltipComponent,
+  GridComponent,
+  ToolboxComponent,
+  LegendComponent,
+} from "echarts/components";
+import { CanvasRenderer } from "echarts/renderers";
+echarts.use([
+  TitleComponent,
+  TooltipComponent,
+  GridComponent,
+  LineChart,
+  CanvasRenderer,
+  ToolboxComponent,
+  LegendComponent,
+]);
+
+// import config from "@/config/index";
+let chart = undefined;
+export default {
+  name: "RealOnline",
+  data() {
+    return {
+      type: "",
+      lastParams: {},
+      page: 1,
+      form: {
+        app: "",
+        version: [],
+        channel: [],
+        date: [],
+        client: ""
+      },
+      cycle: [],
+      oriData: {},
+      showList: [],
+      version: [],
+      channel: [],
+      client: []
+    };
+  },
+  async mounted() {
+    if (chart && chart.dispose) chart.dispose();
+    const { source, appV, appC, clentV, appli, appCLi, appVLi, clentli } =
+      await this.getAppListFunc();
+    const keys = {
+      value: "mname",
+      label: "mname",
+    };
+    let client = clentli.find(r=>r.mdefault).mcode.toString();
+    this.cycle = this.verifyList(appli, source, keys, false);
+    this.channel = this.verifyList(appCLi, appC, keys, true);
+    this.version = this.verifyList(appVLi, appV, keys, true);
+    this.client = this.verifyList(clentli, clentV, {
+      value: "mcode",
+      label: "mname",
+    }, true);
+    this.form = {
+      //   app: (this.cycle[0] || { value: "" }).value,
+      app: "起点新闻",
+      version: [(this.version[0] || { value: "" }).value],
+      client,
+      channel: [(this.channel[0] || { value: "" }).value],
+      date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
+    };
+    this.onSubmit();
+  },
+  computed: {},
+  methods: {
+    verifyList(list, verify, obj, more) {
+      if (!obj) return;
+      let li = list || [];
+      const out = [];
+      more && out.push({ value: -1, label: "不限" });
+      for (let i = 0; i < li.length; i++) {
+        const v = li[i];
+        if (verify.length !== 0 && !verify[v.mcode]) continue;
+        out.push({
+          value: v[obj.value],
+          label: v[obj.label],
+        });
+      }
+      return out;
+    },
+    pagechange(p) {
+      this.page = p;
+      this.pushShowList();
+    },
+    pushShowList() {
+      let s = this.page - 1 < 0 ? 0 : (this.page - 1) * 10;
+      let e = this.page * 10;
+      let li = JSON.parse(JSON.stringify(this.oriData.list || []));
+      let out = [];
+      for (let i = s; i < e; i++) {
+        li[i] && out.push(li[i]);
+      }
+      this.showList = out;
+    },
+    onSubmit() {
+      this.lastParams = {
+        app: this.form.app,
+        start: this.FormData(this.form.date[0]),
+        end: this.FormData(this.form.date[1]),
+        manufacturer: this.form.channel == -1 ? undefined : this.form.channel,
+        version: this.form.version == -1 ? undefined : this.form.version,
+        lib: this.form.client == -1 ? undefined : this.form.client,
+      };
+      getHistory(this.lastParams)
+        .then(r => {
+          if (!this.$refs.regionChart) return;
+          let oriData = r || {};
+          const total = oriData.total || {},
+            keys = Object.keys(total),
+            color = ["rgb(244, 127, 146)", "rgb(17, 160, 248)"],
+            p = [];
+          let tab = undefined,
+            tabName = undefined;
+          for (let i = 0; i < keys.length; i++) {
+            const v = keys[i];
+            if (!total[v].value && total[v].value !== 0) continue;
+            let isNum = /duration/g.test(v);
+            let value = "";
+            if (isNum && typeof total[v].value === "number")
+              value = this.timeFormat(total[v].value);
+            else value = total[v].value;
+            if (!tab && v !== "downloads") {
+              tab = v;
+              tabName = total[v].name;
+            }
+            p.push({
+              name: total[v].name,
+              value,
+              color: color[i % 2],
+              key: v,
+              isNum,
+            });
+          }
+          this.oriData = {
+            list: oriData.list || [],
+            total: p,
+          };
+          this.changeData(tab, tabName);
+          chart && chart.hideLoading();
+          this.page = 1;
+          this.pushShowList();
+        })
+        .catch(() => {
+          this.oriData = {};
+          this.pushShowList();
+          chart && chart.clear() && chart.hideLoading();
+        });
+    },
+    changeData(type, title) {
+      this.type = type;
+      const keyList = [],
+        valueList = [];
+      (this.oriData.list || []).map(v => {
+        keyList.push(v.dt);
+        valueList.push(v[this.type]);
+      });
+      chart && chart.clear();
+      this.createImage(keyList, valueList, title);
+    },
+    createImage(keyList, valueList, title) {
+      !chart && (chart = echarts.init(this.$refs.regionChart));
+      chart.resize({
+        height: (this.$refs.regionChart.offsetWidth * 4) / 16,
+      });
+      const _this = this;
+      chart.setOption({
+        tooltip: {
+          trigger: "axis",
+          formatter(v) {
+            const item = v[0] || {};
+            let val = item.data || 0;
+            if (_this.type === "duration") val = _this.timeFormat(val);
+            return item.axisValue + "<br />" + title + ":" + val;
+          },
+        },
+        toolbox: {
+          feature: {
+            saveAsImage: {
+              type: "jpg",
+              name: "趋势",
+            },
+          },
+        },
+        legend: {
+          data: [title],
+        },
+        grid: {
+          left: "3%",
+          right: "4%",
+          bottom: "3%",
+          containLabel: true,
+        },
+        xAxis: {
+          type: "category",
+          boundaryGap: true,
+          data: keyList,
+        },
+        yAxis: {
+          type: "value",
+          scale: true,
+          minInterval: 1,
+          axisLabel: {
+            formatter(v) {
+              let val = v;
+              if (_this.type === "duration") val = _this.timeFormat(val);
+              else {
+                if (val >= 100000000) {
+                  val = (val / 100000000).toFixed(2) + "亿";
+                } else if (val >= 10000) {
+                  val = (val / 10000).toFixed(2) + "万";
+                }
+              }
+              return val;
+            },
+          },
+        },
+        series: [
+          {
+            name: title,
+            data: valueList,
+            symbolSize: 0,
+            lineStyle: {
+              width: 1,
+            },
+            type: "line",
+            smooth: true,
+            color: "rgba(58,132,255,.9)",
+            areaStyle: {
+              color: {
+                type: "linear",
+                x: 0,
+                y: 0,
+                x2: 0,
+                y2: 1,
+                colorStops: [
+                  {
+                    offset: 0,
+                    color: "rgba(58,132,255, 0.8)", // 0% 处的颜色
+                  },
+                  {
+                    offset: 1,
+                    color: "rgba(58,132,255, 0.1)", // 100% 处的颜色
+                  },
+                ],
+                global: false, // 缺省为 false
+              },
+            },
+          },
+        ],
+      });
+    },
+    async getAppListFunc() {
+      const { r, li, appVersion, channel, clientList } =
+        await this.getAppListOri();
+      let source = { length: 0 },
+        appli = [];
+      let appV = { length: 0 },
+        appVLi = [];
+      let appC = { length: 0 },
+        appCLi = [];
+      let clentV = { length: 0 },
+        clentli = [];
+      let prvList = r.output.data.prvRolectrl || [];
+      for (let i = 0; i < prvList.length; i++) {
+        const v = prvList[i];
+        if (v.controlid == "RMT_SOURCE")
+          (source[v.detid] = true), (source.length = source.length + 1);
+        if (v.controlid == "APP_VERSION")
+          (appV[v.detid] = true), (appV.length = appV.length + 1);
+        if (v.controlid == "CHANNEL")
+          (appC[v.detid] = true), (appC.length = appC.length + 1);
+        if (v.controlid == "CLIENT_TYPE")
+          (clentV[v.detid] = true), (clentV.length = clentV.length + 1);
+      }
+      if (li.status === "0") appli = li.output.data || [];
+      if (appVersion.length) appVLi = appVersion || [];
+      if (channel.length) appCLi = channel || [];
+      if (clientList.length) clentli = clientList || [];
+      return {
+        source,
+        appV,
+        appC,
+        appli,
+        clentV,
+        appVLi,
+        appCLi,
+        clentli,
+      };
+    },
+    async getAppListOri() {
+      const roleid = JSON.parse(
+        window.parent.localStorage.userinfo || "{}"
+      ).roleid;
+      const r = await getRule({
+        db: "authplat",
+        exportMark: "0",
+        menuid: 399,
+        roleid,
+      });
+      //   应用列表
+
+      const li = await getAppList({
+        exportMark: "0",
+        gcode: "SOURCE",
+        pageid: 1,
+        pagesize: 1000,
+      });
+      const defaultAppName = "起点新闻";
+      //   应用版本列表
+      const appVersion = await getSearchData({
+        gcode: "APP_VERSION",
+        source: defaultAppName,
+      });
+      // 端列表
+      const clientList = await getSearchData({
+        gcode: "CLIENT_TYPE",
+        source: defaultAppName,
+      });
+      //   应用渠道列表
+      const channel = await getSearchData({
+        gcode: "CHANNEL",
+        source: defaultAppName,
+      });
+      return { r, li, appVersion, channel, clientList };
+    },
+    disabledDate(time) {
+      const first = new Date("2021-06-21 00:00:00");
+      return (
+        time.getTime() > Date.now() - 86400000 ||
+        time.getTime() < first.getTime()
+      );
+    },
+    FormData(date) {
+      const d = new Date(date || Date.now() - 86400000);
+      const year = d.getFullYear();
+      const month =
+        d.getMonth() <= 8 ? "0" + (d.getMonth() + 1) : d.getMonth() + 1;
+      const day = d.getDate() <= 9 ? "0" + d.getDate() : d.getDate();
+      return [year, month, day].join("-");
+    },
+    timeFormat(t) {
+      const Time = t || 0;
+      const mH = Time % 3600;
+      let hour = (Time - mH) / 3600;
+      let min = (mH - (mH % 60)) / 60;
+      let son = Number(mH % 60).toFixed(0);
+      hour = hour <= 9 ? "0" + hour : hour;
+      min = min <= 9 ? "0" + min : min;
+      son = son <= 9 ? "0" + son : son;
+      let out = [];
+      if (hour * 1 > 0) out.push(hour);
+      out.push(...[min, son]);
+      return out.join(":");
+    },
+    change() {
+      const roleid = JSON.parse(
+        window.parent.localStorage.userinfo || "{}"
+      ).roleid;
+      const appV = {
+        length: 0,
+      };
+      getRule({
+        db: "authplat",
+        exportMark: "0",
+        menuid: 399,
+        roleid,
+      }).then(rule => {
+        let prvList = rule.output.data.prvRolectrl || [];
+        for (let i = 0; i < prvList.length; i++) {
+          const v = prvList[i];
+          if (v.controlid == "APP_VERSION")
+            (appV[v.detid] = true), (appV.length = appV.length + 1);
+        }
+        getSearchData({
+          gcode: "APP_VERSION",
+          source: this.form.app,
+        }).then(r => {
+          let version = [
+            {
+              label: "不限",
+              value: -1,
+            },
+          ];
+          r.map(v => {
+            if ((appV.length && appV[v.mcode]) || appV.length === 0)
+              version.push({
+                value: v.mname,
+                label: v.mname,
+              });
+          });
+          this.version = version;
+          this.form = {
+            ...this.form,
+            version: [-1],
+          };
+        });
+      });
+    },
+    changeversion(v) {
+      if (!v.length) return (this.form.version = [-1]);
+      const last = v[v.length - 1];
+      if (last == -1) return (this.form.version = [-1]);
+      let ver = [];
+      for (let i = 0; i < v.length; i++) {
+        const element = v[i];
+        if (element == -1) continue;
+        ver.push(element);
+      }
+      this.form.version = ver;
+    },
+    changechannel(v) {
+      if (!v.length) return (this.form.channel = [-1]);
+      const last = v[v.length - 1];
+      if (last == -1) return (this.form.channel = [-1]);
+      let ver = [];
+      for (let i = 0; i < v.length; i++) {
+        const element = v[i];
+        if (element == -1) continue;
+        ver.push(element);
+      }
+      this.form.channel = ver;
+    },
+    onExport() {
+      const S = this.form.date[0]
+        ? this.FormData(this.form.date[0])
+        : undefined;
+      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,
+            manufacturer:
+              this.form.channel == -1 ? undefined : this.form.channel,
+            version: this.form.version == -1 ? undefined : this.form.version,
+          };
+      getHistory(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();
+      });
+    },
+  },
+  components: {
+  },
+};
+</script>
+
+<style>
+.RealOnline {
+  margin: 10px 15px;
+}
+.RealOnline .has-seconds .el-time-spinner__wrapper:last-child {
+  display: none;
+}
+.head {
+  display: flex;
+  font-weight: 500;
+}
+.head .head-item {
+  flex: 1;
+  text-align: center;
+  font-size: 0.8em;
+  border-top: 3px solid #fff;
+  padding-top: 10px;
+}
+.head .value {
+  margin: 15px 0;
+  color: #396fff;
+  font-size: 25px;
+}
+</style>