系统业务管理功能
This commit is contained in:
@@ -5,6 +5,6 @@
|
||||
<script type="text/javascript">top.$.jBox.closeTip();</script>
|
||||
<c:if test="${not empty content}">
|
||||
<c:if test="${not empty type}"><c:set var="ctype" value="${type}"/></c:if><c:if test="${empty type}"><c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1?'success':'error'}"/></c:if>
|
||||
<div id="messageBox" class="alert alert-${ctype} hide"><button data-dismiss="alert" class="close">×</button>${content}</div>
|
||||
<div id="messageBox" class="alert alert-${ctype}"><button data-dismiss="alert" class="close">×</button>${content}</div>
|
||||
<script type="text/javascript">/* if(!top.$.jBox.tip.mess) */{top.$.jBox.tip.mess=1;top.$.jBox.tip("${content}","${ctype}",{persistent:true,opacity:0});$("#messageBox").show();} </script>
|
||||
</c:if>
|
||||
255
src/main/webapp/WEB-INF/views/systemService/form.jsp
Normal file
255
src/main/webapp/WEB-INF/views/systemService/form.jsp
Normal file
@@ -0,0 +1,255 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>系统业务管理表单</title>
|
||||
<link href="${pageContext.request.contextPath}/static/pages/css/systemService.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#inputForm").validate({
|
||||
rules: {
|
||||
'serviceName':{
|
||||
required:true
|
||||
},
|
||||
'serviceId':{
|
||||
required:true
|
||||
},
|
||||
'action':{
|
||||
required:true
|
||||
},
|
||||
'serviceType':{
|
||||
required:true
|
||||
},
|
||||
'serviceDesc':{
|
||||
required:true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
'serviceName':{
|
||||
required:'必填项'
|
||||
},
|
||||
'serviceId':{
|
||||
required:'必填项'
|
||||
},
|
||||
'action':{
|
||||
required:'必填项'
|
||||
},
|
||||
'serviceType':{
|
||||
required:'必填项'
|
||||
},
|
||||
'serviceDesc':{
|
||||
required:'必填项'
|
||||
}
|
||||
},
|
||||
submitHandler: function(form){
|
||||
$("[for=childTableFlag]").css("display", "none");
|
||||
var flag = true;
|
||||
var tables = document.getElementsByClassName("child-required");
|
||||
for (var i = 0; i < tables.length; i++) {
|
||||
if (!tables[i].value || tables[i].value == '') {
|
||||
$("[for=childTableFlag]").css("display", "inline");
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
loading('正在提交,请稍等...');
|
||||
form.submit();
|
||||
} else {
|
||||
flag = true;
|
||||
return false;
|
||||
}
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
errorPlacement: function(error, element) {
|
||||
$("#messageBox").text("输入有误,请先更正。");
|
||||
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
||||
error.appendTo(element.parent().parent());
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function addDatatable() {
|
||||
$("#datatables").append(
|
||||
'<div class="table-list col-md-10">' +
|
||||
'<div>' +
|
||||
'<input type="hidden" name="sciId" value="0"/>' +
|
||||
'<input type="hidden" name="sciIsValid" value="1"/>' +
|
||||
'<span class="child-label"><font color="red">*</font>表名:</span> ' +
|
||||
'<span><input class="child-required form-control child-input" name="tableName"/></span> ' +
|
||||
'<span class="child-label"><font color="red">*</font>表类型:</span> ' +
|
||||
'<span> ' +
|
||||
'<select class="child-required" name="tableType"> ' +
|
||||
'<option value="">请选择</option>' +
|
||||
'<option value="1">IP</option>' +
|
||||
'<option value="2">字符串</option>' +
|
||||
'<option value="3">数值</option>' +
|
||||
'<option value="4">增强字符串</option>' +
|
||||
'</select>' +
|
||||
'</span> ' +
|
||||
'<span class="child-label"><font color="red">*</font>MAAT表名:</span> ' +
|
||||
'<span><input class="child-required form-control child-input" name="maatTable"/></span>' +
|
||||
'</div>' +
|
||||
'<div>' +
|
||||
'<span class="child-label"><font color="red">*</font>表描述:</span> ' +
|
||||
'<span><input class="child-required form-control child-input-desc" name="tableDesc"/></span>' +
|
||||
'<button type="button" class="btn btn-danger del-button" onclick="del2(this)">删除</button>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
function del(obj) {
|
||||
$(obj).parent().parent().find("[name=sciIsValid]").val("0");
|
||||
$(obj).parent().parent().css("display", "none");
|
||||
}
|
||||
|
||||
function del2(obj) {
|
||||
$(obj).parent().parent().remove();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
系统业务管理
|
||||
</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>系统业务详情</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="systemServiceInfo" action="${ctx}/systemService/save" method="post" class="form-horizontal">
|
||||
<form:hidden path="id"/>
|
||||
<sys:message content="${message}"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>业务名称:</label>
|
||||
<div class="col-md-4">
|
||||
<form:input path="serviceName" htmlEscape="false" maxlength="30" class="required form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>业务ID:</label>
|
||||
<div class="col-md-4">
|
||||
<form:input path="serviceId" htmlEscape="false" maxlength="30" class="required form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>动作:</label>
|
||||
<div class="col-md-4">
|
||||
<form:select path="action" class="required form-control">
|
||||
<form:option value="">请选择</form:option>
|
||||
<form:option value="1">阻断</form:option>
|
||||
<form:option value="2">监测</form:option>
|
||||
<form:option value="5">封堵白名单</form:option>
|
||||
<form:option value="6">监测白名单</form:option>
|
||||
<form:option value="7">封堵监测白名单</form:option>
|
||||
<form:option value="8">灰名单</form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>类型:</label>
|
||||
<div class="col-md-4">
|
||||
<form:select path="serviceType" class="required form-control">
|
||||
<form:option value="">请选择</form:option>
|
||||
<form:option value="1">单域</form:option>
|
||||
<form:option value="2">多域</form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">数据库表:</label>
|
||||
<div class="col-md-8" id="datatables">
|
||||
<shiro:hasPermission name="system:service:edit">
|
||||
<div>
|
||||
<button type="button" class="btn btn-default" onclick="addDatatable()">增加</button>
|
||||
<label for="childTableFlag" class="error" style="display:none">有未填项</label>
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
<c:forEach items="${systemServiceInfo.serviceConfigInfoList }" var="serviceConfigInfo">
|
||||
<div class="table-list col-md-10">
|
||||
<div>
|
||||
<input type="hidden" name="sciId" value="${serviceConfigInfo.id }"/>
|
||||
<input type="hidden" name="sciIsValid" value="1"/>
|
||||
|
||||
<span class="child-label"><font color="red">*</font>表名:</span>
|
||||
<span><input class="child-required form-control child-input" name="tableName" value="${serviceConfigInfo.tableName }"/></span>
|
||||
|
||||
<span class="child-label"><font color="red">*</font>表类型:</span>
|
||||
<span>
|
||||
<select class="child-required" name="tableType">
|
||||
<option value="">请选择</option>
|
||||
<option value="1" <c:if test="${serviceConfigInfo.tableType eq 1}">selected="selected"</c:if>>IP</option>
|
||||
<option value="2" <c:if test="${serviceConfigInfo.tableType eq 2}">selected="selected"</c:if>>字符串</option>
|
||||
<option value="3" <c:if test="${serviceConfigInfo.tableType eq 3}">selected="selected"</c:if>>数值</option>
|
||||
<option value="4" <c:if test="${serviceConfigInfo.tableType eq 4}">selected="selected"</c:if>>增强字符串</option>
|
||||
</select>
|
||||
</span>
|
||||
|
||||
<span class="child-label"><font color="red">*</font>MAAT表名:</span>
|
||||
<span><input class="child-required form-control child-input" name="maatTable" value="${serviceConfigInfo.maatTable }"/></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="child-label"><font color="red">*</font>表描述:</span>
|
||||
<span><input class="child-required form-control child-input-desc" name="tableDesc" value="${serviceConfigInfo.tableDesc }"/></span>
|
||||
|
||||
<button type="button" class="btn btn-danger del-button" onclick="del(this)">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>描述:</label>
|
||||
<div class="col-md-4">
|
||||
<form:textarea path="serviceDesc" htmlEscape="false" class="required form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<shiro:hasPermission name="system:service:edit"><input type="submit" class="btn btn-circle blue" value="保存"/></shiro:hasPermission>
|
||||
<%-- <shiro:hasPermission name="system:service:edit"><button type="submit" class="btn btn-circle blue">保存</button></shiro:hasPermission> --%>
|
||||
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,22 +2,36 @@
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>系统业务类型管理</title>
|
||||
<title>系统业务类型管理列表</title>
|
||||
<link href="${pageContext.request.contextPath}/static/pages/css/systemService.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
function page(n,s){
|
||||
if(n) $("#pageNo").val(n);
|
||||
if(s) $("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/sysService/list");
|
||||
$("#searchForm").attr("action","${ctx}/systemService/list");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
function deleteService(id) {
|
||||
if (id) {
|
||||
if (confirm("确认删除?")) {
|
||||
$("#serviceId").val(id);
|
||||
$("#searchForm").attr("action","${ctx}/systemService/delete");
|
||||
$("#searchForm").submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-default" onclick="page()">刷新</button>
|
||||
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/sysService/form'">新增</button>
|
||||
<button type="button" class="btn btn-default" onclick="javascript:window.location='${ctx}/systemService/list'">刷新</button>
|
||||
<shiro:hasPermission name="system:service:view">
|
||||
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/systemService/systemServiceform'">新增</button>
|
||||
</shiro:hasPermission>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
@@ -33,33 +47,46 @@ function page(n,s){
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<form:form id="searchForm" modelAttribute="systemServiceInfo" action="${ctx}/sysService/list" method="post">
|
||||
<div class="portlet-body"">
|
||||
<sys:message content="${message}"/>
|
||||
<form:form id="searchForm" modelAttribute="systemServiceInfo" method="post">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo }"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize }"/>
|
||||
<div class="row" >
|
||||
<input id="serviceId" name="id" type="hidden"/>
|
||||
<div class="row search-table">
|
||||
<div class="col-md-12">
|
||||
<span>动作 :</span>
|
||||
<form:select path="action">
|
||||
<form:option value="">请选择</form:option>
|
||||
<form:option value="1">阻断</form:option>
|
||||
<form:option value="2">监测</form:option>
|
||||
<form:option value="5">封堵白名单</form:option>
|
||||
<form:option value="6">监测白名单</form:option>
|
||||
<form:option value="7">封堵监测白名单</form:option>
|
||||
<form:option value="8">灰名单</form:option>
|
||||
</form:select>
|
||||
<span>类型 :</span>
|
||||
<form:select path="serviceType">
|
||||
<form:option value="">请选择</form:option>
|
||||
<form:option value="1">单域</form:option>
|
||||
<form:option value="2">多域</form:option>
|
||||
</form:select>
|
||||
<span>名称 :</span>
|
||||
<form:input path="serviceName" htmlEscape="false" class="input-small"/>
|
||||
<button type="submit" onclick="return page();" class="btn btn-default btn-sm">
|
||||
<i class="fa fa-edit"></i> 搜索
|
||||
</button>
|
||||
<span class="search-item" class="input-small">
|
||||
<span>动作 :</span>
|
||||
<form:select path="action">
|
||||
<form:option value="">请选择</form:option>
|
||||
<form:option value="1">阻断</form:option>
|
||||
<form:option value="2">监测</form:option>
|
||||
<form:option value="5">封堵白名单</form:option>
|
||||
<form:option value="6">监测白名单</form:option>
|
||||
<form:option value="7">封堵监测白名单</form:option>
|
||||
<form:option value="8">灰名单</form:option>
|
||||
</form:select>
|
||||
</span>
|
||||
|
||||
<span class="search-item" class="input-small">
|
||||
<span>类型 :</span>
|
||||
<form:select path="serviceType">
|
||||
<form:option value="">请选择</form:option>
|
||||
<form:option value="1">单域</form:option>
|
||||
<form:option value="2">多域</form:option>
|
||||
</form:select>
|
||||
</span>
|
||||
|
||||
<span class="search-item">
|
||||
<span>名称 :</span>
|
||||
<form:input path="serviceName" htmlEscape="false" class="input-small"/>
|
||||
</span>
|
||||
|
||||
<span class="search-item">
|
||||
<button type="submit" onclick="return page();" class="btn btn-default btn-sm">
|
||||
<i class="fa fa-edit"></i> 搜索
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</form:form>
|
||||
</div>
|
||||
@@ -99,8 +126,10 @@ function page(n,s){
|
||||
<td><fmt:formatDate value="${ssi.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${ssi.serviceDesc }</td>
|
||||
<td>
|
||||
<span><a>修改</a></span>
|
||||
<span><a>删除</a></span>
|
||||
<shiro:hasPermission name="system:service:edit">
|
||||
<span><a href="${ctx }/systemService/systemServiceform?id=${ssi.id }">修改</a></span>
|
||||
<span><a href="javascript:void(0)" onclick="deleteService('${ssi.id }')">删除</a></span>
|
||||
</shiro:hasPermission>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
57
src/main/webapp/static/pages/css/systemService.css
Normal file
57
src/main/webapp/static/pages/css/systemService.css
Normal file
@@ -0,0 +1,57 @@
|
||||
/* global */
|
||||
select, input {
|
||||
border: 1px solid #c2cad8;
|
||||
}
|
||||
|
||||
/* list */
|
||||
.search-table {
|
||||
margin-bottom: 10px;
|
||||
height: 30px;
|
||||
}
|
||||
.search-item {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.search-item input, .search-item select {
|
||||
height: 30px !important;
|
||||
}
|
||||
.search-item button {
|
||||
margin-bottom:4px;
|
||||
}
|
||||
|
||||
/* form */
|
||||
.child-input {
|
||||
width: 160px !important;
|
||||
display: inline !important;
|
||||
margin: 6px 5px 6px 5px;
|
||||
}
|
||||
.child-input-desc {
|
||||
width: 320px !important;
|
||||
display: inline !important;
|
||||
margin: 6px 5px 6px 5px;
|
||||
}
|
||||
.child-label {
|
||||
text-align: right;
|
||||
padding-top: 7px;
|
||||
margin: 6px 5px 6px 5px;
|
||||
}
|
||||
.child-required {
|
||||
color: #e02222;
|
||||
font-size: 12px;
|
||||
padding-left: 6px;
|
||||
}
|
||||
.datatable-index {
|
||||
width: 14px;
|
||||
display: inline-block;
|
||||
}
|
||||
#datatables select {
|
||||
height: 34px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.del-button {
|
||||
float: right;
|
||||
}
|
||||
.table-list {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
background-color: #F8F8FF;
|
||||
}
|
||||
Reference in New Issue
Block a user