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
<!doctype html>
<html>
<head>
[#include "/business/wechat/include/title.html" /]
[#include "/business/wechat/include/wheader.html" /]
</head>
 
<body>
<header class="kltit"><a href="javascript:history.go(-1);"><span></span></a>添加巡检配置</header>
 
[#if ciList?? && ciList?size > 0]
    [#list ciList as ci]
    <div class="item">
        <input type="hidden" class="deivceId" value="${ci.ID}"/>
        <span class="img"></span>
        <span class="text">
            <span class="one">搜索码:<em>${ci.SEARCHCODE}</em></span> 
            <span class="one"> 配置名称:<em>${ci.CINAME}</em></span>
         </span>
    </div>
    [/#list]
    <button class="bluebtn bluebtnsmal2" onclick="saveCi()">确定</button> 
[#else]
    <div class="nodate">无需要巡检的配置</div>
[/#if]
 
</body>
<script type="text/javascript">
 
$(function() { 
    $(".item").click(function() { 
        $(this).toggleClass("item-foucs"); //Remove any "active" class 
    }); 
});
 
function saveCi(){
    var checkedBox = $(".item-foucs");
    
    var cis = new Array();
    var jsonList=[];
    checkedBox.each(function() {
        cis.push($.trim($(this).find(".deivceId").val()));
        //得到空的指标信息
        var itemJson={};
        var item=$.trim('');
        itemJson["itemId"]=item;
        jsonList.push(itemJson);
    });
    var temp = '${ciIds}';
    var cilist =  ($.util.isEmpty(temp)? '' : temp+',') + cis.join(",");
    //组合传过来指标,和当前的空指标
    var items = '${items}';
    var itemsStr = JSON.stringify(jsonList);
    if(itemsStr != "[]"){
        if(items != "[]"){
            items = items.replace("]","") + "," + itemsStr.replace("[","");
        }
    }
    $.post("${base}/ewyw/ewHealth/ewAddCiDialog.html",{'orderId':'${orderId}','cilist':cilist,'items':items},function(data,textStatus) {
        if(data == '1') {
            popupTips("操作成功", 2000);
            window.location.href = "${base}/ewyw/ewHealth/ewHealthInfoCl.html?orderId=${orderId}";
        } else {
            popupTips("操作失败", 2000);
        }
    });    
}
</script>
</html>