|
@ -16,6 +16,7 @@ new Vue({
|
|
|
areaTitle: '',
|
|
|
index: '3',
|
|
|
selectedDateType: 1,
|
|
|
selectedDateType5:1,
|
|
|
endDate: '',
|
|
|
startDate: '',
|
|
|
lowLevel: '',
|
|
@ -32,6 +33,8 @@ new Vue({
|
|
|
index_20: 0,
|
|
|
index_21: 0,
|
|
|
index_27: 0,
|
|
|
index_124: 0,
|
|
|
index_125: 0,
|
|
|
index_86: 0
|
|
|
},
|
|
|
//微信绑定统计数据
|
|
@ -40,7 +43,8 @@ new Vue({
|
|
|
amount1: '', //已缴费人数
|
|
|
amount2: '', //未缴费人数
|
|
|
rate: ''//绑定率
|
|
|
}
|
|
|
},
|
|
|
isloading:false, //加载中
|
|
|
},
|
|
|
components: {
|
|
|
vuedals: Vuedals.Component
|
|
@ -64,12 +68,17 @@ new Vue({
|
|
|
this.selectedDateType = arg.dateType;
|
|
|
loadData([1], this);
|
|
|
},
|
|
|
getNewLineData5:function(arg){
|
|
|
this.selectedDateType5 = arg.dateType;
|
|
|
getArticleData(this)
|
|
|
|
|
|
},
|
|
|
jumpTip:function(tab){
|
|
|
console.log("mouseenter");
|
|
|
$('#shadow'+tab).attr("style","visibility:visible")
|
|
|
$('#shadow'+tab).css("visibility","visible")
|
|
|
},
|
|
|
leaveTip:function(tab){
|
|
|
$('#shadow'+tab).attr("style","visibility:hidden")
|
|
|
$('#shadow'+tab).css("visibility","hidden")
|
|
|
|
|
|
},
|
|
|
getAreaData: function(arg){
|
|
@ -102,12 +111,12 @@ new Vue({
|
|
|
$(".tip").on('mouseenter', function(){
|
|
|
console.log("mouse enter");
|
|
|
var val = $(this).attr("data-val");
|
|
|
$('#shadow'+val).attr("style","visibility:visible")
|
|
|
$('#shadow'+val).css("visibility","visible")
|
|
|
})
|
|
|
$(".tip").on('mouseleave', function(){
|
|
|
console.log("mouse leave");
|
|
|
var val = $(this).attr("data-val");
|
|
|
$('#shadow'+val).attr("style","visibility:hidden")
|
|
|
$('#shadow'+val).css("visibility","hidden")
|
|
|
})
|
|
|
//初始化数据
|
|
|
initData(this);
|
|
@ -243,11 +252,13 @@ function initReqParams(vm){
|
|
|
url3 = "statistics/lowlevel_total_mesh";
|
|
|
}else if(vm.index == '5'){
|
|
|
url3 = '/statistics/article_lowlevel_total';
|
|
|
}else if(vm.index == '27'){
|
|
|
url3 = '/statistics/lowlevel_all';
|
|
|
}
|
|
|
reqParam = [{
|
|
|
url: url2,
|
|
|
data:{
|
|
|
index: vm.index == '5' ? '5,83' : vm.index,
|
|
|
index: vm.index == '5' ? '5,83' : vm.index == 27 ? '27,124,125' : vm.index,
|
|
|
level: vm.level,
|
|
|
area: vm.area,
|
|
|
startDate: vm.startDate,
|
|
@ -273,7 +284,7 @@ function initReqParams(vm){
|
|
|
}
|
|
|
}];
|
|
|
|
|
|
if(vm.index == '20' || vm.index == '21'){
|
|
|
if(vm.index == '20' || vm.index == '21' || vm.index == '27'){
|
|
|
reqParam[1].data.date = vm.endDate;
|
|
|
}else{
|
|
|
reqParam[1].data.endDate = vm.endDate;
|
|
@ -309,7 +320,7 @@ function getTopReqParams(index1, vm){
|
|
|
|
|
|
function getTopTagDatas(vm){
|
|
|
var reqs = [],
|
|
|
indexs = ['3', '4', '5', '27', '21', '20'];
|
|
|
indexs = ['3', '4', '5', '27', '21', '20','124','125'];
|
|
|
for(i=0; i<indexs.length; i++){
|
|
|
var item = getTopReqParams(indexs[i], vm);
|
|
|
reqs.push(httpRequest.get(item.url, {data: item.data}));
|
|
@ -320,6 +331,9 @@ function getTopTagDatas(vm){
|
|
|
if(res.status == 200){
|
|
|
for(key in res.data){
|
|
|
vm.topDatas[key] = res.data[key];
|
|
|
if(vm.chooseYear<2019&&(key=="index_124"||key=="index_125")){
|
|
|
vm.topDatas[key]="--"
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
console.log(res.msg);
|
|
@ -333,6 +347,7 @@ function loadData(loadArr, vm){
|
|
|
getTopTagDatas(vm);
|
|
|
}
|
|
|
|
|
|
vm.isloading=true
|
|
|
//获取其他请求的参数
|
|
|
var reqParams = initReqParams(vm),
|
|
|
reqPromise = [],
|
|
@ -353,7 +368,8 @@ function loadData(loadArr, vm){
|
|
|
newArr.push(3);
|
|
|
}
|
|
|
if(reqPromise.length > 0){
|
|
|
Promise.all(reqPromise).then(function(ress){
|
|
|
Promise.all(reqPromise).then(function(ress){
|
|
|
vm.isloading=false
|
|
|
var res2, res3, res4;
|
|
|
for(var i=0; i<newArr.length; i++){
|
|
|
var j = newArr[i] + 1;
|
|
@ -372,6 +388,7 @@ function loadData(loadArr, vm){
|
|
|
if(res2.status == 200){
|
|
|
handleSecondPanelData(res2.data, vm);
|
|
|
if(vm.index == '5'){
|
|
|
getArticleData(vm)
|
|
|
var arr = [{
|
|
|
name: '健康文章',
|
|
|
value: vm.topDatas.index_83
|
|
@ -408,27 +425,37 @@ function handleSecondPanelData(data, vm){
|
|
|
var xDatas = [],
|
|
|
yDatas = [],
|
|
|
names = [],
|
|
|
colors = ['#12b7f5', '#cd67fd'],
|
|
|
colors = ['#12b7f5', '#cd67fd','#FF9526'],
|
|
|
labels = {'3': '咨询量新增趋势', '4': '随访量新增趋势', '5': '触达人数新增趋势', '20': '绑定设备新增趋势', '21': '绑定微信新增趋势', '27': '代预约量新增趋势'}
|
|
|
index_names = {'index_3': '咨询量', 'index_4': '随访量', 'index_5': '健康指导','index_27':'代预约量','index_21': '绑定微信','index_20': '绑定设备', 'index_83': "健康文章"};
|
|
|
index_names = {'index_3': '咨询量', 'index_4': '随访量', 'index_5': '健康指导','index_27':'代预约量','index_21': '绑定微信','index_20': '绑定设备', 'index_83': "健康文章", 'index_124': "代预约等级医院", 'index_125': "代预约社区医院"};
|
|
|
for(var p in data){
|
|
|
names.push(index_names[p]);
|
|
|
if(p == 'index_21' || p == 'index_20' || p == "index_86"){
|
|
|
var xData = _.map(data[p].data, function(o){
|
|
|
xData = _.map(data[p].data, function(o){
|
|
|
return o.range;
|
|
|
});
|
|
|
var yData = _.map(data[p].data, function(o){
|
|
|
yData = _.map(data[p].data, function(o){
|
|
|
return o.amount;
|
|
|
});
|
|
|
}else{
|
|
|
var xData = _.map(data[p], function(o){
|
|
|
return o.range;
|
|
|
});
|
|
|
var yData = _.map(data[p], function(o){
|
|
|
return o.amount;
|
|
|
});
|
|
|
if(data[p][0].range){
|
|
|
xData = _.map(data[p], function(o){
|
|
|
return o.range;
|
|
|
});
|
|
|
yData = _.map(data[p], function(o){
|
|
|
return o.amount;
|
|
|
});
|
|
|
}else{
|
|
|
if(p=='index_124'||p=='index_125'){
|
|
|
xData=[];yData=[]
|
|
|
_.each(data["index_27"], function(o){
|
|
|
yData.push(0)
|
|
|
xData.push(o.range)
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
console.log(xData);
|
|
|
// console.log(xData);
|
|
|
xDatas.push(xData);
|
|
|
yDatas.push(yData);
|
|
|
}
|
|
@ -438,7 +465,8 @@ function handleSecondPanelData(data, vm){
|
|
|
xData : xDatas[0],
|
|
|
yDatas : yDatas,
|
|
|
colors : colors,
|
|
|
selectedDateType: vm.selectedDateType
|
|
|
selectedDateType: vm.selectedDateType,
|
|
|
nowlineid : "lineChart"
|
|
|
});
|
|
|
}
|
|
|
|
|
@ -463,6 +491,15 @@ function listHandle(data, vm){
|
|
|
cols.push(o.bindRate + '%');
|
|
|
cols.push(o.weChatAmount1);
|
|
|
cols.push(o.weChatAmount0);
|
|
|
}else if(vm.index == '27'){
|
|
|
if(vm.chooseYear<2019){
|
|
|
cols.push("--");
|
|
|
cols.push("--");
|
|
|
}else{
|
|
|
cols.push(o.reservationTotal1Amount0);
|
|
|
cols.push(o.reservationTota2Amount0);
|
|
|
}
|
|
|
cols.push(o.reservationTotalAmount0);
|
|
|
}else{
|
|
|
cols.push(o.amount);
|
|
|
if(vm.index == '5'){
|
|
@ -483,10 +520,11 @@ function listHandle(data, vm){
|
|
|
'5': ["排名", "总触达人数", "阅读量", "阅读率"],
|
|
|
'20': ["排名", "绑定设备"],
|
|
|
'21': ["排名", "绑定率", "已缴费", "未缴费"],
|
|
|
"27": ["排名", "代预约量"]
|
|
|
"27": ["排名", "代预约等级医院", "代预约社区医院", "代预约量"]
|
|
|
};
|
|
|
|
|
|
EventBus.$emit("render-area-data",{
|
|
|
index: vm.index,
|
|
|
level: vm.level,
|
|
|
area: vm.area,
|
|
|
lowLevel: vm.lowLevel,
|
|
@ -533,4 +571,190 @@ function getKeyValueArr2(list, key){
|
|
|
}
|
|
|
|
|
|
return arr;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获得健康文章相关的其他的内容
|
|
|
function getArticleData(vm){
|
|
|
vm.isloading=true
|
|
|
var reqss=[],reqs = [{
|
|
|
url: "/statistics/getAppActicleStatisticsData",
|
|
|
data: {startDate: vm.startDate, endDate: vm.endDate, area: vm.area},
|
|
|
reqType: 'get'
|
|
|
}, {
|
|
|
url: "/statistics/getAppActicleTrendStatisticsData",
|
|
|
data: {startDate: vm.startDate, endDate: vm.endDate, area: vm.area},
|
|
|
reqType: 'get'
|
|
|
}];
|
|
|
_.each(reqs,function(item){
|
|
|
reqss.push(httpRequest.get(item.url, {data: item.data}))
|
|
|
})
|
|
|
Promise.all(reqss).then(function(ress){
|
|
|
var res1 = ress[0],
|
|
|
res2 = ress[1];
|
|
|
if(res1.status == 200){
|
|
|
var data1 = res1.data;
|
|
|
$(".article-total-count").text(data1.totalContentCount);
|
|
|
$(".article-send-count").text(data1.totalPushCount);
|
|
|
var per = '',
|
|
|
full = '50%';
|
|
|
if(parseInt(data1.totalContentCount) > parseInt(data1.totalPushCount)){
|
|
|
per = data1.totalPushCount / data1.totalContentCount * 50;
|
|
|
$(".article-bar").css('width', "50%");
|
|
|
$(".send-bar").css('width', per+"%");
|
|
|
}else{
|
|
|
if(data1.totalPushCount != 0){
|
|
|
per = data1.totalContentCount / data1.totalPushCount * 50;
|
|
|
$(".send-bar").css('width', "50%");
|
|
|
}else{
|
|
|
per = 0;
|
|
|
$(".send-bar").css('width', 0);
|
|
|
}
|
|
|
|
|
|
$(".article-bar").css('width', per+"%");
|
|
|
}
|
|
|
|
|
|
var legend = {
|
|
|
orient: 'vertical',
|
|
|
x: '40%',
|
|
|
data: [],
|
|
|
itemGap: 30,
|
|
|
top: 'middle',
|
|
|
icon: 'circle',
|
|
|
align: 'left',
|
|
|
};
|
|
|
var colors = ["#15c1b0", "#428ffd", "#9892fb", "#f67279", "#fdc44f"];
|
|
|
legendNames = [];
|
|
|
var arr1 = _.map(data1.contentDistrPie, function(o){
|
|
|
var obj = {
|
|
|
name: o.categoryName,
|
|
|
count: parseInt(o.contentCount)
|
|
|
};
|
|
|
legend.data.push(o.categoryName)
|
|
|
legendNames.push(obj);
|
|
|
return {
|
|
|
value: parseInt(o.contentCount),
|
|
|
name: o.categoryName
|
|
|
}
|
|
|
});
|
|
|
legend.formatter = function(name){
|
|
|
var total = 0;
|
|
|
var target;
|
|
|
// console.log(this)
|
|
|
for (var i = 0, l = legendNames.length; i < l; i++) {
|
|
|
total += parseInt(legendNames[i].count);
|
|
|
if (legendNames[i].name == name) {
|
|
|
target = parseInt(legendNames[i].count);
|
|
|
}
|
|
|
}
|
|
|
// console.log(((target/total)*100).toFixed(2)+'% (' + name +')');
|
|
|
return ((target/total)*100).toFixed(2)+'% (' + name +')';
|
|
|
}
|
|
|
var title = {
|
|
|
text: '内容分布',
|
|
|
x:'left',
|
|
|
textStyle:{
|
|
|
fontWeight: 400,
|
|
|
fontSize: 16
|
|
|
}
|
|
|
}
|
|
|
drawPie("articleChart", arr1, colors, legend, ['25%', '50%'], ['55%', '70%'], title);
|
|
|
var arr2 = [
|
|
|
{value: parseInt(data1.userBehaviorPie.shareCount), name: '分享'},
|
|
|
{value: parseInt(data1.userBehaviorPie.browseCount), name: '浏览'},
|
|
|
{value: parseInt(data1.userBehaviorPie.collectCount), name: '收藏'},
|
|
|
{value: parseInt(data1.userBehaviorPie.zanCount), name: '点赞'},
|
|
|
];
|
|
|
var legendNames2 = [{name: "分享", count: parseInt(data1.userBehaviorPie.shareCount)},
|
|
|
{name: "浏览", count: parseInt(data1.userBehaviorPie.browseCount)},
|
|
|
{name: "收藏", count: parseInt(data1.userBehaviorPie.collectCount)},
|
|
|
{name: "点赞", count: parseInt(data1.userBehaviorPie.zanCount)}];
|
|
|
legend.data=["分享","浏览","收藏","点赞"]
|
|
|
legend.formatter = function(name){
|
|
|
var total = 0;
|
|
|
var target;
|
|
|
for (var i = 0, l = legendNames2.length; i < l; i++) {
|
|
|
total += legendNames2[i].count;
|
|
|
if (legendNames2[i].name == name) {
|
|
|
target = legendNames2[i].count;
|
|
|
// console.log(target)
|
|
|
}
|
|
|
}
|
|
|
var rs = "";
|
|
|
if(total == 0){
|
|
|
rs = "0% ("+name+")";
|
|
|
}else{
|
|
|
rs = ((target/total)*100).toFixed(2)+'% (' + name +')'
|
|
|
}
|
|
|
return rs;
|
|
|
}
|
|
|
var title = {
|
|
|
text: '推送分析',
|
|
|
x:'left',
|
|
|
textStyle:{
|
|
|
fontWeight: 400,
|
|
|
fontSize: 16
|
|
|
}
|
|
|
}
|
|
|
drawPie("sendChart", arr2, colors, legend, ['25%', '50%'], ['55%', '70%'], title)
|
|
|
}else{
|
|
|
vm.$message.error(res1.msg);
|
|
|
}
|
|
|
if(res2.status == 200){
|
|
|
articleTrendData = res2.data;
|
|
|
handleArticleTrendChart(articleTrendData,vm);
|
|
|
}else{
|
|
|
vm.$message.error(res2.msg);
|
|
|
}
|
|
|
vm.isloading=false
|
|
|
})
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 处理健康文章运营统计折线图数据
|
|
|
*/
|
|
|
function handleArticleTrendChart(articleTrendData,vm){
|
|
|
var data = {};
|
|
|
if(vm.selectedDateType5 == 1){
|
|
|
data = articleTrendData.day;
|
|
|
}else if(vm.selectedDateType5 == 2){
|
|
|
data = articleTrendData.week;
|
|
|
}else{
|
|
|
data = articleTrendData.month;
|
|
|
}
|
|
|
var dataZoom_end,
|
|
|
xDatas = [],
|
|
|
yDatas = [],
|
|
|
names = [],
|
|
|
colors = [];
|
|
|
for(var p in data){
|
|
|
if(p == 'contentList'){
|
|
|
names.push("新增内容量");
|
|
|
colors.push('#1dff67');
|
|
|
}else if(p == 'pushList'){
|
|
|
names.push("新增推送量");
|
|
|
colors.push('#ffd132');
|
|
|
}else if(p == 'readList'){
|
|
|
names.push("新增阅读量");
|
|
|
colors.push('#00deff');
|
|
|
}
|
|
|
var xData = _.map(data[p], function(o){
|
|
|
return o.date;
|
|
|
});
|
|
|
var yData = _.map(data[p], function(o){
|
|
|
return o.count;
|
|
|
});
|
|
|
|
|
|
xDatas.push(xData);
|
|
|
yDatas.push(yData);
|
|
|
}
|
|
|
EventBus.$emit("draw-line-chart", {
|
|
|
panelName : "运营统计",
|
|
|
quotaNames : names,
|
|
|
xData : xDatas[0],
|
|
|
yDatas : yDatas,
|
|
|
colors : colors,
|
|
|
selectedDateType: vm.selectedDateType5,
|
|
|
nowlineid : "lineChart5",
|
|
|
unit:"篇"
|
|
|
});
|
|
|
}
|