This commit is contained in:
罗松柏 2021-09-16 20:05:16 +08:00
parent 90ce7d635a
commit b47dfd31b0
7 changed files with 168 additions and 44 deletions

View File

@ -3,12 +3,18 @@
{{# layui.each(d, function(index, item){ }}
<div class="analysis-overall-situation-list">
<div class="analysis-overall-situation-attr" data-index="{{index}}">{{item.columnDesc}}</div>
<div class="analysis-overall-situation-fuhao" id="analysis-overall-situation-fuhao-{{index}}" data-index="{{index}}" data-type="{{item.data_type}}" >{{item.comparator_name}}</div>
<div class="analysis-overall-situation-fuhao" data-index="{{index}}" data-type="{{item.data_type}}" >{{item.comparator_name}}</div>
{{# if(item.comparator != "is null" && item.comparator != "is not null" && item.comparator !="not null" && item.comparator != "range"){ }}
<div class="analysis-overall-situation-input" data-type="{{item.data_type}}">
<input type="text" data-index="{{index}}" placeholder="多个用,隔开" value="{{item.strftv}}" data-type="{{item.data_type}}"/>
</div>
{{# } }}
{{# if(item.data_type != "datetime"){ }}
<div class="analysis-overall-situation-input" data-type="{{item.data_type}}">
<input type="text" data-index="{{index}}" placeholder="多个用,隔开" value="{{item.strftv}}" data-type="{{item.data_type}}"/>
</div>
{{# } else { }}
<div class="analysis-overall-situation-date" id="analysis-overall-situation-date{{index}}" data-type="{{item.data_type}}" data-index="{{index}}">
{{item.ftv}}
</div>
{{# } }}
{{# } }}
{{# if(item.comparator === "range"){ }}
<div class="analysis-overall-situation-input2" > <input data-index="{{index}}" type="text" value="{{item.section[0]}}" name="start"/> <span></span> <input data-index="{{index}}" name="end" type="text" value="{{item.section[1]}}"/> <span>之间</span> </div>

View File

@ -39,10 +39,16 @@
<div class="screen-content-sel" data-index="{{index}}" data-type="{{item.data_type}}">{{item.comparator_name}}</div>
</div>
{{# if(item.comparator != "is null" && item.comparator != "is not null" && item.comparator !="not null" && item.comparator != "range"){ }}
<div class="right-box" >
<input type="type" class="screen-right-txt" data-index={{index}} placeholder="多个用,隔开" value="{{item.strftv}}">
</div>
{{# } }}
{{# if(item.data_type != "datetime"){ }}
<div class="right-box" data-type="{{item.data_type}}">
<input type="type" class="screen-right-txt" data-index={{index}} placeholder="多个用,隔开" value="{{item.strftv}}">
</div>
{{# } else { }}
<div class="right-box right-date-box" data-type="{{item.data_type}}" data-index="{{index}}">
{{item.ftv}}
</div>
{{# } }}
{{# } }}
<div class="screen-del" data-index="{{index}}"></div>
</div>

89
web/src/x.min.js vendored
View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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; }

View File

@ -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; }