This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-ntc/src/main/webapp/WEB-INF/views/basics/urlCommGroupList.jsp
2019-07-19 15:26:11 +08:00

360 lines
20 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="url_group_configuration"></spring:message></title>
<script>
$(document).ready(function() {
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.cfgKeywords}"){
$("#intype").val("${cfg.cfgKeywords}");
}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",'');
$("#description").attr("value",'');
$("#searchForm")[0].reset();
});
if($("#exportType").val() != null && $("#exportType").val() != ""){
if($("#intype").val() != null && $("#intype").val() != ""){
$("#exportValue").val($("#intype").val());
}
}
//修改导入Form表单action
var importPath="/basics/url/list?functionId=${cfg.functionId}"
$("#importForm1").attr("action","${ctx}/basics/url/import?importPath="+importPath);
});
var edit=function(url){
var cked = $('tbody tr td input.i-checks:checkbox:checked');
if(cked.val()==1){
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
return;
}
if(cked.length==1){
window.location = url+"&compileId="+cked.attr("id");
}else{
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
return;
}
}
function deletes(url){
var checkboxes = $("tbody tr td input.i-checks:checkbox");
var ids = "";
var str = "";
var groupIds = "";
var canDel = true;
checkboxes.each(function(){
if(true == $(this).is(':checked')){
ids += ","+$(this).attr("id");
str += ","+$(this).attr("groupId")+"_"+$(this).attr("id");
groupIds += ","+$(this).attr("groupId");
}
});
ids = ids.substr(1);
str = str.substr(1);
groupIds = groupIds.substr(1);
var tipInfoAdd = "";
var tipCompileIds = "";
if(ids.length >0){ // 选中单个或多个
$.ajax({
type:'post',
url:'${ctx}/basics/commonGroup/ajaxCheckIsLastOneCfg',
data:{"grouIdAndCfgId":str,"groupType":7},
async:false,
success:function(data,textStatus){// 处理返回结果
if(data.length > 0 && typeof(data) == 'object'){
canDel = false;
for(var index in data){
tipCompileIds += ","+data[index]
}
tipCompileIds = tipCompileIds.substr(1);
}
}
});
if(!canDel){
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+"";
}
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
if(v=="ok"){
loading('onloading');
window.location = url+"&ids="+ids+"&groupIds="+groupIds;
}
},{buttonsFocus:1});
top.$('.jbox-body .jbox-icon').css('top','55px');
}else{ // 未选中任何 批量
loading('onloading');
var myData = {};
var groupId = $("#groupId").val();
if($("#intype").val() != null && $("#intype").val() != ""){
myData[$("#seltype").val()] = $("#intype").val();
}
if(groupId != ''){
myData["groupId"] = groupId;
}
myAjax = $.ajax({
type:'post',
url:'${ctx}/basics/url/ajaxCheckIsLastOneCfgBatch',
data:myData,
success:function(data,textStatus){// 处理返回结果
if(data.length > 0 && typeof(data) == 'object'){
canDel = false;
for(var index in data){
tipCompileIds += ","+data[index]
}
tipCompileIds = tipCompileIds.substr(1);
}
}
});
// myAjax异步请求完毕后执行
$.when(myAjax).done(function() {
if(!canDel){
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+"";
}
top.$.jBox.closeTip();
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
if(v=="ok"){
$("#searchForm").attr("action",url);
page();
}
});
});
}
}
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="url:common:config">
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/basics/url/addForm?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message>
</button>
<c:set var="serviceImport" value="false"></c:set>
<c:forEach items="${serviceList}" var="service" >
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
<c:set var="serviceImport" value="true"></c:set>
</c:if>
</c:forEach>
<c:if test="${serviceImport eq 'true'}">
<button type="button" class="btn btn-primary import" >
<i class="fa fa-plus"></i>
<spring:message code="import"></spring:message>
</button>
</c:if>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="url_group_configuration"></spring:message>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/basics/url/list?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="exportType" type="hidden" value="${cfg.seltype}"/>
<input id="exportValue" type="hidden" value=""/>
<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">
<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="cfgKeywords"><spring:message code="key_word"/></form:option>
</form:select>
</div>
<input id="intype" class="form-control input-medium" type="text" value="">
</div>
</div>
<div class="pull-left">
<form:select path="groupId" class="selectpicker select2 input-small" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code='group_name'/></form:option>
<c:forEach items="${policyGroupInfos}" var="policyGroup">
<form:option value="${policyGroup.serviceGroupId}"><spring:message code='${policyGroup.groupName}'/></form:option>
</c:forEach>
</form:select>
</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="url:common:config">
<sys:delRow url="${ctx}/basics/url/updateForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
<%-- <sys:delRow url="${ctx}/basics/url/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow> --%>
<a href="javascript:void(0);" class="btn btn-default" onclick="deletes('${ctx}/basics/url/delete?isValid=-1&functionId=${cfg.functionId }')" data-toggle="tooltip" data-placement="top">
<i class="fa fa-trash"> <spring:message code="delete"/></i>
</a>
</shiro:hasPermission>
<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="export"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
<li><sys:delRow url="${ctx}/basics/url/exportUrlComm?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/basics/url/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
<li><sys:delRow url="${ctx}/basics/url/exportUrlComm?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/basics/url/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
</ul>
</div>
<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-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>
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<sys:message content="${message}" type="${messageType }"/>
<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="sort-column r.cfg_desc" column="config_describe" ><spring:message code="config_describe"/></th>
<th class="sort-column r.group_id" column="groupId"><spring:message code="group_name"/></th>
<th class="sort-column cfg_keywords"><spring:message code="key_word"/></th>
<th column="expression_type" ><spring:message code="expression_type"/></th>
<th column="match_method" ><spring:message code="match_method"/></th>
<th column="creator" ><spring:message code="creator"/></th>
<th column="config_time" class="sort-column create_time"><spring:message code="config_time"/></th>
<th column="editor" ><spring:message code="editor"/></th>
<th column="edit_time" class="sort-column edit_time"><spring:message code="edit_time"/></th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr>
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" isValid="${cfg.isValid}" value="${cfg.isAudit}" groupId="${cfg.groupId}"></td>
<td>${cfg.cfgDesc }</td>
<td>
<c:forEach items="${policyGroupInfos}" var="info">
<c:if test="${cfg.groupId eq info.serviceGroupId }">
<spring:message code="${info.groupName }"/>
</c:if>
</c:forEach>
</td>
<td>${cfg.cfgKeywords }</td>
<td>
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq cfg.exprType}">
<spring:message code="${exprTypeC.itemValue}"/>
</c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${matchMethodC.itemCode eq cfg.matchMethod}">
<spring:message code="${matchMethodC.itemValue}"/>
</c:if>
</c:forEach>
</td>
<td>${cfg.creatorName }</td>
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${cfg.editorName }</td>
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
</div>
</div>
</div>
</div>
<c:set var="importPath" value="/basics/url/list?functionId=${cfg.functionId}"/>
<!-- 模板导入start -->
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
</body>
</html>