Authored by Zhang

Merge branch 'dev_0426_总成本报表需求' of http://git.yoho.cn/yoho30/yohobuy-union into dev_0426_总成本报表需求

# Conflicts:
#	channel/src/main/java/com/yoho/unions/channel/restapi/MktCostReportFormController.java
... ... @@ -100,10 +100,13 @@ public class MktCostReportFormController {
mktReportFormRspBO.setTotalNewUserList(totalNewUdidList);
mktReportFormRspBO.setIosNewUserList(iosNewUdidList);
mktReportFormRspBO.setAndroidNewUserList(androidNewUdidList);
mktReportFormRspBO.setTopActualCost(Collections.max(totalActuralCostList));
// mktReportFormRspBO.setTopAppActive(Collections.max(totalActiveList));
// mktReportFormRspBO.setTopExpoureNum(Collections.max(totalExpoureNumList));
// mktReportFormRspBO.setTopNewUdid(Collections.max(totalNewUdidList));
mktReportFormRspBO.setTotalActiveRatio(totalActiveRatio);
mktReportFormRspBO.setIosActiveRatio(iosActiveRatio);
mktReportFormRspBO.setAndroidActiveRatio(androidActiveRatio);
... ...
function getEchartOption(title, threeContext, xData, yLeftData, yRightData, ratio, yleftMax, yRightMax){
function getEchartOption(title, threeContext, xData, costData, numData, ratio, topCostData, topNumData, topRatio){
var colors = ['#5793f3', '#d14a61', '#675bba'];
var option = {
title:{
text: title
text:title
},
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: true, readOnly: false},
magicType: {show: true, type: ['line', 'bar']},
restore: {show: true},
saveAsImage: {show: true}
}
... ... @@ -26,53 +30,81 @@ function getEchartOption(title, threeContext, xData, yLeftData, yRightData, rati
xAxis: [
{
type: 'category',
data: xData,
axisPointer: {
type: 'shadow'
}
axisTick: {
alignWithLabel: true
},
data: xData
}
],
yAxis: [
{
type: 'value',
name: threeContext[0],
name: threeContext[1],
min: 0,
max: yleftMax,
interval: yleftMax/10,
max: topNumData*1.2,
position: 'right',
axisLine: {
lineStyle: {
color: colors[0]
}
},
axisLabel: {
formatter: '{value} '
formatter: '{value} '
}
},
{
type: 'value',
name: threeContext[1],
name: threeContext[0],
min: 0,
max: yRightMax,
interval: yRightMax/10,
max: topCostData*1.2,
position: 'right',
offset: 80,
axisLine: {
lineStyle: {
color: colors[1]
}
},
axisLabel: {
formatter: '{value} '
}
},
{
type: 'value',
name: threeContext[2],
min: 0,
max: topRatio*1.2,
position: 'left',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: '{value}'
}
}
],
series: [
{
name:threeContext[0],
name:threeContext[1],
type:'bar',
data:yLeftData
data:numData
},
{
name:threeContext[1],
name:threeContext[0],
type:'bar',
data:yRightData
yAxisIndex: 1,
data:costData
},
{
name:threeContext[2],
type:'line',
yAxisIndex: 1,
yAxisIndex: 2,
data:ratio
}
]
};
return option;
}
\ No newline at end of file
... ...
... ... @@ -6,7 +6,7 @@
<!-- 引入 echarts.js -->
<script src="/union/js/echarts.min.js"></script>
<script src="/union/js/include.js"></script>
<script src="/union/html/reportform/echartJs.js"></script>
<script src="/union/admin/echartJs.js"></script>
</head>
<body>
<table>
... ... @@ -59,95 +59,97 @@
debugger;
// 曝光量
var exposureOption = getEchartOption("市场费用/曝光量",
['实际费用','曝光量','市场费用/曝光量'],
['费用','曝光量','曝光成本'],
data.data.dateIdStrList,
data.data.totalActualCostList,
data.data.totalExpoureNumList,
data.data.totalExpoureRatio,
data.data.topActualCost,
data.data.topExpoureNum );
data.data.topExpoureNum,
data.data.topExpoureRatio);
drawEchart('exposure',exposureOption);
var exposureIosOption = getEchartOption("ios端市场费用/曝光量",
['实际费用','曝光量','市场费用/曝光量'],
['费用','曝光量','曝光成本'],
data.data.dateIdStrList,
data.data.iosActualCostList,
data.data.iosExpoureNumList,
data.data.iosExpoureRatio,
data.data.topActualCost,
data.data.topExpoureNum);
data.data.topExpoureNum,data.data.topExpoureRatio);
drawEchart('exposure_ios',exposureIosOption);
var exposureAndroidOption = getEchartOption("android市场费用/曝光量",
['实际费用','曝光量','市场费用/曝光量'],
['费用','曝光量','曝光成本'],
data.data.dateIdStrList,
data.data.androidActualCost,
data.data.androidExpoureNumList,
data.data.androidExpoureRatio,
data.data.topActualCost,
data.data.topExpoureNum);
data.data.topExpoureNum,data.data.topExpoureRatio);
drawEchart('exposure_android',exposureAndroidOption);
// 激活
var activeOption = getEchartOption("市场费用/激活量",
['实际费用','激活量','市场费用/激活量'],
['费用','激活量','激活成本'],
data.data.dateIdStrList,
data.data.totalActualCostList,
data.data.totalAppActiveList,
data.data.totalActiveRatio,
data.data.topActualCost,
data.data.topAppActive);
data.data.topAppActive,
data.data.topActiveRatio);
drawEchart('active',activeOption);
var activeIosOption = getEchartOption("ios端市场费用/激活量",
['实际费用','激活量','市场费用/激活量'],
['费用','激活量','激活成本'],
data.data.dateIdStrList,
data.data.iosActualCostList,
data.data.iosAppActiveList,
data.data.iosActiveRatio,
data.data.topActualCost,
data.data.topAppActive);
data.data.topAppActive,data.data.topActiveRatio);
drawEchart('active_ios',activeIosOption);
var activeAndroidOption = getEchartOption("android端市场费用/激活量",
['实际费用','激活量','市场费用/激活量'],
['费用','激活量','激活成本'],
data.data.dateIdStrList,
data.data.androidActualCost,
data.data.androidAppActiveList,
data.data.androidActiveRatio,
data.data.topActualCost,
data.data.topAppActive);
data.data.topAppActive,data.data.topActiveRatio);
drawEchart('active_android',activeAndroidOption);
// 新客
var newuserOption = getEchartOption("市场费用/曝光量",
['实际费用','曝光量','市场费用/曝光量'],
var newuserOption = getEchartOption("市场费用/新客量",
['费用','新客量','新客成本'],
data.data.dateIdStrList,
data.data.totalActualCostList,
data.data.totalNewUserList,
data.data.totalNewUdidRatio,
data.data.topActualCost,
data.data.topNewUdid);
data.data.topNewUdid,data.data.topNewUdidRatio);
drawEchart('newuser',newuserOption);
var newuserIosOption = getEchartOption("市场费用/曝光量",
['实际费用','曝光量','市场费用/曝光量'],
var newuserIosOption = getEchartOption("ios端市场费用/新客量",
['费用','新客量','新客成本'],
data.data.dateIdStrList,
data.data.iosActualCostList,
data.data.iosNewUserList,
data.data.iosNewUdidRatio,
data.data.topActualCost,
data.data.topNewUdid);
data.data.topNewUdid,data.data.topNewUdidRatio);
drawEchart('newuser_ios',newuserIosOption);
var newuserAndroidOption = getEchartOption("市场费用/曝光量",
['实际费用','曝光量','市场费用/曝光量'],
var newuserAndroidOption = getEchartOption("android市场费用/新客量",
['费用','新客量','新客成本'],
data.data.dateIdStrList,
data.data.androidActualCost,
data.data.androidNewUserList,
data.data.androidNewUdidRatio,
data.data.topActualCost,
data.data.topNewUdid);
data.data.topNewUdid,data.data.topNewUdidRatio);
drawEchart('newuser_android',newuserAndroidOption);
} else {
window.self.$.messager.alert("失败", data.message, "error");
... ...