修改域名
This commit is contained in:
parent
72409f49cc
commit
655c4797c6
182
web/pages/attribute.html
Normal file
182
web/pages/attribute.html
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
<!-- 属性分析 -->
|
||||||
|
<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">
|
||||||
|
<!-- <div class="participate-box">事件</div> -->
|
||||||
|
<div class="analysis-con-left-screen-list">
|
||||||
|
<!-- 指标选择 -->
|
||||||
|
<div class="analysis-con-left-screen-list-left-box">
|
||||||
|
<div class="analysis-con-left-screen-list-left-zhibiaoname">
|
||||||
|
<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: 23px;">
|
||||||
|
<div class="analysis-zhibiao-list">
|
||||||
|
<div class="ant-dropdown-trigger analysis-zhibiao-list-type1 analysis-background"></div>
|
||||||
|
<div class="analysis-choicetypename analysis-zhibiao-list-type1 analysis-background"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="analysis-con-left-screen-list-right-box">
|
||||||
|
<div class="analysis-con-left-screen-list-right">
|
||||||
|
<div class="analysis-chongmingming" title="重命名指标"></div>
|
||||||
|
<div class="analysis-chongmingming-del" title="取消重命名"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="eventsplit-box">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="block___2n0We">
|
||||||
|
<div class="analysis-con-left-title"> <span>分组项</span> <span class="eventsplit"> 人群对比</span> </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 class="block___2n0We analysis-overall" style="display: block;">
|
||||||
|
<div class="analysis-con-left-title">且用户符合</div>
|
||||||
|
|
||||||
|
<div class="analysis-con-left-screen-box">
|
||||||
|
|
||||||
|
<div class="analysis-overall-situation-box">
|
||||||
|
|
||||||
|
<div class="analysis-overall-situation-left-box">
|
||||||
|
<div class="analysis-overall-situation-left-xian"></div>
|
||||||
|
<div class="analysis-overall-situation-left-guanxi">且</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="analysis-overall-situation-list-box" id="xinwei-whole">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="analysis-foot___P797w">
|
||||||
|
<span class="analysis-overall-situation-add">
|
||||||
|
<img src="./static/img/fenzu.png">
|
||||||
|
添加条件
|
||||||
|
</span>
|
||||||
|
</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="attribute-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="routeanalysis-echarts" style="height: 900px;"></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="eventsplit-box-dot" type="text/html">
|
||||||
|
{{# layui.each(d, function(index, item){ }}
|
||||||
|
<div class="action-row">
|
||||||
|
<div class="action-left">
|
||||||
|
<div class="ant-select-selector2 route-ant-select-selector1" data-index="{{index}}"> {{item.eventDesc}} </div>
|
||||||
|
<span class="word___2ZSA5"> 按 </span>
|
||||||
|
<div class="ant-select-selector2 route-ant-select-selector2" data-index="{{index}}"> {{item.fieDesc}} </div>
|
||||||
|
<div class="analysis-ta-property-range analysis-granularity userevent-granularity" data-index="{{index}}"> <img src="./static/img/shezhi2.png"> </div>
|
||||||
|
<span class="word___2ZSA5">拆分</span>
|
||||||
|
</div>
|
||||||
|
<div class="action-right route-action-right" data-index="{{index}}">
|
||||||
|
<img src="./static/img/del.png">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{# }); }}
|
||||||
|
</script>
|
@ -35,7 +35,7 @@
|
|||||||
<li class="layui-nav-item">
|
<li class="layui-nav-item">
|
||||||
<a href="javascript:;">用户分析</a>
|
<a href="javascript:;">用户分析</a>
|
||||||
<dl class="layui-nav-child">
|
<dl class="layui-nav-child">
|
||||||
<dd><a href="javascript:void(0);">属性分析</a></dd>
|
<dd><a class="ajax-content" href="attribute" data-id="conetnt">属性分析</a></dd>
|
||||||
<dd><a href="javascript:void(0);">用户分群</a></dd>
|
<dd><a href="javascript:void(0);">用户分群</a></dd>
|
||||||
<dd><a href="javascript:void(0);">用户标签</a></dd>
|
<dd><a href="javascript:void(0);">用户标签</a></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
{{# if(item.data_type === "array"){ }}
|
{{# if(item.data_type === "array"){ }}
|
||||||
<div class="analysis-ta-property-range analysis-granularity" data-index="{{index}}" data-type="{{item.data_type}}"> <img src="./static/img/shezhi2.png"> </div>
|
<div class="analysis-ta-property-range analysis-granularity" data-index="{{index}}" data-type="{{item.data_type}}"> <img src="./static/img/shezhi2.png"> </div>
|
||||||
{{# } }}
|
{{# } }}
|
||||||
|
{{# if(item.data_type === "int"){ }}
|
||||||
|
<div class="analysis-ta-property-range analysis-granularity" data-index="{{index}}" data-type="{{item.data_type}}"> <img src="./static/img/shezhi2.png"> </div>
|
||||||
|
{{# } }}
|
||||||
<div class="analysis-action-right" data-index="{{index}}"> <img src="./static/img/cha1.png"/> </div>
|
<div class="analysis-action-right" data-index="{{index}}"> <img src="./static/img/cha1.png"/> </div>
|
||||||
</div>
|
</div>
|
||||||
{{# }); }}
|
{{# }); }}
|
||||||
|
299
web/src/x.min.js
vendored
299
web/src/x.min.js
vendored
@ -102,8 +102,9 @@ var X = window.X || {
|
|||||||
};
|
};
|
||||||
|
|
||||||
(function(){
|
(function(){
|
||||||
|
|
||||||
// var ipurl = "http://10.0.0.77:7889/api/v1/";
|
// var ipurl = "http://10.0.0.77:7889/api/v1/";
|
||||||
var ipurl = "http://119.29.176.224:7889/api/v1/";
|
var ipurl = "http://139.159.159.3:9865/api/v1/";
|
||||||
|
|
||||||
//设置或读取登录缓存,需要保存到localStorage,防止刷新时候登录数据丢失
|
//设置或读取登录缓存,需要保存到localStorage,防止刷新时候登录数据丢失
|
||||||
X.loginCache = function(data){
|
X.loginCache = function(data){
|
||||||
@ -416,29 +417,29 @@ var X = window.X || {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 分组项
|
// 分组项
|
||||||
X.grouped=function(data,id){
|
// X.grouped=function(data,id){
|
||||||
console.log(data)
|
// console.log(data)
|
||||||
var html
|
// var html
|
||||||
for(let i in data){
|
// for(let i in data){
|
||||||
html = html + `
|
// html = html + `
|
||||||
<div class="analysis-action-row">
|
// <div class="analysis-action-row">
|
||||||
<div class="analysis-action-left">
|
// <div class="analysis-action-left">
|
||||||
<div class="analysis-num bgcolor">` + i+1 + `</div>
|
// <div class="analysis-num bgcolor">` + i+1 + `</div>
|
||||||
<div class="analysis-ant-dropdown-trigger">
|
// <div class="analysis-ant-dropdown-trigger">
|
||||||
<img src="./static/img/shaix2.png"/>
|
// <img src="./static/img/shaix2.png"/>
|
||||||
<span>` + data[i]['column_name'] + `</span>
|
// <span>` + data[i]['column_name'] + `</span>
|
||||||
</div>
|
// </div>
|
||||||
</div>
|
// </div>
|
||||||
|
|
||||||
<div class="analysis-ta-property-range analysis-granularity"> <img src="./static/img/shezhi2.png"> </div>
|
// <div class="analysis-ta-property-range analysis-granularity"> <img src="./static/img/shezhi2.png"> </div>
|
||||||
|
|
||||||
<div class="analysis-ta-property-range analysis-section"> <img src="./static/img/shezhi2.png"> </div>
|
// <div class="analysis-ta-property-range analysis-section"> <img src="./static/img/shezhi2.png"> </div>
|
||||||
<div class="analysis-action-right"> <img src="./static/img/cha1.png"/> </div>
|
// <div class="analysis-action-right"> <img src="./static/img/cha1.png"/> </div>
|
||||||
</div>
|
// </div>
|
||||||
`
|
// `
|
||||||
}
|
// }
|
||||||
$(id).html(html);
|
// $(id).html(html);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// function ScreenClick(id){
|
// function ScreenClick(id){
|
||||||
// $("#zhuanghu_xila").hide();
|
// $("#zhuanghu_xila").hide();
|
||||||
@ -1585,7 +1586,7 @@ var X = window.X || {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//监听重命名指标
|
//监听重命名指标
|
||||||
$(document).on('blur','.analysis-con-left-screen-list-left-zhibiaoname input',function(){
|
$(document).off('click','.analysis-con-left-screen-list-left-zhibiaoname input').on('blur','.analysis-con-left-screen-list-left-zhibiaoname input',function(){
|
||||||
var index = $(this).attr("data-index");
|
var index = $(this).attr("data-index");
|
||||||
var txt = $(this).val();
|
var txt = $(this).val();
|
||||||
data['events'][index]['renameindicator'] = txt;
|
data['events'][index]['renameindicator'] = txt;
|
||||||
@ -2316,6 +2317,254 @@ var X = window.X || {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// srczip/logic/attribute.js
|
||||||
|
(function(){
|
||||||
|
X.pageLogic['attribute'] = {
|
||||||
|
init : function(){
|
||||||
|
|
||||||
|
var data ={
|
||||||
|
"eventView":{
|
||||||
|
"groupBy":[
|
||||||
|
|
||||||
|
],
|
||||||
|
"userCrowds":[
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"events":{
|
||||||
|
"analysis":"PER_CAPITA_NUM",
|
||||||
|
"analysisDesc":"",
|
||||||
|
"analysisName":"",
|
||||||
|
"eventNameDisplay":"",
|
||||||
|
"filts":[
|
||||||
|
|
||||||
|
],
|
||||||
|
"quota":"user_prop0",
|
||||||
|
"quotaDesc":"user_prop0",
|
||||||
|
"quotatype":"",
|
||||||
|
"relation":"and",
|
||||||
|
"tableType":"user"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分析属性控制重命名
|
||||||
|
$(document).off('click','.analysis-chongmingming').on('click','.analysis-chongmingming',function(){
|
||||||
|
$('.analysis-con-left-screen-list-left-zhibiaoname').show();
|
||||||
|
$(this).hide();
|
||||||
|
$('.analysis-chongmingming-del').show();
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-chongmingming-del').on('click','.analysis-chongmingming-del',function(){
|
||||||
|
$('.analysis-con-left-screen-list-left-zhibiaoname').hide();
|
||||||
|
$(this).hide();
|
||||||
|
$('.analysis-chongmingming').show();
|
||||||
|
})
|
||||||
|
|
||||||
|
//用户属性数据请求
|
||||||
|
var user_attr = [];
|
||||||
|
var quotas_map = [];
|
||||||
|
var filter_map = [];
|
||||||
|
var user_data = []; //分组项,用户符合,人群对比数据格式
|
||||||
|
X.api("data_auth/user_property","get",{},function(val){
|
||||||
|
for(let i in val){
|
||||||
|
var arr = {
|
||||||
|
id : val[i]['name'],
|
||||||
|
data_type : val[i]['data_type'],
|
||||||
|
title : val[i]['name']
|
||||||
|
};
|
||||||
|
user_attr.push(arr);
|
||||||
|
}
|
||||||
|
data['events']['quota'] = user_attr[0]['id'];
|
||||||
|
data['events']['quotaDesc'] = user_attr[0]['title'];
|
||||||
|
data['events']['quotatype'] = user_attr[0]['data_type'];
|
||||||
|
$('.ant-dropdown-trigger').html(user_attr[0]['title']);
|
||||||
|
$('.analysis-choicetypename').hide();
|
||||||
|
|
||||||
|
var arr = {
|
||||||
|
category: user_attr,
|
||||||
|
id:'',
|
||||||
|
title:'用户属性'
|
||||||
|
}
|
||||||
|
user_data.push(arr);
|
||||||
|
console.log(user_data);
|
||||||
|
|
||||||
|
X.api("data_auth/quotas_map","get",{},function(val){
|
||||||
|
quotas_map = val;
|
||||||
|
})
|
||||||
|
|
||||||
|
X.api("data_auth/filter_map","get",{},function(val){
|
||||||
|
filter_map = val;
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
// 分析属性
|
||||||
|
$(document).off('click','.ant-dropdown-trigger').on('click','.ant-dropdown-trigger',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var offset = obj.offset();
|
||||||
|
X.querycriteriapop(user_attr,'dropdownlist',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
obj.html(val.title);
|
||||||
|
data['events']['quota'] = val.id;
|
||||||
|
data['events']['quotaDesc'] = val.title;
|
||||||
|
data['events']['quotatype'] = val.data_type;
|
||||||
|
if(val.data_type == ""){
|
||||||
|
$('.analysis-choicetypename').hide();
|
||||||
|
}else {
|
||||||
|
$('.analysis-choicetypename').show();
|
||||||
|
data['events']['analysisName'] = quotas_map[val.data_type][0].id;
|
||||||
|
data['events']['analysisDesc'] = quotas_map[val.data_type][0].title;
|
||||||
|
$('.analysis-choicetypename').html(quotas_map[val.data_type][0]['title']);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-choicetypename').on('click','.analysis-choicetypename',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var offset = obj.offset();
|
||||||
|
X.querycriteriapop(quotas_map[data['events']['quotatype']],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
obj.html(val.title);
|
||||||
|
data['events']['analysisName'] = val.id;
|
||||||
|
data['events']['analysisDesc'] = val.title;
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-con-left-screen-list-left-zhibiaoname input').on('blur','.analysis-con-left-screen-list-left-zhibiaoname input',function(){
|
||||||
|
// console.log($(this).val());
|
||||||
|
data['events']['eventNameDisplay'] = $(this).val();
|
||||||
|
})
|
||||||
|
|
||||||
|
// 分组项
|
||||||
|
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||||
|
$(document).off('click','.analysis-footadd___2D4YB').on('click','.analysis-footadd___2D4YB',function(){
|
||||||
|
var arr = {
|
||||||
|
"columnName": user_data[0]['category'][0]['title'],//事件中文显示
|
||||||
|
"column_id": user_data[0]['category'][0]['id'],//事件id
|
||||||
|
'data_type': user_data[0]['category'][0]['data_type'],//类型
|
||||||
|
'table_type': "",
|
||||||
|
"ftv":'',//条件
|
||||||
|
"intervalType":'def',
|
||||||
|
"quotaIntervalArr":[]
|
||||||
|
};
|
||||||
|
data['eventView']['groupBy'].push(arr);
|
||||||
|
if(data['eventView']['groupBy'].length >= 2){
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-action-right').on('click','.analysis-action-right',function(){
|
||||||
|
var index = $(this).attr('data-index');
|
||||||
|
data['eventView']['groupBy'].splice(index,1);
|
||||||
|
if(data['eventView']['groupBy'].length < 2){
|
||||||
|
$(".analysis-footadd___2D4YB").show();
|
||||||
|
}
|
||||||
|
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-ant-dropdown-trigger').on('click','.analysis-ant-dropdown-trigger',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var index = obj.attr('data-index');
|
||||||
|
var offset = obj.offset();
|
||||||
|
X.querycriteriapop(user_data,'category',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
// console.log(val);
|
||||||
|
obj.html(val.title);
|
||||||
|
data['eventView']['groupBy'][index]['column_id'] = val.id;
|
||||||
|
data['eventView']['groupBy'][index]['columnName'] = val.title;
|
||||||
|
data['eventView']['groupBy'][index]['data_type'] = val.type;
|
||||||
|
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-ta-property-range').on('click','.analysis-ta-property-range',function(){
|
||||||
|
var index = $(this).attr('data-index');
|
||||||
|
var sectionid = data['eventView']['groupBy'][index];
|
||||||
|
X.parametersopen(sectionid,'groupeditemspop',"auto",function(val){
|
||||||
|
data['eventView']['groupBy'][index]['intervalType'] = val.type;
|
||||||
|
if(val.type == "user_defined"){
|
||||||
|
data['eventView']['groupBy'][index]['quotaIntervalArr'] = val.quotaIntervalArr;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
//且用户符合
|
||||||
|
$(document).off('click','.analysis-overall-situation-add').on('click','.analysis-overall-situation-add',function(){
|
||||||
|
var drr={
|
||||||
|
"columnName":user_data[0]['category'][0]['title'],//事件中文显示
|
||||||
|
"column_id":user_data[0]['category'][0]['id'],//事件id
|
||||||
|
'data_type':user_data[0]['category'][0]['data_type'],//类型
|
||||||
|
'comparator_name':'等于',//默认等于
|
||||||
|
"comparator_id":'==',//符号id
|
||||||
|
"ftv":[],//条件
|
||||||
|
"strftv":'',//显示条件
|
||||||
|
"section":[-1,1],//区间
|
||||||
|
"table_type":user_data[0]['id']
|
||||||
|
};
|
||||||
|
|
||||||
|
data['events']['filts'].push(drr);
|
||||||
|
|
||||||
|
if(data['events']['filts'].length > 1){
|
||||||
|
$(".analysis-overall-situation-left-guanxi").show();
|
||||||
|
}else{
|
||||||
|
$(".analysis-overall-situation-left-guanxi").hide();
|
||||||
|
}
|
||||||
|
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-overall-situation-left-guanxi').on('click',".analysis-overall-situation-left-guanxi",function(){
|
||||||
|
var tit = $(this).html();
|
||||||
|
if(tit == "且"){
|
||||||
|
$(this).html('或');
|
||||||
|
data['events']['relation'] = 'or';
|
||||||
|
}else {
|
||||||
|
$(this).html('且');
|
||||||
|
data['events']['relation'] = 'and';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-overall-situation-attr').on('click','.analysis-overall-situation-attr',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var index = obj.attr('data-index');
|
||||||
|
var offset = obj.offset();
|
||||||
|
|
||||||
|
X.querycriteriapop(user_data,'category',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
obj.html(val.title);
|
||||||
|
data['events']['filts'][index]['column_id'] = val.id;
|
||||||
|
data['events']['filts'][index]['columnName'] = val.title;
|
||||||
|
data['events']['filts'][index]['data_type'] = val.type;
|
||||||
|
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-overall-situation-fuhao').on('click','.analysis-overall-situation-fuhao',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var index = obj.attr('data-index');
|
||||||
|
var offset = obj.offset();
|
||||||
|
// console.log(filter_map);
|
||||||
|
var filter_type = data['events']['filts'][index]['data_type'];
|
||||||
|
X.querycriteriapop( filter_map[filter_type] ,'dropdownlist',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
obj.html(val.title);
|
||||||
|
data['events']['filts'][index]['comparator_id'] = val.id;
|
||||||
|
data['events']['filts'][index]['comparator_name'] = val.title;
|
||||||
|
if(val.id == "range"){
|
||||||
|
data['events']['filts'][index]['ftv'] = [-1,1];
|
||||||
|
}
|
||||||
|
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 计算按钮
|
||||||
|
$(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
|
||||||
|
console.log(data);
|
||||||
|
})
|
||||||
|
|
||||||
|
// $(document).off('click','.analysis-navigation-bar-right-img').on('click','.analysis-navigation-bar-right-img',function(){
|
||||||
|
// location.reload();
|
||||||
|
// })
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})();
|
||||||
// srczip/logic/category.js
|
// srczip/logic/category.js
|
||||||
(function(){
|
(function(){
|
||||||
|
|
||||||
@ -3530,7 +3779,7 @@ var X = window.X || {
|
|||||||
}else {
|
}else {
|
||||||
is_show = false;
|
is_show = false;
|
||||||
}
|
}
|
||||||
X.api('data_mana/edit',"post",{name:data.name,show_name: fromdata['eventname'],is_show:is_show,cat:data.cat},function(d){
|
X.api('data_mana/attr_edit',"post",{name:data.name,show_name: fromdata['eventname'],is_show:is_show,cat:data.cat},function(d){
|
||||||
layer.msg('修改成功');
|
layer.msg('修改成功');
|
||||||
me.callback && me.callback(d);
|
me.callback && me.callback(d);
|
||||||
layer.closeAll();
|
layer.closeAll();
|
||||||
@ -4348,10 +4597,8 @@ var X = window.X || {
|
|||||||
var data = []
|
var data = []
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(111,data);
|
|
||||||
X.laytpldata("#analysis-con-left-screen-box-dot",data,"#shushi");
|
X.laytpldata("#analysis-con-left-screen-box-dot",data,"#shushi");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
@ -101,8 +101,9 @@ var X = window.X || {
|
|||||||
};
|
};
|
||||||
|
|
||||||
(function(){
|
(function(){
|
||||||
|
|
||||||
// var ipurl = "http://10.0.0.77:7889/api/v1/";
|
// var ipurl = "http://10.0.0.77:7889/api/v1/";
|
||||||
var ipurl = "http://119.29.176.224:7889/api/v1/";
|
var ipurl = "http://139.159.159.3:9865/api/v1/";
|
||||||
|
|
||||||
//设置或读取登录缓存,需要保存到localStorage,防止刷新时候登录数据丢失
|
//设置或读取登录缓存,需要保存到localStorage,防止刷新时候登录数据丢失
|
||||||
X.loginCache = function(data){
|
X.loginCache = function(data){
|
||||||
@ -415,29 +416,29 @@ var X = window.X || {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 分组项
|
// 分组项
|
||||||
X.grouped=function(data,id){
|
// X.grouped=function(data,id){
|
||||||
console.log(data)
|
// console.log(data)
|
||||||
var html
|
// var html
|
||||||
for(let i in data){
|
// for(let i in data){
|
||||||
html = html + `
|
// html = html + `
|
||||||
<div class="analysis-action-row">
|
// <div class="analysis-action-row">
|
||||||
<div class="analysis-action-left">
|
// <div class="analysis-action-left">
|
||||||
<div class="analysis-num bgcolor">` + i+1 + `</div>
|
// <div class="analysis-num bgcolor">` + i+1 + `</div>
|
||||||
<div class="analysis-ant-dropdown-trigger">
|
// <div class="analysis-ant-dropdown-trigger">
|
||||||
<img src="./static/img/shaix2.png"/>
|
// <img src="./static/img/shaix2.png"/>
|
||||||
<span>` + data[i]['column_name'] + `</span>
|
// <span>` + data[i]['column_name'] + `</span>
|
||||||
</div>
|
// </div>
|
||||||
</div>
|
// </div>
|
||||||
|
|
||||||
<div class="analysis-ta-property-range analysis-granularity"> <img src="./static/img/shezhi2.png"> </div>
|
// <div class="analysis-ta-property-range analysis-granularity"> <img src="./static/img/shezhi2.png"> </div>
|
||||||
|
|
||||||
<div class="analysis-ta-property-range analysis-section"> <img src="./static/img/shezhi2.png"> </div>
|
// <div class="analysis-ta-property-range analysis-section"> <img src="./static/img/shezhi2.png"> </div>
|
||||||
<div class="analysis-action-right"> <img src="./static/img/cha1.png"/> </div>
|
// <div class="analysis-action-right"> <img src="./static/img/cha1.png"/> </div>
|
||||||
</div>
|
// </div>
|
||||||
`
|
// `
|
||||||
}
|
// }
|
||||||
$(id).html(html);
|
// $(id).html(html);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// function ScreenClick(id){
|
// function ScreenClick(id){
|
||||||
// $("#zhuanghu_xila").hide();
|
// $("#zhuanghu_xila").hide();
|
||||||
|
@ -338,7 +338,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//监听重命名指标
|
//监听重命名指标
|
||||||
$(document).on('blur','.analysis-con-left-screen-list-left-zhibiaoname input',function(){
|
$(document).off('click','.analysis-con-left-screen-list-left-zhibiaoname input').on('blur','.analysis-con-left-screen-list-left-zhibiaoname input',function(){
|
||||||
var index = $(this).attr("data-index");
|
var index = $(this).attr("data-index");
|
||||||
var txt = $(this).val();
|
var txt = $(this).val();
|
||||||
data['events'][index]['renameindicator'] = txt;
|
data['events'][index]['renameindicator'] = txt;
|
||||||
|
247
web/srczip/logic/attribute.js
Normal file
247
web/srczip/logic/attribute.js
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
(function(){
|
||||||
|
X.pageLogic['attribute'] = {
|
||||||
|
init : function(){
|
||||||
|
|
||||||
|
var data ={
|
||||||
|
"eventView":{
|
||||||
|
"groupBy":[
|
||||||
|
|
||||||
|
],
|
||||||
|
"userCrowds":[
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"events":{
|
||||||
|
"analysis":"PER_CAPITA_NUM",
|
||||||
|
"analysisDesc":"",
|
||||||
|
"analysisName":"",
|
||||||
|
"eventNameDisplay":"",
|
||||||
|
"filts":[
|
||||||
|
|
||||||
|
],
|
||||||
|
"quota":"user_prop0",
|
||||||
|
"quotaDesc":"user_prop0",
|
||||||
|
"quotatype":"",
|
||||||
|
"relation":"and",
|
||||||
|
"tableType":"user"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分析属性控制重命名
|
||||||
|
$(document).off('click','.analysis-chongmingming').on('click','.analysis-chongmingming',function(){
|
||||||
|
$('.analysis-con-left-screen-list-left-zhibiaoname').show();
|
||||||
|
$(this).hide();
|
||||||
|
$('.analysis-chongmingming-del').show();
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-chongmingming-del').on('click','.analysis-chongmingming-del',function(){
|
||||||
|
$('.analysis-con-left-screen-list-left-zhibiaoname').hide();
|
||||||
|
$(this).hide();
|
||||||
|
$('.analysis-chongmingming').show();
|
||||||
|
})
|
||||||
|
|
||||||
|
//用户属性数据请求
|
||||||
|
var user_attr = [];
|
||||||
|
var quotas_map = [];
|
||||||
|
var filter_map = [];
|
||||||
|
var user_data = []; //分组项,用户符合,人群对比数据格式
|
||||||
|
X.api("data_auth/user_property","get",{},function(val){
|
||||||
|
for(let i in val){
|
||||||
|
var arr = {
|
||||||
|
id : val[i]['name'],
|
||||||
|
data_type : val[i]['data_type'],
|
||||||
|
title : val[i]['name']
|
||||||
|
};
|
||||||
|
user_attr.push(arr);
|
||||||
|
}
|
||||||
|
data['events']['quota'] = user_attr[0]['id'];
|
||||||
|
data['events']['quotaDesc'] = user_attr[0]['title'];
|
||||||
|
data['events']['quotatype'] = user_attr[0]['data_type'];
|
||||||
|
$('.ant-dropdown-trigger').html(user_attr[0]['title']);
|
||||||
|
$('.analysis-choicetypename').hide();
|
||||||
|
|
||||||
|
var arr = {
|
||||||
|
category: user_attr,
|
||||||
|
id:'',
|
||||||
|
title:'用户属性'
|
||||||
|
}
|
||||||
|
user_data.push(arr);
|
||||||
|
console.log(user_data);
|
||||||
|
|
||||||
|
X.api("data_auth/quotas_map","get",{},function(val){
|
||||||
|
quotas_map = val;
|
||||||
|
})
|
||||||
|
|
||||||
|
X.api("data_auth/filter_map","get",{},function(val){
|
||||||
|
filter_map = val;
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
// 分析属性
|
||||||
|
$(document).off('click','.ant-dropdown-trigger').on('click','.ant-dropdown-trigger',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var offset = obj.offset();
|
||||||
|
X.querycriteriapop(user_attr,'dropdownlist',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
obj.html(val.title);
|
||||||
|
data['events']['quota'] = val.id;
|
||||||
|
data['events']['quotaDesc'] = val.title;
|
||||||
|
data['events']['quotatype'] = val.data_type;
|
||||||
|
if(val.data_type == ""){
|
||||||
|
$('.analysis-choicetypename').hide();
|
||||||
|
}else {
|
||||||
|
$('.analysis-choicetypename').show();
|
||||||
|
data['events']['analysisName'] = quotas_map[val.data_type][0].id;
|
||||||
|
data['events']['analysisDesc'] = quotas_map[val.data_type][0].title;
|
||||||
|
$('.analysis-choicetypename').html(quotas_map[val.data_type][0]['title']);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-choicetypename').on('click','.analysis-choicetypename',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var offset = obj.offset();
|
||||||
|
X.querycriteriapop(quotas_map[data['events']['quotatype']],'dropdownlist',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
obj.html(val.title);
|
||||||
|
data['events']['analysisName'] = val.id;
|
||||||
|
data['events']['analysisDesc'] = val.title;
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-con-left-screen-list-left-zhibiaoname input').on('blur','.analysis-con-left-screen-list-left-zhibiaoname input',function(){
|
||||||
|
// console.log($(this).val());
|
||||||
|
data['events']['eventNameDisplay'] = $(this).val();
|
||||||
|
})
|
||||||
|
|
||||||
|
// 分组项
|
||||||
|
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||||
|
$(document).off('click','.analysis-footadd___2D4YB').on('click','.analysis-footadd___2D4YB',function(){
|
||||||
|
var arr = {
|
||||||
|
"columnName": user_data[0]['category'][0]['title'],//事件中文显示
|
||||||
|
"column_id": user_data[0]['category'][0]['id'],//事件id
|
||||||
|
'data_type': user_data[0]['category'][0]['data_type'],//类型
|
||||||
|
'table_type': "",
|
||||||
|
"ftv":'',//条件
|
||||||
|
"intervalType":'def',
|
||||||
|
"quotaIntervalArr":[]
|
||||||
|
};
|
||||||
|
data['eventView']['groupBy'].push(arr);
|
||||||
|
if(data['eventView']['groupBy'].length >= 2){
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-action-right').on('click','.analysis-action-right',function(){
|
||||||
|
var index = $(this).attr('data-index');
|
||||||
|
data['eventView']['groupBy'].splice(index,1);
|
||||||
|
if(data['eventView']['groupBy'].length < 2){
|
||||||
|
$(".analysis-footadd___2D4YB").show();
|
||||||
|
}
|
||||||
|
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-ant-dropdown-trigger').on('click','.analysis-ant-dropdown-trigger',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var index = obj.attr('data-index');
|
||||||
|
var offset = obj.offset();
|
||||||
|
X.querycriteriapop(user_data,'category',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
// console.log(val);
|
||||||
|
obj.html(val.title);
|
||||||
|
data['eventView']['groupBy'][index]['column_id'] = val.id;
|
||||||
|
data['eventView']['groupBy'][index]['columnName'] = val.title;
|
||||||
|
data['eventView']['groupBy'][index]['data_type'] = val.type;
|
||||||
|
X.template("grouped","shushi",data['eventView']['groupBy']);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-ta-property-range').on('click','.analysis-ta-property-range',function(){
|
||||||
|
var index = $(this).attr('data-index');
|
||||||
|
var sectionid = data['eventView']['groupBy'][index];
|
||||||
|
X.parametersopen(sectionid,'groupeditemspop',"auto",function(val){
|
||||||
|
data['eventView']['groupBy'][index]['intervalType'] = val.type;
|
||||||
|
if(val.type == "user_defined"){
|
||||||
|
data['eventView']['groupBy'][index]['quotaIntervalArr'] = val.quotaIntervalArr;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
//且用户符合
|
||||||
|
$(document).off('click','.analysis-overall-situation-add').on('click','.analysis-overall-situation-add',function(){
|
||||||
|
var drr={
|
||||||
|
"columnName":user_data[0]['category'][0]['title'],//事件中文显示
|
||||||
|
"column_id":user_data[0]['category'][0]['id'],//事件id
|
||||||
|
'data_type':user_data[0]['category'][0]['data_type'],//类型
|
||||||
|
'comparator_name':'等于',//默认等于
|
||||||
|
"comparator_id":'==',//符号id
|
||||||
|
"ftv":[],//条件
|
||||||
|
"strftv":'',//显示条件
|
||||||
|
"section":[-1,1],//区间
|
||||||
|
"table_type":user_data[0]['id']
|
||||||
|
};
|
||||||
|
|
||||||
|
data['events']['filts'].push(drr);
|
||||||
|
|
||||||
|
if(data['events']['filts'].length > 1){
|
||||||
|
$(".analysis-overall-situation-left-guanxi").show();
|
||||||
|
}else{
|
||||||
|
$(".analysis-overall-situation-left-guanxi").hide();
|
||||||
|
}
|
||||||
|
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-overall-situation-left-guanxi').on('click',".analysis-overall-situation-left-guanxi",function(){
|
||||||
|
var tit = $(this).html();
|
||||||
|
if(tit == "且"){
|
||||||
|
$(this).html('或');
|
||||||
|
data['events']['relation'] = 'or';
|
||||||
|
}else {
|
||||||
|
$(this).html('且');
|
||||||
|
data['events']['relation'] = 'and';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-overall-situation-attr').on('click','.analysis-overall-situation-attr',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var index = obj.attr('data-index');
|
||||||
|
var offset = obj.offset();
|
||||||
|
|
||||||
|
X.querycriteriapop(user_data,'category',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
obj.html(val.title);
|
||||||
|
data['events']['filts'][index]['column_id'] = val.id;
|
||||||
|
data['events']['filts'][index]['columnName'] = val.title;
|
||||||
|
data['events']['filts'][index]['data_type'] = val.type;
|
||||||
|
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).off('click','.analysis-overall-situation-fuhao').on('click','.analysis-overall-situation-fuhao',function(){
|
||||||
|
var obj = $(this);
|
||||||
|
var index = obj.attr('data-index');
|
||||||
|
var offset = obj.offset();
|
||||||
|
// console.log(filter_map);
|
||||||
|
var filter_type = data['events']['filts'][index]['data_type'];
|
||||||
|
X.querycriteriapop( filter_map[filter_type] ,'dropdownlist',offset.left,offset.top+obj.height(),function(val){
|
||||||
|
obj.html(val.title);
|
||||||
|
data['events']['filts'][index]['comparator_id'] = val.id;
|
||||||
|
data['events']['filts'][index]['comparator_name'] = val.title;
|
||||||
|
if(val.id == "range"){
|
||||||
|
data['events']['filts'][index]['ftv'] = [-1,1];
|
||||||
|
}
|
||||||
|
X.template("globalfilter","xinwei-whole",data['events']['filts']);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 计算按钮
|
||||||
|
$(document).off('click','.analysis-calculation').on('click','.analysis-calculation',function(){
|
||||||
|
console.log(data);
|
||||||
|
})
|
||||||
|
|
||||||
|
// $(document).off('click','.analysis-navigation-bar-right-img').on('click','.analysis-navigation-bar-right-img',function(){
|
||||||
|
// location.reload();
|
||||||
|
// })
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})();
|
@ -34,7 +34,7 @@
|
|||||||
}else {
|
}else {
|
||||||
is_show = false;
|
is_show = false;
|
||||||
}
|
}
|
||||||
X.api('data_mana/edit',"post",{name:data.name,show_name: fromdata['eventname'],is_show:is_show,cat:data.cat},function(d){
|
X.api('data_mana/attr_edit',"post",{name:data.name,show_name: fromdata['eventname'],is_show:is_show,cat:data.cat},function(d){
|
||||||
layer.msg('修改成功');
|
layer.msg('修改成功');
|
||||||
me.callback && me.callback(d);
|
me.callback && me.callback(d);
|
||||||
layer.closeAll();
|
layer.closeAll();
|
||||||
|
@ -9,10 +9,8 @@
|
|||||||
var data = []
|
var data = []
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(111,data);
|
|
||||||
X.laytpldata("#analysis-con-left-screen-box-dot",data,"#shushi");
|
X.laytpldata("#analysis-con-left-screen-box-dot",data,"#shushi");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
Loading…
Reference in New Issue
Block a user