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