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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
[@new_ui_static_file /]
<link rel="stylesheet" type="text/css" href="${common_static}/static/style/ci/dialog.css"/>
<title>table_universal</title>
    <script type="text/javascript">
    $(document).ready(function() {
        
        $.formValidator.initConfig({formID:"myform",onError:function(msg){alert(msg)},onSuccess:function(){
            
            if (!confirm('确定提交表单?')){   
                return false;  
            } 
            document.getElementById("myform").target = window.top.openDialog(101,30,30,'操作提示:');
            return true;
        }});
        
    });
    
    function onAdd(){
        window.top.openDialog(1, 20, 80, '新增配置', $.http.getAbsoluteUrl('ciAdd_selectCategory.html?flow_id=${RequestParameters.flow_id}'), {
              buttons: [
                  {text: "提交", iconCls: 'icon-add', _handler: "_onFormSubmit()"},
                  {text: "关闭", _handler: "closeWin(1)"}
              ]
          });
          return false;
    }
    function showDetail(ciid,categoryid){
        var param = new $.HashMap();
        param.put("id",ciid);
        param.put("thirdlevelid",categoryid); 
        window.top.openDialog(101, 95, 95, '配置详细信息', '${base}/business/pages/cirepair/orderdeal/ciDeviceDetail.html?'+$.http.parseHashMap2ParamStr(param), {
              buttons: [
                  {text: "关闭", _handler: "closeWin(101)"}
              ]
          });
          return false;
    }
    
     function onUpdate(ciid,categoryid,tablename){
        var param = new $.HashMap();
        param.put("ciid",ciid);
        param.put("categoryid",categoryid);
        param.put("flow_id","${RequestParameters.flow_id}");
        param.put("tablename",tablename);
        
        window.top.openDialog(2,90,90,'新增配置','${base}/business/pages/cmdb/category/properties/previewForm.html?'+$.http.parseHashMap2ParamStr(param) , {
              buttons: [
                  {text: "提交", iconCls: 'icon-add', _handler: "_onFormSubmit()"},
                  {text: "关闭", _handler: "closeWin(2)"}
              ]
          });
    }
    
    function onDelCi(ciid,categoryid){
        
        if(!confirm("确定要删除该CI吗?")) return false;
        
        var param = new $.HashMap();
        if(!$.util.isNull(ciid)){
            param.put("ciid",ciid);
        } 
        param.put("categoryid",categoryid);
            window.top.openDialog(3, 30, 30, '删除', '${base}/business/pages/cmdb/category/properties/delBaseCi.html?'+$.http.parseHashMap2ParamStr(param));
    }
    
    function onSinglePrint(searchcode){
    
        var param = new $.HashMap();
        param.put("searchCode",searchcode);
        window.top.openDialog(4, 30, 30, '打印', '${base}/business/pages/cmdb/ci/singlePrint.html?'+$.http.parseHashMap2ParamStr(param), {
                buttons: [
                    {text: "关闭", _handler: "closeWin(4)"},
                    {text: "打印", iconCls: 'icon-print',_handler: "prn1_preview()"}
                ]
            });
    }         
    
    function _onFormSubmit(){
        var isAdmin = '${IS_ADMIN}';
        var cilist = document.getElementsByName("cilist");
        if(cilist.length<=0){
          alert("未录入采集配置,请录入!");
          return false;
        }
        if (isAdmin == 0) {
            document.getElementById("btnOK").click();
        } else {
            window.top.openDialog(5, 60, 50, '审批提交', $.http.getAbsoluteUrl('ciAddSpotApprove.html?order_id=${RequestParameters.order_id}&node_id=${RequestParameters.node_id}&flow_id=${RequestParameters.flow_id}'), {
                  buttons: [
                      {text: "提交", iconCls: 'icon-add', _handler: "_onFormSubmit()"},
                      {text: "关闭", _handler: "closeWin(5)"}
                  ]
              });
              return false;
        }
    }
   
    function closeWin() {
        window.top.closeDialog(0);
    }
    </script>
</head>
  
  <body style="padding-bottom:70px;">
  <table width="98%" border="0" class="marginc">
  <tr class="table_title">
        <td colspan="6">
            <div class="floatl">
                <h3 class="table_identifying">采集配置列表</h3>
            </div>
            <div class="floatr">
                <a class="button icon_add" onclick="return onAdd();">新增</a>
            </div>
        </td>
    </tr>
    <tr class="table_head">
      <td width="5%" align="center">序号</td>
      <td width="10%" align="center">类别</td>
      <td width="20%" align="center">配置名称</td>
      <td width="20%" align="center">搜索码</td>
      <td  align="center">位置</td>
      <td width="20%" align="center">操作</td>
   </tr>
[#list CILIST as d]
 <tr> 
      <td align="center"  >${d_index+1}</td>
      <td  align="center">${d.CATEGORY_NAME}</td>
      <td align="center"><a href="####"  name="cilist" onclick="return showDetail('${d.ID}','${d.THIRDLEVELID}')">${d.CINAME}</a></td>
      <td  align="center">${d.SEACHCODE}</td>
      <td  align="left">${d.POSITION}</td>
       <td  align="center"><a class="button icon_del"  onclick="return onDelCi('${d.ID}','${d.THIRDLEVELID}')">删除</a>
                <a class="button icon_modify" onclick="return onUpdate('${d.ID}','${d.THIRDLEVELID}','${d.TABLE_NAME}')">修改</a>
                <a class="button icon_modify" onclick="return onSinglePrint('${d.SEACHCODE}')">打印</a>
       </td>
   </tr>
[/#list]
   </table>
   <form action="" method="post" id="myform" name="myform">
            <input type="submit" id="btnOK" value="提交" style="display:none;"  />
   </form>
  </body>
</html>