-
-
` + i+1 + `
-
-

-
` + data[i]['column_name'] + `
-
-
+ // X.grouped=function(data,id){
+ // console.log(data)
+ // var html
+ // for(let i in data){
+ // html = html + `
+ //
+ //
+ //
` + i+1 + `
+ //
+ //

+ //
` + data[i]['column_name'] + `
+ //
+ //
-
+ //
-
-
-
- `
- }
- $(id).html(html);
- }
+ //
+ //
+ //
+ // `
+ // }
+ // $(id).html(html);
+ // }
// function ScreenClick(id){
// $("#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 txt = $(this).val();
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
(function(){
@@ -3530,7 +3779,7 @@ var X = window.X || {
}else {
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('修改成功');
me.callback && me.callback(d);
layer.closeAll();
@@ -4348,10 +4597,8 @@ var X = window.X || {
var data = []
}
- console.log(111,data);
X.laytpldata("#analysis-con-left-screen-box-dot",data,"#shushi");
-
}
};
})();
diff --git a/web/srczip/common.js b/web/srczip/common.js
index 9e4bac2..ab6e837 100644
--- a/web/srczip/common.js
+++ b/web/srczip/common.js
@@ -101,8 +101,9 @@ var X = window.X || {
};
(function(){
+
// 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,防止刷新时候登录数据丢失
X.loginCache = function(data){
@@ -415,29 +416,29 @@ var X = window.X || {
}
// 分组项
- X.grouped=function(data,id){
- console.log(data)
- var html
- for(let i in data){
- html = html + `
-
-
-
` + i+1 + `
-
-

-
` + data[i]['column_name'] + `
-
-
+ // X.grouped=function(data,id){
+ // console.log(data)
+ // var html
+ // for(let i in data){
+ // html = html + `
+ //
+ //
+ //
` + i+1 + `
+ //
+ //

+ //
` + data[i]['column_name'] + `
+ //
+ //
-
+ //
-
-
-
- `
- }
- $(id).html(html);
- }
+ //
+ //
+ //
+ // `
+ // }
+ // $(id).html(html);
+ // }
// function ScreenClick(id){
// $("#zhuanghu_xila").hide();
diff --git a/web/srczip/logic/analysis.js b/web/srczip/logic/analysis.js
index fb39113..b29b2a0 100644
--- a/web/srczip/logic/analysis.js
+++ b/web/srczip/logic/analysis.js
@@ -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 txt = $(this).val();
data['events'][index]['renameindicator'] = txt;
diff --git a/web/srczip/logic/attribute.js b/web/srczip/logic/attribute.js
new file mode 100644
index 0000000..5ba4ee0
--- /dev/null
+++ b/web/srczip/logic/attribute.js
@@ -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();
+ // })
+
+ }
+ };
+})();
\ No newline at end of file
diff --git a/web/srczip/logic/eventattradminedit.js b/web/srczip/logic/eventattradminedit.js
index 55e60aa..8fff9e2 100644
--- a/web/srczip/logic/eventattradminedit.js
+++ b/web/srczip/logic/eventattradminedit.js
@@ -34,7 +34,7 @@
}else {
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('修改成功');
me.callback && me.callback(d);
layer.closeAll();
diff --git a/web/srczip/logic/grouped.js b/web/srczip/logic/grouped.js
index 18d0954..844c9f6 100644
--- a/web/srczip/logic/grouped.js
+++ b/web/srczip/logic/grouped.js
@@ -9,10 +9,8 @@
var data = []
}
- console.log(111,data);
X.laytpldata("#analysis-con-left-screen-box-dot",data,"#shushi");
-
}
};
})();
\ No newline at end of file