AV-VOIP 列表功能完成,新增界面整体搭建完成

This commit is contained in:
duandongmei
2018-05-22 17:30:52 +08:00
parent c6a9ac126d
commit b87cb3ca26
13 changed files with 1776 additions and 17 deletions

View File

@@ -0,0 +1,407 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<!-- BEGIN THEME GLOBAL STYLES -->
<link href="${pageContext.request.contextPath}/static/global/css/components.css" rel="stylesheet" id="style_components" type="text/css" />
<script src="${pageContext.request.contextPath}/static/global/scripts/common.js" type="text/javascript"></script>
<style type="text/css">
.boxSolid{
border:1px solid #eeeeee
}
</style>
<script type="text/javascript">
$(function(){
switchIpType($("select[name$='ipType']"));
areaControlInit();
$("input[name='isAreaEffective']").on('change',function(){
var val=$(this).val();
if(val==1){
$(".areaType").removeClass("hidden");
if($("input[name='areaType']:checked").val()==1){//areaISP
$("#areaIsp").removeClass("hidden");
}else if($("input[name='areaType']:checked").val()==0){//areaIp
$("#areaIp").removeClass("hidden");
}
}else{
$(".areaType").addClass("hidden");
$("#areaIp").addClass("hidden");
$("#areaIsp").addClass("hidden");
}
});
$("select[name$='ipType']").on("change",function(){
switchIpType($(this));
});
$("input[name='areaType']").on('change',function(){
var val=$(this).val();
if($(this).is(":visible")){
if(val==0){
$("#areaIp").removeClass("hidden");
$("#areaIsp").addClass("hidden");
}else{
$("#areaIsp").removeClass("hidden");
$("#areaIp").addClass("hidden");
}
}else{
$("#areaIsp").addClass("hidden");
$("#areaIp").addClass("hidden");
}
});
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});
$("#cfgFrom").validate({
errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
},
submitHandler: function(form){
//loading('onloading...');
form.submit();
},
errorContainer: "#messageBox",
});
//业务内容增加
$("span[title='add']").on("click",function(){
$(".voipIp0").removeClass("hidden");
});
});
//业务窗口打开
var addContent=function(obj,contentClassName){
$("."+contentClassName+"0").removeClass("hidden").removeClass("disabled");
$(obj).addClass("hidden");
}
//业务窗口关闭
var delContent=function(contentClassName,addBtnClassName){
$("."+contentClassName).addClass("hidden").addClass("disabled");;
$("."+addBtnClassName).removeClass("hidden");
}
</script>
</head>
<body>
<div class="page-content">
<%-- <h3 class="page-title">
<spring:message code="${add}"></spring:message>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/ntc/av/voip/saveVoip" method="post" class="form-horizontal">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<!-- 配置域类型 -->
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
</c:if>
</c:forEach>
<div class="form-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
<div class="col-md-8">
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="action"/></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service" varStatus="satus">
<label class="radio-inline">
<c:if test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action" serviceId="${service.serviceId }" value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || _cfg.action==null}">checked</c:if>
>
<spring:message code="${service.actionCode }"/>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<!--/ip info-->
<h4 class="form-section"> <spring:message code="ac_voip_ip_title"/><small> <span class="glyphicon glyphicon-plus hidden voipIpAdd" onClick="addContent(this,'voipIp')" title="add"></span></small></h4>
<c:forEach items="${_cfg.voipIps}" var="voipIp" varStatus="status">
<div class="row boxSolid voipIp${status.index }">
<div class="row">
<div class="pull-right">
<span class="glyphicon glyphicon-remove pull-right" title="remove" onClick="delContent('voipIp${status.index }','voipIpAdd');"/>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
<div class="col-md-6">
<select name="_cfg.voipIps[${status.index }].ipType" class="selectpicker show-tick form-control required">
<option value="4" <c:if test="${voipIp.ipType==4 || voipIp.ipType==null }">selected</c:if> >V4</option>
<option value="6" <c:if test="${voipIp.ipType==6}">selected</c:if>>V6</option>
</select>
</div>
<div for="ipType"></div>
</div>
</div>
</div>
<div class="row ip">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
<div class="col-md-6">
<select name="_cfg.voipIps[${status.index }].ipPattern" class="selectpicker show-tick form-control required">
<option value="1" <c:if test="${voipIp.ipPattern==1 || voipIp.ipPattern==null}">selected</c:if> ><spring:message code="subnet"/></option>
<option value="2" <c:if test="${voipIp.ipPattern==2}">selected</c:if>><spring:message code="ip_range"/></option>
<option value="3" <c:if test="${voipIp.ipPattern==3}">selected</c:if>>IP</option>
</select>
</div>
<div for="ipPattern"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
<div class="col-md-6">
<input class="form-control required" type="text" name="_cfg.voipIps[${status.index }].srcIpAddress" value="${voipIp.srcIpAddress}">
</div>
<div for="srcIpAddress"></div>
</div>
</div>
</div>
<div class="row hidden disabled port">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
<div class="col-md-6">
<select name="_cfg.voipIps[${status.index }].portPattern" class="selectpicker show-tick form-control required">
<option value="1" <c:if test="${voipIp.portPattern==1 || voipIp.portPattern== null}">selected</c:if> >port</option>
<option value="2" <c:if test="${voipIp.portPattern==2}">selected</c:if>><spring:message code="port_range"/></option>
</select>
</div>
<div for="portPattern"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
<div class="col-md-6">
<input class="form-control required" type="text" name="_cfg.voipIps[${status.index }].srcPort" value="${voipIp.srcPort}">
</div>
<div for="srcPort"></div>
</div>
</div>
</div>
<div class="row hidden disabled destIpPort">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
<div class="col-md-6">
<input class="form-control required" type="text" name="_cfg.voipIps[${status.index }].destIpAddress" value="${voipIp.destIpAddress}">
</div>
<div for="destIpAddress"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6">
<input class="form-control required" type="text" name="_cfg.voipIps[${status.index }].destPort" value="${voipIp.destPort}">
</div>
<div for="destPort"></div>
</div>
</div>
</div>
<div class="row hidden disabled protocol">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="protocol"/></label>
<div class="col-md-6">
<select name="_cfg.voipIps[${status.index }].protocol" class="selectpicker show-tick form-control required">
<option value=""><spring:message code="select"/></option>
<option value="6" <c:if test="${voipIp.protocol==6}">selected</c:if>>TCP</option>
<option value="17" <c:if test="${voipIp.protocol==17}">selected</c:if>>UDP</option>
<option value="0" <c:if test="${voipIp.protocol==0 || voipIp.protocol==null}">selected</c:if>><spring:message code="arbitrary"/></option>
</select>
<%-- <input class="form-control" type="text" name="protocol" value="${_cfg.protocol}"> --%>
</div>
<div for="protocol"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="direction"/></label>
<div class="col-md-6">
<select name="_cfg.voipIps[${status.index }].direction" class="selectpicker show-tick form-control required" >
<option value=""><spring:message code="select"/></option>
<option value="0" <c:if test="${voipIp.direction==0 || voipIp.direction==null}">selected</c:if>><spring:message code="twoway"/></option>
<option value="1" <c:if test="${voipIp.direction==1 }">selected</c:if>>源<spring:message code="ingress"/></option>
<option value="2" <c:if test="${voipIp.direction==2 }">selected</c:if>>目的<spring:message code="degress"/></option>
</select>
</div>
<div for="direction"></div>
</div>
</div>
</div>
<div class="row">
<button type="button" class="btn btn-red-hollow center-block" onClick="more(this);" data-click-times="0"><spring:message code="show_more"/></button>
</div>
<br>
</div>
</c:forEach>
<!--/ip info-->
<!--account info-->
<h4 class="form-section"> <spring:message code="ac_voip_account_title"/><small> <span class="glyphicon glyphicon-plus hidden voipAccountAdd" onClick="addContent(this,'voipAccount')" title="add"></span></small></h4>
<c:forEach items="${_cfg.voipAccounts}" var="voipAccount" varStatus="status">
<div class="row boxSolid voipAccount${status.index }">
<div class="row">
<div class="pull-right">
<span class="glyphicon glyphicon-remove pull-right" title="remove" onClick="delContent('voipAccount${status.index }','voipAccountAdd');"/>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="district"/></label>
<div class="col-md-6">
<select name="_cfg.voipAccounts[${status.index }].district" class="selectpicker show-tick form-control required">
<c:forEach items="${regionList}" var="regionDistrict">
<c:if test="${_cfg.functionId eq regionDistrict.functionId}">
<c:forEach items="${fn:split(regionDistrict.configDistrict,',')}" var="_district">
<option value="${_district }" <c:if test="${voipAccount.district==_district || voipAccount.district==null}">selected</c:if> >${_district }</option>
</c:forEach>
</c:if>
</c:forEach>
</select>
</div>
<div for="district"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>关键词</label>
<div class="col-md-6">
<input class="form-control required" type="text" name="_cfg.voipAccounts[${status.index }].cfgKeywords" value="${voipAccount.cfgKeywords}">
</div>
<div for="cfgKeywords"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="expression_type"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="_cfg.voipAccounts[${status.index }].exprType" value="1" class="required"
<c:if test="${voipAccount.exprType==1}">checked</c:if>
><spring:message code="and"/>
</label>
<label class="radio-inline">
<input type="radio" name="_cfg.voipAccounts[${status.index }].exprType" value="0" class="required"
<c:if test="${voipAccount.exprType==0 || voipAccount.exprType==null}">checked</c:if>
><spring:message code="null"/>
</label>
</div>
<div for="exprType"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="match_method"/></label>
<div class="col-md-6">
<select name="_cfg.voipAccounts[${status.index }].matchMethod" class="selectpicker select2 form-control required" >
<option value=""><spring:message code="select"/></option>
<option value="0" <c:if test="${voipAccount.matchMethod==0 }">selected</c:if>><spring:message code="substring_match"></spring:message></option>
<option value="1" <c:if test="${voipAccount.matchMethod==1 }">selected</c:if>><spring:message code="right_match"></spring:message></option>
<option value="2" <c:if test="${voipAccount.matchMethod==2 }">selected</c:if>><spring:message code="left_match"></spring:message></option>
<option value="3" <c:if test="${voipAccount.matchMethod==3 || voipAccount.matchMethod==null}">selected</c:if>><spring:message code="exactly_match"></spring:message></option>
</select>
</div>
<div for="matchMethod"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="whether_hexbinary"/></label>
<div class="col-md-6">
<select name="_cfg.voipAccounts[${status.index }].isHexbin" class="selectpicker select2 form-control required">
<option value=""><spring:message code="select"/></option>
<option value="0" <c:if test="${voipAccount.isHexbin==0 || voipAccount.isHexbin==null}">selected</c:if>><spring:message code="case_insensitive_nohex"></spring:message></option>
<option value="1" <c:if test="${voipAccount.isHexbin==1 }">selected</c:if>><spring:message code="hex_binary"></spring:message></option>
<option value="2" <c:if test="${voipAccount.isHexbin==2 }">selected</c:if>><spring:message code="case_sensitive_nohex"></spring:message></option>
</select>
</div>
<div for="isHexbin"></div>
</div>
</div>
</div>
</div>
</c:forEach>
<!--account info-->
<br>
<%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> --%>
<br>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
</div>
<div class="col-md-6"> </div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,712 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<link href="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet"/>
<link href="${pageContext.request.contextPath}/static/global/plugins/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/bootstrap-select.min.js"></script>
<c:choose>
<c:when test="${cookie.Language.value eq 'zh_CN'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-zh_CN.min.js"></script>
</c:when>
<c:when test="${cookie.Language.value eq 'en'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-en_US.min.js"></script>
</c:when>
<c:when test="${cookie.Language.value eq 'ru_RU'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-ru_RU.min.js"></script>
</c:when>
<c:otherwise>
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-en_US.min.js"></script>
</c:otherwise>
</c:choose>
<script>
$(document).ready(function() {
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.voipIp.srcIpAddress}"){
$("#intype").val("${cfg.voipIp.srcIpAddress}");
}else if("${cfg.voipIp.srcPort}"){
$("#intype").val("${cfg.voipIp.srcPort}");
}else if("${cfg.voipAccount.cfgKeywords}"){
$("#intype").val("${cfg.voipAccount.cfgKeywords}");
}else if("${cfg.voipAccount.district}"){
$("#intype").val("${cfg.voipAccount.district}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
$("#seltype").change(function(){
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
});
//筛选功能初始化
filterActionInit();
$("#isAudit").change(function(){
page();
});
//reset
$("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){
$(this).selectpicker('val',$(this).find('option:first').val());
$(this).find("option").attr("selected",false);
$(this).find("option:first").attr("selected",true);
});
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
});
//异步获取voip相关信息
$("span[id^=open]").click(function(){
var openId=$(this).attr("id");
var closeId=$(this).attr("id").replace("open","close");
var index=$(this).attr("id").replace("open","");
$("#"+openId).hide();
$("#"+closeId).show();
var compileId=$(this).attr("compileId");
var cfgId=$(this).attr("cfgId");
var hasIp=false;
var hasAccount=false;
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
$("#"+openId).parent().parent().next("tr").show();
}else{
$.ajax({
type:'post',
async:false,
url:'${ctx}/ntc/av/ajaxVoipAndAccountInfo',
data:{"compileId":compileId,"cfgId":cfgId},
success:function(data){
var voipIpCfgTab="<tr class='child'>"+
"<td style='border-right: 1px solid #FFFFFF;'>"+
"<input type='checkbox' hidden='hidden'/>"+
"</td>"+
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
var html="";
html+="<div class='row'>";
if(data.ip.length >0){
hasIp=true;
html+="<div id='ipTitle"+index+"' onclick='switchInfo(\"account\","+index+")' class='col-md-1' style='width:150px;background-color: #eeeeee;border: 1px solid #c2cad8;padding: 5px;border-bottom:0px'>";
html+="<spring:message code='av_voip_ip_title'/>";
html+="<i id='ipDown"+index+"' class='fa fa-angle-double-down' ></i>";
html+="<i id='ipUp"+index+"' class='fa fa-angle-double-up ' style='display:none'></i>";
html+="</div>";
}
if(data.account.length >0){
hasAccount=true;
html+="<div id='accountTitle"+index+"' onclick='switchInfo(\"ip\","+index+")' class='col-md-1' style='width:150px;background-color: #f6f3f3;border: 1px solid #c2cad8;padding: 5px;border-bottom:0px'>";
html+="<spring:message code='av_voip_account_title'/>";
html+="<i id='accountDown"+index+"' class='fa fa-angle-double-down ' style='display:none'></i>";
html+="<i id='accountUp"+index+"' class='fa fa-angle-double-up '></i>";
html+="</div>";
}
html+="</div>";
//ip信息
if(data.ip.length >0){
html+="<div id='ipInfo"+index+"' style='width:1050px;background-color: #f6f3f3;border: 1px solid #c2cad8;padding: 5px;'>";
$.each(data.ip,function(index,item){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='ip_type'/></label>";
html+="<label>"
if(item.ipType==4){
html+="V4";
}
if(item.ipType==6){
html+="V6";
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='ip_pattern'/></label>";
html+="<label>"
if(item.ipPattern==1){
html+="<spring:message code='subnet'/>"
}
if(item.ipPattern==2){
html+="<spring:message code='ip_range'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='client_ip'/></label>";
html+="<label>"
html+=item.srcIpAddress;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='port_pattern'/></label>";
html+="<label>"
if(item.portPattern==1){
html+="<spring:message code='subnet'/>"
}
if(item.portPattern==2){
html+="<spring:message code='ip_range'/>"
}
if(item.portPattern==3){
html+="IP"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='client_port'/></label>";
html+="<label>"
html+=item.srcPort;
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='server_ip'/></label>";
html+="<label>"
html+=item.destIpAddress;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='server_port'/></label>";
html+="<label>"
html+=item.destPort;
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='direction'/></label>";
html+="<label>"
if(item.direction==0){
html+="<spring:message code='twoway'/>"
}
if(item.direction==1){
html+="<spring:message code='ingress'/>"
}
if(item.direction==2){
html+="<spring:message code='degress'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='protocol'/></label>";
html+="<label>"
if(item.protocol==6){
html+="TCP"
}
if(item.protocol==17){
html+="UDP"
}
if(item.protocol==2){
html+="<spring:message code='arbitrary'/>"
}
html+=item.protocol;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
html+="<h5 class='page-header'></h5>";*/
})
html+="</div>";
}
//account信息
if(data.account.length > 0){
html+="<div id='accountInfo"+index+"' style='display:none;width:1050px;background-color: #f6f3f3;border: 1px solid #c2cad8;padding: 5px;'>";
$.each(data.account,function(index,item){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='key_word'/></label>";
html+="<label>"
html+=item.cfgKeywords;
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='strong_string'/></label>";
html+="<label>"
html+=item.district;
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='expression_type'/></label>";
html+="<label>"
if(item.exprType==1){
html+="<spring:message code='and'/>"
}
if(item.exprType==0){
html+="<spring:message code='null'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='match_method'/></label>";
html+="<label>"
if(item.matchMethod==0){
html+="<spring:message code='substring_match'/>"
}
if(item.matchMethod==1){
html+="<spring:message code='right_match'/>"
}
if(item.matchMethod==2){
html+="<spring:message code='left_match'/>"
}
if(item.matchMethod==3){
html+="<spring:message code='exactly_match'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='whether_hexbinary'/></label>";
html+="<label>"
if(item.isHexbin==1){
html+="<spring:message code='hex_binary'/>"
}
if(item.isHexbin==2){
html+="<spring:message code='case_sensitive_nohex'/>"
}
if(item.isHexbin==0){
html+="<spring:message code='case_insensitive_nohex'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label></label>";
html+="<label>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
html+="<h5 class='page-header'></h5>";*/
})
html+="</div>";
}
voipIpCfgTab=voipIpCfgTab+html;
voipIpCfgTab+="</td>";
voipIpCfgTab+="</tr>";
$("#"+openId).parent().parent().after(voipIpCfgTab);
if(hasAccount && ! hasIp){
switchInfo("ip",index);
}
}
});
}
});
$("span[id^=close]").on("click",function(){
var closeId=$(this).attr("id");
var openId=$(this).attr("id").replace("close","open");
$("#"+closeId).hide();
$("#"+openId).show();
$("#"+closeId).parent().parent().next("tr").hide();
});
});
/* function edit() {
var checkboxes = $(".child-checks:checked");
if (checkboxes.length == 0) {
alertx("<spring:message code='one_more'/>");
} else if (checkboxes.length > 1) {
alertx("<spring:message code='check_one'/>");
} else {
window.location.href = "${ctx}/cfg/dnsIp/form?cfgId=" + checkboxes.attr("id");
}
}
function delCfg() {
var checkboxes = $(".child-checks:checked");
if (checkboxes.length == 0) {
alertx("<spring:message code='one_more'/>");
} else {
var ids = "";
checkboxes.each(function(){
ids = ids + $(this).attr("id") + ",";
});
console.log(ids);
if (confirm("<spring:message code='confirm_message'/>")) {
$("#fakeIds").val(ids);
$("#searchForm").attr("action","${ctx}/cfg/dnsIp/delete");
$("#searchForm").submit();
}
}
} */
function switchInfo(flag,index){
//关闭ip信息
if("ip" ==flag){
$("#ipInfo"+index).hide();
$("#downIp"+index).hide();
$("#ipTitle"+index).css("background-color","#f6f3f3");
$("#accountInfo"+index).show();
$("#accountDown"+index).show();
$("#accountUp"+index).hide();
$("#ipUp"+index).show();
$("#ipDown"+index).hide();
$("#accountTitle"+index).css("background-color","#eeeeee");
}else{
//关闭account信息
$("#accountInfo"+index).hide();
$("#downAccount"+index).hide();
$("#accountTitle"+index).css("background-color","#f6f3f3");
$("#ipInfo"+index).show();
$("#ipDown"+index).show();
$("#accountUp"+index).show();
$("#accountDown"+index).hide();
$("#ipUp"+index).hide();
$("#ipTitle"+index).css("background-color","#eeeeee");
}
}
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="avVoip:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/ntc/av/voipForm?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message></button>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="av_voip_control"></spring:message>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/ntc/av/voipList?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
callback="page();" />
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<c:set var="state"><spring:message code='state'/></c:set>
<form:select path="isAudit" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="all_states"/></form:option>
<form:option value="0"><spring:message code="created"></spring:message></form:option>
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
</form:select>
</div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
<form:option value="voipAccount.district"><spring:message code="strong_string"/></form:option>
</form:select>
</div>
<input id="intype" class="form-control input-medium" type="text" value="">
</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>
<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">
<shiro:hasPermission name="avVoip:audit">
<sys:delRow url="${ctx}/ntc/av/voipForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/ntc/av/updateAvVoip?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="avVoip:audit">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoip?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoip?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoip?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul>
</div>
</shiro:hasPermission>
<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 class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='request_number'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${requestInfos}" var="requestInfo" >
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='type'/></label>
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fls}" var="fl" >
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='attribute'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${xzs}" var="xz" >
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='label'/></label>
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${lables}" var="lable" >
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="config_time"/></label>
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="edit_time"/></label>
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="audit_time"/></label>
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<div class="table-responsive">
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="type"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="creator"/></th>
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
<th><spring:message code="editor"/></th>
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
<th><spring:message code="auditor"/></th>
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
<tr>
<td>
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.cfgDesc }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemValue eq indexCfg.action }">
<spring:message code="${dict.itemCode }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isAreaEffective==1}"><spring:message code="yes"/></c:if>
</td>
<td>${indexCfg.requestName }</td>
<td>
<c:forEach items="${fn:split(indexCfg.classify,',')}" var="classifyId">
<c:forEach items="${fls}" var="fl">
<c:if test="${classifyId eq fn:trim(fl.serviceDictId)}">
${fl.itemValue},
</c:if>
</c:forEach>
</c:forEach>
${classifyName[status]}
</td>
<td>
<c:forEach items="${fn:split(indexCfg.attribute,',')}" var="attributeId">
<c:forEach items="${xzs}" var="xz">
<c:if test="${attributeId eq fn:trim(xz.serviceDictId)}">${xz.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<td>
<c:forEach items="${fn:split(indexCfg.lable,',')}" var="lableId">
<c:forEach items="${lables}" var="lable">
<c:if test="${lableId eq fn:trim(lable.serviceDictId)}">${lable.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<td>
<c:if test="${indexCfg.isValid==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isValid==1}"><spring:message code="yes"/></c:if>
<c:if test="${indexCfg.isValid==-1}"><spring:message code="deleted"/></c:if>
</td>
<td>
<c:choose>
<c:when test="${indexCfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
</c:choose>
</td>
<td>${indexCfg.creatorName }</td>
<td><fmt:formatDate value="${indexCfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${indexCfg.editorName }</td>
<td><fmt:formatDate value="${indexCfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${indexCfg.auditorName }</td>
<td><fmt:formatDate value="${indexCfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page" style="margin-top:40px">${page}</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -368,11 +368,12 @@ function customColumnClick(){
return true;
}
}
if($(this).hasClass("cfgDesc")){
return true;
}
var checked = ($(this).is(":visible") ? "checked='checked'":"");
var ckbox_html = "<input type='checkbox' "+checked+" value='"+colIndex+"'/>";
html+="<div class='col-md-6'><label>"+ckbox_html+" "+$(this).html()+"</label></div>";
})
html +="</div>";
@@ -394,7 +395,9 @@ function customColumnInit() {
//选中则显示
showColumn(indexCol);
}else {
hideColumn(indexCol);
if($(".table tr th[class='cfgDesc']").index()!=indexCol){
hideColumn(indexCol);
}
}
})
}else {