融合代码 提交本地
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="maat-tools-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/gwall/lib/maat-tools-0.0.1-SNAPSHOT.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="java-output-path" value="/gk/target/classes"/>
|
||||
<property name="context-root" value="gwall"/>
|
||||
</wb-module>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -396,14 +397,42 @@ public class ServiceDictInfoController extends BaseController {
|
||||
}
|
||||
}else{
|
||||
ServiceDictInfo c = serviceDictInfoService.getDictById(currentId);
|
||||
if((p.getLevelNo()+c.getLevelNo())<(max+1)){
|
||||
if(p.getLevelNo()<max){
|
||||
//查出该类所有下级的层级数之和
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.getDictByParentId(currentId);
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}
|
||||
List<ServiceDictInfo> resultList = Lists.newArrayList();
|
||||
List<Integer> intList = Lists.newArrayList();
|
||||
allTreeNode(1,list,resultList);
|
||||
for(ServiceDictInfo se:resultList){
|
||||
intList.add(se.getLevelNo());
|
||||
}
|
||||
int x = Collections.max(intList);
|
||||
if((p.getLevelNo()+x)<(max+1)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查出所该节点下有树形子节点
|
||||
*/
|
||||
|
||||
void allTreeNode(Integer levelNo, List<ServiceDictInfo> list,List<ServiceDictInfo> resultList){
|
||||
if(list!=null&&list.size()>0){
|
||||
for(ServiceDictInfo se:list){
|
||||
se.setLevelNo(levelNo+1);
|
||||
resultList.add(se);
|
||||
List<ServiceDictInfo> newList = serviceDictInfoService.getDictByParentId(se.getServiceDictId());
|
||||
allTreeNode(se.getLevelNo(),newList,resultList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -185,10 +185,10 @@ public class SysDictInfoController extends BaseController {
|
||||
|
||||
try {
|
||||
sysDictInfoService.saveOrUpdate(sysDictInfo);
|
||||
addMessage(redirectAttributes, "保存成功");
|
||||
addMessage(redirectAttributes, "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存失败!");
|
||||
addMessage(redirectAttributes, "save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType;
|
||||
@@ -205,10 +205,10 @@ public class SysDictInfoController extends BaseController {
|
||||
public String delete(SysDictInfo sysDictInfo, RedirectAttributes redirectAttributes, String itType, String mulitId) {
|
||||
try {
|
||||
sysDictInfoService.deleteDict(mulitId);
|
||||
addMessage(redirectAttributes, "删除成功");
|
||||
addMessage(redirectAttributes, "delete_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "删除失败!");
|
||||
addMessage(redirectAttributes, "delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@
|
||||
|
||||
<select id="getDictByParentId" resultMap="dictResultMap">
|
||||
select *
|
||||
from service_dict_info s where parent_id = #{parentId}
|
||||
from service_dict_info s where parent_id = #{parentId} and is_valid = 1
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
|
||||
<select id="getDictByParentId" resultMap="dictResultMap">
|
||||
select *
|
||||
from sys_dict_info s where parent_id = #{parentId}
|
||||
from sys_dict_info s where parent_id = #{parentId} and is_valid = 1
|
||||
</select>
|
||||
|
||||
<!-- 查询最大itemCode值 -->
|
||||
|
||||
@@ -148,7 +148,6 @@ parent_id=parentid
|
||||
is_leaf=whether leaf node
|
||||
is_valid=whether valid
|
||||
create_time=create time
|
||||
edit_time=edittime
|
||||
superior_config=superior configuration
|
||||
config_content=configuration content
|
||||
root_node=root node
|
||||
@@ -156,7 +155,7 @@ leafChange=this configuration includes subnode,cannot be leaf node
|
||||
typeChild=this data type will be not same with subnode
|
||||
typeSame=please select the consistent upper and lower data types
|
||||
isLevelNoSure=more than the maximum level
|
||||
is_repeat=field content is repeat
|
||||
is_repeat=content is repeat
|
||||
submitting=submitting
|
||||
#============yewu end======================
|
||||
|
||||
@@ -304,7 +303,6 @@ audit_time=audit time
|
||||
yes=yes
|
||||
no=no
|
||||
deleted=deleted
|
||||
cancel_approved=cancel approved
|
||||
|
||||
#==========youjianguankong end=====================
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ leafChange=this configuration includes subnode,cannot be leaf node
|
||||
typeChild=this data type will be not same with subnode
|
||||
typeSame=please select the consistent upper and lower data types
|
||||
isLevelNoSure=more than the maximum level
|
||||
is_repeat=field content is repeat
|
||||
is_repeat=content is repeat
|
||||
submitting=submitting
|
||||
#============yewu end======================
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ show=\u67e5\u770b
|
||||
edit=\u4fee\u6539
|
||||
hi=\u4f60\u597d
|
||||
exit=\u9000\u51fa
|
||||
choose=\u9009\u62e9
|
||||
|
||||
#==========menu begin=====================
|
||||
requestInfo=\u6765\u51fd\u4fe1\u606f
|
||||
@@ -138,7 +139,6 @@ parent_id=\u7236ID
|
||||
is_leaf=\u662f\u5426\u53f6\u5b50\u8282\u70b9
|
||||
is_valid=\u6709\u6548\u6807\u5fd7
|
||||
create_time=\u521b\u5efa\u65f6\u95f4
|
||||
edit_time=\u4fee\u6539\u65f6\u95f4
|
||||
superior_config=\u4e0a\u7ea7\u914d\u7f6e
|
||||
config_content=\u914d\u7f6e\u5185\u5bb9
|
||||
root_node=\u6839\u8282\u70b9
|
||||
@@ -174,7 +174,6 @@ begin_date=\u5f00\u59cb\u65f6\u95f4
|
||||
end_date=\u7ed3\u675f\u65f6\u95f4
|
||||
delete=\u5220\u9664
|
||||
special_task=\u4e13\u9879\u4efb\u52a1
|
||||
cancel_approved=\u914d\u7f6e\u53d6\u6d88
|
||||
task_name=\u4e13\u9879\u540d\u79f0
|
||||
task_org=\u62a5\u9001\u5355\u4f4d
|
||||
task_time=\u62a5\u9001\u65f6\u95f4
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
return true;
|
||||
}
|
||||
// 正常打开
|
||||
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}", "选择${title}", 320, 420, {
|
||||
ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"<spring:message code='ok'/>":"ok", ${allowClear?"\"<spring:message code='clear'/>\":\"clear\", ":""}"<spring:message code='close'/>":true}, submit:function(v, h, f){
|
||||
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}", "<spring:message code='choose'/>${title}", 320, 420, {
|
||||
ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"ok":"ok", ${allowClear?"\"clear\":\"clear\", ":""}"close":true}, submit:function(v, h, f){
|
||||
if (v=="ok"){
|
||||
var tree = h.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
|
||||
var ids = [], names = [], nodes = [];
|
||||
|
||||
@@ -23,18 +23,36 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
errorShow();
|
||||
|
||||
}
|
||||
function errorShow(){
|
||||
var flaelNoSure = false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/basics/serviceDictInfo/isLevelTotalSure',
|
||||
data:{parentId:$(".singleClass").val(),currentId:'${serviceDictInfo.serviceDictId}'},
|
||||
success:function(data){
|
||||
if(data){
|
||||
$(".errorShow").hide();
|
||||
}else{
|
||||
$(".errorShow").show();
|
||||
}
|
||||
flaelNoSure = data;
|
||||
}
|
||||
});
|
||||
return flaelNoSure;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("#serviceDictInfoId").on('onchange',errorShow);
|
||||
|
||||
//层级校验
|
||||
jQuery.validator.addMethod("isLevelNoSure",function(value,element){
|
||||
/* jQuery.validator.addMethod("isLevelNoSure",function(value,element){
|
||||
var flagIsLevelNoSure = false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
cache:false,
|
||||
url:'${ctx}/basics/serviceDictInfo/isLevelTotalSure',
|
||||
data:{parentId:$(".singleClass").val(),currentId:'${serviceDictInfo.serviceDictId}'},
|
||||
success:function(data){
|
||||
@@ -43,7 +61,7 @@
|
||||
});
|
||||
return flagIsLevelNoSure;
|
||||
|
||||
},"选择此配置上下层级数将超过最大层级");
|
||||
},"选择此配置上下层级数将超过最大层级"); */
|
||||
|
||||
//类型选择与上级是否冲突
|
||||
jQuery.validator.addMethod("typeSame",function(value,element){
|
||||
@@ -109,9 +127,9 @@
|
||||
//ignore:[],
|
||||
//需验证 item_code item_value
|
||||
rules: {
|
||||
'parent.itemValue':{
|
||||
/* 'parent.itemValue':{
|
||||
isLevelNoSure:true
|
||||
},
|
||||
}, */
|
||||
|
||||
'itemCode':{
|
||||
//isLevelNoSure:true,
|
||||
@@ -132,9 +150,9 @@
|
||||
|
||||
},
|
||||
messages: {
|
||||
'parent.itemValue':{
|
||||
/* 'parent.itemValue':{
|
||||
isLevelNoSure:'<spring:message code="isLevelNoSure"/>'
|
||||
},
|
||||
}, */
|
||||
'itemCode':{
|
||||
//isLevelNoSure:"选择此配置上下层级数将超过四级",
|
||||
required:'<spring:message code="required"/>',
|
||||
@@ -154,6 +172,11 @@
|
||||
},
|
||||
|
||||
submitHandler: function(form){
|
||||
var is_level_wrong=errorShow();
|
||||
if(!is_level_wrong){
|
||||
return false;
|
||||
$(".errorShow").show();
|
||||
}
|
||||
loading('<spring:message code="submitting"/>');
|
||||
form.submit();
|
||||
},
|
||||
@@ -215,6 +238,7 @@
|
||||
<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}"
|
||||
title="菜单" url="/basics/serviceDictInfo/treeData?itType=${itType}" extId="${serviceDictInfo.serviceDictId}" cssClass="required form-control"/>
|
||||
<label class="error errorShow" style="display: none;"><spring:message code="isLevelNoSure"/></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
Reference in New Issue
Block a user