diff --git a/web/pages/savedbaobiao.html b/web/pages/savedbaobiao.html
index eeb2a74..f1e62c3 100644
--- a/web/pages/savedbaobiao.html
+++ b/web/pages/savedbaobiao.html
@@ -14,7 +14,7 @@
-
+
diff --git a/web/pages/sqlquery.html b/web/pages/sqlquery.html
new file mode 100644
index 0000000..85c81aa
--- /dev/null
+++ b/web/pages/sqlquery.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ SQL查询
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+ 序号 |
+ group_0 |
+ data_map_0 |
+ total_amount |
+ group_num |
+
+
+
+
+ 1 |
+ 10001->0~150 |
+ {2021-06-20 00:00:00.000=102074.0, 2021-06-19 00:00:00.000=99475.0, 2021-06-18 00:00:00.000=95836.0, 2021-06-17 00:00:00.000=97811.0, 2021-06-30 00:00:00.000=84835.0, 2021-06-14 00:00:00.000=114416.0, 2021-06-15 00:00:00.000=102522.0, 2021-06-16 00:00:00.000=99453.0, 2021-07-06 00:00:00.000=79581.0, 2021-07-04 00:00:00.000=83007.0, 2021-07-03 00:00:00.000=86494.0, 2021-06-12 00:00:00.000=109462.0, 2021-06-13 00:00:00.000=110534.0, 2021-06-10 00:00:00.000=104465.0, 2021-06-29 00:00:00.000=87856.0, 2021-07-05 00:00:00.000=79524.0, 2021-06-11 00:00:00.000=105071.0, 2021-06-24 00:00:00.000=79070.0, 2021-06-23 00:00:00.000=84739.0, 2021-06-21 00:00:00.000=89720.0, 2021-06-26 00:00:00.000=78439.0, 2021-06-27 00:00:00.000=83172.0, 2021-06-09 00:00:00.000=109536.0, 2021-06-28 00:00:00.000=79058.0, 2021-06-22 00:00:00.000=89580.0, 2021-07-01 00:00:00.000=76888.0, 2021-07-02 00:00:00.000=79507.0, 2021-06-08 00:00:00.000=120262.0, 2021-06-07 00:00:00.000=108156.0, 2021-06-25 00:00:00.000=78684.0} |
+ 2799227.0 |
+ 2 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/src/x.min.js b/web/src/x.min.js
index 73a1bd6..fa1c140 100644
--- a/web/src/x.min.js
+++ b/web/src/x.min.js
@@ -96,29 +96,7 @@ var X = window.X || {
{'title': "UTC±00:00",id:0}
],
'analysis':{
- 'type1':[
- {"title":'全部','id':'0','Category':[]},
- {
- 'title':'事件属性',
- 'id':'1',
- 'Category':[
- {'title':'时间偏移','id':'10','type':'string'},
- {'title':'区服ID','id':'11','type':'string'},
- {'title':'来源渠道','id':'12','type':'string'},
- {'title':'VIP等级','id':'13','type':'string'},
- ]
- },
- {
- 'title':'用户属性',
- 'id':'2',
- 'Category':[
- {'title':'账户ID','id':'14','type':'string'},
- {'title':'访客ID','id':'15','type':'string'},
- {'title':'注册时间','id':'16','type':'time'},
- {'title':'来源渠道','id':'17','type':'time'},
- ]
- },
- ]
+
}
},
};
@@ -389,7 +367,7 @@ var X = window.X || {
]
},
"alwaysShowCalendars": true,
- "startDate": moment().subtract(29, 'days'),
+ "startDate": moment().subtract(7, 'days'),
"endDate": new Date(),
"opens": "right",
@@ -572,15 +550,15 @@ var X = window.X || {
})();
// srczip/base/visibleChange.js
(function(){
- /*
- $('.table').visibleChange(function(isShow){
- if(isShow==1){
- //被看见了
- }else{
- //看不见了
- }
- });
- */
+
+ // $('.table').visibleChange(function(isShow){
+ // if(isShow==1){
+ // //被看见了
+ // }else{
+ // //看不见了
+ // }
+ // });
+
var observer = new IntersectionObserver(function(changes){
changes.forEach(function(item,index){
var callback = $(item.target).data('_visibleChangeCall');
@@ -1974,6 +1952,7 @@ var X = window.X || {
$(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
console.log(data);
calculationdata();
+
})
var querydata;//查询数据
@@ -2267,10 +2246,23 @@ var X = window.X || {
//表格
function tabledata(d){
console.log(d);
- // var titledata=d[0]['date_range'];
- // titledata.unshift('指标','阶段总和')
- // X.laytpldata("#table-fenxi-th-dot",titledata,".table-fenxi-th");
- // X.laytpldata("#table-fenxi-td-dot", ,".table-fenxi-td");
+ var titledata,condata = [];
+ for(let i in d){
+ if(d[i]['groups']['length'] == 0){
+ titledata= $.extend(true,[],d[0]['date_range']) ;
+ titledata.unshift('指标','阶段总和');
+ condata.push(d[i].values[0]);
+ condata[i].unshift(d[i]['event_name'],d[i]['sum']);
+ // console.log(condata);
+ }else {
+
+ }
+ }
+ console.log(titledata);
+ console.log(condata);
+
+ X.laytpldata("#table-fenxi-th-dot",titledata,".table-fenxi-th");
+ X.laytpldata("#table-fenxi-td-dot",condata ,".table-fenxi-td");
}
function calculationdata(){
@@ -2288,6 +2280,7 @@ var X = window.X || {
querydata = d;
if(d[0].values.length > 0 ){
updata();
+ tabledata(d);
// stackingdiagram(d);
// tabledata(d);
}else {
@@ -2831,10 +2824,10 @@ var X = window.X || {
var data ={
"eventView":{
"cksql":"scatter",
- "endTime":"2021-06-20 23:59:59",
+ "endTime":"",
"groupBy":[],
"recentDay":"1-7",
- "startTime":"2021-06-14 00:00:00",
+ "startTime":"",
"timeParticleSize":"P1D"
},
"events":[
@@ -2868,6 +2861,11 @@ var X = window.X || {
distributiondata();
})
+ var time = $("#retained-condition-date").val();
+ var timearr = time.split(" ");
+ data['eventView']['startTime'] = timearr[0] + " "+"00:00:00";
+ data['eventView']['endTime'] = timearr[2]+" "+"23:59:59";
+
$(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){
console.log(d);
@@ -4331,7 +4329,7 @@ var X = window.X || {
var data = []
}
- console.log(111,data);
+ // console.log(111,data);
X.laytpldata("#analysis-overall-situation-list-box-dot",data,"#xinwei-whole");
@@ -4371,6 +4369,7 @@ var X = window.X || {
{title:'离散数字',id:'discrete',checked:false},
{title:'自定义区间',id:'user_defined',checked:false},
]
+ console.log(data);
if(data!= ''){
for(let i in arr){
if(arr[i]['id'] == data['intervalType']){
@@ -5045,12 +5044,13 @@ var X = window.X || {
X.laytpldata("#judge-box-dot",data.list,".setgrouping-box2 .setgrouping-content-box2");
layui.form.render();
- if( data.select && Object.keys(data.select).length > 0){
- var select = Object.keys(data['select'])
+ if( data.select && data.select.length > 0){
+ var select = data['select'];
var selectdata = {};
for(let i in select){
- selectdata[select[i]] = true;
+ selectdata["like["+select[i]+"]"] = true;
}
+ console.log(selectdata);
layui.form.val('participateexample', selectdata);
}
@@ -5094,6 +5094,7 @@ var X = window.X || {
layui.form.on('checkbox(checkboxexample)', function(){
var data = layui.form.val('participateexample');
+ console.log(data);
if(Object.keys(data).length >= 30){
$(this).prop("checked", false);
}
@@ -6186,18 +6187,19 @@ var X = window.X || {
X.pageLogic['routeanalysis'] = {
init : function(){
var eventdata = {};
+ var filtsftvdata =[];
X.api("data_auth/my_event","get",{},function(d){
eventdata['list'] = d;
})
var data = {
"eventView":{
+ "cksql":'trace',
"col_limit":10,
- "startTime":"2021-06-22 00:00:00",
- "recent_day":"1-7",
+ "startTime":"",
"session_interval":30,
"session_type":"minute",
- "endTime":"2021-06-28 23:59:59"
+ "endTime":""
},
"events":{
"by_fields":[
@@ -6205,9 +6207,10 @@ var X = window.X || {
],
"event_names":[],
"source_event":{
- "event_name":"complete_activity",
- "event_Desc":"complete_activity",
+ "eventName":"",
+ "eventDesc":"",
"source_type":"initial_event",
+ "source_type_name":"初始事件",
"filts": [],
"relation":'and'
},
@@ -6215,18 +6218,26 @@ var X = window.X || {
"filterType":"COMPOUND",
"filts":[]
}
+ },
+ "cachedata":{
+ "event_names":[],
+ "groupitemeventsdata":[],
+ "filtsftvdata":[]
}
}
+
X.template("route","event-roue-event",data['events']['source_event']);
- // 日期渲染
- X.daterender("#route-condition-date",function(start, end, label){
+ // 日期渲染
+ X.daterender("#route-condition-date",function(start, end, label){
var startTime = start.format('YYYY-MM-DD')+ " "+ "00:00:00";
var endTime = end.format('YYYY-MM-DD')+ " "+ "23:59:59";
data['eventView']['startTime'] = startTime;
data['eventView']['endTime'] = endTime;
- retaineddata();
+ X.api("ck/trace_model","post",data,function(d){
+ routeanalysisdata(d);
+ })
})
var time = $("#route-condition-date").val();
@@ -6245,7 +6256,9 @@ var X = window.X || {
"fieDesc":"rmbmoney",
"range":"",
"range_type":"def",
- "table_type":"event"
+ "tableType":"event",
+ "intervalType":"",
+ "quotaIntervalArr":""
};
data['events']['by_fields'].push(arr);
X.laytpldata("#eventsplit-box-dot",data['events']['by_fields'],".eventsplit-box");
@@ -6270,13 +6283,14 @@ var X = window.X || {
var offset = obj.offset();
X.querycriteriapop(eventdata,'participate',offset.left,offset.top+obj.height(),function(val){
var selectdata = []; //选中事件的id数组
+ X.DATA['routeevent'] = [];
// var selectdescdata = []; //选中事件的别名数组
for(let i in val){
selectdata.push(val[i]['event_name']);
// selectdescdata.push(val[i]['event_desc']);
}
eventdata['select'] = selectdata;
- data['event_names'] = selectdata;
+ data['events']['event_names'] = selectdata;
$('.participate-num').html(selectdata.length);
for(let i in val){
@@ -6291,8 +6305,17 @@ var X = window.X || {
X.DATA['routeevent'].push(arr);
}
}
+ data['events']['source_event']['eventName'] = X.DATA['routeevent'][0]['id'];
+ data['events']['source_event']['eventDesc'] = X.DATA['routeevent'][0]['title'];
+ X.template("route","event-roue-event",data['events']['source_event']);
+
+ X.api("data_auth/load_filter_props","post",{event_name:val[0]['event_name']},function(val){
+ // defaultgroupdata = val;
+ groupitemeventsdata.push(val);
+ })
})
})
+
var groupitemeventsdata = [];
$(document).off('click','.route-ant-select-selector1').on('click','.route-ant-select-selector1',function(){
var obj = $(this);
@@ -6335,50 +6358,35 @@ var X = window.X || {
var obj = $(this);
var offset = obj.offset();
var index = obj.attr('data-index');
-
X.querycriteriapop(filteringdata(),'category',offset.left,offset.top+obj.height(),function(val){
console.log(val);
obj.html(val.title);
- // data['events']['by_fields'][index]['eventDesc'] = val.title;
- // data['events']['by_fields'][index]['eventName'] = val.id;
+ data['events']['by_fields'][index]['eventDesc'] = val.title;
+ data['events']['by_fields'][index]['eventName'] = val.id;
})
})
- $(document).off('click','.analysis-overall-situation-add').on('click','.analysis-overall-situation-add',function(){
- var drr={
- "columnName":'asdasd',//事件中文显示
- "column_id":'asdasd',//事件id
- 'data_type':'asdasd',//类型
- 'comparator_name':'等于',//默认等于
- "comparator_id":'==',//符号id
- "ftv":[],//条件
- "strftv":'',//显示条件
- "section":[-1,1],//区间
- "table_type":'asdasd'
- };
- data['events']['user_filter']['filts'].push(drr);
- if(data['events']['user_filter']['filts'].length > 1){
- $(".analysis-overall-situation-left-guanxi").show();
- }else{
- $(".analysis-overall-situation-left-guanxi").hide();
- }
- X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts'],function(){
- // analysisdown();
- });
+ $(document).off('click','.userevent-granularity').on('click','.userevent-granularity',function(){
+ var index = $(this).attr('data-index');
+ var sectionid = data['events']['by_fields'][index];
+ console.log(sectionid);
+ X.parametersopen(sectionid,'groupeditemspop',"auto",function(val){
+ data['events']['by_fields'][index]['intervalType'] = val.type;
+ if(val.type == "user_defined"){
+ data['events']['by_fields'][index]['quotaIntervalArr'] = val.quotaIntervalArr;
+ }
+ })
})
$(document).off('click','.analysis-overall-situation-del').on('click','.analysis-overall-situation-del',function(){
var index = $(this).attr('data-index');
data['events']['user_filter']['filts'].splice(index,1);
- // filtsftvdata.splice(index,1);
+ filtsftvdata.splice(index,1);
if(data['events']['user_filter']['filts'].length > 1){
$(".analysis-overall-situation-left-guanxi").show();
}else{
$(".analysis-overall-situation-left-guanxi").hide();
}
- X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts'],function(){
- // analysisdown();
- });
})
$(document).off('click','.analysis-shaix-initial-event').on('click','.analysis-shaix-initial-event',function(){
@@ -6390,8 +6398,9 @@ var X = window.X || {
})
// 添加筛选项
+ var filtersymbols = [];
function addscreen(index){
- X.api('data_auth/load_filter_props',"post",{event_name:data['events']['source_event']["event_name"]},function(d){
+ X.api('data_auth/load_filter_props',"post",{event_name:data['events']['source_event']["eventName"]},function(d){
var arr = {
"columnDesc":d[0]['category'][0]['title'],//事件中文显示
"columnName":d[0]['category'][0]['id'],//事件id
@@ -6405,7 +6414,7 @@ var X = window.X || {
data['events']['source_event']['filts'].push(arr);
X.template("route","event-roue-event",data['events']['source_event']); //更新事件
// screentypearr[index] = d;
- // filtersymbols.push(d[0]['category'][0]["category"]);
+ filtersymbols.push(d[0]['category'][0]["category"]);
})
}
@@ -6419,6 +6428,275 @@ var X = window.X || {
}
})
+ $(document).off('click','.ant-dropdown-trigger').on('click','.ant-dropdown-trigger',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ X.querycriteriapop(X.DATA['routeevent'],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ obj.html(val.title);
+ data['events']['source_event']['eventDesc']= val.title;
+ data['events']['source_event']['eventName'] = val.id;
+ X.api("data_auth/load_filter_props","post",{event_name:val.id},function(val){
+ console.log(val);
+ // defaultgroupdata = val;
+ groupitemeventsdata.push(val);
+ })
+ })
+ })
+
+ $(document).off('click','.analysis-zhibiao-list-type2').on('click','.analysis-zhibiao-list-type2',function(){
+ var eventdata = [
+ {'title':'初始事件','id':'initial_event'},
+ {'title':'结束事件','id':'termination_event'}
+ ]
+ var obj = $(this);
+ var offset = obj.offset();
+ X.querycriteriapop(eventdata,'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ obj.html(val.title);
+ // data['events']['source_event']['source_type_name']= val.title;
+ data['events']['source_event']['source_type'] = val.id;
+
+ })
+ })
+
+ $(document).off("click",".ta-property-select").on('click','.ta-property-select',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ var indexs = obj.attr("data-indexs");
+ X.querycriteriapop(filteringdata(),'category',offset.left,offset.top+obj.height(),function(val){
+ obj.html(val.title);
+ filtersymbols[indexs] = val.category;
+ data['events']['source_event']['filts'][indexs]['columnDesc'] = val.title;
+ data['events']['source_event']['filts'][indexs]['columnName'] = val.id;
+ data['events']['source_event']['filts'][indexs]['data_type'] = val.type;
+ data['events']['source_event']['filts'][indexs]['tableType'] = val.table_type;
+ })
+ })
+
+ $(document).off('click','.analysis-choicetypename').on('click','.analysis-choicetypename',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ var indexs = $(this).attr("data-indexs");
+ X.querycriteriapop(filtersymbols[indexs],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ if(val != undefined){
+ obj.html(val.title);
+ data['events']['source_event']['filts'][indexs]['comparator_name'] = val.title;
+ data['events']['source_event']['filts'][indexs]['comparator'] = val.id;
+ X.template("userpar","userpar-event",data['events']);
+ }
+ })
+ })
+
+ $(document).off('click','.analysis-zhibiao-list-type4 input').on('blur','.analysis-zhibiao-list-type4 input',function(){
+ var indexs = $(this).attr("data-indexs");
+ var val = $(this).val();
+ var valarr = val.split(",");
+ data['events']['source_event']['filts'][indexs]['ftv']=valarr;
+ data['events']['source_event']['filts'][indexs]['strftv']=val;
+ })
+
+ $(document).off('click','.analysis-overall-situation-add').on('click','.analysis-overall-situation-add',function(){
+ var screentypedata = filteringdata();
+ if(!screentypedata) {alert('请先选择参与分析事件'); return;}
+ var drr={
+ "columnName":screentypedata[0]['category'][0]['title'],//事件中文显示
+ "column_id":screentypedata[0]['category'][0]['id'],//事件id
+ 'data_type':screentypedata[0]['category'][0]['data_type'],//类型
+ 'comparator_name':'等于',//默认等于
+ "comparator_id":'==',//符号id
+ "ftv":[],//条件
+ "strftv":'',//显示条件
+ "section":[-1,1],//区间
+ "table_type":screentypedata[0]['id']
+ };
+ data['events']['user_filter']['filts'].push(drr);
+ filtsftvdata.push(screentypedata[0]['category'][0]['category']);
+ if(data['events']['user_filter']['filts'].length > 1){
+ $(".analysis-overall-situation-left-guanxi").show();
+ }else{
+ $(".analysis-overall-situation-left-guanxi").hide();
+ }
+ X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts']);
+
+ })
+
+ $(document).off('click','.analysis-overall-situation-attr').on('click','.analysis-overall-situation-attr',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ var index = $(this).attr("data-index");
+ X.querycriteriapop(filteringdata(),'category',offset.left,offset.top+obj.height(),function(val){
+ obj.html(val.title);
+ data['events']['user_filter']['filts'][index]['columnName'] = val.title;
+ data['events']['user_filter']['filts'][index]['column_id'] = val.id;
+ data['events']['user_filter']['filts'][index]['data_type'] = val.type;
+ data['events']['user_filter']['filts'][index]['tableType'] = val.table_type;
+ filtsftvdata[index] = val.category;
+ })
+ })
+
+ $(document).off('click','.analysis-overall-situation-fuhao').on('click','.analysis-overall-situation-fuhao',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ var index = $(this).attr("data-index");
+ X.querycriteriapop(filtsftvdata[index],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ if(val != undefined){
+ obj.html(val.title);
+ data['events']['user_filter']['filts'][index]['comparator_name'] = val.title;
+ data['events']['user_filter']['filts'][index]['comparator_id'] = val.id;
+ if(val.id == "range"){
+ data['events']['user_filter']['filts'][index]['ftv'] = [-1,1];
+ }
+ X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts']);
+ }
+ })
+ })
+ $(document).off('click','.analysis-overall-situation-input input').on('blur','.analysis-overall-situation-input input',function(){
+ var val = $(this).val();
+ var index = $(this).attr("data-index");
+ data['events']['user_filter']['filts'][index]['strftv'] = val;
+ })
+
+ $(document).off('click','.analysis-overall-situation-input2 input').on('blur','.analysis-overall-situation-input2 input',function(){
+ var name = $(this).attr('name');
+ var val = $(this).val();
+ var index = $(this).attr("data-index");
+
+ if(name == 'start'){
+ data['events']['user_filter']['filts'][index]['ftv'][0] = val;
+ data['events']['user_filter']['filts'][index]['section'][0] = val;
+ }else {
+ data['events']['user_filter']['filts'][index]['ftv'][1] = val;
+ data['events']['user_filter']['filts'][index]['section'][1] = val;
+ }
+ })
+
+ // 时间粒度
+ var timeParticleSizearr = [
+ {'title':'秒','id':'second'},
+ {'title':'分钟','id':'minute'},
+ {'title':'小时','id':'hour'},
+ ]
+ X.laydropdown('.route-condition',timeParticleSizearr,function(d){
+ console.log(d);
+ $(".route-condition").html(d.title);
+ data['eventView']['session_type'] = parseInt(d.id);
+ })
+
+ $(document).off('click','.analysis-con-left-screen-box2 input').on('blur','.analysis-con-left-screen-box2',function(){
+ data['eventView']['session_interval'] =parseInt($('.analysis-con-left-screen-box2 input').val());
+ })
+
+ //计算按钮
+ $(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
+ calculationdata();
+ });
+
+
+ function calculationdata(){
+ data['cachedata']['event_names'] = X['DATA']['routeevent'];
+ data['cachedata']['groupitemeventsdata'] = groupitemeventsdata;
+ data['cachedata']['filtsftvdata'] = filtsftvdata;
+ var dataArr = {
+ eventView: data.eventView,
+ events: data.events
+ }
+ X.api("ck/trace_model","post",dataArr,function(d){
+ routeanalysisdata(d);
+ })
+ }
+
+ // sql语句显示
+ $(document).off('click','.sqlquery').on('click','.sqlquery',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ X.querycriteriapop(data,'conditionquery',offset.left - 410,offset.top+obj.height(),function(){
+
+ })
+ })
+
+ $(document).off('click','.analysis-savereport').on('click','.analysis-savereport',function(){
+ X.parametersopen(data,'savereport','auto')
+ })
+
+ $(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){
+ console.log(d);
+ if(d){
+ data = d.query;
+ filtsftvdata = data.cachedata.filtsftvdata;
+ groupitemeventsdata = data.cachedata.groupitemeventsdata;
+ $('.route-time-input').val(data['eventView']['session_interval']);
+ if(data['eventView']['session_type'] == "second"){
+ $(".route-condition").html("秒");
+ }else if(data['eventView']['session_type'] == "minute"){
+ $(".route-condition").html("分钟");
+ }else {
+ $(".route-condition").html("小时");
+ }
+ X.DATA['routeevent'] = data.cachedata.event_names;
+ $('.participate-num').html(data.cachedata.event_names.length);
+
+ X.template("route","event-roue-event",data['events']['source_event']);
+ X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts']);
+ X.laytpldata("#eventsplit-box-dot",data['events']['by_fields'],".eventsplit-box");
+ // X.template("userpar","userpar-event",data['events']);
+
+ calculationdata();
+ }
+
+ })
+ })
+
+ function routeanalysisdata(d){
+ var myChart = echarts.init(document.getElementById('routeanalysis-echarts'));
+
+ var colordata = X.DATA['echartscolor'];
+ var levelsdata = [];
+ for(let i in colordata){
+ var arr = {
+ depth: i,
+ itemStyle: {
+ color: colordata[i]
+ },
+ lineStyle: {
+ color: 'source',
+ opacity: 0.6
+ }
+ };
+ levelsdata.push(arr);
+ }
+
+ myChart.setOption(option = {
+ title: {
+ text: '用户行为路径'
+ },
+ grid: {
+ left: '2%',
+ right: '2%',
+ bottom: '2%',
+ top: '10%',
+ containLabel: true
+ },
+ tooltip: {
+ trigger: 'item',
+ triggerOn: 'mousemove'
+ },
+ series: [
+ {
+ type: 'sankey',
+ data: d.nodes,
+ links: d.links,
+ emphasis: {
+ focus: 'adjacency'
+ },
+ levels: levelsdata,
+ lineStyle: {
+ curveness: 0.5
+ }
+ }
+ ]
+ });
+ }
+
}
};
})();
@@ -6483,7 +6761,7 @@ var X = window.X || {
}
// 点击报表数据
- $(document).on('click','.saved-list',function(){
+ $(document).off('click','.saved-list').on('click','.saved-list',function(){
var index = $(this).attr("data-index");
if(type == data[index]['cat']){
me.callback && me.callback(data[index]);
@@ -6510,7 +6788,7 @@ var X = window.X || {
})
// 删除报表
- $(document).on("click",".saved-list-del",function(e){
+ $(document).off('click','.saved-list-del').on("click",".saved-list-del",function(e){
var id = $(this).attr("data-id");
e.stopPropagation();
X.api("report/delete","post",{"_id": id},function(d){
@@ -6533,7 +6811,7 @@ var X = window.X || {
this.parms = parms;
this.callback = parms.callback;
var data = parms.extData;
- $(document).on('click','.savereport-but-qd',function(){
+ $(document).off('click',".savereport-but-qd").on('click','.savereport-but-qd',function(){
var tabval = layui.form.val('savereportexample');
if(tabval['title'] == ""){
layer.msg("请填写报表名称");
@@ -6559,7 +6837,7 @@ var X = window.X || {
})
- $(document).on('click','.savereport-but-qx',function(){
+ $(document).off('click',".savereport-but-qx").on('click','.savereport-but-qx',function(){
layer.closeAll();
})
@@ -6924,6 +7202,29 @@ var X = window.X || {
};
})();
+// srczip/logic/sqlquery.js
+(function(){
+ X.pageLogic['sqlquery'] = {
+ init : function(){
+ $(document).off('click','.sqlquery-but').on('click','.sqlquery-but',function(){
+ var txt = $('.sql-textarea').val();
+
+ console.log(EncodeURIFilter(txt));
+ })
+
+ function EncodeURIFilter(str) {
+ if(str != null && str != "") {
+ str = str.replace(/\+/g, "%2B");
+ str = str.replace(/\&/g, "%26");
+ }
+ return str;
+ }
+
+
+
+ }
+ };
+})();
// srczip/logic/timeadmin.js
(function(){
X.pageLogic['timeadmin'] = {
diff --git a/web/srczip/base/visibleChange.js b/web/srczip/base/visibleChange.js
index 3e38178..190a4bd 100644
--- a/web/srczip/base/visibleChange.js
+++ b/web/srczip/base/visibleChange.js
@@ -1,13 +1,13 @@
(function(){
- /*
- $('.table').visibleChange(function(isShow){
- if(isShow==1){
- //被看见了
- }else{
- //看不见了
- }
- });
- */
+
+ // $('.table').visibleChange(function(isShow){
+ // if(isShow==1){
+ // //被看见了
+ // }else{
+ // //看不见了
+ // }
+ // });
+
var observer = new IntersectionObserver(function(changes){
changes.forEach(function(item,index){
var callback = $(item.target).data('_visibleChangeCall');
diff --git a/web/srczip/common.js b/web/srczip/common.js
index c9b0b20..304455c 100644
--- a/web/srczip/common.js
+++ b/web/srczip/common.js
@@ -95,29 +95,7 @@ var X = window.X || {
{'title': "UTC±00:00",id:0}
],
'analysis':{
- 'type1':[
- {"title":'全部','id':'0','Category':[]},
- {
- 'title':'事件属性',
- 'id':'1',
- 'Category':[
- {'title':'时间偏移','id':'10','type':'string'},
- {'title':'区服ID','id':'11','type':'string'},
- {'title':'来源渠道','id':'12','type':'string'},
- {'title':'VIP等级','id':'13','type':'string'},
- ]
- },
- {
- 'title':'用户属性',
- 'id':'2',
- 'Category':[
- {'title':'账户ID','id':'14','type':'string'},
- {'title':'访客ID','id':'15','type':'string'},
- {'title':'注册时间','id':'16','type':'time'},
- {'title':'来源渠道','id':'17','type':'time'},
- ]
- },
- ]
+
}
},
};
@@ -388,7 +366,7 @@ var X = window.X || {
]
},
"alwaysShowCalendars": true,
- "startDate": moment().subtract(29, 'days'),
+ "startDate": moment().subtract(7, 'days'),
"endDate": new Date(),
"opens": "right",
diff --git a/web/srczip/logic/analysis.js b/web/srczip/logic/analysis.js
index 212871c..fb39113 100644
--- a/web/srczip/logic/analysis.js
+++ b/web/srczip/logic/analysis.js
@@ -705,6 +705,7 @@
$(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
console.log(data);
calculationdata();
+
})
var querydata;//查询数据
@@ -998,10 +999,23 @@
//表格
function tabledata(d){
console.log(d);
- // var titledata=d[0]['date_range'];
- // titledata.unshift('指标','阶段总和')
- // X.laytpldata("#table-fenxi-th-dot",titledata,".table-fenxi-th");
- // X.laytpldata("#table-fenxi-td-dot", ,".table-fenxi-td");
+ var titledata,condata = [];
+ for(let i in d){
+ if(d[i]['groups']['length'] == 0){
+ titledata= $.extend(true,[],d[0]['date_range']) ;
+ titledata.unshift('指标','阶段总和');
+ condata.push(d[i].values[0]);
+ condata[i].unshift(d[i]['event_name'],d[i]['sum']);
+ // console.log(condata);
+ }else {
+
+ }
+ }
+ console.log(titledata);
+ console.log(condata);
+
+ X.laytpldata("#table-fenxi-th-dot",titledata,".table-fenxi-th");
+ X.laytpldata("#table-fenxi-td-dot",condata ,".table-fenxi-td");
}
function calculationdata(){
@@ -1019,6 +1033,7 @@
querydata = d;
if(d[0].values.length > 0 ){
updata();
+ tabledata(d);
// stackingdiagram(d);
// tabledata(d);
}else {
diff --git a/web/srczip/logic/distribution.js b/web/srczip/logic/distribution.js
index 0e93168..e177219 100644
--- a/web/srczip/logic/distribution.js
+++ b/web/srczip/logic/distribution.js
@@ -5,10 +5,10 @@
var data ={
"eventView":{
"cksql":"scatter",
- "endTime":"2021-06-20 23:59:59",
+ "endTime":"",
"groupBy":[],
"recentDay":"1-7",
- "startTime":"2021-06-14 00:00:00",
+ "startTime":"",
"timeParticleSize":"P1D"
},
"events":[
@@ -42,6 +42,11 @@
distributiondata();
})
+ var time = $("#retained-condition-date").val();
+ var timearr = time.split(" ");
+ data['eventView']['startTime'] = timearr[0] + " "+"00:00:00";
+ data['eventView']['endTime'] = timearr[2]+" "+"23:59:59";
+
$(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){
console.log(d);
diff --git a/web/srczip/logic/globalfilter.js b/web/srczip/logic/globalfilter.js
index 51674fd..2d4e704 100644
--- a/web/srczip/logic/globalfilter.js
+++ b/web/srczip/logic/globalfilter.js
@@ -9,7 +9,7 @@
var data = []
}
- console.log(111,data);
+ // console.log(111,data);
X.laytpldata("#analysis-overall-situation-list-box-dot",data,"#xinwei-whole");
diff --git a/web/srczip/logic/groupeditemspop.js b/web/srczip/logic/groupeditemspop.js
index 77477dc..c4a9c4e 100644
--- a/web/srczip/logic/groupeditemspop.js
+++ b/web/srczip/logic/groupeditemspop.js
@@ -11,6 +11,7 @@
{title:'离散数字',id:'discrete',checked:false},
{title:'自定义区间',id:'user_defined',checked:false},
]
+ console.log(data);
if(data!= ''){
for(let i in arr){
if(arr[i]['id'] == data['intervalType']){
diff --git a/web/srczip/logic/participate.js b/web/srczip/logic/participate.js
index 40defd4..447a401 100644
--- a/web/srczip/logic/participate.js
+++ b/web/srczip/logic/participate.js
@@ -10,12 +10,13 @@
X.laytpldata("#judge-box-dot",data.list,".setgrouping-box2 .setgrouping-content-box2");
layui.form.render();
- if( data.select && Object.keys(data.select).length > 0){
- var select = Object.keys(data['select'])
+ if( data.select && data.select.length > 0){
+ var select = data['select'];
var selectdata = {};
for(let i in select){
- selectdata[select[i]] = true;
+ selectdata["like["+select[i]+"]"] = true;
}
+ console.log(selectdata);
layui.form.val('participateexample', selectdata);
}
@@ -59,6 +60,7 @@
layui.form.on('checkbox(checkboxexample)', function(){
var data = layui.form.val('participateexample');
+ console.log(data);
if(Object.keys(data).length >= 30){
$(this).prop("checked", false);
}
diff --git a/web/srczip/logic/routeanalysis.js b/web/srczip/logic/routeanalysis.js
index 7fdb0c9..960a8de 100644
--- a/web/srczip/logic/routeanalysis.js
+++ b/web/srczip/logic/routeanalysis.js
@@ -2,18 +2,19 @@
X.pageLogic['routeanalysis'] = {
init : function(){
var eventdata = {};
+ var filtsftvdata =[];
X.api("data_auth/my_event","get",{},function(d){
eventdata['list'] = d;
})
var data = {
"eventView":{
+ "cksql":'trace',
"col_limit":10,
- "startTime":"2021-06-22 00:00:00",
- "recent_day":"1-7",
+ "startTime":"",
"session_interval":30,
"session_type":"minute",
- "endTime":"2021-06-28 23:59:59"
+ "endTime":""
},
"events":{
"by_fields":[
@@ -21,9 +22,10 @@
],
"event_names":[],
"source_event":{
- "event_name":"complete_activity",
- "event_Desc":"complete_activity",
+ "eventName":"",
+ "eventDesc":"",
"source_type":"initial_event",
+ "source_type_name":"初始事件",
"filts": [],
"relation":'and'
},
@@ -31,18 +33,26 @@
"filterType":"COMPOUND",
"filts":[]
}
+ },
+ "cachedata":{
+ "event_names":[],
+ "groupitemeventsdata":[],
+ "filtsftvdata":[]
}
}
+
X.template("route","event-roue-event",data['events']['source_event']);
- // 日期渲染
- X.daterender("#route-condition-date",function(start, end, label){
+ // 日期渲染
+ X.daterender("#route-condition-date",function(start, end, label){
var startTime = start.format('YYYY-MM-DD')+ " "+ "00:00:00";
var endTime = end.format('YYYY-MM-DD')+ " "+ "23:59:59";
data['eventView']['startTime'] = startTime;
data['eventView']['endTime'] = endTime;
- retaineddata();
+ X.api("ck/trace_model","post",data,function(d){
+ routeanalysisdata(d);
+ })
})
var time = $("#route-condition-date").val();
@@ -61,7 +71,9 @@
"fieDesc":"rmbmoney",
"range":"",
"range_type":"def",
- "table_type":"event"
+ "tableType":"event",
+ "intervalType":"",
+ "quotaIntervalArr":""
};
data['events']['by_fields'].push(arr);
X.laytpldata("#eventsplit-box-dot",data['events']['by_fields'],".eventsplit-box");
@@ -86,13 +98,14 @@
var offset = obj.offset();
X.querycriteriapop(eventdata,'participate',offset.left,offset.top+obj.height(),function(val){
var selectdata = []; //选中事件的id数组
+ X.DATA['routeevent'] = [];
// var selectdescdata = []; //选中事件的别名数组
for(let i in val){
selectdata.push(val[i]['event_name']);
// selectdescdata.push(val[i]['event_desc']);
}
eventdata['select'] = selectdata;
- data['event_names'] = selectdata;
+ data['events']['event_names'] = selectdata;
$('.participate-num').html(selectdata.length);
for(let i in val){
@@ -107,8 +120,17 @@
X.DATA['routeevent'].push(arr);
}
}
+ data['events']['source_event']['eventName'] = X.DATA['routeevent'][0]['id'];
+ data['events']['source_event']['eventDesc'] = X.DATA['routeevent'][0]['title'];
+ X.template("route","event-roue-event",data['events']['source_event']);
+
+ X.api("data_auth/load_filter_props","post",{event_name:val[0]['event_name']},function(val){
+ // defaultgroupdata = val;
+ groupitemeventsdata.push(val);
+ })
})
})
+
var groupitemeventsdata = [];
$(document).off('click','.route-ant-select-selector1').on('click','.route-ant-select-selector1',function(){
var obj = $(this);
@@ -151,50 +173,35 @@
var obj = $(this);
var offset = obj.offset();
var index = obj.attr('data-index');
-
X.querycriteriapop(filteringdata(),'category',offset.left,offset.top+obj.height(),function(val){
console.log(val);
obj.html(val.title);
- // data['events']['by_fields'][index]['eventDesc'] = val.title;
- // data['events']['by_fields'][index]['eventName'] = val.id;
+ data['events']['by_fields'][index]['eventDesc'] = val.title;
+ data['events']['by_fields'][index]['eventName'] = val.id;
})
})
- $(document).off('click','.analysis-overall-situation-add').on('click','.analysis-overall-situation-add',function(){
- var drr={
- "columnName":'asdasd',//事件中文显示
- "column_id":'asdasd',//事件id
- 'data_type':'asdasd',//类型
- 'comparator_name':'等于',//默认等于
- "comparator_id":'==',//符号id
- "ftv":[],//条件
- "strftv":'',//显示条件
- "section":[-1,1],//区间
- "table_type":'asdasd'
- };
- data['events']['user_filter']['filts'].push(drr);
- if(data['events']['user_filter']['filts'].length > 1){
- $(".analysis-overall-situation-left-guanxi").show();
- }else{
- $(".analysis-overall-situation-left-guanxi").hide();
- }
- X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts'],function(){
- // analysisdown();
- });
+ $(document).off('click','.userevent-granularity').on('click','.userevent-granularity',function(){
+ var index = $(this).attr('data-index');
+ var sectionid = data['events']['by_fields'][index];
+ console.log(sectionid);
+ X.parametersopen(sectionid,'groupeditemspop',"auto",function(val){
+ data['events']['by_fields'][index]['intervalType'] = val.type;
+ if(val.type == "user_defined"){
+ data['events']['by_fields'][index]['quotaIntervalArr'] = val.quotaIntervalArr;
+ }
+ })
})
$(document).off('click','.analysis-overall-situation-del').on('click','.analysis-overall-situation-del',function(){
var index = $(this).attr('data-index');
data['events']['user_filter']['filts'].splice(index,1);
- // filtsftvdata.splice(index,1);
+ filtsftvdata.splice(index,1);
if(data['events']['user_filter']['filts'].length > 1){
$(".analysis-overall-situation-left-guanxi").show();
}else{
$(".analysis-overall-situation-left-guanxi").hide();
}
- X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts'],function(){
- // analysisdown();
- });
})
$(document).off('click','.analysis-shaix-initial-event').on('click','.analysis-shaix-initial-event',function(){
@@ -206,8 +213,9 @@
})
// 添加筛选项
+ var filtersymbols = [];
function addscreen(index){
- X.api('data_auth/load_filter_props',"post",{event_name:data['events']['source_event']["event_name"]},function(d){
+ X.api('data_auth/load_filter_props',"post",{event_name:data['events']['source_event']["eventName"]},function(d){
var arr = {
"columnDesc":d[0]['category'][0]['title'],//事件中文显示
"columnName":d[0]['category'][0]['id'],//事件id
@@ -221,7 +229,7 @@
data['events']['source_event']['filts'].push(arr);
X.template("route","event-roue-event",data['events']['source_event']); //更新事件
// screentypearr[index] = d;
- // filtersymbols.push(d[0]['category'][0]["category"]);
+ filtersymbols.push(d[0]['category'][0]["category"]);
})
}
@@ -235,6 +243,275 @@
}
})
+ $(document).off('click','.ant-dropdown-trigger').on('click','.ant-dropdown-trigger',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ X.querycriteriapop(X.DATA['routeevent'],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ obj.html(val.title);
+ data['events']['source_event']['eventDesc']= val.title;
+ data['events']['source_event']['eventName'] = val.id;
+ X.api("data_auth/load_filter_props","post",{event_name:val.id},function(val){
+ console.log(val);
+ // defaultgroupdata = val;
+ groupitemeventsdata.push(val);
+ })
+ })
+ })
+
+ $(document).off('click','.analysis-zhibiao-list-type2').on('click','.analysis-zhibiao-list-type2',function(){
+ var eventdata = [
+ {'title':'初始事件','id':'initial_event'},
+ {'title':'结束事件','id':'termination_event'}
+ ]
+ var obj = $(this);
+ var offset = obj.offset();
+ X.querycriteriapop(eventdata,'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ obj.html(val.title);
+ // data['events']['source_event']['source_type_name']= val.title;
+ data['events']['source_event']['source_type'] = val.id;
+
+ })
+ })
+
+ $(document).off("click",".ta-property-select").on('click','.ta-property-select',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ var indexs = obj.attr("data-indexs");
+ X.querycriteriapop(filteringdata(),'category',offset.left,offset.top+obj.height(),function(val){
+ obj.html(val.title);
+ filtersymbols[indexs] = val.category;
+ data['events']['source_event']['filts'][indexs]['columnDesc'] = val.title;
+ data['events']['source_event']['filts'][indexs]['columnName'] = val.id;
+ data['events']['source_event']['filts'][indexs]['data_type'] = val.type;
+ data['events']['source_event']['filts'][indexs]['tableType'] = val.table_type;
+ })
+ })
+
+ $(document).off('click','.analysis-choicetypename').on('click','.analysis-choicetypename',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ var indexs = $(this).attr("data-indexs");
+ X.querycriteriapop(filtersymbols[indexs],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ if(val != undefined){
+ obj.html(val.title);
+ data['events']['source_event']['filts'][indexs]['comparator_name'] = val.title;
+ data['events']['source_event']['filts'][indexs]['comparator'] = val.id;
+ X.template("userpar","userpar-event",data['events']);
+ }
+ })
+ })
+
+ $(document).off('click','.analysis-zhibiao-list-type4 input').on('blur','.analysis-zhibiao-list-type4 input',function(){
+ var indexs = $(this).attr("data-indexs");
+ var val = $(this).val();
+ var valarr = val.split(",");
+ data['events']['source_event']['filts'][indexs]['ftv']=valarr;
+ data['events']['source_event']['filts'][indexs]['strftv']=val;
+ })
+
+ $(document).off('click','.analysis-overall-situation-add').on('click','.analysis-overall-situation-add',function(){
+ var screentypedata = filteringdata();
+ if(!screentypedata) {alert('请先选择参与分析事件'); return;}
+ var drr={
+ "columnName":screentypedata[0]['category'][0]['title'],//事件中文显示
+ "column_id":screentypedata[0]['category'][0]['id'],//事件id
+ 'data_type':screentypedata[0]['category'][0]['data_type'],//类型
+ 'comparator_name':'等于',//默认等于
+ "comparator_id":'==',//符号id
+ "ftv":[],//条件
+ "strftv":'',//显示条件
+ "section":[-1,1],//区间
+ "table_type":screentypedata[0]['id']
+ };
+ data['events']['user_filter']['filts'].push(drr);
+ filtsftvdata.push(screentypedata[0]['category'][0]['category']);
+ if(data['events']['user_filter']['filts'].length > 1){
+ $(".analysis-overall-situation-left-guanxi").show();
+ }else{
+ $(".analysis-overall-situation-left-guanxi").hide();
+ }
+ X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts']);
+
+ })
+
+ $(document).off('click','.analysis-overall-situation-attr').on('click','.analysis-overall-situation-attr',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ var index = $(this).attr("data-index");
+ X.querycriteriapop(filteringdata(),'category',offset.left,offset.top+obj.height(),function(val){
+ obj.html(val.title);
+ data['events']['user_filter']['filts'][index]['columnName'] = val.title;
+ data['events']['user_filter']['filts'][index]['column_id'] = val.id;
+ data['events']['user_filter']['filts'][index]['data_type'] = val.type;
+ data['events']['user_filter']['filts'][index]['tableType'] = val.table_type;
+ filtsftvdata[index] = val.category;
+ })
+ })
+
+ $(document).off('click','.analysis-overall-situation-fuhao').on('click','.analysis-overall-situation-fuhao',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ var index = $(this).attr("data-index");
+ X.querycriteriapop(filtsftvdata[index],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ if(val != undefined){
+ obj.html(val.title);
+ data['events']['user_filter']['filts'][index]['comparator_name'] = val.title;
+ data['events']['user_filter']['filts'][index]['comparator_id'] = val.id;
+ if(val.id == "range"){
+ data['events']['user_filter']['filts'][index]['ftv'] = [-1,1];
+ }
+ X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts']);
+ }
+ })
+ })
+ $(document).off('click','.analysis-overall-situation-input input').on('blur','.analysis-overall-situation-input input',function(){
+ var val = $(this).val();
+ var index = $(this).attr("data-index");
+ data['events']['user_filter']['filts'][index]['strftv'] = val;
+ })
+
+ $(document).off('click','.analysis-overall-situation-input2 input').on('blur','.analysis-overall-situation-input2 input',function(){
+ var name = $(this).attr('name');
+ var val = $(this).val();
+ var index = $(this).attr("data-index");
+
+ if(name == 'start'){
+ data['events']['user_filter']['filts'][index]['ftv'][0] = val;
+ data['events']['user_filter']['filts'][index]['section'][0] = val;
+ }else {
+ data['events']['user_filter']['filts'][index]['ftv'][1] = val;
+ data['events']['user_filter']['filts'][index]['section'][1] = val;
+ }
+ })
+
+ // 时间粒度
+ var timeParticleSizearr = [
+ {'title':'秒','id':'second'},
+ {'title':'分钟','id':'minute'},
+ {'title':'小时','id':'hour'},
+ ]
+ X.laydropdown('.route-condition',timeParticleSizearr,function(d){
+ console.log(d);
+ $(".route-condition").html(d.title);
+ data['eventView']['session_type'] = parseInt(d.id);
+ })
+
+ $(document).off('click','.analysis-con-left-screen-box2 input').on('blur','.analysis-con-left-screen-box2',function(){
+ data['eventView']['session_interval'] =parseInt($('.analysis-con-left-screen-box2 input').val());
+ })
+
+ //计算按钮
+ $(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
+ calculationdata();
+ });
+
+
+ function calculationdata(){
+ data['cachedata']['event_names'] = X['DATA']['routeevent'];
+ data['cachedata']['groupitemeventsdata'] = groupitemeventsdata;
+ data['cachedata']['filtsftvdata'] = filtsftvdata;
+ var dataArr = {
+ eventView: data.eventView,
+ events: data.events
+ }
+ X.api("ck/trace_model","post",dataArr,function(d){
+ routeanalysisdata(d);
+ })
+ }
+
+ // sql语句显示
+ $(document).off('click','.sqlquery').on('click','.sqlquery',function(){
+ var obj = $(this);
+ var offset = obj.offset();
+ X.querycriteriapop(data,'conditionquery',offset.left - 410,offset.top+obj.height(),function(){
+
+ })
+ })
+
+ $(document).off('click','.analysis-savereport').on('click','.analysis-savereport',function(){
+ X.parametersopen(data,'savereport','auto')
+ })
+
+ $(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){
+ console.log(d);
+ if(d){
+ data = d.query;
+ filtsftvdata = data.cachedata.filtsftvdata;
+ groupitemeventsdata = data.cachedata.groupitemeventsdata;
+ $('.route-time-input').val(data['eventView']['session_interval']);
+ if(data['eventView']['session_type'] == "second"){
+ $(".route-condition").html("秒");
+ }else if(data['eventView']['session_type'] == "minute"){
+ $(".route-condition").html("分钟");
+ }else {
+ $(".route-condition").html("小时");
+ }
+ X.DATA['routeevent'] = data.cachedata.event_names;
+ $('.participate-num').html(data.cachedata.event_names.length);
+
+ X.template("route","event-roue-event",data['events']['source_event']);
+ X.template("globalfilter","xinwei-whole",data['events']['user_filter']['filts']);
+ X.laytpldata("#eventsplit-box-dot",data['events']['by_fields'],".eventsplit-box");
+ // X.template("userpar","userpar-event",data['events']);
+
+ calculationdata();
+ }
+
+ })
+ })
+
+ function routeanalysisdata(d){
+ var myChart = echarts.init(document.getElementById('routeanalysis-echarts'));
+
+ var colordata = X.DATA['echartscolor'];
+ var levelsdata = [];
+ for(let i in colordata){
+ var arr = {
+ depth: i,
+ itemStyle: {
+ color: colordata[i]
+ },
+ lineStyle: {
+ color: 'source',
+ opacity: 0.6
+ }
+ };
+ levelsdata.push(arr);
+ }
+
+ myChart.setOption(option = {
+ title: {
+ text: '用户行为路径'
+ },
+ grid: {
+ left: '2%',
+ right: '2%',
+ bottom: '2%',
+ top: '10%',
+ containLabel: true
+ },
+ tooltip: {
+ trigger: 'item',
+ triggerOn: 'mousemove'
+ },
+ series: [
+ {
+ type: 'sankey',
+ data: d.nodes,
+ links: d.links,
+ emphasis: {
+ focus: 'adjacency'
+ },
+ levels: levelsdata,
+ lineStyle: {
+ curveness: 0.5
+ }
+ }
+ ]
+ });
+ }
+
}
};
})();
\ No newline at end of file
diff --git a/web/srczip/logic/savedbaobiao.js b/web/srczip/logic/savedbaobiao.js
index 4beb9ab..df3dc77 100644
--- a/web/srczip/logic/savedbaobiao.js
+++ b/web/srczip/logic/savedbaobiao.js
@@ -58,7 +58,7 @@
}
// 点击报表数据
- $(document).on('click','.saved-list',function(){
+ $(document).off('click','.saved-list').on('click','.saved-list',function(){
var index = $(this).attr("data-index");
if(type == data[index]['cat']){
me.callback && me.callback(data[index]);
@@ -85,7 +85,7 @@
})
// 删除报表
- $(document).on("click",".saved-list-del",function(e){
+ $(document).off('click','.saved-list-del').on("click",".saved-list-del",function(e){
var id = $(this).attr("data-id");
e.stopPropagation();
X.api("report/delete","post",{"_id": id},function(d){
diff --git a/web/srczip/logic/savereport.js b/web/srczip/logic/savereport.js
index 3a44d59..e195896 100644
--- a/web/srczip/logic/savereport.js
+++ b/web/srczip/logic/savereport.js
@@ -5,7 +5,7 @@
this.parms = parms;
this.callback = parms.callback;
var data = parms.extData;
- $(document).on('click','.savereport-but-qd',function(){
+ $(document).off('click',".savereport-but-qd").on('click','.savereport-but-qd',function(){
var tabval = layui.form.val('savereportexample');
if(tabval['title'] == ""){
layer.msg("请填写报表名称");
@@ -31,7 +31,7 @@
})
- $(document).on('click','.savereport-but-qx',function(){
+ $(document).off('click',".savereport-but-qx").on('click','.savereport-but-qx',function(){
layer.closeAll();
})
diff --git a/web/srczip/logic/sqlquery.js b/web/srczip/logic/sqlquery.js
new file mode 100644
index 0000000..2ea059e
--- /dev/null
+++ b/web/srczip/logic/sqlquery.js
@@ -0,0 +1,22 @@
+(function(){
+ X.pageLogic['sqlquery'] = {
+ init : function(){
+ $(document).off('click','.sqlquery-but').on('click','.sqlquery-but',function(){
+ var txt = $('.sql-textarea').val();
+
+ console.log(EncodeURIFilter(txt));
+ })
+
+ function EncodeURIFilter(str) {
+ if(str != null && str != "") {
+ str = str.replace(/\+/g, "%2B");
+ str = str.replace(/\&/g, "%26");
+ }
+ return str;
+ }
+
+
+
+ }
+ };
+})();
\ No newline at end of file
diff --git a/web/static/css/analysis.css b/web/static/css/analysis.css
index c0289fd..ef28e25 100644
--- a/web/static/css/analysis.css
+++ b/web/static/css/analysis.css
@@ -1,5 +1,5 @@
-.analysis-zhanwei { height: 64px; }
-.analysis-navigation-bar-box { width: 100%; border-bottom: 1px solid #e6e6e6; border-top: 1px solid #e6e6e6; }
+.analysis-zhanwei { height: 60px; }
+.analysis-navigation-bar-box { width: 100%; border-bottom: 0px solid #e6e6e6; border-top: 1px solid #e6e6e6; }
.analysis-navigation-bar { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; height: 56px; }
.analysis-navigation-bar-left span{ font-size: 16px; font-weight: 500; color: #202d3f; }
.analysis-navigation-bar-left img { width: 14px; height: 14px; margin-left: 8px; position: relative; top: 3px; }
@@ -151,7 +151,7 @@
.setgrouping-action-box-right div { margin-left: 8px; cursor: pointer; }
.setgrouping-action-box-right div:hover { background-color: #f6f8fa; }
.setgrouping-content-box { height: calc(100% - 120px); width: 100%; padding: 12px 0; overflow-x: hidden; overflow-y: auto; }
-.setgrouping-content-box2 { height: calc(100% - 180px); width: 100%; padding: 12px 0; overflow-x: hidden; overflow-y: auto; }
+.setgrouping-content-box2 { height: 281px; width: 100%; padding: 12px 0; overflow-x: hidden; overflow-y: auto; }
.setgrouping-content { margin-bottom: 12px; border-bottom: 1px solid #f0f0f0; padding: 0 16px 0 24px; color: #42546d; font-size: 14px; }
.setgrouping-content-title { color: #42546d; font-size: 14px; line-height: 20px; }
.setgrouping-content-list-box { display: flex; flex-wrap: wrap; padding: 8px 0 4px; color: #42546d; }
@@ -281,4 +281,14 @@
.participate-box { color: #67729d; margin-left: 16px; padding: 0 6px; display: inline-block; min-width: 40px; height: 28px; font-size: 13px; line-height: 29px; border-radius: 2px; cursor: pointer; background-color: #fff; border: 1px solid #f0f2f5; }
+/* sql查询 */
+.sqlquery-bg { border-top: 1px solid #e6e6e6; width: 100%; height: 100%; position: fixed; top: 121px; background: #f0f2f5; }
+.sqlquery-xqltxt-box { width: calc(100% - 40px); margin: 24px auto; background-color: #fff; border-radius: 2px; }
+.sql-textarea { height: 80px; padding: 16px; margin: 16px; width: calc(100% - 64px); border: 0px; background-color: #e6e6e6; resize:none; font-size: 14px; line-height: 24px; color: #42546d; }
+.sqlquery-but-box { display: flex; justify-content: flex-end; align-items: center; padding: 0 16px 16px 16px; }
+.sqlquery-but { cursor: pointer; padding: 0 16px; margin-left: 8px; height: 32px; color: #fff; font-weight: 400; font-size: 14px; line-height: 30px; text-shadow: none; background-color: #3d90ff; border-radius: 2px; text-align: center; }
+.sqlquery-table-box { background-color: #fff; width: calc(100% - 40px); height: calc(100% - 385px); margin: 0 auto 20px auto; border-radius: 2px; overflow: auto; }
+.table-sql-box { padding: 16px; overflow: auto; }
+.slq-left { text-align: left; }
+