cy
2022-06-28 2ba5c891b24d4d0cd6ce7ef833592e4f576ee5e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!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>