diff --git a/web/pages/analysis.html b/web/pages/analysis.html index 3b4a278..56dee28 100644 --- a/web/pages/analysis.html +++ b/web/pages/analysis.html @@ -257,12 +257,31 @@
{{item.event_attr}}
{{# if(item.event_attr_id != "*"){ }} -
{{item.analysisname}}
+
{{item.analysisname}}
+ +
+ {{# if( item.operator != undefined && item.operator != "" ){ }} + {{item.operator}} + {{# } else { }} + 无 + {{# } }} +
+ {{# if(item.operator != undefined && item.operator != "" ){ }} +
+ +
+ {{# } else { }} + + {{# } }} + + {{# } else { }} {{# } }} - + {{# if(item.filts.length > 0){ }}
diff --git a/web/src/x.min.js b/web/src/x.min.js index 67466eb..9404a6f 100644 --- a/web/src/x.min.js +++ b/web/src/x.min.js @@ -124,7 +124,14 @@ var X = window.X || { {'title':'留存','id':0}, {'title':'流失','id':1}, ], - 'screenlist':[] + 'screenlist':[], + "operatorarr": [ + {title: '无',id:""}, + {title: '+',id:'+'}, + {title: '-',id:'-'}, + {title: '*',id:'*'}, + {title: '/',id:'/'}, + ] }, }; @@ -3704,7 +3711,7 @@ var X = window.X || { }, "filts":[],//全局筛选 "relation":'and', - "zone_time":'8'//时区 + "zone_time":'8',//时区 } } @@ -3754,7 +3761,9 @@ var X = window.X || { "eventNameDisplay":'',//重命名指标 "format":'float', "formatname":'两位小数', - "is_show" : true + "is_show" : true, + "operator": '',//运算符 + "operator_val":'' //运算值 } data.events.push(defaultindicator); updataindex(data.events); @@ -3991,6 +4000,29 @@ var X = window.X || { }) }); + //选择运算符 + $(document).off('click','.operator-box').on('click','.operator-box',function(){ + var obj = $(this); + var offset = obj.offset(); + var index = obj.attr("data-index"); + X.parametersopen(X['DATA']['operatorarr'],'dropdownlist',[offset.top+obj.height(),offset.left],function(val){ + obj.html(val.title); + data['events'][index]['operator'] = val.id; + if(val.id == ""){ + obj.next().hide(); + }else { + obj.next().show(); + } + + }) + }); + + $(document).off('change','.operator-val-box input').on('change','.operator-val-box input',function(){ + var index = $(this).attr("data-index"); + var txt = $(this).val(); + data['events'][index]['operator_val'] = txt; + }); + $(document).off('click','.ta-property-select').on('click','.ta-property-select',function(){ var obj = $(this); var offset = obj.offset(); @@ -4048,7 +4080,7 @@ var X = window.X || { "data_type":d[0]['category'][0]['data_type'], "ftv":[],//条件 "strftv":'',//字符串显示条件 - "tableType": d[0]['id'] + "tableType": d[0]['id'], } //筛选数据 data['events'][index]['filts'].push(arr); updataindex(data.events); @@ -4163,7 +4195,9 @@ var X = window.X || { "eventNameDisplay":'',//重命名指标 "format":'float', "formatname":'两位小数', - "is_show": true + "is_show": true, + "operator": '',//运算符 + "operator_val":'' //运算值 } data['events'].push(defaultindicator); diff --git a/web/srczip/common.js b/web/srczip/common.js index 7da8d68..1f5f7e6 100644 --- a/web/srczip/common.js +++ b/web/srczip/common.js @@ -123,7 +123,14 @@ var X = window.X || { {'title':'留存','id':0}, {'title':'流失','id':1}, ], - 'screenlist':[] + 'screenlist':[], + "operatorarr": [ + {title: '无',id:""}, + {title: '+',id:'+'}, + {title: '-',id:'-'}, + {title: '*',id:'*'}, + {title: '/',id:'/'}, + ] }, }; diff --git a/web/srczip/logic/analysis.js b/web/srczip/logic/analysis.js index f4848ed..1bee50c 100644 --- a/web/srczip/logic/analysis.js +++ b/web/srczip/logic/analysis.js @@ -29,7 +29,7 @@ }, "filts":[],//全局筛选 "relation":'and', - "zone_time":'8'//时区 + "zone_time":'8',//时区 } } @@ -79,7 +79,9 @@ "eventNameDisplay":'',//重命名指标 "format":'float', "formatname":'两位小数', - "is_show" : true + "is_show" : true, + "operator": '',//运算符 + "operator_val":'' //运算值 } data.events.push(defaultindicator); updataindex(data.events); @@ -316,6 +318,29 @@ }) }); + //选择运算符 + $(document).off('click','.operator-box').on('click','.operator-box',function(){ + var obj = $(this); + var offset = obj.offset(); + var index = obj.attr("data-index"); + X.parametersopen(X['DATA']['operatorarr'],'dropdownlist',[offset.top+obj.height(),offset.left],function(val){ + obj.html(val.title); + data['events'][index]['operator'] = val.id; + if(val.id == ""){ + obj.next().hide(); + }else { + obj.next().show(); + } + + }) + }); + + $(document).off('change','.operator-val-box input').on('change','.operator-val-box input',function(){ + var index = $(this).attr("data-index"); + var txt = $(this).val(); + data['events'][index]['operator_val'] = txt; + }); + $(document).off('click','.ta-property-select').on('click','.ta-property-select',function(){ var obj = $(this); var offset = obj.offset(); @@ -373,7 +398,7 @@ "data_type":d[0]['category'][0]['data_type'], "ftv":[],//条件 "strftv":'',//字符串显示条件 - "tableType": d[0]['id'] + "tableType": d[0]['id'], } //筛选数据 data['events'][index]['filts'].push(arr); updataindex(data.events); @@ -488,7 +513,9 @@ "eventNameDisplay":'',//重命名指标 "format":'float', "formatname":'两位小数', - "is_show": true + "is_show": true, + "operator": '',//运算符 + "operator_val":'' //运算值 } data['events'].push(defaultindicator); diff --git a/web/static/css/analysis.css b/web/static/css/analysis.css index 317c0a4..6ee87e0 100644 --- a/web/static/css/analysis.css +++ b/web/static/css/analysis.css @@ -21,6 +21,8 @@ .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;} +.operator-val-box { text-align: center; margin-left: 8px; border:1px solid #f0f2f5; background-color: #fff; color: #67729d; padding: 0 6px; display: inline-block; min-width: 40px; height: 28px; font-size: 13px; line-height: 29px; border-radius: 2; cursor: pointer; } +.operator-val-box input { border: 0px; height: 27px; width: 60px; } .saved-bg { width: 270px; background-color: #f6f8fa; } .saved-top { background-color: #ffffff; display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; color: rgba(0, 0, 0, 0.85); border-bottom: 1px solid #f0f0f0; border-radius: 2px 2px 0 0; } .saved-top img { cursor: pointer; } @@ -49,12 +51,12 @@ .analysis-event-splitting img { width: 14px; height: 14px; position: relative; top: -2px; } .analysis-con-left-screen-box { min-height: 40px;} .analysis-con-left-screen-box2 { min-height: 40px; display: flex; align-items: center; } -.analysis-con-left-screen-list { padding: 8px 0; display: flex; justify-content: space-between; align-items: end; } +.analysis-con-left-screen-list { padding: 8px 0; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: end; position: relative; } .analysis-con-left-screen-list:hover{ background-color: #f6f8fa; } .analysis-background { border: 1px solid #f0f2f5; background-color: #fff !important; } /* .analysis-con-left-screen-list:hover > .analysis-zhibiao-list .analysis-zhibiao-list-type2 { background-color: #ffffff; } .analysis-con-left-screen-list:hover > .analysis-zhibiao-list .analysis-zhibiao-list-type1 { background-color: #ffffff; } */ -.analysis-con-left-screen-list:hover > .analysis-con-left-screen-list-right-box{ display: block; } +.analysis-con-left-screen-list:hover > .analysis-con-left-screen-list-right-box{ display: block; margin-left: 286px; margin-top: 8px; } .analysis-echarts { width: 100%; height: 400px; } .eventsplit:hover { color: #4fa1ff; cursor: pointer; } .eventsplit-box { padding: 0 8px; margin: 8px 8px; font-size: 13px; margin-bottom: 0; background-color: #f0f2f5; }