report日期选择方式更改

This commit is contained in:
chenjinsong
2018-07-10 10:08:36 +08:00
parent 74246e1f1f
commit 8f95c95b82
2 changed files with 132 additions and 113 deletions

View File

@@ -6,6 +6,7 @@ import java.util.Calendar;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@@ -139,7 +140,7 @@ public class NtcTagReportController extends BaseController {
// // TODO: handle exception // // TODO: handle exception
// e.printStackTrace(); // e.printStackTrace();
// } // }
HashMap<String,List<Long>> showData=new HashMap<>();//构造数据展示集合 HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(ServiceDictInfo label:labels){ for(ServiceDictInfo label:labels){
List<Long> line= new ArrayList<Long>(); List<Long> line= new ArrayList<Long>();
long total=0l; long total=0l;

View File

@@ -7,6 +7,11 @@
$(document).ready(function() { $(document).ready(function() {
//筛选功能初始化 //筛选功能初始化
filterActionInit(); filterActionInit();
//日期类型初始化
changeReportType("${bean.reportType}", true);
$("#reportType").change(function(){
changeReportType($("#reportType", false).val());
});
//reset //reset
$("#resetBtn").on("click",function(){ $("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){ $("select.selectpicker").each(function(){
@@ -44,6 +49,20 @@
} }
}); });
}); });
function changeReportType(reportType, init) {
$("#intype").remove();
if(reportType == 1){//需删除元素后重新添加直接更改onclick会出现缓存问题
$("#reportTypeDiv").append('<input id="intype" class="form-control input-medium" type="text" value="" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy-MM-dd",isShowClear:true});>');
} else if(reportType == 2){
$("#reportTypeDiv").append('<input id="intype" class="form-control input-medium" type="text" value="" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy-MM",isShowClear:true});>');
} else if(reportType == 3){
$("#reportTypeDiv").append('<input id="intype" class="form-control input-medium" type="text" value="" readonly="readonly" onclick=WdatePicker({dateFmt:"yyyy",isShowClear:true});>');
}
if (init) {
}
}
var ajaxGetLabelReport=function(){ var ajaxGetLabelReport=function(){
$.ajax({ $.ajax({
type:'post', type:'post',
@@ -94,125 +113,124 @@ var ajaxGetLwhhReport=function(){
<small><spring:message code="report_list"/></small> <small><spring:message code="report_list"/></small>
</h3> </h3>
<h5 class="page-header"></h5> <h5 class="page-header"></h5>
<div class="row"> <div class="col-md-12">
<div class="col-md-12"> <div class="portlet">
<div class="portlet"> <div class="portlet-body">
<div class="portlet-body"> <div class="row" >
<div class="row" > <form:form id="searchForm" modelAttribute="bean" action="${ctx}/report/list" method="post" class="form-search">
<form:form id="searchForm" modelAttribute="bean" action="${ctx}/report/list" method="post" class="form-search"> <input id="functionId" name="functionId" type="hidden" value="${bean.functionId}"/>
<input id="functionId" name="functionId" type="hidden" value="${bean.functionId}"/> <input name="cfgName" type="hidden" value="${bean.cfgName}"/>
<input name="cfgName" type="hidden" value="${bean.cfgName}"/> <input id="reportBusinessType" name="reportBusinessType" type="hidden" value="${bean.reportBusinessType}"/>
<input id="reportBusinessType" name="reportBusinessType" type="hidden" value="${bean.reportBusinessType}"/> <!-- 筛选按钮展开状态-->
<!-- 筛选按钮展开状态--> <input id="isFilterAction" name="isFilterAction" type="hidden" value="${bean.isFilterAction }"/>
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${bean.isFilterAction }"/> <!-- 搜索内容与操作按钮栏 -->
<!-- 搜索内容与操作按钮栏 --> <div class="col-md-12">
<div class="col-md-12"> <div class="pull-left">
<div class="pull-left"> <form:select path="action" class="selectpicker select2 input-small">
<form:select path="action" class="selectpicker select2 input-small"> <form:option value=""><spring:message code="action"/></form:option>
<form:option value=""><spring:message code="action"/></form:option> <c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action" >
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action" > <c:forEach items="${serviceList}" var="service" >
<c:forEach items="${serviceList}" var="service" > <c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}">
<c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}"> <form:option value="${action.itemCode}" ><spring:message code="${action.itemValue}"/></form:option>
<form:option value="${action.itemCode}" ><spring:message code="${action.itemValue}"/></form:option> </c:if>
</c:if>
</c:forEach>
</c:forEach> </c:forEach>
</form:select> </c:forEach>
</div> </form:select>
<div class="pull-left">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default">
<input type="radio" name="reportType" value="1"
<c:if test="${bean.reportType==1}">checked</c:if>
><spring:message code="小时报"/>
</label>
<label class="btn btn-default">
<input type="radio" name="reportType" value="2"
<c:if test="${bean.reportType==2}">checked</c:if>
><spring:message code="日报"/>
</label>
<label class="btn btn-default">
<input type="radio" name="reportType" value="3"
<c:if test="${bean.reportType==3}">checked</c:if>
><spring:message code="月报"/>
</label>
</div>
</div>
<div class="pull-left">
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<sys:delRow url="${ctx}/report/export?functionId=${cfg.functionId}" id="contentTable" label="export" maxRow="${page.maxExportSize}"></sys:delRow>
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/><i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
</a>
</div>
</div> </div>
<!-- 搜索内容与操作按钮栏 --> <div class="pull-left">
<div class="btn-group" data-toggle="buttons">
<!-- 筛选搜索内容栏默认隐藏--> <label class="btn btn-default">
<div class="col-md-12 filter-action-select-panle hide" > <input type="radio" name="reportType" value="1"
<c:if test="${bean.reportType==1}">checked</c:if>
><spring:message code="小时报"/>
</label>
<label class="btn btn-default">
<input type="radio" name="reportType" value="2"
<c:if test="${bean.reportType==2}">checked</c:if>
><spring:message code="日报"/>
</label>
<label class="btn btn-default">
<input type="radio" name="reportType" value="3"
<c:if test="${bean.reportType==3}">checked</c:if>
><spring:message code="月报"/>
</label>
</div>
</div> </div>
<!-- /筛选搜索内容栏 结束--> <div class="pull-left">
</form:form> <button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
</div> <button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<sys:delRow url="${ctx}/report/export?functionId=${cfg.functionId}" id="contentTable" label="export" maxRow="${page.maxExportSize}"></sys:delRow>
<div class="table-responsive"> <button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/><i class="fa fa-angle-double-down"></i></button>
<sys:message content="${message}"/> </div>
<br> <div class="pull-right">
<ul class="nav nav-tabs nav-justified"> <a class="btn btn-icon-only btn-default setfields tooltips"
<li data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}"> <i class="icon-wrench"></i>
class="active" </a>
</c:if> </div>
><a data-bussiness="label_report" data-toggle="tab" href="#label"><spring:message code="label_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'attr_type_report'}">
class="active"
</c:if>
><a data-bussiness="attr_type_report" data-toggle="tab" href="#attrType"><spring:message code="attr_type_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
class="active"
</c:if>
><a data-bussiness="lwhh_report" data-toggle="tab" href="#lwhh"><spring:message code="lwhh_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'src_ip_report'}">
class="active"
</c:if>
><a data-bussiness="src_ip_report" data-toggle="tab" href="#srcIp"><spring:message code="src_ip_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'dest_ip_report'}">
class="active"
</c:if>
><a data-bussiness="dest_ip_report" data-toggle="tab" href="#destIp"><spring:message code="dest_ip_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'isp_report'}">
class="active"
</c:if>
><a data-bussiness="isp_report" data-toggle="tab" href="#entranceId"><spring:message code="isp_report"/></a></li>
</ul>
<div class="tab-content">
<div id="label" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}">
in active
</c:if>"></div>
<%@include file="/WEB-INF/views/report/attrType.jsp" %>
<div id="lwhh" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
in active
</c:if>"></div>
<%@include file="/WEB-INF/views/report/srcIp.jsp" %>
<%@include file="/WEB-INF/views/report/destIp.jsp" %>
<%@include file="/WEB-INF/views/report/entranceId.jsp" %>
</div> </div>
<!-- 搜索内容与操作按钮栏 -->
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<div class="table-responsive">
<sys:message content="${message}"/>
<br>
<ul class="nav nav-tabs nav-justified">
<li
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}">
class="active"
</c:if>
><a data-bussiness="label_report" data-toggle="tab" href="#label"><spring:message code="label_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'attr_type_report'}">
class="active"
</c:if>
><a data-bussiness="attr_type_report" data-toggle="tab" href="#attrType"><spring:message code="attr_type_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
class="active"
</c:if>
><a data-bussiness="lwhh_report" data-toggle="tab" href="#lwhh"><spring:message code="lwhh_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'src_ip_report'}">
class="active"
</c:if>
><a data-bussiness="src_ip_report" data-toggle="tab" href="#srcIp"><spring:message code="src_ip_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'dest_ip_report'}">
class="active"
</c:if>
><a data-bussiness="dest_ip_report" data-toggle="tab" href="#destIp"><spring:message code="dest_ip_report"/></a></li>
<li
<c:if test="${bean.reportBusinessType eq 'isp_report'}">
class="active"
</c:if>
><a data-bussiness="isp_report" data-toggle="tab" href="#entranceId"><spring:message code="isp_report"/></a></li>
</ul>
<div class="tab-content">
<div id="label" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'label_report' or bean.reportBusinessType ==null}">
in active
</c:if>"></div>
<%@include file="/WEB-INF/views/report/attrType.jsp" %>
<div id="lwhh" class="tab-pane fade
<c:if test="${bean.reportBusinessType eq 'lwhh_report'}">
in active
</c:if>"></div>
<%@include file="/WEB-INF/views/report/srcIp.jsp" %>
<%@include file="/WEB-INF/views/report/destIp.jsp" %>
<%@include file="/WEB-INF/views/report/entranceId.jsp" %>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
</body> </body>
</html> </html>