(1)没有分类的特定服务追加到ztree树的末尾

(2)业务类别下有特定服务的时候更改样式,与有特定服务一致
(3)树修改搜索属性,当页面上的sys:treeselect标签配置了enableSearch="true"属性的时候,开启搜索节点的功能
This commit is contained in:
wangxin
2018-08-30 16:58:33 +08:00
parent d1acc38429
commit 374087ca85
4 changed files with 35 additions and 7 deletions

View File

@@ -91,6 +91,14 @@
var nodes = tree.getNodesByParam("level", 1);
for(var i=0; i<nodes.length; i++) {
tree.expandNode(nodes[i], true, false, false);
var nodeId=nodes[i].id;
//处理特定服务业务类型的图标
if(typeof nodeId=='string'&&nodeId.indexOf("businessType")==0){
if(!nodes[i].isParent){//强制改变没有子节点的特定服务业务类型为父节点,让其改变样式
nodes[i].isParent=true;
tree.updateNode(nodes[i],false);
}
}
}
nodes=tree.getNodesByParam("level", 0);
for(var i=0; i<nodes.length; i++) {
@@ -217,8 +225,8 @@
// 开始搜索
function search() {
$("#search").slideToggle(200);
$("#txt").toggle();
//$("#search").slideToggle(200);
//$("#txt").toggle();
$("#key").focus();
}
function beforeEditName(treeId, treeNode) {
@@ -362,10 +370,12 @@
<div style="position:absolute;right:8px;top:5px;cursor:pointer;" onclick="search();">
<i class="icon-search"></i><label id="txt">搜索</label>
</div> -->
<div id="search" class="form-search hide" style="padding:10px 0 0 13px;">
<label for="key" class="control-label" style="padding:5px 5px 3px 0;">关键字:</label>
<input type="text" class="empty" id="key" name="key" maxlength="50" style="width:110px;">
<button class="btn" id="btn" onclick="searchNode()"> <i class="icon-search"></i> &nbsp;搜索 </button>
<c:if test="${enableSearch ne null and enableSearch==true}">
<div id="search" class="form-search input-group" style="padding:10px 0 0 13px;">
<label for="key" class="control-label" style="padding:5px 5px 3px 0;"><spring:message code="keywords"/>:</label>
<input type="text" class="empty input-small" id="key" name="key" maxlength="50" style="width:170px;" placeholder="<spring:message code='search'/>...">
<!-- <button class="btn" id="btn" onclick="searchNode()"> <i class="icon-search"></i> &nbsp;搜索 </button> -->
</div>
</c:if>
<div id="tree" class="ztree" style="padding:15px 20px;"></div>
</body>