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/sys/roleForm.jsp

185 lines
7.4 KiB
Plaintext
Raw Normal View History

2017-12-29 16:18:40 +08:00
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title>角色管理</title>
2018-02-02 17:58:32 +08:00
<link href="${pageContext.request.contextPath}/static/global/plugins/jquery-ztree/3.5.12/css/zTreeStyle/zTreeStyle.min.css" rel="stylesheet" type="text/css"/>
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-ztree/3.5.12/js/jquery.ztree.all-3.5.min.js" type="text/javascript"></script>
2017-12-29 16:18:40 +08:00
<script type="text/javascript">
$(document).ready(function(){
$("#name").focus();
$("#inputForm").validate({
rules: {
name: {remote: "${ctx}/sys/role/checkName?oldName=" + encodeURIComponent("${role.name}")}
},
messages: {
name: {remote: "<spring:message code='role_unique'/>"}
2017-12-29 16:18:40 +08:00
},
submitHandler: function(form){
var ids = [], nodes = tree.getCheckedNodes(true);
for(var i=0; i<nodes.length; i++) {
ids.push(nodes[i].id);
}
$("#menuIds").val(ids);
loading('onloading...');
2017-12-29 16:18:40 +08:00
form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function(error, element) {
$("#messageBox").text("<spring:message code='role_error_info'/>");
2017-12-29 16:18:40 +08:00
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
var setting = {check:{enable:true,nocheckInherit:true},view:{selectedMulti:false},
data:{simpleData:{enable:true}},callback:{beforeClick:function(id, node){
tree.checkNode(node, !node.checked, true, true);
return false;
}}};
// 用户-菜单
var zNodes=[
2018-04-11 11:50:49 +08:00
<c:forEach items="${menuList}" var="menu">{id:"${menu.id}", pId:"${not empty menu.parent.id?menu.parent.id:0}", name:"<c:if test='${not empty menu.parent.id}'><spring:message code="${menu.code}"/></c:if><c:if test='${empty menu.parent.id}'><spring:message code='permission_list'/></c:if>"},
2017-12-29 16:18:40 +08:00
</c:forEach>];
// 初始化树结构
var tree = $.fn.zTree.init($("#menuTree"), setting, zNodes);
// 不选择父节点
tree.setting.check.chkboxType = { "Y" : "ps", "N" : "s" };
// 默认选择节点
var ids = "${role.menuIds}".split(",");
for(var i=0; i<ids.length; i++) {
var node = tree.getNodeByParam("id", ids[i]);
try{tree.checkNode(node, true, false);}catch(e){}
}
// 默认展开全部节点
tree.expandAll(true);
});
</script>
</head>
<body>
2018-02-02 17:58:32 +08:00
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
2017-12-29 16:18:40 +08:00
2018-04-11 11:50:49 +08:00
<button type="button" class="btn btn-default" onclick="history.go(-1)">&nbsp;<spring:message code="back"/>&nbsp;</button>
2018-02-02 17:58:32 +08:00
</div>
2017-12-29 16:18:40 +08:00
2018-02-02 17:58:32 +08:00
<h3 class="page-title">
<spring:message code="roleManage"/>
2018-02-02 17:58:32 +08:00
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
2018-04-11 11:50:49 +08:00
<i class="fa fa-gift"></i><shiro:hasPermission name="sys:role:edit"><c:if test="${not empty role.id}"><spring:message code="edit"/></c:if><c:if test="${empty role.id}"><spring:message code="add"/></c:if></shiro:hasPermission><shiro:lacksPermission name="sys:role:edit"><spring:message code="show"/></shiro:lacksPermission></div>
2018-02-02 17:58:32 +08:00
</div>
<div class="portlet-body form">
<div class="form-body">
<!-- BEGIN FORM-->
<form:form id="inputForm" modelAttribute="sysRole" action="${ctx}/sys/role/saveOrUpdate" method="post" class="form-horizontal">
<form:hidden path="id"/>
<spring:message code="${message}"/>
2018-02-02 17:58:32 +08:00
<div class="form-group">
2018-04-11 11:50:49 +08:00
<label class="col-md-3 control-label"><spring:message code="role_name"/>:</label>
2018-02-02 17:58:32 +08:00
<div class="col-md-4">
<input id="oldName" name="oldName" type="hidden" value="${role.name}">
<form:input path="name" htmlEscape="false" maxlength="50" class="required form-control"/>
</div>
2018-04-11 11:50:49 +08:00
<span class="help-inline"><font color="red">*</font> </span>
2018-02-02 17:58:32 +08:00
</div>
<c:choose>
<c:when test="${fns:getUser().identity eq 1}">
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code="role_type"/>:</label>
<div class="col-md-4">
<!-- <form:input path="roleType" htmlEscape="false" maxlength="50" class="required"/>
<span class="help-inline" title="activiti有3种预定义的组类型security-role、assignment、user 如果使用Activiti Explorer需要security-role才能看到manage页签需要assignment才能claim任务">
工作流组用户组类型security-role管理员、assignment可进行任务分配、user普通用户</span> -->
<form:select path="roleType" class="form-control">
<%-- <form:option value="assignment"><spring:message code="task_allot"/></form:option> --%>
<form:option value="security-role"><spring:message code="manager"/></form:option>
<form:option value="user"><spring:message code="ordinary_man"/></form:option>
</form:select>
<%-- <span class="help-inline" title="activiti有3种预定义的组类型security-role、assignment、user 如果使用Activiti Explorer需要security-role才能看到manage页签需要assignment才能claim任务">
<spring:message code="role_type_info"/></span> --%>
</div>
</div>
</c:when>
<c:otherwise>
<input type="hidden" name="roleType" value="user"/>
</c:otherwise>
</c:choose>
2018-02-02 17:58:32 +08:00
<div class="form-group">
2018-04-11 11:50:49 +08:00
<label class="col-md-3 control-label"><spring:message code="data_range"/>:</label>
2018-02-02 17:58:32 +08:00
<div class="col-md-4">
<form:select path="dataScope" class="form-control">
<form:options items="${fns:getDictList('SYS_DATA_SCOPE')}" itemLabel="itemValue" itemValue="itemCode" htmlEscape="false"/>
</form:select>
<%-- <span class="help-inline"><spring:message code="data_range_info"/></span> --%>
2018-02-02 17:58:32 +08:00
</div>
</div>
<div class="form-group">
2018-04-11 11:50:49 +08:00
<label class="col-md-3 control-label"><spring:message code="role_permission"/>:</label>
2018-02-02 17:58:32 +08:00
<div class="col-md-4">
<div id="menuTree" class="ztree" style="margin-top:3px;float:left;"></div>
<form:hidden path="menuIds"/>
</div>
</div>
<div class="form-group">
2018-04-11 11:50:49 +08:00
<label class="col-md-3 control-label"><spring:message code="remarks"/>:</label>
2018-02-02 17:58:32 +08:00
<div class="col-md-4">
<form:textarea path="remark" htmlEscape="false" rows="3" maxlength="200" class="form-control"/>
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-3 col-md-9">
2018-04-11 11:50:49 +08:00
<shiro:hasPermission name="sys:role:edit"><button type="submit" class="btn btn-circle blue">&nbsp;&nbsp;<spring:message code="submit"/>&nbsp;&nbsp;</button></shiro:hasPermission>
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"/></button>
2018-02-02 17:58:32 +08:00
</div>
</div>
</div>
</form:form>
<!-- END FORM-->
</div>
</div>
2017-12-29 16:18:40 +08:00
</div>
</div>
2018-02-02 17:58:32 +08:00
</div>
</div>
2017-12-29 16:18:40 +08:00
</body>
</html>