(1)修复排除ID 0=''
(2)notAllowSelectRoot参数用来处理select选中项 (3)app,基础协议,加密隧道行为处理,不得选择rootNode
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<%@ attribute name="unCheckedPS" type="java.lang.String" required="false" description="复选框取消选中时是否关联父子节点,ps关联父子,p关联父,s关联子,都不关联为空"%>
|
||||
<div class="input-group">
|
||||
<input id="${id}Id" name="${name}" class="${cssClass} singleClass" type="hidden" value="${value}" />
|
||||
<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'} type="text" value="<spring:message code='${labelValue}'/>" data-msg-required="${dataMsgRequired}" placeholder="${value}"
|
||||
<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'} type="text" value="<spring:message code='${empty value?"":labelValue}'/>" data-msg-required="${dataMsgRequired}" placeholder="${empty value?labelValue:value}"
|
||||
class="${cssClass}" style="${cssStyle} background-color:transparent"/>
|
||||
|
||||
<div class="input-group-btn">
|
||||
@@ -49,7 +49,7 @@
|
||||
ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"<spring:message code='ok'/>":"ok", "<spring:message code='clear'/>":"clear","<spring:message code='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 = [],types =[];
|
||||
var ids = [], names = [], nodes = [];
|
||||
if ("${checked}" == "true"){
|
||||
nodes = tree.getCheckedNodes(true);
|
||||
}else{
|
||||
@@ -100,12 +100,17 @@
|
||||
|
||||
}//</c:if><c:if test="${!showParentName}">
|
||||
names.push(nodes[i].name);
|
||||
if(nodes[i].type){
|
||||
types.push(nodes[i].type);
|
||||
}
|
||||
//if(nodes[i].type){
|
||||
// types.push(nodes[i].type);
|
||||
//}
|
||||
//</c:if><c:if test="${!checked}">
|
||||
break; // 如果为非复选框选择,则返回第一个选择 </c:if>
|
||||
}
|
||||
|
||||
if((nodes.length==1)&&(nodes[0].level == 0)&&('true'=='${notAllowSelectRoot}')){
|
||||
top.$.jBox.tip("<spring:message code='no_root'/>("+nodes[0].name+")<spring:message code='reselect'/>");
|
||||
return false;
|
||||
}
|
||||
$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
|
||||
//if(types.length>0){
|
||||
// $("#${id}Id").attr('cfgtype',types.join(","));
|
||||
@@ -120,9 +125,7 @@
|
||||
//$("#${id}Id").removeAttr('cfgtype');
|
||||
$("#${id}Id").change();//手动触发change事件,使Id的值得变化可以被监听到
|
||||
$("#${id}Name").val("");
|
||||
if('${value}'){//如果值不存在,但是value却有值,将placeholder清空
|
||||
$("#${id}Name").attr("placeholder","");
|
||||
}
|
||||
$("#${id}Name").attr("placeholder","");
|
||||
}
|
||||
if(typeof ${id}TreeselectCallBack == 'function'){
|
||||
${id}TreeselectCallBack(v, h, f);
|
||||
|
||||
@@ -201,8 +201,8 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
|
||||
labelName="parent.specServiceName"
|
||||
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
|
||||
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
|
||||
cssClass="form-control required"/>
|
||||
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="0"
|
||||
notAllowSelectRoot="true" cssClass="form-control required"/>
|
||||
</div>
|
||||
<div for="parent.specServiceName"></div>
|
||||
</div>
|
||||
|
||||
@@ -153,8 +153,8 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
|
||||
labelName="parent.specServiceName"
|
||||
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
|
||||
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
|
||||
cssClass="form-control required"/>
|
||||
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="0"
|
||||
notAllowSelectRoot="true" cssClass="form-control required"/>
|
||||
</div>
|
||||
<div for="parent.specServiceName"></div>
|
||||
</div>
|
||||
|
||||
@@ -202,8 +202,8 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
|
||||
labelName="parent.specServiceName"
|
||||
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
|
||||
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
|
||||
cssClass="form-control required"/>
|
||||
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="0"
|
||||
notAllowSelectRoot="true" cssClass="form-control required"/>
|
||||
</div>
|
||||
<div for="parent.specServiceName"></div>
|
||||
</div>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
for(var i=0; i<ids.length; i++) {
|
||||
var node = tree.getNodeByParam("id", (type==3?"u_":"")+ids[i]);
|
||||
//如果节点id与排除id相同,不被选中
|
||||
if(node.id!="${extId}"){
|
||||
if(node.id!=parseInt("${extId}")){
|
||||
if("${checked}" == "true"){
|
||||
try{tree.checkNode(node, true, true);}catch(e){}
|
||||
tree.selectNode(node, false);
|
||||
|
||||
Reference in New Issue
Block a user