liyongli před 2 roky
rodič
revize
ac679aef0b

+ 22 - 7
src/utils/tool.js

@@ -1,7 +1,22 @@
-export function formatter(num){
-    if(isNaN(num) || !num) return 0;
-    let n = num.toString().split(".");
-    let number = n[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
-    if(n[1]) number = number + '.' + n[1];
-    return number
-}
+export function formatter(num) {
+  if (isNaN(num) || !num) return 0;
+  let n = num.toString().split('.');
+  let number = n[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
+  if (n[1]) number = number + '.' + n[1];
+  return number;
+}
+
+export function defaultAppNameFunc(list, key) {
+  let appName = '';
+  const defaultName = '起点新闻';
+  for (let i = 0; i < list.length; i++) {
+    const v = list[i];
+    
+    if (v[key || 'value'] === defaultName) {
+      appName = defaultName;
+      break;
+    }
+  }
+  if (!appName) appName = list[0][key || 'value'];
+  return appName;
+}

+ 64 - 63
src/views/Channle/index.vue

@@ -149,7 +149,7 @@
           align="center"
         >
           <template #default>
-            <span>{{ lastParams.app || "-" }}</span>
+            <span>{{ lastParams.app || '-' }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -220,19 +220,20 @@ import {
   getSearchData,
   getChannleChart,
   getChannlePage,
-} from "@/api/index";
+} from '@/api/index';
 
-import countTo from "@/components/counto/vue-countTo.vue";
-import * as echarts from "echarts/core";
-import { LineChart } from "echarts/charts";
+import countTo from '@/components/counto/vue-countTo.vue';
+import { defaultAppNameFunc } from '@/utils/tool.js';
+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";
+} from 'echarts/components';
+import { CanvasRenderer } from 'echarts/renderers';
 echarts.use([
   TitleComponent,
   TooltipComponent,
@@ -246,14 +247,14 @@ echarts.use([
 // import config from "@/config/index";
 let chart = undefined;
 export default {
-  name: "Version",
+  name: 'Version',
   data() {
     return {
       lastParams: {},
       table: [],
-      numType: "newUser",
+      numType: 'newUser',
       form: {
-        app: "",
+        app: '',
         version: [],
         channel: [],
         date: [],
@@ -269,8 +270,8 @@ export default {
     const { source, appV, appC, appli, appVLi, appCLi } =
       await this.getAppListFunc();
     const keys = {
-      value: "mname",
-      label: "mname",
+      value: 'mname',
+      label: 'mname',
     };
     const channel = [];
     this.cycle = this.verifyList(appli, source, keys, false);
@@ -283,8 +284,8 @@ export default {
     }
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: "起点新闻",
-      version: [(this.version[0] || { value: "" }).value],
+      app: defaultAppNameFunc(this.cycle),
+      version: [(this.version[0] || { value: '' }).value],
       channel,
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
     };
@@ -296,7 +297,7 @@ export default {
       if (!obj) return;
       let li = list || [];
       const out = [];
-      more && out.push({ value: -1, label: "不限" });
+      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;
@@ -360,13 +361,13 @@ export default {
       chart.setOption({
         tooltip: {
           confine: true,
-          trigger: "axis",
+          trigger: 'axis',
         },
         toolbox: {
           feature: {
             saveAsImage: {
-              type: "jpg",
-              name: "内容分析-" + this.form.app,
+              type: 'jpg',
+              name: '内容分析-' + this.form.app,
             },
           },
         },
@@ -374,27 +375,27 @@ export default {
           data: title,
         },
         grid: {
-          left: "3%",
-          right: "4%",
-          bottom: "3%",
+          left: '3%',
+          right: '4%',
+          bottom: '3%',
           containLabel: true,
         },
         xAxis: {
-          type: "category",
+          type: 'category',
           boundaryGap: true,
           data: keyList,
         },
         yAxis: {
-          type: "value",
+          type: 'value',
           scale: true,
           minInterval: 1,
           axisLabel: {
             formatter(v) {
               let val = v;
               if (val >= 100000000) {
-                val = (val / 100000000).toFixed(2) + "亿";
+                val = (val / 100000000).toFixed(2) + '亿';
               } else if (val >= 10000) {
-                val = (val / 10000).toFixed(2) + "万";
+                val = (val / 10000).toFixed(2) + '万';
               }
               return val;
             },
@@ -408,7 +409,7 @@ export default {
             lineStyle: {
               width: 1,
             },
-            type: "line",
+            type: 'line',
             smooth: true,
           };
         }),
@@ -425,14 +426,14 @@ export default {
       let prvList = r.output.data.prvRolectrl || [];
       for (let i = 0; i < prvList.length; i++) {
         const v = prvList[i];
-        if (v.controlid == "RMT_SOURCE")
+        if (v.controlid == 'RMT_SOURCE')
           (source[v.detid] = true), (source.length = source.length + 1);
-        if (v.controlid == "APP_VERSION")
+        if (v.controlid == 'APP_VERSION')
           (appV[v.detid] = true), (appV.length = appV.length + 1);
-        if (v.controlid == "CHANNEL")
+        if (v.controlid == 'CHANNEL')
           (appC[v.detid] = true), (appC.length = appC.length + 1);
       }
-      if (li.status === "0") appli = li.output.data || [];
+      if (li.status === '0') appli = li.output.data || [];
       if (appVersion.length) appVLi = appVersion || [];
       if (channel.length) appCLi = channel || [];
       return {
@@ -446,37 +447,37 @@ export default {
     },
     async getAppListOri() {
       const roleid = JSON.parse(
-        window.parent.localStorage.userinfo || "{}"
+        window.parent.localStorage.userinfo || '{}'
       ).roleid;
       const r = await getRule({
-        db: "authplat",
-        exportMark: "0",
+        db: 'authplat',
+        exportMark: '0',
         menuid: 399,
         roleid,
       });
       //   应用列表
 
       const li = await getAppList({
-        exportMark: "0",
-        gcode: "SOURCE",
+        exportMark: '0',
+        gcode: 'SOURCE',
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = "起点新闻";
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
-        gcode: "APP_VERSION",
-        source: defaultAppName,
+        gcode: 'APP_VERSION',
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       //   应用渠道列表
       const channel = await getSearchData({
-        gcode: "CHANNEL",
-        source: defaultAppName,
+        gcode: 'CHANNEL',
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion, channel };
     },
     disabledDate(time) {
-      const first = new Date("2021-06-21 00:00:00");
+      const first = new Date('2021-06-21 00:00:00');
       return (
         time.getTime() > Date.now() - 86400000 ||
         time.getTime() < first.getTime()
@@ -486,9 +487,9 @@ export default {
       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("-");
+        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;
@@ -496,40 +497,40 @@ export default {
       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;
+      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(":");
+      return out.join(':');
     },
     change() {
       const roleid = JSON.parse(
-        window.parent.localStorage.userinfo || "{}"
+        window.parent.localStorage.userinfo || '{}'
       ).roleid;
       const appV = {
         length: 0,
       };
       getRule({
-        db: "authplat",
-        exportMark: "0",
+        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")
+          if (v.controlid == 'APP_VERSION')
             (appV[v.detid] = true), (appV.length = appV.length + 1);
         }
         getSearchData({
-          gcode: "APP_VERSION",
+          gcode: 'APP_VERSION',
           source: this.form.app,
         }).then(r => {
           let version = [
             {
-              label: "不限",
+              label: '不限',
               value: -1,
             },
           ];
@@ -547,7 +548,7 @@ export default {
           };
         });
         getSearchData({
-          gcode: "CHANNEL",
+          gcode: 'CHANNEL',
           source: this.form.app,
         }).then(r => {
           let channel = [];
@@ -614,7 +615,7 @@ export default {
       getChannlePage(p).then(r => {
         // 生成数据
         let strcsv =
-          "data:text/csv;charset=utf-8,\uFEFF渠道,应用,本渠道新用户,启动次数,启动户数,平均使用时长\r\n";
+          'data:text/csv;charset=utf-8,\uFEFF渠道,应用,本渠道新用户,启动次数,启动户数,平均使用时长\r\n';
         (r || []).map(v => {
           strcsv += [
             v.appVersion,
@@ -623,16 +624,16 @@ export default {
             v.startTimes,
             v.activeUser,
             this.timeFormat(v.duration),
-            "\r\n",
-          ].join(",");
+            '\r\n',
+          ].join(',');
         });
         // 导出
-        let link = document.createElement("a");
-        link.id = "download-csv";
-        link.setAttribute("href", encodeURI(strcsv));
+        let link = document.createElement('a');
+        link.id = 'download-csv';
+        link.setAttribute('href', encodeURI(strcsv));
         link.setAttribute(
-          "download",
-          p.app + "渠道分析" + S + "_" + E + ".csv"
+          'download',
+          p.app + '渠道分析' + S + '_' + E + '.csv'
         );
         // document.body.appendChild(link);
         link.click();

+ 9 - 8
src/views/Content/index.vue

@@ -359,6 +359,7 @@ import {
 } from '@/api/index';
 
 import countTo from '@/components/counto/vue-countTo.vue';
+import { defaultAppNameFunc } from '@/utils/tool.js';
 import * as echarts from 'echarts/core';
 import { LineChart } from 'echarts/charts';
 import {
@@ -436,7 +437,7 @@ export default {
     );
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: '起点新闻',
+      app: defaultAppNameFunc(this.cycle),
       version: [(this.version[0] || { value: '' }).value],
       content: -1,
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
@@ -663,12 +664,6 @@ export default {
         menuid: 399,
         roleid,
       });
-      const defaultAppName = '起点新闻';
-      // 端列表
-      const clientList = await getSearchData({
-        gcode: 'CLIENT_TYPE',
-        source: defaultAppName,
-      });
       //   应用列表
 
       const li = await getAppList({
@@ -677,10 +672,16 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
+      const cycle = li.output ? li.output.data || [] : [];
+      // 端列表
+      const clientList = await getSearchData({
+        gcode: 'CLIENT_TYPE',
+        source: defaultAppNameFunc(cycle, 'mname'),
+      });
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: 'APP_VERSION',
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       // 端列表
       let contentList = await getAppList({

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

@@ -205,6 +205,7 @@
 import { getRule, getAppList, getHistory, getSearchData } from '@/api/index';
 
 import countTo from '@/components/counto/vue-countTo.vue';
+import { defaultAppNameFunc } from '@/utils/tool.js';
 
 import * as echarts from 'echarts/core';
 import { LineChart } from 'echarts/charts';
@@ -274,7 +275,7 @@ export default {
     );
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: '起点新闻',
+      app: defaultAppNameFunc(this.cycle),
       version: [(this.version[0] || { value: '' }).value],
       client,
       channel: [(this.channel[0] || { value: '' }).value],
@@ -544,21 +545,21 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = '起点新闻';
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: 'APP_VERSION',
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       // 端列表
       const clientList = await getSearchData({
         gcode: 'CLIENT_TYPE',
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       //   应用渠道列表
       const channel = await getSearchData({
         gcode: 'CHANNEL',
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion, channel, clientList };
     },

+ 5 - 4
src/views/Keep/activeUser.vue

@@ -377,6 +377,7 @@
 import { getRule, getAppList, getActivePage, getSearchData } from "@/api/index";
 
 import countTo from "@/components/counto/vue-countTo.vue";
+import { defaultAppNameFunc } from '@/utils/tool.js';
 
 // import config from "@/config/index";
 export default {
@@ -410,7 +411,7 @@ export default {
     this.version = this.verifyList(appVLi, appV, keys, true);
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: "起点新闻",
+      app: defaultAppNameFunc(this.cycle),
       keepType: 1,
       version: [(this.version[0] || { value: "" }).value],
       channel: [(this.channel[0] || { value: "" }).value],
@@ -510,16 +511,16 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = "起点新闻";
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: "APP_VERSION",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       //   应用渠道列表
       const channel = await getSearchData({
         gcode: "CHANNEL",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion, channel };
     },

+ 48 - 48
src/views/Keep/index.vue

@@ -374,19 +374,19 @@
 
 <script>
 // @ is an alias to /src
-import { getRule, getAppList, getKeepPage, getSearchData } from "@/api/index";
-
-import countTo from "@/components/counto/vue-countTo.vue";
+import { getRule, getAppList, getKeepPage, getSearchData } from '@/api/index';
 
+import countTo from '@/components/counto/vue-countTo.vue';
+import { defaultAppNameFunc } from '@/utils/tool.js';
 // import config from "@/config/index";
 export default {
-  name: "RealOnline",
+  name: 'RealOnline',
   data() {
     return {
-      type: "",
+      type: '',
       lastParams: {},
       form: {
-        app: "",
+        app: '',
         keepType: 1,
         version: [],
         channel: [],
@@ -402,18 +402,18 @@ export default {
     const { source, appV, appC, appli, appCLi, appVLi } =
       await this.getAppListFunc();
     const keys = {
-      value: "mname",
-      label: "mname",
+      value: 'mname',
+      label: 'mname',
     };
     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.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: "起点新闻",
+      app: defaultAppNameFunc(this.cycle),
       keepType: 1,
-      version: [(this.version[0] || { value: "" }).value],
-      channel: [(this.channel[0] || { value: "" }).value],
+      version: [(this.version[0] || { value: '' }).value],
+      channel: [(this.channel[0] || { value: '' }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
     };
     this.onSubmit();
@@ -429,7 +429,7 @@ export default {
       if (!obj) return;
       let li = list || [];
       const out = [];
-      more && out.push({ value: -1, label: "不限" });
+      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;
@@ -471,14 +471,14 @@ export default {
       let prvList = r.output.data.prvRolectrl || [];
       for (let i = 0; i < prvList.length; i++) {
         const v = prvList[i];
-        if (v.controlid == "RMT_SOURCE")
+        if (v.controlid == 'RMT_SOURCE')
           (source[v.detid] = true), (source.length = source.length + 1);
-        if (v.controlid == "APP_VERSION")
+        if (v.controlid == 'APP_VERSION')
           (appV[v.detid] = true), (appV.length = appV.length + 1);
-        if (v.controlid == "CHANNEL")
+        if (v.controlid == 'CHANNEL')
           (appC[v.detid] = true), (appC.length = appC.length + 1);
       }
-      if (li.status === "0") appli = li.output.data || [];
+      if (li.status === '0') appli = li.output.data || [];
       if (appVersion.length) appVLi = appVersion || [];
       if (channel.length) appCLi = channel || [];
       return {
@@ -494,37 +494,37 @@ export default {
     },
     async getAppListOri() {
       const roleid = JSON.parse(
-        window.parent.localStorage.userinfo || "{}"
+        window.parent.localStorage.userinfo || '{}'
       ).roleid;
       const r = await getRule({
-        db: "authplat",
-        exportMark: "0",
+        db: 'authplat',
+        exportMark: '0',
         menuid: 399,
         roleid,
       });
       //   应用列表
 
       const li = await getAppList({
-        exportMark: "0",
-        gcode: "SOURCE",
+        exportMark: '0',
+        gcode: 'SOURCE',
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = "起点新闻";
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
-        gcode: "APP_VERSION",
-        source: defaultAppName,
+        gcode: 'APP_VERSION',
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       //   应用渠道列表
       const channel = await getSearchData({
-        gcode: "CHANNEL",
-        source: defaultAppName,
+        gcode: 'CHANNEL',
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion, channel };
     },
     disabledDate(time) {
-      const first = new Date("2021-06-21 00:00:00");
+      const first = new Date('2021-06-21 00:00:00');
       return (
         time.getTime() > Date.now() - 86400000 ||
         time.getTime() < first.getTime()
@@ -534,9 +534,9 @@ export default {
       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("-");
+        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;
@@ -544,40 +544,40 @@ export default {
       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;
+      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(":");
+      return out.join(':');
     },
     change() {
       const roleid = JSON.parse(
-        window.parent.localStorage.userinfo || "{}"
+        window.parent.localStorage.userinfo || '{}'
       ).roleid;
       const appV = {
         length: 0,
       };
       getRule({
-        db: "authplat",
-        exportMark: "0",
+        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")
+          if (v.controlid == 'APP_VERSION')
             (appV[v.detid] = true), (appV.length = appV.length + 1);
         }
         getSearchData({
-          gcode: "APP_VERSION",
+          gcode: 'APP_VERSION',
           source: this.form.app,
         }).then(r => {
           let version = [
             {
-              label: "不限",
+              label: '不限',
               value: -1,
             },
           ];
@@ -640,7 +640,7 @@ export default {
       getKeepPage(p).then(r => {
         // 生成数据
         let strcsv =
-          "data:text/csv;charset=utf-8,\uFEFF日期,新增用户数,第1天,第2天,第3天,第4天,第5天,第6天,第7天,第15天,第30天\r\n";
+          'data:text/csv;charset=utf-8,\uFEFF日期,新增用户数,第1天,第2天,第3天,第4天,第5天,第6天,第7天,第15天,第30天\r\n';
         (r || []).map(v => {
           strcsv += [
             v.dt,
@@ -654,16 +654,16 @@ export default {
             v.r7,
             v.r15,
             v.r30,
-            "\r\n",
-          ].join(",");
+            '\r\n',
+          ].join(',');
         });
         // 导出
-        let link = document.createElement("a");
-        link.id = "download-csv";
-        link.setAttribute("href", encodeURI(strcsv));
+        let link = document.createElement('a');
+        link.id = 'download-csv';
+        link.setAttribute('href', encodeURI(strcsv));
         link.setAttribute(
-          "download",
-          p.app + "新用户留存" + S + "_" + E + ".csv"
+          'download',
+          p.app + '新用户留存' + S + '_' + E + '.csv'
         );
         // document.body.appendChild(link);
         link.click();

+ 5 - 4
src/views/LiveRoom/index.vue

@@ -287,6 +287,7 @@
 import { getRule, getAppList, getSearchData, getLivePage } from "@/api/index";
 
 import countTo from "@/components/counto/vue-countTo.vue";
+import { defaultAppNameFunc } from '@/utils/tool.js';
 
 import config from "@/config/index";
 export default {
@@ -325,7 +326,7 @@ export default {
     this.version = this.verifyList(appVLi, appV, keys, true);
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: "起点新闻",
+      app: defaultAppNameFunc(this.cycle),
       version: [(this.version[0] || { value: "" }).value],
       channel: [(this.channel[0] || { value: "" }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
@@ -422,16 +423,16 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = "起点新闻";
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: "APP_VERSION",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       //   应用渠道列表
       const channel = await getSearchData({
         gcode: "CHANNEL",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion, channel };
     },

+ 6 - 5
src/views/NMedia/ActivityUser.vue

@@ -232,6 +232,7 @@ import {
 } from "@/api/index";
 
 import countTo from "@/components/counto/vue-countTo.vue";
+import { defaultAppNameFunc } from '@/utils/tool.js';
 import * as echarts from "echarts/core";
 import { LineChart } from "echarts/charts";
 import {
@@ -300,7 +301,7 @@ export default {
    
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: "起点新闻",
+      app: defaultAppNameFunc(this.cycle),
       version: [-1],
       channel: [(this.channel[0] || { value: "" }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
@@ -500,21 +501,21 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = "起点新闻";
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: "APP_VERSION",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       //   应用渠道列表
       const channel = await getSearchData({
         gcode: "CHANNEL",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       // 端列表
       const clientList = await getSearchData({
         gcode: "CLIENT_TYPE",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion, channel, clientList };
     },

+ 4 - 3
src/views/NMedia/column/index.vue

@@ -160,6 +160,7 @@ import { getRule, getAppList, getSearchData } from '@/api/index';
 import { getColunmList } from '@/api/newMdeiaApi';
 
 import countTo from '@/components/counto/vue-countTo.vue';
+import { defaultAppNameFunc } from '@/utils/tool.js';
 
 import config from "@/config/index";
 export default {
@@ -189,7 +190,7 @@ export default {
     this.version = this.verifyList(appVLi, appV, keys, true);
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: '起点新闻',
+      app: defaultAppNameFunc(this.cycle),
       version: [(this.version[0] || { value: '' }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
     };
@@ -269,11 +270,11 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = '起点新闻';
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: 'APP_VERSION',
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion };
     },

+ 4 - 3
src/views/NMedia/contentDay/index.vue

@@ -183,6 +183,7 @@ import { getRule, getAppList, getSearchData } from '@/api/index';
 import { getContentDayList } from '@/api/newMdeiaApi';
 
 import countTo from '@/components/counto/vue-countTo.vue';
+import { defaultAppNameFunc } from '@/utils/tool.js';
 
 import config from '@/config/index';
 export default {
@@ -212,7 +213,7 @@ export default {
     this.version = this.verifyList(appVLi, appV, keys, true);
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: '起点新闻',
+      app: defaultAppNameFunc(this.cycle),
       version: [(this.version[0] || { value: '' }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
     };
@@ -288,11 +289,11 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = '起点新闻';
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: 'APP_VERSION',
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion };
     },

+ 47 - 46
src/views/RealOnline/index.vue

@@ -57,7 +57,7 @@
             :endVal="item.value"
             :duration="1500"
           ></countTo>
-          <p v-text="item.name" style="font-size: 16px;color: #000;"></p>
+          <p v-text="item.name" style="font-size: 16px; color: #000"></p>
         </div>
       </div>
     </el-card>
@@ -70,24 +70,25 @@
 
 <script>
 // @ is an alias to /src
-import countTo from "@/components/counto/vue-countTo.vue";
+import countTo from '@/components/counto/vue-countTo.vue';
 import {
   getRealAppOnline,
   getRule,
   getAppList,
   getSearchData,
-} from "@/api/index";
+} from '@/api/index';
+import { defaultAppNameFunc } from '@/utils/tool.js';
 
-import * as echarts from "echarts/core";
-import { LineChart } from "echarts/charts";
+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";
+} from 'echarts/components';
+import { CanvasRenderer } from 'echarts/renderers';
 echarts.use([
   TitleComponent,
   TooltipComponent,
@@ -102,12 +103,12 @@ echarts.use([
 let chart = undefined,
   time = undefined;
 export default {
-  name: "RealOnline",
+  name: 'RealOnline',
   data() {
     return {
       form: {
-        app: "",
-        lidu: "",
+        app: '',
+        lidu: '',
       },
       total: {},
       tableData: [],
@@ -139,7 +140,7 @@ export default {
       });
       this.form = {
         // app: (this.cycle[0] || { value: "" }).value,
-        app: '起点新闻',
+        app: defaultAppNameFunc(this.cycle),
         lidu: '60',
       };
       this.regularData();
@@ -161,13 +162,13 @@ export default {
             T = r.total || {},
             keys = Object.keys(T),
             total = [],
-            color = ["rgb(244, 127, 146)", "rgb(17, 160, 248)"];
+            color = ['rgb(244, 127, 146)', 'rgb(17, 160, 248)'];
           const keyList = [],
             valueList_active = [],
             valueList_newUser = [];
           for (let i = 0; i < keys.length; i++) {
             const v = keys[i];
-            if (typeof T[v].value !== "number") continue;
+            if (typeof T[v].value !== 'number') continue;
             let p = {
               name: T[v].name,
               value: T[v].value,
@@ -177,7 +178,7 @@ export default {
           }
           this.total = total;
           li.map(v => {
-            const key = v.recMinute.split(" ")[1] || "";
+            const key = v.recMinute.split(' ')[1] || '';
             keyList.push(key);
             valueList_active.push(v.active);
             valueList_newUser.push(v.newUser);
@@ -200,59 +201,59 @@ export default {
       chart.setOption({
         tooltip: {
           confine: true,
-          trigger: "axis",
+          trigger: 'axis',
         },
         toolbox: {
           feature: {
             saveAsImage: {
-              type: "jpg",
-              name: "实时",
+              type: 'jpg',
+              name: '实时',
             },
           },
         },
         grid: {
-          left: "3%",
-          right: "4%",
-          bottom: "3%",
+          left: '3%',
+          right: '4%',
+          bottom: '3%',
           containLabel: true,
         },
         legend: {
-          data: ["活跃用户", "新增用户"],
+          data: ['活跃用户', '新增用户'],
         },
         xAxis: {
-          type: "category",
+          type: 'category',
           boundaryGap: true,
           data: keyList,
         },
         yAxis: {
-          type: "value",
+          type: 'value',
           minInterval: 1,
           axisLabel: {
             formatter(v) {
               let val = v;
               if (val >= 100000000) {
-                val = (val / 100000000).toFixed(2) + "亿";
+                val = (val / 100000000).toFixed(2) + '亿';
               } else if (val >= 10000) {
-                val = (val / 10000).toFixed(2) + "万";
+                val = (val / 10000).toFixed(2) + '万';
               }
               return val;
             },
           },
         },
-        color: [ "rgb(17, 160, 248)","rgb(244, 127, 146)"],
+        color: ['rgb(17, 160, 248)', 'rgb(244, 127, 146)'],
         series: [
           {
-            name: "活跃用户",
+            name: '活跃用户',
             data: valueList_active,
             symbolSize: 0,
             lineStyle: {
               width: 1,
             },
-            type: "line",
+            type: 'line',
             smooth: true,
             areaStyle: {
               color: {
-                type: "linear",
+                type: 'linear',
                 x: 0,
                 y: 0,
                 x2: 0,
@@ -260,11 +261,11 @@ export default {
                 colorStops: [
                   {
                     offset: 0,
-                    color: "rgba(17, 160, 248, 0.8)", // 0% 处的颜色
+                    color: 'rgba(17, 160, 248, 0.8)', // 0% 处的颜色
                   },
                   {
                     offset: 1,
-                    color: "rgba(17, 160, 248, 0.1)", // 100% 处的颜色
+                    color: 'rgba(17, 160, 248, 0.1)', // 100% 处的颜色
                   },
                 ],
                 global: false, // 缺省为 false
@@ -272,17 +273,17 @@ export default {
             },
           },
           {
-            name: "新增用户",
+            name: '新增用户',
             data: valueList_newUser,
             symbolSize: 0,
             lineStyle: {
               width: 1,
             },
-            type: "line",
+            type: 'line',
             smooth: true,
             areaStyle: {
               color: {
-                type: "linear",
+                type: 'linear',
                 x: 0,
                 y: 0,
                 x2: 0,
@@ -290,11 +291,11 @@ export default {
                 colorStops: [
                   {
                     offset: 0,
-                    color: "rgba(244, 127, 146, 0.8)", // 0% 处的颜色
+                    color: 'rgba(244, 127, 146, 0.8)', // 0% 处的颜色
                   },
                   {
                     offset: 1,
-                    color: "rgba(244, 127, 146, 0.1)", // 100% 处的颜色
+                    color: 'rgba(244, 127, 146, 0.1)', // 100% 处的颜色
                   },
                 ],
                 global: false, // 缺省为 false
@@ -313,10 +314,10 @@ export default {
       let prvList = r.output.data.prvRolectrl || [];
       for (let i = 0; i < prvList.length; i++) {
         const v = prvList[i];
-        if (v.controlid == "RMT_SOURCE")
+        if (v.controlid == 'RMT_SOURCE')
           (source[v.detid] = true), (source.length = source.length + 1);
       }
-      if (li.status === "0") appli = li.output.data || [];
+      if (li.status === '0') appli = li.output.data || [];
       return {
         source,
         appli,
@@ -325,24 +326,24 @@ export default {
     },
     async getAppListOri() {
       const roleid = JSON.parse(
-        window.parent.localStorage.userinfo || "{}"
+        window.parent.localStorage.userinfo || '{}'
       ).roleid;
       const r = await getRule({
-        db: "authplat",
-        exportMark: "0",
+        db: 'authplat',
+        exportMark: '0',
         menuid: 400,
         roleid,
       });
       const li = await getAppList({
-        exportMark: "0",
-        gcode: "SOURCE",
+        exportMark: '0',
+        gcode: 'SOURCE',
         pageid: 1,
         pagesize: 1000,
       });
 
-      const defaultAppName = li.status == "0" ? li.output.data[0].mname : "";
+      const defaultAppName = li.status == '0' ? li.output.data[0].mname : '';
       const lidu = await getSearchData({
-        gcode: "TIME_MINUTE",
+        gcode: 'TIME_MINUTE',
         source: defaultAppName,
       });
       return { r, li, lidu };
@@ -374,7 +375,7 @@ export default {
   top: 0;
   right: 0;
   bottom: 0;
-  content: "";
+  content: '';
   display: block;
   width: 1px;
   background: #e7eef0;

+ 5 - 4
src/views/Region/index.vue

@@ -190,6 +190,7 @@
 import china from "../../assets/map/100000_full.json";
 import shanxi from "../../assets/map/610000_shaanxi.json";
 import countTo from "@/components/counto/vue-countTo.vue";
+import { defaultAppNameFunc } from '@/utils/tool.js';
 // @ is an alias to /src
 import {
   getRule,
@@ -239,7 +240,7 @@ export default {
     this.version = this.verifyList(appVLi, appV, keys, true);
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: "起点新闻",
+      app: defaultAppNameFunc(this.cycle),
       version: [(this.version[0] || { value: "" }).value],
       channel: [(this.channel[0] || { value: "" }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
@@ -414,16 +415,16 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = "起点新闻";
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: "APP_VERSION",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       //   应用渠道列表
       const channel = await getSearchData({
         gcode: "CHANNEL",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion, channel };
     },

+ 4 - 3
src/views/Search/index.vue

@@ -216,6 +216,7 @@ import {
 } from "@/api/index";
 
 import countTo from "@/components/counto/vue-countTo.vue";
+import { defaultAppNameFunc } from '@/utils/tool.js';
 
 import config from "@/config/index";
 export default {
@@ -245,7 +246,7 @@ export default {
     this.version = this.verifyList(appVLi, appV, keys, true);
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: "起点新闻",
+      app: defaultAppNameFunc(this.cycle),
       version: [(this.version[0] || { value: "" }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
       page: 1,
@@ -336,11 +337,11 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = "起点新闻";
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: "APP_VERSION",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion };
     },

+ 5 - 4
src/views/Version/index.vue

@@ -249,6 +249,7 @@ import {
 } from "@/api/index";
 
 import countTo from "@/components/counto/vue-countTo.vue";
+import { defaultAppNameFunc } from '@/utils/tool.js';
 import * as echarts from "echarts/core";
 import { LineChart } from "echarts/charts";
 import {
@@ -309,7 +310,7 @@ export default {
     }
     this.form = {
       //   app: (this.cycle[0] || { value: "" }).value,
-      app: "起点新闻",
+      app: defaultAppNameFunc(this.cycle),
       version: V,
       channel: [(this.channel[0] || { value: "" }).value],
       date: [new Date(Date.now() - 604800000), new Date(Date.now() - 86400000)],
@@ -493,16 +494,16 @@ export default {
         pageid: 1,
         pagesize: 1000,
       });
-      const defaultAppName = "起点新闻";
+      const cycle = li.output ? li.output.data || [] : [];
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: "APP_VERSION",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       //   应用渠道列表
       const channel = await getSearchData({
         gcode: "CHANNEL",
-        source: defaultAppName,
+        source: defaultAppNameFunc(cycle, 'mname'),
       });
       return { r, li, appVersion, channel };
     },