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
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
118
119
120
121
122
123
124
125
126
127
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>添加配置关系</title>
[#include "/business/pages/include/static.html" /]
[#include "/component/popTree.html" /]
</head>
 
<body>
<div class="fs_main clearfix">
    <div class="relationwrap" style="width:auto;">
        <h2>
            配置关系:
            [#if links?? && links?size>0]
                [#list links as link]
                    <span><input type="radio" name="radio" value="${link.id}" class="relation"/>${link.text}</span>
                [/#list]
            [/#if]
        </h2>
    </div>
 
    <div class="event_fill list_common_select">
    <table><tr><th width="75%">
           
        <div class="fill_item">
            <label>搜索码:</label>
                <input  class="general" type="text" name="searchCode" id="searchCode" />
           </div> 
           
           <div class="fill_item">
            <label>配置项名称:</label>
                <input  class="general" type="text" name="ciName" id="ciName" />
           </div>
            
    </th><td width="25%">
        <a class="retrievebtn focus" onclick="query();">查询</a><a class="retrievebtn" id="reset">重置</a>
    </td></tr></table>
    </div>
</div>
 
    <div class="fs_main clearfix">
        <div id="main"></div>   
    </div>
    
    
    
 
<script type="text/javascript">
    var ci_id = '${RequestParameters.id}';
    function query(){
        var searchCode = $.trim($("#searchCode").val());
        var ciName = $.trim($("#ciName").val());
        var cate = $.trim($("#categoryId").val());
        var params = {"searchCode":searchCode,"ciName":ciName,"cate":cate,"ci_id":ci_id};
        loading($("#main"));
        $.post("${base}/business/pages/cfg/selectrelationLink.html",params,function(data,textStatus) {
            $("#main").html(data);
        })
    }
    
    function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            
            var $checkedRelation = $(".relation:checked");
            var relationLen = $checkedRelation.length;
            if(relationLen == 0) {
                window.top.popupTips("请选择一个关联关系");
                return;
            }
        
            var $checkedSelectProp = $(".selectProp:checked");
            var checkedSelectPropLen = $checkedSelectProp.length;
            if(checkedSelectPropLen == 0) {
                window.top.popupTips("请至少选择一个选择配置项");
                return;
            }
            
            
            if(!window.top.openConfirm("确定要选择吗?")) {
                return;
            }
            
            var relation = $checkedRelation.val();
            var idArray = new Array();
            $checkedSelectProp.each(function() {
                idArray.push($(this).val());
            });    
            
            var ids = idArray.join(",");
            var params = {"relation":relation,"ids":ids,"ci_id":ci_id};
            $.post("${base}/business/pages/cfg/saveRelation.html",params,function(data,textStatus) {
                if(data==1) {
                    window.top.popupTips("选择成功");
                    window.top.hideDialog(dialogID);
                    window.top.document.getElementById("dialogIframe0").contentWindow.query();
                } else {
                    window.top.popupTips("选择失败");
                }
            })        
        }
    }
    
    
    $(function() {
        query();
        $("#reset").click(function() {
            window.location.reload(true);
        });
        
        $("#selectAll").live("click",function() {
            $(".selectProp").attr("checked",$(this).attr("checked"));
        })
        
        $(".selectProp").live("click",function() {
            var checkedSelectPropLen = $(".selectProp:checked").length;
            var allSelectPropLen = $(".selectProp").length;
            
            $("#selectAll").attr("checked",(checkedSelectPropLen==allSelectPropLen));
            
        })
        
    })
</script>
 
</body>
</html>