分布分析
This commit is contained in:
parent
37766f3aac
commit
c59ddb08cc
@ -27,8 +27,8 @@
|
||||
<dd><a class="ajax-content" href="analysis" data-id="conetnt">事件分析</a></dd>
|
||||
<dd><a class="ajax-content" href="retained" data-id="conetnt">留存分析</a></dd>
|
||||
<dd><a class="ajax-content" href="funnelanalysis" data-id="conetnt">漏斗分析</a></dd>
|
||||
<dd><a href="javascript:void(0);">分布分析</a></dd>
|
||||
<dd><a href="javascript:void(0);">路径分析</a></dd>
|
||||
<dd><a class="ajax-content" href="distribution" data-id="conetnt">分布分析</a></dd>
|
||||
<dd><a class="ajax-content" href="route" data-id="conetnt">路径分析</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item">
|
||||
|
141
web/pages/distribution.html
Normal file
141
web/pages/distribution.html
Normal file
@ -0,0 +1,141 @@
|
||||
<!-- 分布分析 -->
|
||||
<div class="analysis-zhanwei">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="analysis-navigation-bar-box">
|
||||
<div class="analysis-navigation-bar">
|
||||
<div class="analysis-navigation-bar-left">
|
||||
<span>分布分析</span><img src="./static/img/capytishi.png" title="分析某段时间内,某个事件或事件属性的整体趋势情况"/>
|
||||
</div>
|
||||
<div class="analysis-navigation-bar-right">
|
||||
<div class="analysis-navigation-bar-right-jisuan">
|
||||
<!-- <span>TA用户ID</span> -->
|
||||
</div>
|
||||
<div class="analysis-navigation-bar-right-img" title="最后更新时间:2021-04-29 14:44:39">
|
||||
<img src="./static/img/gengxin.png">
|
||||
</div>
|
||||
<div class="analysis-navigation-bar-right-img sqlquery" title="查看条件代码">
|
||||
<i class="iconfont" style="font-size: 18px; color: #67729d;"></i>
|
||||
</div>
|
||||
<div class="analysis-navigation-bar-right-img" title="以页面格式下载全量数据">
|
||||
<img src="./static/img/xiazai.png">
|
||||
</div>
|
||||
<div class="analysis-navigation-bar-right-img analysis-navigation-bar-right-img-baobiao" title="报表">
|
||||
<img src="./static/img/baobiao2.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="analysis-bg">
|
||||
<!-- 左侧条件筛选区域 -->
|
||||
<div class="analysis-con-left">
|
||||
<!-- 伸缩按钮 -->
|
||||
<div class="analysis-con-left-shrink"></div>
|
||||
|
||||
<div class="root___2a4tb">
|
||||
|
||||
<div class="block___2n0We">
|
||||
<div class="analysis-con-left-title">用户参与事件</div>
|
||||
<div class="analysis-con-left-screen-list-box" id="userpar-event">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block___2n0We">
|
||||
<div class="analysis-con-left-title">分组项</div>
|
||||
<div class="analysis-con-left-screen-box" id="shushi">
|
||||
|
||||
</div>
|
||||
<div class="analysis-foot___P797w">
|
||||
<span class="analysis-footadd___2D4YB">
|
||||
<img src="./static/img/fenzu.png">
|
||||
添加分组项
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="analysis-but-box">
|
||||
<div class="analysis-savereport">保存报表</div>
|
||||
<div class="analysis-calculation">计 算</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- 右边图表显示区域 -->
|
||||
<div class="analysis-con-right">
|
||||
<div class="analtsis-con-box">
|
||||
<div class="analtsis-con-right-box">
|
||||
<div class="analtsis-con-right-top-title">
|
||||
玩法参与情况
|
||||
</div>
|
||||
<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>
|
||||
|
||||
<div class="analtsis-condition-right-box">
|
||||
<!-- <div class="analtsis-condition">指标</div>
|
||||
<div class="analtsis-condition">分组</div> -->
|
||||
<div class="analtsis-chart-switch-box">
|
||||
<div class="analtsis-chart-switch select-chart" title="数据表"> <i class="iconfont" style="font-size: 18px; "></i> </div>
|
||||
<div class="analtsis-chart-switch " title="数值分布"> <i class="iconfont" style="font-size: 18px; "></i> </div>
|
||||
<div class="analtsis-chart-switch" title="百分比分布"> <i class="iconfont" style="font-size: 18px; "></i> </div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 统计图 -->
|
||||
<div class="analysis-echarts" id="distribution-echarts" style="display: none;"></div>
|
||||
|
||||
<div class="table-div-box">
|
||||
<table class="table-fenxi-box">
|
||||
<thead>
|
||||
<tr class="table-fenxi-th">
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-fenxi-td">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script id="table-fenxi-th-dot" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
{{# if(item == "第0日"){ }}
|
||||
<th>当日</th>
|
||||
{{# } else { }}
|
||||
<th>{{item}}</th>
|
||||
{{# } }}
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script id="table-fenxi-td-dot" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<tr >
|
||||
<td>{{item.date}}</td>
|
||||
<td>{{item.total}}</td>
|
||||
{{# layui.each(item.data, function(indexs, items){ }}
|
||||
<td>
|
||||
<p>{{items.n}}</p>
|
||||
<p>{{items.p}}%</p>
|
||||
</td>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
|
@ -76,7 +76,7 @@
|
||||
<!-- <div class="analysis-gongshi" data-index="{{index}}" title="切换为指标公式"></div> -->
|
||||
<div class="analysis-zhibiao" data-index="{{index}}" title="切换为指标选择"></div>
|
||||
<div class="analysis-jia1" data-index="{{index}}" title="添加指标"></div>
|
||||
<div class="analysis-fuzhi" title="复制指标" data-index="{{index}}"></div>
|
||||
<!-- <div class="analysis-fuzhi" title="复制指标" data-index="{{index}}"></div> -->
|
||||
<div class="analysis-del" data-index="{{index}}" title="删除指标" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,13 +1,17 @@
|
||||
<!-- 分组项弹窗 -->
|
||||
<div class="groupeditemspop-box">
|
||||
<div class="groupeditemspop-con-box">
|
||||
<form class="layui-form" action="" >
|
||||
<form class="layui-form" action="" lay-filter="groupeditemsexample">
|
||||
<div class="groupeditemspop-list-box">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<div class="groupeditemspop-custom-box">
|
||||
<div class="qvjian-box">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="qvjian-but"> 添 加 </div>
|
||||
</div>
|
||||
|
||||
<div class="groupeditemspop-but-box">
|
||||
@ -25,3 +29,24 @@
|
||||
{{# } }}
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script id="qvjian-box-dot" type="text/html">
|
||||
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
{{# if(index == 0){ }}
|
||||
<div class="qvjian">
|
||||
<input type="text" disabled='disabled' value="-∞" >,<input type="text" value="{{item.tail}}" data-index="{{index}}">
|
||||
</div>
|
||||
{{# } else if(index == d.length - 1) { }}
|
||||
<div class="qvjian">
|
||||
<input type="text" disabled='disabled' value="{{item.rise}}">,<input type="text" disabled='disabled' value="+∞" >
|
||||
</div>
|
||||
{{# } else { }}
|
||||
<div class="qvjian">
|
||||
<input type="text" disabled='disabled' value="{{item.rise}}">,<input type="text" value="{{item.tail}}" data-index="{{index}}">
|
||||
</div>
|
||||
{{# } }}
|
||||
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
|
147
web/pages/route.html
Normal file
147
web/pages/route.html
Normal file
@ -0,0 +1,147 @@
|
||||
<!-- 路径分析 -->
|
||||
<div class="analysis-zhanwei">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="analysis-navigation-bar-box">
|
||||
<div class="analysis-navigation-bar">
|
||||
<div class="analysis-navigation-bar-left">
|
||||
<span>路径分析</span><img src="./static/img/capytishi.png" title="记录用户每次会话时的访问循序,通过桑基图直观掌握用户行为扩展路线,以供优化节点内容,提升整体转化效率"/>
|
||||
</div>
|
||||
<div class="analysis-navigation-bar-right">
|
||||
<div class="analysis-navigation-bar-right-img" title="最后更新时间:2021-04-29 14:44:39">
|
||||
<img src="./static/img/gengxin.png">
|
||||
</div>
|
||||
<div class="analysis-navigation-bar-right-img sqlquery" title="查看条件代码">
|
||||
<i class="iconfont" style="font-size: 18px; color: #67729d;"></i>
|
||||
</div>
|
||||
<div class="analysis-navigation-bar-right-img analysis-navigation-bar-right-img-baobiao" title="报表">
|
||||
<img src="./static/img/baobiao2.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="analysis-bg">
|
||||
<!-- 左侧条件筛选区域 -->
|
||||
<div class="analysis-con-left">
|
||||
<!-- 伸缩按钮 -->
|
||||
<div class="analysis-con-left-shrink"></div>
|
||||
|
||||
<div class="root___2a4tb">
|
||||
|
||||
<div class="block___2n0We">
|
||||
<div class="analysis-con-left-title">参与分析的事件</div>
|
||||
<div class="analysis-con-left-screen-list-box" id="-event">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block___2n0We">
|
||||
<div class="analysis-con-left-title">分析路径以</div>
|
||||
<div class="analysis-con-left-screen-list-box" id="-event">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block___2n0We">
|
||||
<div class="analysis-con-left-title">且用户符合</div>
|
||||
<div class="analysis-con-left-screen-list-box" id="-event">
|
||||
|
||||
</div>
|
||||
<div class="analysis-foot___P797w">
|
||||
<span class="route-updataevent">
|
||||
<img src="./static/img/fenzu.png">
|
||||
添加条件
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block___2n0We">
|
||||
<div class="analysis-con-left-title">会话间隔时长</div>
|
||||
<div class="analysis-con-left-screen-box" >
|
||||
<div class="analtsis-condition analtsis-timeParticleSize windows_gap">7天</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="analysis-but-box">
|
||||
<div class="analysis-savereport">保存报表</div>
|
||||
<div class="analysis-calculation">计 算</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- 右边图表显示区域 -->
|
||||
<div class="analysis-con-right">
|
||||
<div class="analtsis-con-box">
|
||||
<div class="analtsis-con-right-box">
|
||||
<div class="analtsis-con-right-top-title">
|
||||
玩法参与情况
|
||||
</div>
|
||||
<div class="analtsis-condition-box">
|
||||
<div class="analtsis-time-box">
|
||||
<div class="analtsis-condition" > <input id="retained-condition-date" readonly="readonly"></input> </div>
|
||||
</div>
|
||||
|
||||
<div class="analtsis-condition-right-box">
|
||||
<!-- <div class="analtsis-condition">指标</div>
|
||||
<div class="analtsis-condition">分组</div> -->
|
||||
<div class="analtsis-chart-switch-box">
|
||||
<div class="analtsis-chart-switch select-chart" title="转化图"> <i class="iconfont" style="font-size: 18px; "></i> </div>
|
||||
<div class="analtsis-chart-switch " title="趋势图"> <i class="iconfont" style="font-size: 18px; "></i> </div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 统计图 -->
|
||||
<div class="analysis-echarts" id="funnel-echarts" ></div>
|
||||
|
||||
<div class="table-div-box" style="height: 100%; margin-top: 16px;">
|
||||
<table class="table-fenxi-box">
|
||||
<thead>
|
||||
<tr class="table-fenxi-th">
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-fenxi-td">
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script id="table-fenxi-th-dot" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
{{# if(item == "第0日"){ }}
|
||||
<th>当日</th>
|
||||
{{# } else { }}
|
||||
<th>{{item}}</th>
|
||||
{{# } }}
|
||||
{{# }); }}
|
||||
</script>
|
||||
|
||||
<script id="table-fenxi-td-dot" type="text/html">
|
||||
{{# layui.each(d, function(index, item){ }}
|
||||
<tr >
|
||||
<td>{{item.title}}</td>
|
||||
{{# layui.each(item.data, function(indexs, items){ }}
|
||||
<td>
|
||||
<p>{{items.n}}</p>
|
||||
<p>{{items.p}}%</p>
|
||||
</td>
|
||||
{{# }); }}
|
||||
</tr>
|
||||
{{# }); }}
|
||||
</script>
|
@ -9,13 +9,13 @@
|
||||
<div class="layui-form-item" style="padding-top: 16px; margin-bottom: 0px;">
|
||||
<select name="interest" lay-filter="aihao" class="saved-select-type">
|
||||
<option value=""></option>
|
||||
<option value="0">全部报表</option>
|
||||
<option value="1" selected="">事件分析</option>
|
||||
<option value="2">留存分析</option>
|
||||
<option value="3">漏斗分析</option>
|
||||
<option value="0" selected="">全部报表</option>
|
||||
<option value="event">事件分析</option>
|
||||
<option value="retention">留存分析</option>
|
||||
<option value="funnel">漏斗分析</option>
|
||||
<option value="4">属性分析</option>
|
||||
<option value="5">路径分析</option>
|
||||
<option value="6">分布分析</option>
|
||||
<option value="scatter">分布分析</option>
|
||||
<option value="7">SQL查询</option>
|
||||
</select>
|
||||
</div>
|
||||
|
61
web/pages/userpar.html
Normal file
61
web/pages/userpar.html
Normal file
@ -0,0 +1,61 @@
|
||||
<!-- 用户参与事件 -->
|
||||
<script id="userpar-overall-situation-list-box-dot" type="text/html">
|
||||
<div class="analysis-con-left-screen-list">
|
||||
<!-- 指标选择 -->
|
||||
<div class="analysis-con-left-screen-list-left-box" id="analysis-con-left-screen-list-left-box">
|
||||
<div class="analysis-con-left-screen-list-left-zhibiaoname analysis-con-left-screen-list-left-zhibiaoname-initial-event" id="analysis-con-left-screen-list-left-zhibiaoname-initial-event">
|
||||
<input type="text" placeholder="请输入指标名" class="analysis-con-left-screen-list-left-zhibiaoname-txt"/>
|
||||
</div>
|
||||
<div class="analysis-con-left-screen-list-left" style="margin-left: 24px;">
|
||||
<div class="analysis-zhibiao-list">
|
||||
<div class="ant-dropdown-trigger ant-dropdown-trigger0 analysis-zhibiao-list-type1 analysis-background" data-index="0"> {{d.eventDesc}}</div>
|
||||
<span style="margin-left: 6px;">的</span>
|
||||
<div id="analysis-zhibiao-list-type2-0" class="analysis-zhibiao-list-type2 analysis-background" data-index="0">{{d.quotaname}}</div>
|
||||
{{# if(d.quota != "*"){ }}
|
||||
<div id="analysis-zhibiao-list-type3-0" class="analysis-zhibiao-list-type3 analysis-background analysis-zhibiao-condition" data-index="0">{{d.analysisDesc}}</div>
|
||||
{{# } }}
|
||||
<div class="analysis-ta-property-range analysis-granularity userevent-granularity" data-index="0" data-type="{{d.data_type}}"> <img src="./static/img/shezhi2.png"> </div>
|
||||
</div>
|
||||
</div>
|
||||
{{# if(d.filts.length > 0){ }}
|
||||
<div class="analysis-con-left-screen-list-right-screen-bg" id="analysis-con-left-screen-list-right-screen-bg">
|
||||
<div class="analysis-con-left-screen-list-right-screen-box">
|
||||
<div class="analysis-con-left-screen-list-right-screen-qh">
|
||||
<div class="analysis-con-left-screen-list-right-screen-qh-xian"></div>
|
||||
{{# if(d.filts.length > 1){ }}
|
||||
{{# if(d.relation === "and"){ }}
|
||||
<div class="analysis-con-left-screen-list-right-screen-qh-tit">且</div>
|
||||
{{# } else { }}
|
||||
<div class="analysis-con-left-screen-list-right-screen-qh-tit">或</div>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</div>
|
||||
<div style="padding-bottom: 10px;" class="analysis-zhibiao-list2-box">
|
||||
{{# layui.each(d.filts, function(indexs, items){ }}
|
||||
<div class="analysis-zhibiao-list analysis-zhibiao-list-mar" id="analysis-zhibiao-list-mar-{{indexs}}">
|
||||
<div id="ta-property-select-{{indexs}}" class="ta-property-select analysis-zhibiao-list-type1 analysis-background" data-index="0" data-indexs="{{indexs}}"> {{items.columnDesc}}</div>
|
||||
<div class="analysis-zhibiao-list-type3 analysis-background analysis-choicetypename" data-index="0" data-indexs="{{indexs}}">{{items.comparator_name}}</div>
|
||||
{{# if(items.comparator != "is null" && items.comparator != "is not null" && items.comparator !="not null" && items.comparator != "range"){ }}
|
||||
<div class="analysis-zhibiao-list-type4" id="analysis-zhibiao-list-type4-{{indexs}}"> <input type="text" data-index="0" data-indexs="{{indexs}}" placeholder="多个条件用,隔开" value="{{items.strftv}}"> </div>
|
||||
{{# } }}
|
||||
<div class="analysis-zhibiao-list-del analysis-zhibiao-list-del-initial-event" data-twonum="{{indexs}}"></div>
|
||||
</div>
|
||||
{{# }); }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="analysis-zhibiao-updata-list-box">
|
||||
<span class="analysis-zhibiao-updata analysis-zhibiao-updata-initial-event"> <img src="./static/img/shaix.png" /> 添加条件 </span>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
<!-- 操作按钮 -->
|
||||
<div class="analysis-con-left-screen-list-right-box">
|
||||
<div class="analysis-con-left-screen-list-right" >
|
||||
<div class="analysis-chongmingming analysis-chongmingming-initial-event" title="重命名指标" data-index="0"></div>
|
||||
<div class="analysis-chongmingming-del analysis-chongmingming-del-initial-event" title="取消重命名" data-index="0"></div>
|
||||
<div class="analysis-shaix analysis-shaix-initial-event" title="指标筛选" data-index="0"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
875
web/src/x.min.js
vendored
875
web/src/x.min.js
vendored
File diff suppressed because it is too large
Load Diff
@ -185,7 +185,7 @@ var X = window.X || {
|
||||
}
|
||||
},
|
||||
error:function(error){
|
||||
layer.msg('服务器错误');
|
||||
layer.msg('条件错误');
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
|
@ -43,45 +43,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
var retdata,props
|
||||
var retdata,props;
|
||||
|
||||
// 日期选择器
|
||||
$("#analtsis-condition-date").daterangepicker({
|
||||
'locale': {
|
||||
"format": 'YYYY-MM-DD',
|
||||
"separator": " - ",
|
||||
"applyLabel": "应用",
|
||||
"cancelLabel": "取消",
|
||||
"fromLabel": "起始时间",
|
||||
"toLabel": "结束时间'",
|
||||
"customRangeLabel": "自定义",
|
||||
"weekLabel": "W",
|
||||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||
"firstDay": 1
|
||||
},
|
||||
ranges: {
|
||||
'今日': [moment(), moment()],
|
||||
'昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'最近7日': [moment().subtract(7, 'days'), moment().subtract(1, 'days')],
|
||||
'最近30日': [moment().subtract(30, 'days'), moment().subtract(1, 'days')],
|
||||
'上周': [moment().subtract(1, 'week').startOf('week')+86400000, moment().subtract(1, 'week').endOf('week')+86400000],
|
||||
'本周': [moment().startOf('week')+86400000, moment()+86400000],
|
||||
'本月': [moment().startOf('month'), moment()],
|
||||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')
|
||||
]
|
||||
},
|
||||
"alwaysShowCalendars": true,
|
||||
"startDate": moment().subtract(29, 'days'),
|
||||
"endDate": new Date(),
|
||||
"opens": "right"
|
||||
}, function (start, end, label) {
|
||||
// 日期渲染
|
||||
X.daterender("#analtsis-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;
|
||||
calculationdata();
|
||||
});
|
||||
})
|
||||
|
||||
var time = $("#analtsis-condition-date").val();
|
||||
var timearr = time.split(" ");
|
||||
@ -148,8 +119,8 @@
|
||||
});
|
||||
|
||||
//已存报表
|
||||
$(".analysis-navigation-bar-right .analysis-navigation-bar-right-img-baobiao").click(function(){
|
||||
X.parametersopen({},'savedbaobiao','rt',function(d){
|
||||
$(document).off('click','.analysis-navigation-bar-right .analysis-navigation-bar-right-img-baobiao').on('click','.analysis-navigation-bar-right .analysis-navigation-bar-right-img-baobiao',function(){
|
||||
X.parametersopen(data['eventView']['cksql'],'savedbaobiao','rt',function(d){
|
||||
console.log(d);
|
||||
if(d){
|
||||
data = d.query;
|
||||
@ -220,7 +191,7 @@
|
||||
// })
|
||||
|
||||
//重命名指标
|
||||
$(document).on('click','.analysis-chongmingming',function(){
|
||||
$(document).off('click','.analysis-chongmingming').on('click','.analysis-chongmingming',function() {
|
||||
var index = $(this).attr('data-index');
|
||||
$("#analysis-con-left-screen-list-left-zhibiaoname-"+index).show();
|
||||
$(this).hide();
|
||||
@ -228,7 +199,7 @@
|
||||
})
|
||||
|
||||
//删除重命名
|
||||
$(document).on('click','.analysis-chongmingming-del',function(){
|
||||
$(document).off('click','.analysis-chongmingming-del').on('click','.analysis-chongmingming-del',function() {
|
||||
var index = $(this).attr("data-index");
|
||||
$("#analysis-con-left-screen-list-left-zhibiaoname-"+index).hide();
|
||||
$("#analysis-con-left-screen-list-left-zhibiaoname-"+index+" "+"input").val('');
|
||||
@ -273,7 +244,7 @@
|
||||
type3data[index]=val.category;
|
||||
data['events'][index]['event_attr'] = val.title;
|
||||
data['events'][index]['event_attr_id'] = val.id;
|
||||
if(val.category.length > 0){
|
||||
if(val.category && val.category.length > 0){
|
||||
$("#analysis-zhibiao-list-type3-"+index).show();
|
||||
$("#analysis-zhibiao-list-type3-"+index).html(val.category[0].title);
|
||||
data['events'][index]['analysisname'] = val.category[0].title;
|
||||
@ -803,11 +774,6 @@
|
||||
type:'scroll',
|
||||
data: xAxisData
|
||||
},
|
||||
// toolbox: {
|
||||
// feature: {
|
||||
// saveAsImage: {}
|
||||
// }
|
||||
// },
|
||||
grid: {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
@ -1076,8 +1042,13 @@
|
||||
X.parametersopen(data,'savereport','auto')
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 保存报表
|
||||
// savereport:function(d){
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
|
546
web/srczip/logic/distribution.js
Normal file
546
web/srczip/logic/distribution.js
Normal file
@ -0,0 +1,546 @@
|
||||
(function(){
|
||||
X.pageLogic['distribution'] = {
|
||||
init : function(){
|
||||
|
||||
var data ={
|
||||
"eventView":{
|
||||
"cksql":"scatter",
|
||||
"endTime":"2021-06-20 23:59:59",
|
||||
"groupBy":[],
|
||||
"recentDay":"1-7",
|
||||
"startTime":"2021-06-14 00:00:00",
|
||||
"timeParticleSize":"P1D"
|
||||
},
|
||||
"events":[
|
||||
|
||||
],
|
||||
"cachedata":{
|
||||
eventdata : [],
|
||||
type2data : [],
|
||||
type3data : [],
|
||||
groupitemeventsdata: [],
|
||||
filtersymbols:[],//筛选符号
|
||||
screentypearr:[], //筛选项数据
|
||||
}
|
||||
}
|
||||
|
||||
// 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(){
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
// 日期渲染
|
||||
X.daterender("#retained-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;
|
||||
distributiondata();
|
||||
})
|
||||
|
||||
$(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;
|
||||
type2data = data.cachedata.type2data;
|
||||
type3data = data.cachedata.type3data;
|
||||
screentypearr = data.cachedata.screentypearr;
|
||||
filtersymbols = data.cachedata.filtersymbols;
|
||||
|
||||
X.template("userpar","userpar-event",data['events']);
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
distributiondata();
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
X.template("grouped","shushi");
|
||||
|
||||
var eventdata = [];
|
||||
var type2data = [];
|
||||
var type3data = [];
|
||||
var groupitemeventsdata = [];
|
||||
var filtersymbols=[];//筛选符号
|
||||
var screentypearr=[]; //筛选项数据
|
||||
var drr = [];
|
||||
screentypearr.push(drr); //每一个筛选事件按添加次数依次写入
|
||||
|
||||
X.api("data_auth/my_event","get",{},function(d){
|
||||
eventdata = d;
|
||||
var arr = [
|
||||
{
|
||||
"analysis":"times",
|
||||
"analysisDesc":"次数",
|
||||
"eventName":d[0]['category'][0]['event_name'],
|
||||
"eventDesc":d[0]['category'][0]['event_desc'],
|
||||
"filts":[],
|
||||
"intervalType":"def",
|
||||
"quota":"*",
|
||||
"quotaname":"次数",
|
||||
"relation":"and", //筛选关系
|
||||
"type":"normal",
|
||||
"renameindicator":'' //重命名指标
|
||||
}
|
||||
]
|
||||
data['events'] = arr;
|
||||
|
||||
X.api("data_auth/load_prop_quotas","post",{event_name:d[0]['category'][0]['event_name'], 'model':'scatter' },function(d){
|
||||
X.template("userpar","userpar-event",data['events']);
|
||||
var retdata = d.staid_quots.concat(d.props);
|
||||
type2data[0]=retdata;
|
||||
screentypearr[0] = d.props;
|
||||
})
|
||||
X.api("data_auth/load_filter_props","post",{event_name:d[0]['category'][0]['event_name']},function(val){
|
||||
groupitemeventsdata[0] = val;
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
$(document).off('click','.ant-dropdown-trigger').on('click','.ant-dropdown-trigger',function(){
|
||||
var obj = $(this);
|
||||
var offset = obj.offset();
|
||||
var index = obj.attr("data-index");
|
||||
var dataevent= data['events'][index];
|
||||
|
||||
X.querycriteriapop(eventdata,'setgrouping',offset.left,offset.top+obj.height(),function(val){
|
||||
obj.html(val.id);
|
||||
dataevent['eventName'] = val.name;
|
||||
dataevent['eventDesc'] = val.id;
|
||||
X.api("data_auth/load_filter_props","post",{event_name:val.name},function(val){
|
||||
groupitemeventsdata[index] = val;
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
//设置一级事件中第二个参数
|
||||
$(document).off('click','.analysis-zhibiao-list-type2').on('click','.analysis-zhibiao-list-type2',function(){
|
||||
var obj = $(this);
|
||||
var offset = obj.offset();
|
||||
var index = obj.attr("data-index");
|
||||
if(type2data.length >0){
|
||||
X.querycriteriapop(type2data[index],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
|
||||
if(val != undefined){
|
||||
$("#analysis-zhibiao-list-type2-"+index).html(val.title);
|
||||
|
||||
type3data[index]=val.category;
|
||||
data['events'][index]['quotaname'] = val.title;
|
||||
data['events'][index]['quota'] = val.id;
|
||||
if(val.category && val.category.length > 0){
|
||||
$("#analysis-zhibiao-list-type3-"+index).show();
|
||||
$("#analysis-zhibiao-list-type3-"+index).html(val.category[0].title);
|
||||
data['events'][index]['analysisDesc'] = val.category[0].title;
|
||||
data['events'][index]['analysis'] = val.category[0].id;
|
||||
}else {
|
||||
$("#analysis-zhibiao-list-type3-"+index).hide();
|
||||
data['events'][index]['analysis'] = val.analysis;
|
||||
}
|
||||
X.template("userpar","userpar-event",data['events']);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
//设置一级事件中第三个参数
|
||||
$(document).off('click','.analysis-zhibiao-condition').on('click','.analysis-zhibiao-condition',function(){
|
||||
var obj = $(this);
|
||||
var offset = obj.offset();
|
||||
var index = obj.attr("data-index");
|
||||
if(type3data.length>0){
|
||||
if(type3data[index].length > 0){
|
||||
X.querycriteriapop(type3data[index],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
|
||||
$("#analysis-zhibiao-list-type3-"+index).html(val.title);
|
||||
data['events'][index]['analysisDesc'] = val.title;
|
||||
data['events'][index]['analysis'] = val.id;
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$(document).off('click','.userevent-granularity').on('click','.userevent-granularity',function(){
|
||||
var sectionid = data['events'][0];
|
||||
X.parametersopen(sectionid,'groupeditemspop',"auto",function(val){
|
||||
data['events'][0]['intervalType'] = val.type;
|
||||
if(val.type == "user_defined"){
|
||||
data['events'][0]['quotaIntervalArr'] = val.quotaIntervalArr;
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//重命名指标
|
||||
$(document).off('click','.analysis-chongmingming').on('click','.analysis-chongmingming',function() {
|
||||
$("#analysis-con-left-screen-list-left-zhibiaoname-initial-event").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-initial-event").hide();
|
||||
$(".analysis-con-left-screen-list-left-zhibiaoname-txt").val('');
|
||||
$(this).hide();
|
||||
$(".analysis-chongmingming ").show();
|
||||
})
|
||||
|
||||
$(document).off('click','.analysis-con-left-screen-list-left-zhibiaoname-initial-event input').on('blur','.analysis-con-left-screen-list-left-zhibiaoname-initial-event input',function(){
|
||||
var txt = $(this).val();
|
||||
data['events'][0]['renameindicator'] = txt;
|
||||
})
|
||||
|
||||
// 添加筛选项
|
||||
$(document).off('click','.analysis-shaix').on('click','.analysis-shaix',function(){
|
||||
var obj = $(this);
|
||||
var index = obj.attr("data-index");
|
||||
addscreen(index);
|
||||
})
|
||||
|
||||
// 添加筛选项
|
||||
function addscreen(index){
|
||||
X.api('data_auth/load_filter_props',"post",{event_name:data['events'][index]["eventName"]},function(d){
|
||||
var arr = {
|
||||
"columnDesc":d[0]['category'][0]['title'],//事件中文显示
|
||||
"columnName":d[0]['category'][0]['id'],//事件id
|
||||
"comparator_name":d[0]['category'][0]['category'][0]['title'],//选择符号中文显示
|
||||
"comparator":d[0]['category'][0]['category'][0]['id'],//符号id
|
||||
"data_type":d[0]['category'][0]['data_type'],
|
||||
"ftv":'',//条件
|
||||
"strftv":'',//字符串显示条件
|
||||
"tableType": d[0]['id']
|
||||
} //筛选数据
|
||||
data['events'][index]['filts'].push(arr);
|
||||
X.template("userpar","userpar-event",data['events']); //更新事件
|
||||
screentypearr[index] = d;
|
||||
filtersymbols.push(d[0]['category'][0]["category"]);
|
||||
})
|
||||
}
|
||||
|
||||
$(document).off("click",".ta-property-select").on('click','.ta-property-select',function(){
|
||||
var obj = $(this);
|
||||
var offset = obj.offset();
|
||||
var index = obj.attr("data-index");
|
||||
var indexs = obj.attr("data-indexs");
|
||||
X.querycriteriapop(screentypearr[index],'category',offset.left,offset.top+obj.height(),function(val){
|
||||
console.log(val);
|
||||
var htmlstring = val.title;
|
||||
obj.html(htmlstring);
|
||||
filtersymbols[indexs] = val.category;
|
||||
data['events'][index]['filts'][indexs]['columnDesc'] = htmlstring;
|
||||
data['events'][index]['filts'][indexs]['columnName'] = val.id;
|
||||
data['events'][index]['filts'][indexs]['data_type'] = val.type;
|
||||
data['events'][index]['filts'][indexs]['tableType'] = val.table_type;
|
||||
})
|
||||
})
|
||||
|
||||
$(document).off('click','.analysis-choicetypename').on('click','.analysis-choicetypename',function(){
|
||||
var obj = $(this);
|
||||
var offset = obj.offset();
|
||||
var index = $(this).attr("data-index");
|
||||
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'][index]['filts'][indexs]['comparator_name'] = val.title;
|
||||
data['events'][index]['filts'][indexs]['comparator'] = val.id;
|
||||
X.template("userpar","userpar-event",data['events']);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
$(document).off('click','.analysis-con-left-screen-list-right-screen-qh-tit').on('click','.analysis-con-left-screen-list-right-screen-qh-tit',function(){
|
||||
var tit = $(this).html();
|
||||
if(tit == '且'){
|
||||
$(this).html('或');
|
||||
data['events'][0]['relation'] = 'or';
|
||||
}else{
|
||||
$(this).html('且');
|
||||
data['events'][0]['relation'] = 'and';
|
||||
}
|
||||
})
|
||||
|
||||
$(document).off('click','.analysis-zhibiao-list-type4 input').on('blur','.analysis-zhibiao-list-type4 input',function(){
|
||||
var index = $(this).attr("data-index");
|
||||
var indexs = $(this).attr("data-indexs");
|
||||
var val = $(this).val();
|
||||
var valarr = val.split(",");
|
||||
data['events'][index]['filts'][indexs]['ftv']=valarr;
|
||||
data['events'][index]['filts'][indexs]['strftv']=val;
|
||||
})
|
||||
|
||||
|
||||
// 分组项
|
||||
$(document).off('click','.analysis-action-right').on('click','.analysis-action-right',function() {
|
||||
var index = $(this).attr("data-index");
|
||||
data.eventView.groupBy.splice(index,1);
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
})
|
||||
|
||||
$(document).off('click','.analysis-footadd___2D4YB').on('click','.analysis-footadd___2D4YB',function() {
|
||||
|
||||
var arr = {
|
||||
"columnName": "#account_id",//事件中文显示
|
||||
"column_id": "#account_id",//事件id
|
||||
'data_type': "string",//类型
|
||||
'table_type': "event",
|
||||
"ftv":'',//条件
|
||||
"section":''//区间
|
||||
};
|
||||
data['eventView']['groupBy'].push(arr);
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
})
|
||||
|
||||
$(document).off('click','.analysis-ant-dropdown-trigger').on('click','.analysis-ant-dropdown-trigger',function(){
|
||||
var obj = $(this);
|
||||
var offset = obj.offset();
|
||||
var index = obj.attr("data-index");
|
||||
X.querycriteriapop(groupitemeventsdata[0],'category',offset.left,offset.top+obj.height(),function(val){
|
||||
var htmlstring = val.title;
|
||||
obj.html(htmlstring);
|
||||
data.eventView.groupBy[index]['columnName'] = val.title;
|
||||
data.eventView.groupBy[index]['column_id'] = val.id;
|
||||
data.eventView.groupBy[index]['data_type'] = val.type;
|
||||
data.eventView.groupBy[index]['table_type'] = val.table_type;
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
// 时间粒度
|
||||
var timeParticleSizearr = [
|
||||
{'title':'当日','id':'1'},
|
||||
{'title':'次日','id':'2'},
|
||||
{'title':'7日','id':'7'},
|
||||
{'title':'14日','id':'14'},
|
||||
{'title':'30日','id':'30'},
|
||||
]
|
||||
X.laydropdown('.analtsis-timeParticleSize',timeParticleSizearr,function(d){
|
||||
console.log(d);
|
||||
$(".analtsis-timeParticleSize").html(d.title);
|
||||
data['eventView']['unitNum'] = parseInt(d.id);
|
||||
retaineddata();
|
||||
})
|
||||
|
||||
// 计算
|
||||
$(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
|
||||
|
||||
distributiondata()
|
||||
|
||||
})
|
||||
|
||||
var querydata;
|
||||
function distributiondata(){
|
||||
data['cachedata']['eventdata'] = eventdata;
|
||||
data['cachedata']['type2data'] = type2data;
|
||||
data['cachedata']['type3data'] = type3data;
|
||||
data['cachedata']['groupitemeventsdata'] = groupitemeventsdata;
|
||||
data['cachedata']['filtersymbols'] = filtersymbols;
|
||||
data['cachedata']['screentypearr'] = screentypearr;
|
||||
var dataArr = {
|
||||
eventView: data.eventView,
|
||||
events: data.events
|
||||
}
|
||||
X.api("ck/scatter_model","post",dataArr,function(d){
|
||||
querydata = d;
|
||||
d['tabletitle'] = $.extend(true,[],d['label']);
|
||||
d['tabletitle'].unshift('事件发生时间','总人数');
|
||||
updata(d)
|
||||
})
|
||||
}
|
||||
|
||||
function updata(d){
|
||||
var title = $(".select-chart").attr("title");
|
||||
if(title == '数据表'){ $(".table-div-box").show(); $(".analysis-echarts").hide(); retainedtable(d)}
|
||||
else if(title == '数值分布'){ $(".table-div-box").hide(); $(".analysis-echarts").show(); retainednRetained(d) }
|
||||
else if(title == '百分比分布'){ $(".table-div-box").hide(); $(".analysis-echarts").show(); retaineddayRetained(d) }
|
||||
}
|
||||
|
||||
$(document).off('click','.analtsis-chart-switch').on('click','.analtsis-chart-switch',function(){
|
||||
if(querydata){
|
||||
$('.analtsis-chart-switch-box .analtsis-chart-switch').removeClass('select-chart');
|
||||
$(this).addClass('select-chart');
|
||||
if($(this).attr('title') == '数据表'){ $(".table-div-box").show(); $(".analysis-echarts").hide(); retainedtable(querydata)}
|
||||
else if($(this).attr('title') == '数值分布'){ $(".table-div-box").hide(); $(".analysis-echarts").show(); retainednRetained(querydata) }
|
||||
else if($(this).attr('title') == '百分比分布'){ $(".table-div-box").hide(); $(".analysis-echarts").show(); retaineddayRetained(querydata) }
|
||||
}else{
|
||||
layer.msg('请先计算数据,在切换图表');
|
||||
}
|
||||
})
|
||||
|
||||
function retainedtable(d){
|
||||
var tabledata = [];
|
||||
for(let i in d.list){
|
||||
var arr = {
|
||||
date: i,
|
||||
total: d['list'][i]["total"],
|
||||
data:[]
|
||||
}
|
||||
for(let j in d['list'][i]["n"]){
|
||||
var nrr = {
|
||||
n:0,
|
||||
p:0
|
||||
}
|
||||
nrr["n"] = d['list'][i]["n"][j];
|
||||
nrr["p"] = d['list'][i]["p"][j]
|
||||
arr['data'].push(nrr);
|
||||
}
|
||||
tabledata.push(arr)
|
||||
}
|
||||
X.laytpldata("#table-fenxi-th-dot",d.tabletitle,".table-fenxi-th");
|
||||
X.laytpldata("#table-fenxi-td-dot",tabledata,".table-fenxi-td");
|
||||
}
|
||||
|
||||
function retainednRetained(d){
|
||||
var legendData = d.label;
|
||||
var xAxisData = [];
|
||||
var seriesData = [];
|
||||
var nrr =[];
|
||||
for(let i in d['list']){
|
||||
xAxisData.push(i);
|
||||
|
||||
for(let j in d['list'][i]['n']){
|
||||
if(nrr[j]){
|
||||
nrr[j].push(d['list'][i]['n'][j]);
|
||||
}else {
|
||||
nrr[j] = [];
|
||||
nrr[j].push(d['list'][i]['n'][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(let i in nrr){
|
||||
var arr = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: nrr[i]
|
||||
}
|
||||
seriesData.push(arr);
|
||||
}
|
||||
|
||||
var myChart = echarts.init(document.getElementById('distribution-echarts'));
|
||||
var option = {
|
||||
color: X.DATA.echartscolor,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type:'scroll',
|
||||
data: legendData
|
||||
},
|
||||
grid: {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '2%',
|
||||
top: '10%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: xAxisData
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: seriesData
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
}
|
||||
|
||||
function retaineddayRetained(d){
|
||||
var legendData = d.label;
|
||||
var xAxisData = [];
|
||||
var seriesData = [];
|
||||
var nrr =[];
|
||||
for(let i in d['list']){
|
||||
xAxisData.push(i);
|
||||
|
||||
for(let j in d['list'][i]['p']){
|
||||
if(nrr[j]){
|
||||
nrr[j].push(d['list'][i]['p'][j]);
|
||||
}else {
|
||||
nrr[j] = [];
|
||||
nrr[j].push(d['list'][i]['p'][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(let i in nrr){
|
||||
var arr = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
areaStyle: {},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: nrr[i]
|
||||
}
|
||||
seriesData.push(arr);
|
||||
}
|
||||
|
||||
var myChart = echarts.init(document.getElementById('distribution-echarts'));
|
||||
var option = {
|
||||
color: X.DATA.echartscolor,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type:'scroll',
|
||||
data: legendData
|
||||
},
|
||||
grid: {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '2%',
|
||||
top: '10%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: xAxisData
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
formatter:'{value}%'
|
||||
}
|
||||
}
|
||||
],
|
||||
series: seriesData
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
}
|
||||
|
||||
$(document).off('click','.analysis-savereport').on('click','.analysis-savereport',function(){
|
||||
X.parametersopen(data,'savereport','auto')
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
})();
|
@ -4,14 +4,14 @@
|
||||
var me = this;
|
||||
this.parms = parms;
|
||||
this.callback = parms.callback;
|
||||
var data = parms.extData;
|
||||
console.log('aaa',data.length);
|
||||
var listdata = parms.extData;
|
||||
// console.log('aaa',listdata);
|
||||
|
||||
X.laytpldata("#dropdownlist-con-box-dot",data,".dropdownlist-con-box");
|
||||
X.laytpldata("#dropdownlist-con-box-dot",listdata,".dropdownlist-con-box");
|
||||
|
||||
$(document).on('click','.dropdownlist-list',function(){
|
||||
$(document).off('click','.dropdownlist-list').on('click','.dropdownlist-list',function(){
|
||||
var index = $(this).attr("data-index");
|
||||
var dataArr = data[index];
|
||||
var dataArr = listdata[index];
|
||||
me.callback && me.callback(dataArr);
|
||||
layer.closeAll();
|
||||
})
|
||||
|
@ -20,6 +20,12 @@
|
||||
"events":[
|
||||
|
||||
],
|
||||
"cachedata":{
|
||||
eventdata : [],
|
||||
groupitemeventsdata: [],
|
||||
filtsftvdata:[],
|
||||
filtersymbols:[],//筛选符号
|
||||
}
|
||||
};
|
||||
|
||||
// 日期渲染
|
||||
@ -402,7 +408,15 @@
|
||||
})
|
||||
var querydata;
|
||||
function retaineddata(){
|
||||
X.api("ck/funnel_model","post",data,function(d){
|
||||
data['cachedata']['eventdata'] = eventdata;
|
||||
data['cachedata']['groupitemeventsdata'] = groupitemeventsdata;
|
||||
data['cachedata']['filtersymbols'] = filtersymbols;
|
||||
data['cachedata']['filtsftvdata'] = filtsftvdata;
|
||||
var dataArr = {
|
||||
eventView: data.eventView,
|
||||
events: data.events
|
||||
}
|
||||
X.api("ck/funnel_model","post",dataArr,function(d){
|
||||
d['etitle'] = $.extend(true,[],d['title']);
|
||||
if(d['title'].length == 2){
|
||||
d['etitle'].unshift('总体');
|
||||
@ -675,6 +689,31 @@
|
||||
}
|
||||
})
|
||||
|
||||
$(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;
|
||||
screentypearr = data.cachedata.screentypearr;
|
||||
filtersymbols = data.cachedata.filtersymbols;
|
||||
filtsftvdata = data.cachedata.filtsftvdata;
|
||||
|
||||
X.template("funnel","funnel-event",data['events']);
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
X.template("globalfilter","xinwei-whole",data['eventView']['filts'],function(){
|
||||
analysisdown();
|
||||
});
|
||||
|
||||
retaineddata();
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
})();
|
@ -1,34 +1,107 @@
|
||||
(function(){
|
||||
X.pageLogic['groupeditemspop'] = {
|
||||
init : function(parms){
|
||||
var me = this;
|
||||
this.parms = parms;
|
||||
this.callback = parms.callback;
|
||||
var data = parms.extData;
|
||||
console.log(data);
|
||||
var arr = [
|
||||
{title:'默认区间',id:0,checked:true},
|
||||
{title:'离散数字',id:1,checked:false},
|
||||
{title:'自定义区间',id:2,checked:false},
|
||||
{title:'默认区间',id:'def',checked:true},
|
||||
{title:'离散数字',id:'discrete',checked:false},
|
||||
{title:'自定义区间',id:'user_defined',checked:false},
|
||||
]
|
||||
if(data!= ''){
|
||||
for(let i in arr){
|
||||
if(arr[i]['id'] == data){
|
||||
if(arr[i]['id'] == data['intervalType']){
|
||||
arr[i]['checked'] = true
|
||||
}else {
|
||||
arr[i]['checked'] = false
|
||||
}
|
||||
}
|
||||
// 添加
|
||||
var qvjian = [
|
||||
{'rise':'-∞','tail':1},
|
||||
{'rise':1,'tail':2},
|
||||
{'rise':2,'tail':'+∞'},
|
||||
];
|
||||
if(data['intervalType'] == 'user_defined'){
|
||||
$(".groupeditemspop-custom-box").show();
|
||||
console.log(data['quotaIntervalArr']);
|
||||
if(data['quotaIntervalArr'].length >= qvjian.length){
|
||||
var num = data['quotaIntervalArr'].length - qvjian.length;
|
||||
for(var i = 0; i < num; i ++){
|
||||
var qrr = {'rise': qvjian[qvjian.length - 2]['tail'] ,'tail': qvjian[qvjian.length - 2]['tail'] + 1 };
|
||||
qvjian.splice( qvjian.length - 1 , 0, qrr);
|
||||
}
|
||||
}
|
||||
for(let i in data['quotaIntervalArr']){
|
||||
if(i == 0){
|
||||
qvjian[i]['tail'] = data['quotaIntervalArr'][i];
|
||||
}else {
|
||||
qvjian[i]['tail'] = data['quotaIntervalArr'][i];
|
||||
qvjian[i]['rise'] = data['quotaIntervalArr'][i - 1];
|
||||
}
|
||||
|
||||
}
|
||||
var drr = {'rise': data['quotaIntervalArr'][data['quotaIntervalArr'].length - 1] ,'tail':'+∞'}
|
||||
qvjian[qvjian.length - 1 ] = drr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
X.laytpldata("#groupeditemspop-list-box-dot",arr,".groupeditemspop-list-box");
|
||||
layui.form.render();
|
||||
|
||||
layui.form.on('radio(groupeditemspopexample)',function(data){
|
||||
console.log(data);
|
||||
if(data.value == "2"){
|
||||
|
||||
if(data.value == "user_defined"){
|
||||
$(".groupeditemspop-custom-box").show();
|
||||
}else {
|
||||
$(".groupeditemspop-custom-box").hide();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
X.laytpldata("#qvjian-box-dot",qvjian,".qvjian-box");
|
||||
$(document).off('click','.qvjian-but').on('click','.qvjian-but',function(){
|
||||
var arr = {'rise': qvjian[qvjian.length - 2]['tail'] ,'tail': qvjian[qvjian.length - 2]['tail'] + 1 };
|
||||
qvjian.splice( qvjian.length - 1 , 0, arr);
|
||||
qvjian[qvjian.length - 1]['rise'] = Number(qvjian[qvjian.length - 2]['tail']) + 1;
|
||||
X.laytpldata("#qvjian-box-dot",qvjian,".qvjian-box");
|
||||
})
|
||||
|
||||
|
||||
$(document).off('click','.qvjian input').on('blur','.qvjian input',function(){
|
||||
var index = $(this).attr("data-index");
|
||||
var tit = $(this).val();
|
||||
for(let i in qvjian){
|
||||
if(i > index){
|
||||
qvjian[i]['tail'] = Number(tit) + 1;
|
||||
qvjian[i]['rise'] = qvjian[ i - 1 ]['tail'];
|
||||
}else if(i == index){
|
||||
qvjian[i]['tail'] = Number(tit);
|
||||
}
|
||||
}
|
||||
X.laytpldata("#qvjian-box-dot",qvjian,".qvjian-box");
|
||||
})
|
||||
|
||||
$(document).off('click','.groupeditemspop-qd').on('click','.groupeditemspop-qd',function(){
|
||||
var data = layui.form.val('groupeditemsexample');
|
||||
if(data.type == "user_defined"){
|
||||
var quotaIntervalArr=[];
|
||||
for(let i in qvjian){
|
||||
if(i < qvjian.length - 1){
|
||||
quotaIntervalArr.push(qvjian[i]['tail']);
|
||||
}
|
||||
}
|
||||
data['quotaIntervalArr'] = quotaIntervalArr;
|
||||
}
|
||||
layer.closeAll();
|
||||
me.callback && me.callback(data);
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
@ -21,6 +21,13 @@
|
||||
"events":[
|
||||
|
||||
],
|
||||
"cachedata":{
|
||||
eventdata:[],
|
||||
initialevent:[],
|
||||
returnevent:[],
|
||||
filtersymbols:[],
|
||||
groupitemeventsdata:[],
|
||||
}
|
||||
};
|
||||
|
||||
// 日期渲染
|
||||
@ -420,13 +427,50 @@
|
||||
})
|
||||
|
||||
function retaineddata(){
|
||||
X.api("ck/retention_model","post",data,function(d){
|
||||
data['cachedata']['eventdata'] = eventdata;
|
||||
data['cachedata']['initialevent'] = initialevent;
|
||||
data['cachedata']['returnevent'] = returnevent;
|
||||
data['cachedata']['groupitemeventsdata'] = groupitemeventsdata;
|
||||
data['cachedata']['filtersymbols'] = filtersymbols;
|
||||
var dataArr = {
|
||||
eventView: data.eventView,
|
||||
events: data.events
|
||||
}
|
||||
X.api("ck/retention_model","post",dataArr,function(d){
|
||||
console.log(data);
|
||||
querydata = d;
|
||||
updata(d)
|
||||
})
|
||||
}
|
||||
|
||||
$(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;
|
||||
eventdata = data.cachedata.eventdata;
|
||||
initialevent = data.cachedata.initialevent;
|
||||
returnevent = data.cachedata.returnevent;
|
||||
filtersymbols = data.cachedata.filtersymbols;
|
||||
groupitemeventsdata = data.cachedata.groupitemeventsdata;
|
||||
|
||||
X.template("event","initial-event",data['events'][0]);
|
||||
X.template("returnvisitevent","returnvisit-event",data['events'][1]);
|
||||
X.template("globalfilter","xinwei-whole",data['eventView']['filts'],function(){
|
||||
analysisdown();
|
||||
});
|
||||
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||
|
||||
retaineddata();
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
function updata(d){
|
||||
var title = $(".select-chart").attr("title");
|
||||
if(title == '数据报表'){ $(".table-div-box").show(); $(".analysis-echarts").hide(); retainedtable(d)}
|
||||
|
9
web/srczip/logic/route.js
Normal file
9
web/srczip/logic/route.js
Normal file
@ -0,0 +1,9 @@
|
||||
(function(){
|
||||
X.pageLogic['route'] = {
|
||||
init : function(){
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
})();
|
@ -2,19 +2,21 @@
|
||||
X.pageLogic['savedbaobiao'] = {
|
||||
init : function(parms){
|
||||
// 弹窗占满整平
|
||||
var me = this;
|
||||
var me = this;
|
||||
this.parms = parms;
|
||||
this.callback = parms.callback;
|
||||
var type = parms.extData;
|
||||
layui.form.render();
|
||||
$(".saved-bg").css('height',window.innerHeight+'px');
|
||||
|
||||
$(".saved-bg").css('height',window.innerHeight+'px');
|
||||
var data = []
|
||||
reportdata();
|
||||
|
||||
function reportdata(){
|
||||
X.api("report/read_report",'post',{project_id:X.DATA.projectid},function(d){
|
||||
data = d;
|
||||
X.laytpldata("#saved-list-box-dot",d,".saved-list-box");
|
||||
updatalist(type);
|
||||
$(".saved-select-type").val(type);
|
||||
})
|
||||
}
|
||||
|
||||
@ -36,25 +38,34 @@
|
||||
|
||||
// 下拉框
|
||||
$(".saved-select-type").change(function(){
|
||||
var screendata=[];//筛选后的数据
|
||||
for(let i in data){
|
||||
if($(this).val() == 0){
|
||||
screendata = data;
|
||||
}else {
|
||||
if(data[i]['cat'] == $(this).val()){
|
||||
screendata.push(data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
X.laytpldata("#saved-list-box-dot",screendata,".saved-list-box");
|
||||
updatalist($(this).val())
|
||||
})
|
||||
|
||||
function updatalist(title){
|
||||
console.log(title);
|
||||
var screendata=[];//筛选后的数据
|
||||
for(let i in data){
|
||||
if(title == 0){
|
||||
screendata = data;
|
||||
}else {
|
||||
if(data[i]['cat'] == title){
|
||||
screendata.push(data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
X.laytpldata("#saved-list-box-dot",screendata,".saved-list-box");
|
||||
}
|
||||
|
||||
// 点击报表数据
|
||||
$(document).on('click','.saved-list',function(){
|
||||
var index = $(this).attr("data-index");
|
||||
me.callback && me.callback(data[index]);
|
||||
layer.closeAll();
|
||||
if(type == data[index]['cat']){
|
||||
me.callback && me.callback(data[index]);
|
||||
layer.closeAll();
|
||||
}else {
|
||||
layer.msg('选择报表不是当前分析报表');
|
||||
}
|
||||
})
|
||||
|
||||
// 搜索
|
||||
@ -74,11 +85,12 @@
|
||||
})
|
||||
|
||||
// 删除报表
|
||||
$(document).on("click",".saved-list-del",function(){
|
||||
$(document).on("click",".saved-list-del",function(e){
|
||||
var id = $(this).attr("data-id");
|
||||
|
||||
e.stopPropagation();
|
||||
X.api("report/delete","post",{"_id": id},function(d){
|
||||
reportdata();
|
||||
layer.msg('删除成功!!!');
|
||||
reportdata();
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -20,7 +20,8 @@
|
||||
desc:tabval['desc'],
|
||||
query:data,
|
||||
project_id:X.DATA.projectid,
|
||||
cat:'event'
|
||||
cat: data['eventView']['cksql']
|
||||
// reporttype : data['eventView']['cksql']
|
||||
}
|
||||
console.log(arr);
|
||||
X.api('report/create','post',arr,function(d){
|
||||
|
17
web/srczip/logic/userpar.js
Normal file
17
web/srczip/logic/userpar.js
Normal file
@ -0,0 +1,17 @@
|
||||
(function(){
|
||||
X.pageLogic['userpar'] = {
|
||||
init : function(parms){
|
||||
|
||||
var me = this;
|
||||
if(parms){
|
||||
this.parms = parms;
|
||||
var data = parms;
|
||||
}else {
|
||||
var data = []
|
||||
}
|
||||
console.log(data);
|
||||
X.laytpldata("#userpar-overall-situation-list-box-dot",data[0],"#userpar-event");
|
||||
|
||||
}
|
||||
};
|
||||
})();
|
@ -17,7 +17,7 @@
|
||||
.analysis-con-left { width: 550px; height: 100%; background-color: #ffffff; }
|
||||
.analysis-con-right { width: calc(100% - 550px); height: 100%;}
|
||||
.analtsis-con-box { height: calc(100% - 153px); margin: 16px; background-color: #ffffff; overflow: auto; }
|
||||
.analysis-con-left-shrink { background-color: #ffffff !important; z-index: 999999; position: absolute; top: 0; left: 537px; margin: auto; bottom: 125px; border: 1px solid #f0f2f5; width: 24px; height: 24px; border-radius: 24px; line-height: 30px; cursor: pointer; text-align: center; background: url('../img/zuoshuangjiantou.png') no-repeat 100%; background-position: center;}
|
||||
.analysis-con-left-shrink { display: none; background-color: #ffffff !important; z-index: 999999; position: absolute; top: 0; left: 537px; margin: auto; bottom: 125px; border: 1px solid #f0f2f5; width: 24px; height: 24px; border-radius: 24px; line-height: 30px; cursor: pointer; text-align: center; background: url('../img/zuoshuangjiantou.png') no-repeat 100%; background-position: center;}
|
||||
.analysis-con-left-shrink:hover{ border-color: #3d90ff; box-shadow: 0 0px 6px #3d90ff; background: url('../img/zuoshuangjiantou2.png') no-repeat 100%; background-position: center;}
|
||||
|
||||
.saved-bg { width: 270px; background-color: #f6f8fa; }
|
||||
@ -155,7 +155,7 @@
|
||||
.funnel-updataevent:hover { background-color: #f1f8ff; }
|
||||
|
||||
.bgcolor { background-color: #6bb2ff; }
|
||||
.analysis-action-left { display: flex; align-items: center; }
|
||||
.analysis-action-left { display: flex; align-items: center; margin-left: 10px; }
|
||||
.analysis-ant-dropdown-trigger { color: #67729d; margin: 6px 0 6px 6px; padding: 0 6px; min-width: 40px; height: 28px; font-size: 13px; line-height: 26px; white-space: nowrap; vertical-align: top; border: 1px solid #f0f2f5; cursor: pointer; border-radius: 2px; }
|
||||
.analysis-ant-dropdown-trigger img { width: 13px; height: 13px; }
|
||||
.analysis-ta-property-range { cursor: pointer; width: 28px; height: 28px; margin-left: 8px; border: 1px solid #f0f2f5; text-align: center; }
|
||||
@ -179,13 +179,18 @@
|
||||
.dropdownlist-list:hover { background-color: #f6f8fa; }
|
||||
|
||||
/* 分组项弹窗 */
|
||||
.groupeditemspop-box { width: 400px; height: 270px; background-color: #fff; }
|
||||
.groupeditemspop-box { width: 364px; height: 270px; background-color: #fff; }
|
||||
.groupeditemspop-con-box { padding: 4px; }
|
||||
.groupeditemspop-list-box { padding: 8px; }
|
||||
.layui-form-radio:hover *, .layui-form-radioed, .layui-form-radioed>i { color: #3d90ff !important; }
|
||||
.groupeditemspop-custom-box { margin-top: 16px; height: 145px; background-color: #fff; border: 1px solid #f0f0f0; }
|
||||
.groupeditemspop-custom-box { margin-top: 16px; height: 145px; background-color: #f0f0f0; display: none; }
|
||||
.qvjian-box { margin: 8px; height: 100px; overflow-y: auto; }
|
||||
.qvjian-but { display: inline-block; font-size: 12px; color: #67729d; padding: 6px; cursor: pointer; margin-left: 8px; }
|
||||
.qvjian-but:hover { background-color: #fff; }
|
||||
.qvjian { margin-top: 6px; display: flex;justify-content: space-around; align-items: center; }
|
||||
.qvjian input { height: 24px; width: 60px; padding: 0 5px; line-height: 24px; color: #8d9eb9; font-size: 13px; border: 0px; border-bottom: 1px solid #d9d9d9; }
|
||||
|
||||
.groupeditemspop-but-box{ display: flex; justify-content: flex-end; padding: 8.5px 10px; }
|
||||
.groupeditemspop-but-box{ display: flex; justify-content: flex-end; padding: 8.5px 10px; position: absolute; bottom: 0; right: 0; }
|
||||
.groupeditemspop-qd { cursor: pointer; margin-left: 10px; height: 32px; padding: 0 16px; font-weight: 400; font-size: 14px; line-height: 30px; border-radius: 2px; color: #fff; background-color: #3d90ff; }
|
||||
|
||||
|
||||
@ -248,10 +253,10 @@
|
||||
.conditionquery-copy { cursor: pointer; color: #fff; background-color: #3d90ff; border-radius: 2px; padding: 0 16px; font-weight: 400; font-size: 14px; height: 32px; line-height: 32px; }
|
||||
.conditionquery-but-box span{ background-color: #eaecf8; color: #3d90ff; padding: 0 8px; cursor: pointer; display: inline-block; }
|
||||
|
||||
.table-div-box { width: 100%; height: 670px; overflow: auto; }
|
||||
.table-div-box { width: 100%; height: 660px; overflow: auto; }
|
||||
.table-fenxi-box { width: 100%; }
|
||||
.table-fenxi-box th { background-color: #f0f2f5; min-width: 100px; max-width: 200px; padding: 10px 16px; color: #202d3f; font-size: 13px; font-weight: 400; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #f0f2f5; }
|
||||
.table-fenxi-box tr { text-align: center; }
|
||||
.table-fenxi-box tr { text-align: center; border-left: 1px solid #e6e6e6; }
|
||||
.table-fenxi-box tr td{ padding: 10px 16px; color: #202d3f; font-size: 13px; font-weight: 400; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #f0f2f5; }
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
.layui-table-body { height: 100% !important; }
|
||||
.layui-form-item .layui-form-checkbox[lay-skin=primary] { text-indent: 0px !important; }
|
||||
.layui-anim-downbit { max-height: 350px; overflow-y: auto; overflow-x: hidden; }
|
||||
|
||||
..layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this { background-color: #f6f8fa !important; }
|
||||
|
||||
.username { color: #67729d; margin-right: 16px; }
|
||||
.layui-project { position:absolute; top: 0; left: 80px; ;}
|
||||
|
Loading…
Reference in New Issue
Block a user