cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>${Constants.UNIT_CONSTANTS}</title>
</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 RequestParameters.value??&&RequestParameters.value!=""]
                   <a><span class='removeSelect' val='${RequestParameters.value}'>${text}</span></a>
                   [/#if]
             </td>
         </tr>
     </table>
     <div class="first_level">
         <div class="fl_title">
             <input class="pos tree bigtree" name="treeValue" type="radio" value="${info.id}" style="float:left;margin-top:12px;margin-right:8px;"/><span><h3>${info.name}</h3></span>
             <a class="fl_morebtn"></a>
         </div>
         <table class="second_level">
             [#if list?? && list?size>0]
                 [#list list as lv1]
                     <tr><th style="width:150px;"><input class="pos tree" name="treeValue" type="radio" value="${lv1.id}" style="margin-right:8px;"><span>${lv1.name}</span>:</th>
                     <td><div class="thrid_level">
                          <div class="thrid_level_con clearfix">
                              [#if lv1.children?? && lv1.children?size>0]
                                  [#list lv1.children as lv2]
                                     <div class="tl_item">
                                         <input class="pos tree" name="treeValue" type="radio" value="${lv2.id}"/>
                                        <span>${lv2.name}</span>
                                     </div>
                                  [/#list]
                              [/#if]
                         </div>
                     </div></td>
                     <th class="tl_morebtn_wrap"><a class="tl_morebtn">更多</a></th></tr>
                 [/#list]
             [/#if]
         </table>
     </div>
</div>
         
        <script type="text/javascript">
            $(function() {
                
                $(":radio[value=${RequestParameters.value}]").attr("checked",true);
                
                $(":radio").click(function(){
                    var val = $(":radio:checked").val();
                    var text = $(":radio:checked").next("span").text();
                    var htmlstr = "<a><span class='removeSelect' val='"+val+"'>"+text+"</span></a>";
                    $("#treeLabel").html(htmlstr);
                });
                
                $(".removeSelect").live("click",function() {
                    $(":radio:checked").attr("checked",false);
                    $(this).parent().remove();
                })
            })
            
            function onDialogBtnClick(btnID, dialogID, config){
            if(btnID == "btnSure"){
                var id = $(".removeSelect").attr("val");
                var name = $(".removeSelect").text();
                [#if RequestParameters.iframe_lv1_id?length<=0]
                    window.parent.selSubCus(id,name);
                [#else]
                    [#if RequestParameters.iframe_lv2_id?length<=0]
                    window.top.document.getElementById("${RequestParameters.iframe_lv1_id}").contentWindow
                    .selSubCus(id,name);        
                    [#else]
                        window.top.document.getElementById("${RequestParameters.iframe_lv1_id}").contentWindow
                            .document.getElementById("${RequestParameters.iframe_lv2_id}").contentWindow
                            .selSubCus(id,name);
                    [/#if]
                [/#if]
                window.top.hideDialog(dialogID);
            }
        }
        </script>
</body>
</html>