111
This commit is contained in:
parent
50cee716e4
commit
c59244d3e3
@ -164,7 +164,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script id="eventsplit-box-dot" type="text/html">
|
||||
<!-- <script id="eventsplit-box-dot" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<div class="action-row">
|
||||
<div class="action-left">
|
||||
@ -179,7 +179,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</script>
|
||||
</script> -->
|
||||
|
||||
<script id="table-attrbute-th-dot" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
|
@ -74,7 +74,7 @@
|
||||
<div class="analtsis-condition-box">
|
||||
<div class="analtsis-time-box">
|
||||
<div class="analtsis-condition" > <input id="retained-condition-date" readonly="readonly"></input> </div>
|
||||
<!-- <div class="analtsis-condition analtsis-timeParticleSize">7天</div> -->
|
||||
<div class="analtsis-condition analtsis-timeParticleSize">7天</div>
|
||||
</div>
|
||||
|
||||
<div class="analtsis-condition-right-box">
|
||||
|
@ -88,73 +88,88 @@
|
||||
</div>
|
||||
|
||||
<div class="table-box">
|
||||
<table class="table-fenxi-box">
|
||||
<thead>
|
||||
<!-- <colgroup>
|
||||
{{# layui.each(d.titledata, function(indexs, items) { }}
|
||||
<col />
|
||||
{{# }); }}
|
||||
</colgroup> -->
|
||||
<tr class="table-fenxi-th">
|
||||
{{# layui.each(d.titledata, function(indexs, items) { }}
|
||||
<th>{{items}}</th>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
{{# if(d.cat === "event"){ }}
|
||||
<tbody class="table-fenxi-td">
|
||||
|
||||
<!-- <div class="table-thead">
|
||||
<table class="table-fenxi-box">
|
||||
<thead>
|
||||
<colgroup>
|
||||
{{# layui.each(d.titledata, function(indexs, items) { }}
|
||||
<col />
|
||||
{{# }); }}
|
||||
</colgroup>
|
||||
{{# layui.each(d.condata, function(indexs, items) { }}
|
||||
<tr class="table-fenxi-th">
|
||||
{{# layui.each(d.titledata, function(indexs, items) { }}
|
||||
<th>{{items}}</th>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div> -->
|
||||
<div class="table-tbody-box">
|
||||
<table class="table-fenxi-box">
|
||||
<thead>
|
||||
<colgroup>
|
||||
{{# layui.each(d.titledata, function(indexs, items) { }}
|
||||
<col />
|
||||
{{# }); }}
|
||||
</colgroup>
|
||||
<tr class="table-fenxi-th">
|
||||
{{# layui.each(d.titledata, function(indexs, items) { }}
|
||||
<th>{{items}}</th>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
{{# if(d.cat === "event"){ }}
|
||||
<tbody class="table-fenxi-td">
|
||||
|
||||
{{# layui.each(d.condata, function(indexs, items) { }}
|
||||
<tr >
|
||||
{{# layui.each(items, function(indexss, itemss) { }}
|
||||
<td>{{itemss}}</td>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</tbody>
|
||||
{{# } else if(d.cat === "retention"){ }}
|
||||
<tbody class="table-fenxi-td">
|
||||
|
||||
{{# layui.each(d.condata, function(indexs, items) { }}
|
||||
<tr >
|
||||
{{# layui.each(items, function(indexss, itemss) { }}
|
||||
<td>{{itemss}}</td>
|
||||
<td>{{items.date}}</td>
|
||||
<td>{{items.d0}}</td>
|
||||
{{# layui.each(items.data, function(indexss, itemss){ }}
|
||||
<td>
|
||||
<p>{{itemss.n}}</p>
|
||||
<p>{{itemss.p}}%</p>
|
||||
</td>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</tbody>
|
||||
{{# } else if(d.cat === "retention"){ }}
|
||||
<tbody class="table-fenxi-td">
|
||||
<colgroup>
|
||||
{{# layui.each(d.titledata, function(indexs, items) { }}
|
||||
<col />
|
||||
{{# }); }}
|
||||
</colgroup>
|
||||
</tbody>
|
||||
{{# } else if(d.cat === "ltv"){ }}
|
||||
<tbody class="table-fenxi-td">
|
||||
|
||||
{{# layui.each(d.condata, function(indexs, items) { }}
|
||||
<tr >
|
||||
{{# layui.each(items, function(indexss, itemss){ }}
|
||||
<td>{{itemss}}</td>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</tbody>
|
||||
{{# } else if(d.cat === "user_property"){ }}
|
||||
{{# layui.each(d.condata, function(indexs, items) { }}
|
||||
<tr >
|
||||
<td>{{items.date}}</td>
|
||||
<td>{{items.d0}}</td>
|
||||
{{# layui.each(items.data, function(indexss, itemss){ }}
|
||||
<td>
|
||||
<p>{{itemss.n}}</p>
|
||||
<p>{{itemss.p}}%</p>
|
||||
</td>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{indexs}}</td>
|
||||
<td>{{items}}</td>
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</tbody>
|
||||
{{# } else if(d.cat === "ltv"){ }}
|
||||
<tbody class="table-fenxi-td">
|
||||
<colgroup>
|
||||
{{# layui.each(d.titledata, function(indexs, items) { }}
|
||||
<col />
|
||||
{{# }); }}
|
||||
</colgroup>
|
||||
{{# layui.each(d.condata, function(indexs, items) { }}
|
||||
<tr >
|
||||
{{# layui.each(items, function(indexss, itemss){ }}
|
||||
<td>{{itemss}}</td>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</tbody>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -14,7 +14,7 @@
|
||||
<option value="retention">留存分析</option>
|
||||
<option value="ltv">LTV模型</option>
|
||||
<option value="funnel">漏斗分析</option>
|
||||
<option value="4">属性分析</option>
|
||||
<option value="user_property">属性分析</option>
|
||||
<option value="trace">路径分析</option>
|
||||
<option value="scatter">分布分析</option>
|
||||
<option value="ltv">LTV模型</option>
|
||||
|
176
web/src/x.min.js
vendored
176
web/src/x.min.js
vendored
@ -679,6 +679,18 @@ var X = window.X || {
|
||||
callback && callback(dataArr);
|
||||
};
|
||||
|
||||
X.userpropertytable=function(data,callback){
|
||||
var dataArr = {
|
||||
titledata:data.title,
|
||||
condata:data.value
|
||||
}
|
||||
callback && callback(dataArr);
|
||||
};
|
||||
|
||||
X.userpropertychart=function(data,callback){
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 分组项
|
||||
// X.grouped=function(data,id){
|
||||
@ -1655,7 +1667,8 @@ var X = window.X || {
|
||||
var startmonth = Date.parse(startdate)/1000;
|
||||
data['eventView']['e_days'] = parseInt((sameday - endmonth)/86400);
|
||||
data['eventView']['s_days'] = parseInt((sameday - startmonth)/86400);
|
||||
console.log(data);
|
||||
console.log(parseInt((sameday - endmonth)/86400));
|
||||
console.log(parseInt((sameday - startmonth)/86400));
|
||||
// calculationdata();
|
||||
})
|
||||
|
||||
@ -2842,21 +2855,22 @@ var X = window.X || {
|
||||
"quotatype":"",
|
||||
"relation":"and",
|
||||
"tableType":"user"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cachedata":{}
|
||||
};
|
||||
|
||||
// 分析属性控制重命名
|
||||
$(document).off('click','.analysis-chongmingming').on('click','.analysis-chongmingming',function(){
|
||||
$('.analysis-con-left-screen-list-left-zhibiaoname').show();
|
||||
$(this).hide();
|
||||
$('.analysis-chongmingming-del').show();
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-chongmingming-del').on('click','.analysis-chongmingming-del',function(){
|
||||
$('.analysis-con-left-screen-list-left-zhibiaoname').hide();
|
||||
$(this).hide();
|
||||
$('.analysis-chongmingming').show();
|
||||
})
|
||||
});
|
||||
|
||||
//用户属性数据请求
|
||||
var user_attr = [];
|
||||
@ -2901,7 +2915,16 @@ var X = window.X || {
|
||||
filter_map = val;
|
||||
})
|
||||
|
||||
})
|
||||
//从数据看板点击进来触发事件
|
||||
if(X.DATA.user_property && X.DATA.user_property != ''){
|
||||
var report_idarr = [];
|
||||
report_idarr.push(X.DATA.user_property);
|
||||
X.api('report/read_report','post',{project_id:X.DATA.projectid,report_id:report_idarr},function(d){
|
||||
backfilldata(d[0]);
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// sql语句显示
|
||||
$(document).off('click','.sqlquery').on('click','.sqlquery',function(){
|
||||
@ -2910,7 +2933,7 @@ var X = window.X || {
|
||||
X.querycriteriapop(data,'conditionquery',offset.left - 410,offset.top+obj.height(),function(){
|
||||
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
// 分析属性
|
||||
$(document).off('click','.ant-dropdown-trigger').on('click','.ant-dropdown-trigger',function(){
|
||||
@ -2930,7 +2953,7 @@ var X = window.X || {
|
||||
$('.analysis-choicetypename').html(quotas_map[val.data_type][0]['title']);
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-choicetypename').on('click','.analysis-choicetypename',function(){
|
||||
var obj = $(this);
|
||||
@ -2941,12 +2964,12 @@ var X = window.X || {
|
||||
data['events']['analysisDesc'] = val.title;
|
||||
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-con-left-screen-list-left-zhibiaoname input').on('blur','.analysis-con-left-screen-list-left-zhibiaoname input',function(){
|
||||
// console.log($(this).val());
|
||||
data['events']['eventNameDisplay'] = $(this).val();
|
||||
})
|
||||
});
|
||||
|
||||
// 分组项
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
@ -2965,7 +2988,7 @@ var X = window.X || {
|
||||
$(this).hide();
|
||||
}
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-action-right').on('click','.analysis-action-right',function(){
|
||||
var index = $(this).attr('data-index');
|
||||
@ -2974,7 +2997,7 @@ var X = window.X || {
|
||||
$(".analysis-footadd___2D4YB").show();
|
||||
}
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-ant-dropdown-trigger').on('click','.analysis-ant-dropdown-trigger',function(){
|
||||
var obj = $(this);
|
||||
@ -2988,7 +3011,7 @@ var X = window.X || {
|
||||
data['eventView']['groupBy'][index]['data_type'] = val.type;
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-ta-property-range').on('click','.analysis-ta-property-range',function(){
|
||||
var index = $(this).attr('data-index');
|
||||
@ -2999,7 +3022,7 @@ var X = window.X || {
|
||||
data['eventView']['groupBy'][index]['quotaIntervalArr'] = val.quotaIntervalArr;
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
//且用户符合
|
||||
$(document).off('click','.analysis-overall-situation-add').on('click','.analysis-overall-situation-add',function(){
|
||||
@ -3023,7 +3046,7 @@ var X = window.X || {
|
||||
$(".analysis-overall-situation-left-guanxi").hide();
|
||||
}
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-left-guanxi').on('click',".analysis-overall-situation-left-guanxi",function(){
|
||||
var tit = $(this).html();
|
||||
@ -3034,7 +3057,7 @@ var X = window.X || {
|
||||
$(this).html('且');
|
||||
data['events']['relation'] = 'and';
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-attr').on('click','.analysis-overall-situation-attr',function(){
|
||||
var obj = $(this);
|
||||
@ -3048,7 +3071,7 @@ var X = window.X || {
|
||||
data['events']['filts'][index]['data_type'] = val.type;
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-fuhao').on('click','.analysis-overall-situation-fuhao',function(){
|
||||
var obj = $(this);
|
||||
@ -3065,7 +3088,7 @@ var X = window.X || {
|
||||
}
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-input input').on('blur','.analysis-overall-situation-input input',function(){
|
||||
var val = $(this).val();
|
||||
@ -3073,7 +3096,7 @@ var X = window.X || {
|
||||
var index = $(this).attr("data-index");
|
||||
data['events']['filts'][index]['strftv'] = val;
|
||||
data['events']['filts'][index]['ftv'] = titarr;
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-input2 input').on('blur','.analysis-overall-situation-input2 input',function(){
|
||||
var name = $(this).attr('name');
|
||||
@ -3085,7 +3108,7 @@ var X = window.X || {
|
||||
}else {
|
||||
data['events']['filts'][index]['ftv'][1] = val;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-del').on('click','.analysis-overall-situation-del',function(){
|
||||
var index = $(this).attr('data-index');
|
||||
@ -3096,24 +3119,34 @@ var X = window.X || {
|
||||
$(".analysis-overall-situation-left-guanxi").hide();
|
||||
}
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
})
|
||||
});
|
||||
|
||||
// 计算按钮
|
||||
$(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
|
||||
calculationdata();
|
||||
});
|
||||
|
||||
X.api("ck/user_property_model","post",data,function(val){
|
||||
function calculationdata(){
|
||||
data['cachedata']['user_attr'] = user_attr;
|
||||
data['cachedata']['quotas_map'] = quotas_map;
|
||||
data['cachedata']['filter_map'] = filter_map;
|
||||
data['cachedata']['user_data'] = user_data;
|
||||
var dataArr = {
|
||||
eventView: data.eventView,
|
||||
events: data.events
|
||||
}
|
||||
X.api("ck/user_property_model","post",dataArr,function(val){
|
||||
attributetable(val);
|
||||
querydata = val;
|
||||
updata(val)
|
||||
})
|
||||
|
||||
})
|
||||
};
|
||||
|
||||
function updata(d){
|
||||
var title = $(".select-chart").attr("title");
|
||||
if(title == '柱状分布图'){ attributebar(d);}
|
||||
else if(title == '饼状图'){ attributepie(d); }
|
||||
}
|
||||
};
|
||||
|
||||
var querydata;
|
||||
$(document).off('click','.analtsis-chart-switch').on('click','.analtsis-chart-switch',function(){
|
||||
@ -3127,12 +3160,12 @@ var X = window.X || {
|
||||
}else{
|
||||
layer.msg('请先计算数据,在切换图表');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
function attributetable(val){
|
||||
X.laytpldata("#table-attrbute-th-dot",val.title,".table-attrbute-th");
|
||||
X.laytpldata("#table-attrbute-td-dot",val.value,".table-attrbute-td");
|
||||
}
|
||||
};
|
||||
|
||||
function attributebar(val){
|
||||
|
||||
@ -3181,7 +3214,7 @@ var X = window.X || {
|
||||
}]
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
}
|
||||
};
|
||||
|
||||
function attributepie(val){
|
||||
// console.log(val);
|
||||
@ -3221,6 +3254,47 @@ var X = window.X || {
|
||||
]
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
};
|
||||
|
||||
//已存报表
|
||||
var baobiaodata;
|
||||
$(document).off('click','.analysis-navigation-bar-right-img-baobiao').on('click','.analysis-navigation-bar-right-img-baobiao',function(){
|
||||
X.parametersopen(data['eventView']['cksql'],'savedbaobiao','rt',function(d){
|
||||
if(d){
|
||||
backfilldata(d)
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 保存报表
|
||||
$(document).off('click','.analysis-savereport').on('click','.analysis-savereport',function(){
|
||||
if(baobiaodata != '' && baobiaodata != undefined && baobiaodata != null){
|
||||
X.parametersopen(baobiaodata,'savereport','auto');
|
||||
}else{
|
||||
X.parametersopen(data,'savereport','auto');
|
||||
}
|
||||
});
|
||||
|
||||
// 反向填充数据
|
||||
function backfilldata(d){
|
||||
data = d.query;
|
||||
console.log(d);
|
||||
|
||||
user_attr = data.cachedata.user_attr;
|
||||
quotas_map = data.cachedata.quotas_map;
|
||||
filter_map = data.cachedata.filter_map;
|
||||
user_data = data.cachedata.user_data;
|
||||
|
||||
baobiaodata = d;
|
||||
|
||||
// if(d.query.eventView.filts.length > 0){
|
||||
// $(".analysis-overall").show();
|
||||
// }else {
|
||||
// $(".analysis-overall").hide();
|
||||
// }
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
calculationdata();
|
||||
}
|
||||
|
||||
}
|
||||
@ -3249,22 +3323,23 @@ var X = window.X || {
|
||||
$('.zhuanghu_ss .qingkomg').show();
|
||||
for(let i in data){
|
||||
var Categoryarr =[];
|
||||
for(let j in data[i]['Category']){
|
||||
if(data[i]['Category'][j]['title'].indexOf(tit) != -1){
|
||||
Categoryarr.push(data[i]['Category'][j]);
|
||||
for(let j in data[i]['category']){
|
||||
if(data[i]['category'][j]['title'].indexOf(tit) != -1){
|
||||
Categoryarr.push(data[i]['category'][j]);
|
||||
}
|
||||
}
|
||||
if(Categoryarr.length > 0){
|
||||
var arr = {
|
||||
'title':data[i]['title'],
|
||||
'id':data[i]['id'],
|
||||
'Category':Categoryarr
|
||||
'category':Categoryarr
|
||||
}
|
||||
arrData.push(arr);
|
||||
}
|
||||
}
|
||||
// $("#zhuang-conetnt-dot").html("");
|
||||
|
||||
console.log(data);
|
||||
console.log(arrData)
|
||||
X.laytpldata("#zhuang-conetnt-dot",arrData,'.zhuang_conetnt ');
|
||||
}else {
|
||||
$('.zhuanghu_ss .qingkomg').hide();
|
||||
@ -3825,6 +3900,7 @@ var X = window.X || {
|
||||
// console.log(d);
|
||||
X.api("ck/"+d['model']+"_model","post",{report_id:d['report_id']},function(val){
|
||||
var eventdata=[];
|
||||
var data;
|
||||
if(d['model'] == "event"){
|
||||
// 事件分析
|
||||
if(d['graph_size'] == 'small'){
|
||||
@ -3907,6 +3983,29 @@ var X = window.X || {
|
||||
eventdata.push(data);
|
||||
})
|
||||
}
|
||||
}else if(d['model'] == 'user_property'){
|
||||
// 属性分析
|
||||
if(d['graph_type'] == 'table'){
|
||||
X.userpropertytable(val,function(data){
|
||||
data['name'] = d['name'];
|
||||
data['modeltype'] = d['graph_type'];
|
||||
data['id'] = d['report_id'];
|
||||
data['modelsize'] = d['graph_size'];
|
||||
data['cat'] = d['model'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else {
|
||||
X.userpropertychart(val,function(data){
|
||||
data['name'] = d['name'];
|
||||
data['modeltype'] = d['graph_type'];
|
||||
data['id'] = d['report_id'];
|
||||
data['modelsize'] = d['graph_size'];
|
||||
data['cat'] = d['model'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(eventdata.length > 0){
|
||||
for(var z in eventdata){
|
||||
@ -4490,11 +4589,10 @@ var X = window.X || {
|
||||
|
||||
// 时间粒度
|
||||
var timeParticleSizearr = [
|
||||
{'title':'当日','id':'1'},
|
||||
{'title':'次日','id':'2'},
|
||||
{'title':'7日','id':'7'},
|
||||
{'title':'14日','id':'14'},
|
||||
{'title':'30日','id':'30'},
|
||||
{'title':'按天','id':'P1D'},
|
||||
{'title':'按周','id':'P1W'},
|
||||
{'title':'按月','id':'P1M'},
|
||||
{'title':'合计','id':'total'}
|
||||
]
|
||||
X.laydropdown('.analtsis-timeParticleSize',timeParticleSizearr,function(d){
|
||||
// console.log(d);
|
||||
@ -7315,8 +7413,8 @@ var X = window.X || {
|
||||
var arr = [];
|
||||
arr.push(id);
|
||||
X.api("authz/add_policy",'post',{role_id:role_id,game:X['DATA']['game'],path_list:arr,act:"*"},function(d){
|
||||
layer.msg('添加成功');
|
||||
layer.close(layer.index);
|
||||
layer.msg('添加成功');
|
||||
updataapiinfo(role_id);
|
||||
})
|
||||
});
|
||||
|
@ -678,6 +678,18 @@ var X = window.X || {
|
||||
callback && callback(dataArr);
|
||||
};
|
||||
|
||||
X.userpropertytable=function(data,callback){
|
||||
var dataArr = {
|
||||
titledata:data.title,
|
||||
condata:data.value
|
||||
}
|
||||
callback && callback(dataArr);
|
||||
};
|
||||
|
||||
X.userpropertychart=function(data,callback){
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 分组项
|
||||
// X.grouped=function(data,id){
|
||||
|
@ -61,7 +61,8 @@
|
||||
var startmonth = Date.parse(startdate)/1000;
|
||||
data['eventView']['e_days'] = parseInt((sameday - endmonth)/86400);
|
||||
data['eventView']['s_days'] = parseInt((sameday - startmonth)/86400);
|
||||
console.log(data);
|
||||
console.log(parseInt((sameday - endmonth)/86400));
|
||||
console.log(parseInt((sameday - startmonth)/86400));
|
||||
// calculationdata();
|
||||
})
|
||||
|
||||
|
@ -24,21 +24,22 @@
|
||||
"quotatype":"",
|
||||
"relation":"and",
|
||||
"tableType":"user"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cachedata":{}
|
||||
};
|
||||
|
||||
// 分析属性控制重命名
|
||||
$(document).off('click','.analysis-chongmingming').on('click','.analysis-chongmingming',function(){
|
||||
$('.analysis-con-left-screen-list-left-zhibiaoname').show();
|
||||
$(this).hide();
|
||||
$('.analysis-chongmingming-del').show();
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-chongmingming-del').on('click','.analysis-chongmingming-del',function(){
|
||||
$('.analysis-con-left-screen-list-left-zhibiaoname').hide();
|
||||
$(this).hide();
|
||||
$('.analysis-chongmingming').show();
|
||||
})
|
||||
});
|
||||
|
||||
//用户属性数据请求
|
||||
var user_attr = [];
|
||||
@ -83,7 +84,16 @@
|
||||
filter_map = val;
|
||||
})
|
||||
|
||||
})
|
||||
//从数据看板点击进来触发事件
|
||||
if(X.DATA.user_property && X.DATA.user_property != ''){
|
||||
var report_idarr = [];
|
||||
report_idarr.push(X.DATA.user_property);
|
||||
X.api('report/read_report','post',{project_id:X.DATA.projectid,report_id:report_idarr},function(d){
|
||||
backfilldata(d[0]);
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// sql语句显示
|
||||
$(document).off('click','.sqlquery').on('click','.sqlquery',function(){
|
||||
@ -92,7 +102,7 @@
|
||||
X.querycriteriapop(data,'conditionquery',offset.left - 410,offset.top+obj.height(),function(){
|
||||
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
// 分析属性
|
||||
$(document).off('click','.ant-dropdown-trigger').on('click','.ant-dropdown-trigger',function(){
|
||||
@ -112,7 +122,7 @@
|
||||
$('.analysis-choicetypename').html(quotas_map[val.data_type][0]['title']);
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-choicetypename').on('click','.analysis-choicetypename',function(){
|
||||
var obj = $(this);
|
||||
@ -123,12 +133,12 @@
|
||||
data['events']['analysisDesc'] = val.title;
|
||||
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-con-left-screen-list-left-zhibiaoname input').on('blur','.analysis-con-left-screen-list-left-zhibiaoname input',function(){
|
||||
// console.log($(this).val());
|
||||
data['events']['eventNameDisplay'] = $(this).val();
|
||||
})
|
||||
});
|
||||
|
||||
// 分组项
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
@ -147,7 +157,7 @@
|
||||
$(this).hide();
|
||||
}
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-action-right').on('click','.analysis-action-right',function(){
|
||||
var index = $(this).attr('data-index');
|
||||
@ -156,7 +166,7 @@
|
||||
$(".analysis-footadd___2D4YB").show();
|
||||
}
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-ant-dropdown-trigger').on('click','.analysis-ant-dropdown-trigger',function(){
|
||||
var obj = $(this);
|
||||
@ -170,7 +180,7 @@
|
||||
data['eventView']['groupBy'][index]['data_type'] = val.type;
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-ta-property-range').on('click','.analysis-ta-property-range',function(){
|
||||
var index = $(this).attr('data-index');
|
||||
@ -181,7 +191,7 @@
|
||||
data['eventView']['groupBy'][index]['quotaIntervalArr'] = val.quotaIntervalArr;
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
//且用户符合
|
||||
$(document).off('click','.analysis-overall-situation-add').on('click','.analysis-overall-situation-add',function(){
|
||||
@ -205,7 +215,7 @@
|
||||
$(".analysis-overall-situation-left-guanxi").hide();
|
||||
}
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-left-guanxi').on('click',".analysis-overall-situation-left-guanxi",function(){
|
||||
var tit = $(this).html();
|
||||
@ -216,7 +226,7 @@
|
||||
$(this).html('且');
|
||||
data['events']['relation'] = 'and';
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-attr').on('click','.analysis-overall-situation-attr',function(){
|
||||
var obj = $(this);
|
||||
@ -230,7 +240,7 @@
|
||||
data['events']['filts'][index]['data_type'] = val.type;
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-fuhao').on('click','.analysis-overall-situation-fuhao',function(){
|
||||
var obj = $(this);
|
||||
@ -247,7 +257,7 @@
|
||||
}
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-input input').on('blur','.analysis-overall-situation-input input',function(){
|
||||
var val = $(this).val();
|
||||
@ -255,7 +265,7 @@
|
||||
var index = $(this).attr("data-index");
|
||||
data['events']['filts'][index]['strftv'] = val;
|
||||
data['events']['filts'][index]['ftv'] = titarr;
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-input2 input').on('blur','.analysis-overall-situation-input2 input',function(){
|
||||
var name = $(this).attr('name');
|
||||
@ -267,7 +277,7 @@
|
||||
}else {
|
||||
data['events']['filts'][index]['ftv'][1] = val;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$(document).off('click','.analysis-overall-situation-del').on('click','.analysis-overall-situation-del',function(){
|
||||
var index = $(this).attr('data-index');
|
||||
@ -278,24 +288,34 @@
|
||||
$(".analysis-overall-situation-left-guanxi").hide();
|
||||
}
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
})
|
||||
});
|
||||
|
||||
// 计算按钮
|
||||
$(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
|
||||
calculationdata();
|
||||
});
|
||||
|
||||
X.api("ck/user_property_model","post",data,function(val){
|
||||
function calculationdata(){
|
||||
data['cachedata']['user_attr'] = user_attr;
|
||||
data['cachedata']['quotas_map'] = quotas_map;
|
||||
data['cachedata']['filter_map'] = filter_map;
|
||||
data['cachedata']['user_data'] = user_data;
|
||||
var dataArr = {
|
||||
eventView: data.eventView,
|
||||
events: data.events
|
||||
}
|
||||
X.api("ck/user_property_model","post",dataArr,function(val){
|
||||
attributetable(val);
|
||||
querydata = val;
|
||||
updata(val)
|
||||
})
|
||||
|
||||
})
|
||||
};
|
||||
|
||||
function updata(d){
|
||||
var title = $(".select-chart").attr("title");
|
||||
if(title == '柱状分布图'){ attributebar(d);}
|
||||
else if(title == '饼状图'){ attributepie(d); }
|
||||
}
|
||||
};
|
||||
|
||||
var querydata;
|
||||
$(document).off('click','.analtsis-chart-switch').on('click','.analtsis-chart-switch',function(){
|
||||
@ -309,12 +329,12 @@
|
||||
}else{
|
||||
layer.msg('请先计算数据,在切换图表');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
function attributetable(val){
|
||||
X.laytpldata("#table-attrbute-th-dot",val.title,".table-attrbute-th");
|
||||
X.laytpldata("#table-attrbute-td-dot",val.value,".table-attrbute-td");
|
||||
}
|
||||
};
|
||||
|
||||
function attributebar(val){
|
||||
|
||||
@ -363,7 +383,7 @@
|
||||
}]
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
}
|
||||
};
|
||||
|
||||
function attributepie(val){
|
||||
// console.log(val);
|
||||
@ -403,6 +423,47 @@
|
||||
]
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
};
|
||||
|
||||
//已存报表
|
||||
var baobiaodata;
|
||||
$(document).off('click','.analysis-navigation-bar-right-img-baobiao').on('click','.analysis-navigation-bar-right-img-baobiao',function(){
|
||||
X.parametersopen(data['eventView']['cksql'],'savedbaobiao','rt',function(d){
|
||||
if(d){
|
||||
backfilldata(d)
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 保存报表
|
||||
$(document).off('click','.analysis-savereport').on('click','.analysis-savereport',function(){
|
||||
if(baobiaodata != '' && baobiaodata != undefined && baobiaodata != null){
|
||||
X.parametersopen(baobiaodata,'savereport','auto');
|
||||
}else{
|
||||
X.parametersopen(data,'savereport','auto');
|
||||
}
|
||||
});
|
||||
|
||||
// 反向填充数据
|
||||
function backfilldata(d){
|
||||
data = d.query;
|
||||
console.log(d);
|
||||
|
||||
user_attr = data.cachedata.user_attr;
|
||||
quotas_map = data.cachedata.quotas_map;
|
||||
filter_map = data.cachedata.filter_map;
|
||||
user_data = data.cachedata.user_data;
|
||||
|
||||
baobiaodata = d;
|
||||
|
||||
// if(d.query.eventView.filts.length > 0){
|
||||
// $(".analysis-overall").show();
|
||||
// }else {
|
||||
// $(".analysis-overall").hide();
|
||||
// }
|
||||
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
calculationdata();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -20,22 +20,23 @@
|
||||
$('.zhuanghu_ss .qingkomg').show();
|
||||
for(let i in data){
|
||||
var Categoryarr =[];
|
||||
for(let j in data[i]['Category']){
|
||||
if(data[i]['Category'][j]['title'].indexOf(tit) != -1){
|
||||
Categoryarr.push(data[i]['Category'][j]);
|
||||
for(let j in data[i]['category']){
|
||||
if(data[i]['category'][j]['title'].indexOf(tit) != -1){
|
||||
Categoryarr.push(data[i]['category'][j]);
|
||||
}
|
||||
}
|
||||
if(Categoryarr.length > 0){
|
||||
var arr = {
|
||||
'title':data[i]['title'],
|
||||
'id':data[i]['id'],
|
||||
'Category':Categoryarr
|
||||
'category':Categoryarr
|
||||
}
|
||||
arrData.push(arr);
|
||||
}
|
||||
}
|
||||
// $("#zhuang-conetnt-dot").html("");
|
||||
|
||||
console.log(data);
|
||||
console.log(arrData)
|
||||
X.laytpldata("#zhuang-conetnt-dot",arrData,'.zhuang_conetnt ');
|
||||
}else {
|
||||
$('.zhuanghu_ss .qingkomg').hide();
|
||||
|
@ -344,6 +344,7 @@
|
||||
// console.log(d);
|
||||
X.api("ck/"+d['model']+"_model","post",{report_id:d['report_id']},function(val){
|
||||
var eventdata=[];
|
||||
var data;
|
||||
if(d['model'] == "event"){
|
||||
// 事件分析
|
||||
if(d['graph_size'] == 'small'){
|
||||
@ -426,6 +427,29 @@
|
||||
eventdata.push(data);
|
||||
})
|
||||
}
|
||||
}else if(d['model'] == 'user_property'){
|
||||
// 属性分析
|
||||
if(d['graph_type'] == 'table'){
|
||||
X.userpropertytable(val,function(data){
|
||||
data['name'] = d['name'];
|
||||
data['modeltype'] = d['graph_type'];
|
||||
data['id'] = d['report_id'];
|
||||
data['modelsize'] = d['graph_size'];
|
||||
data['cat'] = d['model'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else {
|
||||
X.userpropertychart(val,function(data){
|
||||
data['name'] = d['name'];
|
||||
data['modeltype'] = d['graph_type'];
|
||||
data['id'] = d['report_id'];
|
||||
data['modelsize'] = d['graph_size'];
|
||||
data['cat'] = d['model'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(eventdata.length > 0){
|
||||
for(var z in eventdata){
|
||||
|
@ -316,11 +316,10 @@
|
||||
|
||||
// 时间粒度
|
||||
var timeParticleSizearr = [
|
||||
{'title':'当日','id':'1'},
|
||||
{'title':'次日','id':'2'},
|
||||
{'title':'7日','id':'7'},
|
||||
{'title':'14日','id':'14'},
|
||||
{'title':'30日','id':'30'},
|
||||
{'title':'按天','id':'P1D'},
|
||||
{'title':'按周','id':'P1W'},
|
||||
{'title':'按月','id':'P1M'},
|
||||
{'title':'合计','id':'total'}
|
||||
]
|
||||
X.laydropdown('.analtsis-timeParticleSize',timeParticleSizearr,function(d){
|
||||
// console.log(d);
|
||||
|
@ -65,8 +65,8 @@
|
||||
var arr = [];
|
||||
arr.push(id);
|
||||
X.api("authz/add_policy",'post',{role_id:role_id,game:X['DATA']['game'],path_list:arr,act:"*"},function(d){
|
||||
layer.msg('添加成功');
|
||||
layer.close(layer.index);
|
||||
layer.msg('添加成功');
|
||||
updataapiinfo(role_id);
|
||||
})
|
||||
});
|
||||
|
@ -132,7 +132,9 @@
|
||||
.control { height: 21px; display: none; }
|
||||
.tool-show .control { display: block; }
|
||||
|
||||
.table-box { margin: 10px 24px 0 24px; height: 283px; overflow-x: auto; }
|
||||
.table-box { margin: 10px 24px 0 24px; height: 283px; overflow-x: auto; overflow-y: hidden; }
|
||||
.table-tbody-box { height: 283px; overflow-x: auto; overflow-y: auto; }
|
||||
.table-thead { }
|
||||
|
||||
.layui-table-body { height: 242px; overflow: auto; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user