2018-02-22 12:46:50 +08:00
|
|
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
|
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
2018-03-04 19:20:32 +08:00
|
|
|
<link rel="stylesheet" type="text/css" href="${ctxStatic}/pages/css/dictInfo.css" />
|
|
|
|
|
<script type="text/javascript" src="${ctxStatic}/pages/scripts/dict.js"></script>
|
|
|
|
|
<title>配置管理</title>
|
2018-02-22 12:46:50 +08:00
|
|
|
<script type="text/javascript">
|
2018-03-04 19:20:32 +08:00
|
|
|
//上级选择数据类型自动改变
|
|
|
|
|
function serviceDictInfoTreeselectCallBack(){
|
|
|
|
|
var parent = $("#serviceDictInfoId").val();
|
|
|
|
|
$.ajax({
|
|
|
|
|
type:'post',
|
|
|
|
|
async:true,
|
|
|
|
|
cache:false,
|
2018-03-06 10:06:42 +08:00
|
|
|
url:'${ctx}/basics/serviceDictInfo/ajaxItemType',
|
2018-03-04 19:20:32 +08:00
|
|
|
data:{parent:parent},
|
|
|
|
|
success:function(data){
|
|
|
|
|
$("#itemType option").each(function(){
|
|
|
|
|
$(this).attr("selected",false);
|
|
|
|
|
});
|
|
|
|
|
$("#itemType").find("option[value='"+data+"']").attr("selected",true);
|
|
|
|
|
}
|
|
|
|
|
});
|
2018-03-08 20:30:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-04 19:20:32 +08:00
|
|
|
}
|
|
|
|
|
$(document).ready(function() {
|
2018-03-11 15:28:36 +08:00
|
|
|
|
2018-03-08 20:30:01 +08:00
|
|
|
//层级校验
|
|
|
|
|
jQuery.validator.addMethod("isLevelNoSure",function(value,element){
|
2018-03-11 15:28:36 +08:00
|
|
|
var flagIsLevelNoSure = false;
|
2018-03-10 18:54:05 +08:00
|
|
|
$.ajax({
|
2018-03-08 20:30:01 +08:00
|
|
|
type:'post',
|
2018-03-11 15:28:36 +08:00
|
|
|
async:false,
|
2018-03-08 20:30:01 +08:00
|
|
|
cache:false,
|
|
|
|
|
url:'${ctx}/basics/serviceDictInfo/isLevelTotalSure',
|
2018-03-10 18:54:05 +08:00
|
|
|
data:{parentId:$(".singleClass").val(),currentId:'${serviceDictInfo.serviceDictId}'},
|
2018-03-08 20:30:01 +08:00
|
|
|
success:function(data){
|
2018-03-10 18:54:05 +08:00
|
|
|
flagIsLevelNoSure = data;
|
2018-03-08 20:30:01 +08:00
|
|
|
}
|
2018-03-10 18:54:05 +08:00
|
|
|
});
|
2018-03-11 15:28:36 +08:00
|
|
|
return flagIsLevelNoSure;
|
2018-03-10 18:54:05 +08:00
|
|
|
|
2018-03-11 15:28:36 +08:00
|
|
|
},"选择此配置上下层级数将超过最大层级");
|
2018-03-08 20:30:01 +08:00
|
|
|
|
|
|
|
|
//类型选择与上级是否冲突
|
2018-03-04 19:20:32 +08:00
|
|
|
jQuery.validator.addMethod("typeSame",function(value,element){
|
2018-03-10 18:54:05 +08:00
|
|
|
var flagTypeSame=false;
|
2018-03-04 19:20:32 +08:00
|
|
|
$.ajax({
|
|
|
|
|
type:'post',
|
|
|
|
|
async:false,
|
2018-03-06 10:06:42 +08:00
|
|
|
url:'${ctx}/basics/serviceDictInfo/ajaxType',
|
2018-03-10 18:54:05 +08:00
|
|
|
data:{parent:$("#serviceDictInfoId").val(),child:$("#itemTypeCheckChild option:selected").val()},
|
2018-03-04 19:20:32 +08:00
|
|
|
success:function(data){
|
2018-03-10 18:54:05 +08:00
|
|
|
flagTypeSame=data;
|
2018-03-04 19:20:32 +08:00
|
|
|
}
|
|
|
|
|
});
|
2018-03-10 18:54:05 +08:00
|
|
|
return flagTypeSame;
|
2018-03-04 19:20:32 +08:00
|
|
|
},"请选择正确的数据类型");
|
|
|
|
|
//校验更改数据类型后校验数据类型是否与下级冲突
|
|
|
|
|
jQuery.validator.addMethod("typeChild",function(value,element){
|
2018-03-10 18:54:05 +08:00
|
|
|
var flagTypeChild=false;
|
2018-03-04 19:20:32 +08:00
|
|
|
$.ajax({
|
|
|
|
|
type:'post',
|
|
|
|
|
async:false,
|
2018-03-06 10:06:42 +08:00
|
|
|
url:'${ctx}/basics/serviceDictInfo/ajaxChildrenType',
|
2018-03-10 18:54:05 +08:00
|
|
|
data:{parent:"${serviceDictInfo.serviceDictId}",newItemType:$("#itemTypeCheckChild option:selected").val()},
|
2018-03-04 19:20:32 +08:00
|
|
|
success:function(data){
|
2018-03-10 18:54:05 +08:00
|
|
|
flagTypeChild=data;
|
2018-03-04 19:20:32 +08:00
|
|
|
}
|
|
|
|
|
});
|
2018-03-10 18:54:05 +08:00
|
|
|
return flagTypeChild;
|
2018-03-04 19:20:32 +08:00
|
|
|
},"该配置包含下级配置,数据类型更改后上下级类型不一致");
|
|
|
|
|
//校验叶子节点有下级不得更改为叶子节点
|
|
|
|
|
jQuery.validator.addMethod("leafChange",function(value,element){
|
2018-03-10 18:54:05 +08:00
|
|
|
var flagLeafChange=false;
|
2018-03-04 19:20:32 +08:00
|
|
|
$.ajax({
|
|
|
|
|
type:'post',
|
|
|
|
|
async:false,
|
2018-03-06 10:06:42 +08:00
|
|
|
url:'${ctx}/basics/serviceDictInfo/ajaxLeafChange',
|
2018-03-04 19:20:32 +08:00
|
|
|
data:{parent:"${serviceDictInfo.serviceDictId}",newIsLeaf:$("#isLeaf option:selected").val()},
|
|
|
|
|
success:function(data){
|
2018-03-10 18:54:05 +08:00
|
|
|
flagLeafChange=data;
|
2018-03-04 19:20:32 +08:00
|
|
|
}
|
|
|
|
|
});
|
2018-03-10 18:54:05 +08:00
|
|
|
return flagLeafChange;
|
2018-03-04 19:20:32 +08:00
|
|
|
},"该配置包含下级配置,不得改为叶子节点");
|
|
|
|
|
|
|
|
|
|
//校验叶子节点无上级不得选为叶子节点
|
|
|
|
|
jQuery.validator.addMethod("leafHasTree",function(value,element){
|
2018-03-10 18:54:05 +08:00
|
|
|
var flagLeafHasTree=false;
|
2018-03-04 19:20:32 +08:00
|
|
|
$.ajax({
|
|
|
|
|
type:'post',
|
|
|
|
|
async:false,
|
2018-03-06 10:06:42 +08:00
|
|
|
url:'${ctx}/basics/serviceDictInfo/ajaxLeafHasTree',
|
2018-03-04 19:20:32 +08:00
|
|
|
data:{serviceDictId:"${serviceDictInfo.serviceDictId}",newIsLeaf:$("#isLeaf option:selected").val(),parentId:$("#serviceDictInfoId").val()},
|
|
|
|
|
success:function(data){
|
2018-03-10 18:54:05 +08:00
|
|
|
flagLeafHasTree=data;
|
2018-03-04 19:20:32 +08:00
|
|
|
}
|
|
|
|
|
});
|
2018-03-10 18:54:05 +08:00
|
|
|
return flagLeafHasTree;
|
2018-03-06 10:06:42 +08:00
|
|
|
},"该配置上级为根节点,不得设为叶子节点");
|
2018-03-04 19:20:32 +08:00
|
|
|
|
|
|
|
|
|
2018-02-22 12:46:50 +08:00
|
|
|
$("#name").focus();
|
|
|
|
|
$("#inputForm").validate({
|
2018-03-10 18:54:05 +08:00
|
|
|
//ignore:[],
|
2018-02-22 12:46:50 +08:00
|
|
|
//需验证 item_code item_value
|
|
|
|
|
rules: {
|
2018-03-11 15:28:36 +08:00
|
|
|
'parent.itemValue':{
|
|
|
|
|
isLevelNoSure:true
|
|
|
|
|
},
|
2018-03-10 18:54:05 +08:00
|
|
|
|
2018-03-08 20:30:01 +08:00
|
|
|
'itemCode':{
|
2018-03-10 18:54:05 +08:00
|
|
|
//isLevelNoSure:true,
|
2018-03-08 20:30:01 +08:00
|
|
|
required:true,
|
|
|
|
|
remote:'${ctx}/basics/serviceDictInfo/isItemCodeRepeat?oldItemCode=${serviceDictInfo.itemCode}'
|
|
|
|
|
},
|
2018-02-22 12:46:50 +08:00
|
|
|
'itemValue':{
|
|
|
|
|
required:true
|
2018-03-04 19:20:32 +08:00
|
|
|
},
|
|
|
|
|
'itemType':{
|
|
|
|
|
typeSame:true,
|
|
|
|
|
typeChild:true
|
|
|
|
|
},
|
|
|
|
|
'isLeaf':{
|
2018-03-28 08:42:32 +08:00
|
|
|
leafChange:true
|
|
|
|
|
//leafHasTree:true
|
2018-02-22 12:46:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
messages: {
|
2018-03-11 15:28:36 +08:00
|
|
|
'parent.itemValue':{
|
2018-03-28 08:42:32 +08:00
|
|
|
isLevelNoSure:'<spring:message code="isLevelNoSure"/>'
|
2018-03-11 15:28:36 +08:00
|
|
|
},
|
2018-03-08 20:30:01 +08:00
|
|
|
'itemCode':{
|
2018-03-10 18:54:05 +08:00
|
|
|
//isLevelNoSure:"选择此配置上下层级数将超过四级",
|
2018-03-28 08:42:32 +08:00
|
|
|
required:'<spring:message code="required"/>',
|
|
|
|
|
remote:'<spring:message code="is_repeat"/>'
|
2018-03-08 20:30:01 +08:00
|
|
|
},
|
2018-02-22 12:46:50 +08:00
|
|
|
'itemValue':{
|
2018-03-28 08:42:32 +08:00
|
|
|
required:'<spring:message code="required"/>'
|
2018-03-04 19:20:32 +08:00
|
|
|
},
|
|
|
|
|
'itemType':{
|
2018-03-28 08:42:32 +08:00
|
|
|
typeSame:'<spring:message code="typeSame"/>',
|
|
|
|
|
typeChild:'<spring:message code="typeChild"/>'
|
2018-03-04 19:20:32 +08:00
|
|
|
},
|
|
|
|
|
'isLeaf':{
|
2018-03-28 08:42:32 +08:00
|
|
|
leafChange:'<spring:message code="leafChange"/>'
|
|
|
|
|
//leafHasTree:'该配置上级为根节点,不得设为叶子节点'
|
2018-02-22 12:46:50 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submitHandler: function(form){
|
2018-03-28 08:42:32 +08:00
|
|
|
loading('<spring:message code="submitting"/>');
|
2018-02-22 12:46:50 +08:00
|
|
|
form.submit();
|
|
|
|
|
},
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="page-content">
|
|
|
|
|
|
|
|
|
|
<div class="theme-panel hidden-xs hidden-sm">
|
|
|
|
|
|
2018-03-07 15:54:04 +08:00
|
|
|
<button type="button" class="btn btn-default" onclick="history.go(-1)"><spring:message code="back"/></button>
|
2018-02-22 12:46:50 +08:00
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 class="page-title">
|
2018-03-07 15:54:04 +08:00
|
|
|
<spring:message code="configuration_manage"/>
|
2018-02-22 12:46:50 +08:00
|
|
|
</h3>
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<div class="portlet box blue">
|
|
|
|
|
<div class="portlet-title">
|
|
|
|
|
<div class="caption">
|
2018-03-28 08:42:32 +08:00
|
|
|
<i class="fa fa-gift"></i><c:if test="${not empty serviceDictInfo.serviceDictId}"><spring:message code='edit'/></c:if><c:if test="${empty serviceDictInfo.serviceDictId}"><spring:message code='add'/></c:if></div>
|
2018-02-22 12:46:50 +08:00
|
|
|
<div class="tools">
|
|
|
|
|
<!-- <a href="javascript:;" class="collapse"> </a>
|
|
|
|
|
<a href="#portlet-config" data-toggle="modal" class="config"> </a>
|
|
|
|
|
<a href="javascript:;" class="reload"> </a>
|
|
|
|
|
<a href="javascript:;" class="remove"> </a> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="portlet-body form">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-body">
|
|
|
|
|
|
|
|
|
|
<!-- BEGIN FORM-->
|
2018-03-06 10:06:42 +08:00
|
|
|
<form:form id="inputForm" modelAttribute="serviceDictInfo" action="${ctx}/basics/serviceDictInfo/saveOrUpdate?itType=${itType}" method="post" class="form-horizontal">
|
2018-02-22 15:43:47 +08:00
|
|
|
<form:hidden path="serviceDictId"/>
|
2018-02-22 12:46:50 +08:00
|
|
|
<sys:message content="${message}"/>
|
|
|
|
|
<div class="form-group">
|
2018-03-07 15:54:04 +08:00
|
|
|
<label class="col-md-3 control-label"><spring:message code="superior_config"/>:</label>
|
2018-02-22 12:46:50 +08:00
|
|
|
<div class="col-md-4">
|
2018-03-28 08:42:32 +08:00
|
|
|
<c:set var="fatherName"><spring:message code="root_node"/></c:set>
|
|
|
|
|
<sys:treeselect id="serviceDictInfo" name="parent.serviceDictId" value="${serviceDictInfo.parent.serviceDictId}" labelName="parent.itemValue" labelValue="${serviceDictInfo.parent.itemValue eq 'root_node'?fatherName:fns:getServiceDictInfoById(serviceDictInfo.parent.serviceDictId).itemValue}"
|
2018-03-11 15:28:36 +08:00
|
|
|
title="菜单" url="/basics/serviceDictInfo/treeData?itType=${itType}" extId="${serviceDictInfo.serviceDictId}" cssClass="required form-control"/>
|
2018-02-22 12:46:50 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2018-03-07 15:54:04 +08:00
|
|
|
<label class="col-md-3 control-label radio-lable"><font color="red">*</font> <spring:message code="item_type"/>:</label>
|
2018-02-22 12:46:50 +08:00
|
|
|
<div class="col-md-4">
|
2018-03-10 18:54:05 +08:00
|
|
|
<select id="itemTypeCheckChild" name="itemType" class="form-control">
|
2018-02-22 15:43:47 +08:00
|
|
|
<c:forEach items="${fns:getDictList('SERVICE_DICT_ITM_TYPE')}" var="dict">
|
2018-03-04 19:20:32 +08:00
|
|
|
<c:forEach items="${intArr}" var="itTemp">
|
|
|
|
|
<c:if test="${dict.itemCode eq itTemp}">
|
2018-03-28 08:42:32 +08:00
|
|
|
<option value="${dict.itemCode}" <c:if test="${serviceDictInfo.itemType eq dict.itemCode}">selected="selected"</c:if>><spring:message code="${dict.itemValue}"/></option>
|
2018-03-04 19:20:32 +08:00
|
|
|
</c:if>
|
|
|
|
|
</c:forEach>
|
2018-02-22 12:46:50 +08:00
|
|
|
</c:forEach>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-03-08 20:30:01 +08:00
|
|
|
<div class="form-group">
|
2018-03-28 08:42:32 +08:00
|
|
|
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="item_code"/>:</label>
|
2018-02-22 12:46:50 +08:00
|
|
|
<div class="col-md-4">
|
|
|
|
|
<form:input path="itemCode" htmlEscape="false" maxlength="50" class="form-control"/>
|
|
|
|
|
</div>
|
2018-03-08 20:30:01 +08:00
|
|
|
</div>
|
2018-02-22 12:46:50 +08:00
|
|
|
<div class="form-group">
|
2018-03-07 15:54:04 +08:00
|
|
|
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="config_content"/>:</label>
|
2018-02-22 12:46:50 +08:00
|
|
|
<div class="col-md-4">
|
|
|
|
|
<form:input path="itemValue" htmlEscape="false" maxlength="2000" class="form-control"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2018-03-07 15:54:04 +08:00
|
|
|
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="is_leaf"/>:</label>
|
2018-02-22 12:46:50 +08:00
|
|
|
<div class="col-md-4">
|
|
|
|
|
<form:select path="isLeaf" class="form-control">
|
2018-03-28 08:42:32 +08:00
|
|
|
<c:forEach items="${fns:getDictList('INT_YES_NO')}" var="dict">
|
|
|
|
|
<form:option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"/></form:option>
|
|
|
|
|
</c:forEach>
|
2018-02-22 12:46:50 +08:00
|
|
|
</form:select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2018-03-07 15:54:04 +08:00
|
|
|
<label class="col-md-3 control-label"><spring:message code="desc"/>:</label>
|
2018-02-22 12:46:50 +08:00
|
|
|
<div class="col-md-4">
|
|
|
|
|
<form:textarea path="itemDesc" htmlEscape="false" maxlength="2000" class="form-control"/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-offset-3 col-md-9">
|
2018-03-07 15:54:04 +08:00
|
|
|
<shiro:hasPermission name="sys:menu:edit"><button type="submit" class="btn btn-circle blue"><spring:message code="submit"/></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-22 12:46:50 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form:form>
|
|
|
|
|
<!-- END FORM-->
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|