<!doctype html>
|
<html class="no-js">
|
<head>
|
<meta charset="utf-8">
|
<title>所属部门</title>
|
<!--(start) public flies-->
|
|
</head>
|
|
<body class="select_tree_body">
|
[#include "/business/pages/include/static.html" /]
|
<div class="select_tree">
|
<table class="st_title">
|
<tr>
|
<th width="14%">当前已选择:</th>
|
<td id="treeLabel">
|
[#if checkSl.bmName != ""]<a><span class='removeSelect' sl='${checkSl.bmId}'>${checkSl.bmName}</span></a>[#else][/#if]
|
</td>
|
</tr>
|
</table>
|
[#if trees?? && trees?size>0]
|
[#list trees as tree]
|
<div class="first_level">
|
<div class="fl_title">
|
<input class="pos tree bigtree" name="treeValue" type="radio" [#if checkSl.bmId==tree.ID]checked="checked"[/#if] id="${tree.ID}" value="${tree.ID}" labelName="${tree.JGMC}" style="float:left;margin-top:12px;margin-right:8px;"/><h3>${tree.JGMC}</h3>
|
<a class="fl_morebtn"></a>
|
</div>
|
<table class="second_level">
|
[#if tree.ejTree?? && tree.ejTree?size>0]
|
[#list tree.ejTree as ej]
|
<tr><th width="14%">
|
<input class="pos tree bigtree" name="treeValue" type="radio" [#if checkSl.bmId==ej.ID]checked="checked"[/#if] id="${ej.ID}" value="${ej.ID}" labelName="${ej.JGMC}" style="float:left;margin-top:4px;margin-right:8px;"/>${ej.JGMC}:
|
</th>
|
<td><div class="thrid_level">
|
<div class="thrid_level_con clearfix">
|
[#if ej.sjTree?? && ej.sjTree?size>0]
|
[#list ej.sjTree as sj]
|
<div class="tl_item">
|
<input class="pos tree" name="treeValue" type="radio" id="${sj.ID}" [#if checkSl.bmId==sj.ID]checked="checked"[/#if] value="${sj.ID}" labelName="${sj.JGMC}"/>
|
<span>${sj.JGMC}</span>
|
</div>
|
[/#list]
|
[/#if]
|
</div>
|
</div></td><th class="tl_morebtn_wrap"><a class="tl_morebtn">更多</a></th></tr>
|
[/#list]
|
[/#if]
|
</table>
|
</div>
|
[/#list]
|
[/#if]
|
</div>
|
|
<script type="text/javascript">
|
$(function() {
|
$(".tree").click(function() {
|
var checkTree = $(".tree:checked");
|
var alreadySelect = "";
|
checkTree.each(function() {
|
var slId = $(this).attr("id");
|
alreadySelect += "<a><span class='removeSelect' sl='"+slId+"'>"+$(this).next('span').text()+"</span></a>";
|
});
|
|
$("#treeLabel").empty().append(alreadySelect);
|
});
|
$(".bigtree").click(function() {
|
var checkTree = $(".bigtree:checked");
|
var alreadySelect = "";
|
checkTree.each(function() {
|
var slId = $(this).attr("id");
|
alreadySelect += "<a><span class='removeSelect' sl='"+slId+"'>"+$(this).next('h3').text()+"</span></a>";
|
});
|
|
$("#treeLabel").empty().append(alreadySelect);
|
});
|
|
$(".removeSelect").live("click",function() {
|
var slId = $(this).attr("sl");
|
niceform("#"+slId).prop("checked",false);
|
$(this).parent().remove();
|
});
|
defaultOpen();
|
})
|
|
//加载页面时默认打开选中项所在div
|
function defaultOpen(){
|
//判断窗体加载,默认选择哪个div
|
var id = $(".removeSelect").attr("sl");
|
//让选中的默认展开
|
if(id != undefined){
|
//关闭所有
|
$('div.select_tree').each(function(i){
|
var fl = $(this).children('div.first_level'),
|
flb = fl.find('a.fl_morebtn');
|
flb.removeClass('focus');
|
fl.height('38px');
|
});
|
var fl = $("#"+id).closest("div.first_level");
|
flb = fl.find('a.fl_morebtn');
|
fl.height('auto');
|
flb.addClass('focus');
|
|
}
|
}
|
|
function onDialogBtnClick(btnID, dialogID, config){
|
if(btnID == "btnSure"){
|
var checkTree = $(".tree:checked");
|
var labelId = checkTree.attr("id");
|
var labelName = checkTree.attr("labelName");
|
window.top.document.getElementById('dialogIframe0').contentWindow.showBm(labelId,labelName);
|
window.top.hideDialog(dialogID);
|
}
|
}
|
</script>
|
</body>
|
</html>
|