实时报表 时间检索条件优化
This commit is contained in:
@@ -93,6 +93,12 @@
|
||||
function changeReportType(reportType) {
|
||||
$("#intype").remove();
|
||||
var reportTime = "${bean.reportTime }";
|
||||
var time=getNowFormatDate();
|
||||
if(reportTime.length==4){
|
||||
reportTime = reportTime+"-"+time.substring(5,10);
|
||||
}else if(reportTime.length==7){
|
||||
reportTime = reportTime+"-"+time.substring(8,10);
|
||||
}
|
||||
if(reportType == 1){//需删除元素后重新添加,直接更改onclick会出现缓存问题
|
||||
$("#reportTypeDiv").append('<input id="intype" name="reportTime" class="form-control input-medium Wdate" type="text" value="' + reportTime + '" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy-MM-dd",isShowClear:true});>');
|
||||
} else if(reportType == 2){
|
||||
@@ -101,6 +107,24 @@
|
||||
$("#reportTypeDiv").append('<input id="intype" name="reportTime" class="form-control input-medium Wdate" type="text" value="' + reportTime.substring(0, 4) + '" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy",isShowClear:true});>');
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前时间
|
||||
function getNowFormatDate() {
|
||||
var date = new Date();
|
||||
var seperator1 = "-";
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var currentdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
var ajaxServiceLogTotal=function(){
|
||||
var services=[];
|
||||
var objs=[];
|
||||
|
||||
Reference in New Issue
Block a user