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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>修改配置关系</title>
[#include "/business/pages/include/static.html" /]
</head>
<body>
<div class="relationwrap">
    <h2>
        配置关系:
            [#if links?? && links?size>0]
                [#list links as relation]
                    <span><input type="radio" name="radio" value="${relation.id}" class="relation" [#if relation.id == relationing.AFTER_RELATION_TYPE]checked="checked"[/#if]/>${relation.text}</span>
                [/#list]
            [/#if]
    </h2>
    <div>
        <p [#if relationing.AFTER_RELATION_TYPE != Constants.CMDB_CI_RELATION_RELATION_CONTAIN]style="display:none;"[/#if] class="linkImg"><img src="${common_static}/static/ui/images/relation_bh.jpg" alt="" /></p>
        <p [#if relationing.AFTER_RELATION_TYPE != Constants.CMDB_CI_RELATION_RELATION_LINK]style="display:none;"[/#if] class="linkImg"><img src="${common_static}/static/ui/images/relation_sy.jpg" alt="" /></p>
        <p [#if relationing.AFTER_RELATION_TYPE != Constants.CMDB_CI_RELATION_RELATION_USE]style="display:none;"[/#if] class="linkImg"><img src="${common_static}/static/ui/images/relation_lj.jpg" alt="" /></p>
        <p [#if relationing.AFTER_RELATION_TYPE != Constants.CMDB_CI_RELATION_RELATION_INSTALL_HAS]style="display:none;"[/#if] class="linkImg"><img src="${common_static}/static/ui/images/relation_azy.jpg" alt="" /></p>
    </div>
</div>
 
<script type="text/javascript">
$(function() {
    $(":radio").click(function() {
        var index = $(":radio").index(this);
        $("p.linkImg").hide();
        $("p.linkImg").eq(index).show();
    });
})
var id = '${RequestParameters.id}';
function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            
            var $checkedRelation = $(".relation:checked");
            
            
            var relation = $checkedRelation.val();
            
            var params = {"relation":relation,"id":id};
            
            $.post("${base}/business/pages/change/updateRelation.html",params,function(data,textStatus) {
                if(data==1) {
                    window.top.popupTips("修改成功");
                    window.top.hideDialog(dialogID);
                    window.top.document.getElementById("dialogIframeConfigEditIndex").contentWindow.document.getElementById("relationIframe").contentWindow.query();
                } else {
                    window.top.popupTips("修改失败");
                }
            })        
            
            
            
        }
    }
</script>
 
</body>
</html>