diff --git a/web/pages/globalfilter.html b/web/pages/globalfilter.html index d7174ae..b4ce2c6 100644 --- a/web/pages/globalfilter.html +++ b/web/pages/globalfilter.html @@ -3,12 +3,18 @@ {{# layui.each(d, function(index, item){ }}
{{item.columnDesc}}
-
{{item.comparator_name}}
+
{{item.comparator_name}}
{{# if(item.comparator != "is null" && item.comparator != "is not null" && item.comparator !="not null" && item.comparator != "range"){ }} -
- -
- {{# } }} + {{# if(item.data_type != "datetime"){ }} +
+ +
+ {{# } else { }} +
+ {{item.ftv}} +
+ {{# } }} + {{# } }} {{# if(item.comparator === "range"){ }}
之间
diff --git a/web/pages/screen.html b/web/pages/screen.html index 770fe07..a4af8a6 100644 --- a/web/pages/screen.html +++ b/web/pages/screen.html @@ -39,10 +39,16 @@
{{item.comparator_name}}
{{# if(item.comparator != "is null" && item.comparator != "is not null" && item.comparator !="not null" && item.comparator != "range"){ }} -
- -
- {{# } }} + {{# if(item.data_type != "datetime"){ }} +
+ +
+ {{# } else { }} +
+ {{item.ftv}} +
+ {{# } }} + {{# } }}
diff --git a/web/src/x.min.js b/web/src/x.min.js index 04aead4..edd1fe8 100644 --- a/web/src/x.min.js +++ b/web/src/x.min.js @@ -3536,7 +3536,9 @@ var X = window.X || { }else{ $(".analysis-overall-situation-left-guanxi").hide(); } - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); }); $(document).off('click','.analysis-overall-situation-left-guanxi').on('click',".analysis-overall-situation-left-guanxi",function(){ @@ -3560,7 +3562,9 @@ var X = window.X || { data['events']['filts'][index]['columnName'] = val.id; data['events']['filts'][index]['columnDesc'] = val.title; data['events']['filts'][index]['data_type'] = val.type; - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); }) }); @@ -3577,18 +3581,35 @@ var X = window.X || { if(val.id == "range"){ data['events']['filts'][index]['ftv'] = [-1,1]; } - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); }) }); - // $(document).off('click','.analysis-overall-situation-input').on('click','.analysis-overall-situation-input',function(){ - // var obj = $(this); - // var type = obj.attr('data-type'); - // console.log(type); - // if( type == "datetime"){ - - // } - // }); + var render_date_index;//且用户符合时间选择框的index + $(document).off('click','.analysis-overall-situation-date').on('click','.analysis-overall-situation-date',function(){ + var index = $(this).attr('data-index'); + render_date_index = index; + // console.log(index); + }); + + // 渲染过滤项时间框 + function renderdate(){ + lay('.analysis-overall-situation-date').each(function(){ + layui.laydate.render({ + elem: this + ,type:"datetime" + ,trigger: 'click' + ,done: function(value, date, endDate){ + data['events']['filts'][render_date_index]['strftv'] = value; + var datearr = []; + datearr.push(value) + data['events']['filts'][render_date_index]['ftv'] = datearr; + } + }); + }); + }; $(document).off('click','.analysis-overall-situation-input input').on('blur','.analysis-overall-situation-input input',function(){ var val = $(this).val(); @@ -3618,7 +3639,9 @@ var X = window.X || { }else{ $(".analysis-overall-situation-left-guanxi").hide(); } - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); }); // 计算按钮 @@ -3779,7 +3802,9 @@ var X = window.X || { console.log(data); $('.ant-dropdown-trigger').html(data['events']['quotaDesc']); $('.analysis-choicetypename').html(data['events']['analysisDesc']); - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); X.template("grouped","shushi",data['eventView']['groupBy']); calculationdata(); } @@ -10419,7 +10444,9 @@ var X = window.X || { "tableType":load_filter_props[0]['id'] }; data['filts'].push(drr); - X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box"); + X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box",function(){ + renderdate(); + }); if(data['filts'].length >= 2){ $(".screen-left-qei").show(); }else { @@ -10434,6 +10461,28 @@ var X = window.X || { X.daterender("#time-box-timechoice1"); + var render_date_index;//且用户符合时间选择框的index + $(document).off('click','.right-date-box').on("click",'.right-date-box',function(){ + var index = $(this).attr("data-index"); + render_date_index = index; + }); + + function renderdate(){ + lay('.right-date-box').each(function(){ + layui.laydate.render({ + elem: this + ,type:"datetime" + ,trigger: 'click' + ,done: function(value, date, endDate){ + data['filts'][render_date_index]['strftv'] = value; + var datearr = []; + datearr.push(value) + data['filts'][render_date_index]['ftv'] = datearr; + } + }); + }); + } + $(document).off('click','.screen-con-bg .left-type').on('click','.screen-con-bg .left-type',function(){ var obj = $(this); var offset = obj.offset(); @@ -10445,7 +10494,9 @@ var X = window.X || { data['filts'][index]['columnName'] = val.id; data['filts'][index]['data_type'] = val.type; data['filts'][index]['tableType'] = val.table_type; - X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box"); + X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box",function(){ + renderdate(); + }); }); }); @@ -10463,7 +10514,9 @@ var X = window.X || { if(val.id == "range"){ data['filts'][index]['ftv'] = [-1,1]; } - X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box"); + X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box",function(){ + renderdate(); + }); }) }); @@ -10481,7 +10534,9 @@ var X = window.X || { var index = $(this).attr('data-index'); if(data['filts'].length > 1){ data['filts'].splice(index, 1); - X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box"); + X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box",function(){ + renderdate(); + }); if(data['filts'].length < 2){ $(".screen-left-qei").hide(); } diff --git a/web/srczip/logic/attribute.js b/web/srczip/logic/attribute.js index 6e497d3..91fdadc 100644 --- a/web/srczip/logic/attribute.js +++ b/web/srczip/logic/attribute.js @@ -211,7 +211,9 @@ }else{ $(".analysis-overall-situation-left-guanxi").hide(); } - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); }); $(document).off('click','.analysis-overall-situation-left-guanxi').on('click',".analysis-overall-situation-left-guanxi",function(){ @@ -235,7 +237,9 @@ data['events']['filts'][index]['columnName'] = val.id; data['events']['filts'][index]['columnDesc'] = val.title; data['events']['filts'][index]['data_type'] = val.type; - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); }) }); @@ -252,18 +256,35 @@ if(val.id == "range"){ data['events']['filts'][index]['ftv'] = [-1,1]; } - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); }) }); - // $(document).off('click','.analysis-overall-situation-input').on('click','.analysis-overall-situation-input',function(){ - // var obj = $(this); - // var type = obj.attr('data-type'); - // console.log(type); - // if( type == "datetime"){ - - // } - // }); + var render_date_index;//且用户符合时间选择框的index + $(document).off('click','.analysis-overall-situation-date').on('click','.analysis-overall-situation-date',function(){ + var index = $(this).attr('data-index'); + render_date_index = index; + // console.log(index); + }); + + // 渲染过滤项时间框 + function renderdate(){ + lay('.analysis-overall-situation-date').each(function(){ + layui.laydate.render({ + elem: this + ,type:"datetime" + ,trigger: 'click' + ,done: function(value, date, endDate){ + data['events']['filts'][render_date_index]['strftv'] = value; + var datearr = []; + datearr.push(value) + data['events']['filts'][render_date_index]['ftv'] = datearr; + } + }); + }); + }; $(document).off('click','.analysis-overall-situation-input input').on('blur','.analysis-overall-situation-input input',function(){ var val = $(this).val(); @@ -293,7 +314,9 @@ }else{ $(".analysis-overall-situation-left-guanxi").hide(); } - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); }); // 计算按钮 @@ -454,7 +477,9 @@ console.log(data); $('.ant-dropdown-trigger').html(data['events']['quotaDesc']); $('.analysis-choicetypename').html(data['events']['analysisDesc']); - X.template("globalfilter","xinwei-whole",data['events']['filts']); + X.template("globalfilter","xinwei-whole",data['events']['filts'],function(){ + renderdate(); + }); X.template("grouped","shushi",data['eventView']['groupBy']); calculationdata(); } diff --git a/web/srczip/logic/screen.js b/web/srczip/logic/screen.js index 69686ab..19c5851 100644 --- a/web/srczip/logic/screen.js +++ b/web/srczip/logic/screen.js @@ -71,7 +71,9 @@ "tableType":load_filter_props[0]['id'] }; data['filts'].push(drr); - X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box"); + X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box",function(){ + renderdate(); + }); if(data['filts'].length >= 2){ $(".screen-left-qei").show(); }else { @@ -86,6 +88,28 @@ X.daterender("#time-box-timechoice1"); + var render_date_index;//且用户符合时间选择框的index + $(document).off('click','.right-date-box').on("click",'.right-date-box',function(){ + var index = $(this).attr("data-index"); + render_date_index = index; + }); + + function renderdate(){ + lay('.right-date-box').each(function(){ + layui.laydate.render({ + elem: this + ,type:"datetime" + ,trigger: 'click' + ,done: function(value, date, endDate){ + data['filts'][render_date_index]['strftv'] = value; + var datearr = []; + datearr.push(value) + data['filts'][render_date_index]['ftv'] = datearr; + } + }); + }); + } + $(document).off('click','.screen-con-bg .left-type').on('click','.screen-con-bg .left-type',function(){ var obj = $(this); var offset = obj.offset(); @@ -97,7 +121,9 @@ data['filts'][index]['columnName'] = val.id; data['filts'][index]['data_type'] = val.type; data['filts'][index]['tableType'] = val.table_type; - X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box"); + X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box",function(){ + renderdate(); + }); }); }); @@ -115,7 +141,9 @@ if(val.id == "range"){ data['filts'][index]['ftv'] = [-1,1]; } - X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box"); + X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box",function(){ + renderdate(); + }); }) }); @@ -133,7 +161,9 @@ var index = $(this).attr('data-index'); if(data['filts'].length > 1){ data['filts'].splice(index, 1); - X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box"); + X.laytpldata("#screen-con-box-dot",data['filts'],".screen-con-box",function(){ + renderdate(); + }); if(data['filts'].length < 2){ $(".screen-left-qei").hide(); } diff --git a/web/static/css/analysis.css b/web/static/css/analysis.css index 36207f8..2565c98 100644 --- a/web/static/css/analysis.css +++ b/web/static/css/analysis.css @@ -252,6 +252,7 @@ .analysis-overall-situation-section-box input { width: 45px; padding: 0 4px; border: 0; color: #67729d; } .analysis-overall-situation-time-box { margin-left: 8px; margin-top: 2px; } .analysis-overall-situation-time-box input{ width: 320px; height: 30px; border: 1px solid #f0f0f0; background-color: #fff; border-right: 2px; padding: 0 8px; } +.analysis-overall-situation-date { width: 168px; height: 30px; border-right: 2px; padding: 0 8px; } /* 保存报表 */ .savereport-box { width: 520px; height: 350px; background-color: #fff; } diff --git a/web/static/css/style.css b/web/static/css/style.css index 678a053..f31ea92 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -549,7 +549,8 @@ label:not(.form-check-label):not(.custom-file-label) { font-weight: 400; } .screen-con-bg .content-type { cursor: pointer; height: 28px; line-height: 28px; margin-left: 4px; padding: 0 6px; color: #67729d; background-color: #f0f2f5; } .screen-con-bg .content-type .screen-content-sel { height: 28px; border: 0; background-color: #f0f2f5; color: #67729d; } -.screen-con-bg .right-box { margin-left: 4px; background-color: #f0f2f5; padding: 0 6px; color: #67729d; height: 28px; } +.screen-con-bg .right-box { margin-left: 4px; background-color: #f0f2f5; padding: 0 6px; color: #67729d; height: 28px; line-height: 28px; } +.right-date-box { width: 140px; height: 28px; background-color: #f0f2f5; border:0; color: #67729d; } .screen-con-bg .right-box .screen-right-txt { width: 120px; height: 28px; background-color: #f0f2f5; border:0; color: #67729d; } .screen-content-time-box { cursor: pointer; display: none; }