Authored by qinchao

操作类型

... ... @@ -37,15 +37,13 @@ public class TypeCtrl {
@RequestMapping("/add")
@ResponseBody
public String addType(@RequestParam String name, @RequestParam int pid, @RequestParam int isleaf,@RequestParam String tags) {
String rel;
JSONObject req=new JSONObject();
req.put("typeName",name);
req.put("typeParentId",pid);
req.put("typeIsLeaf",isleaf);
req.put("tags",tags);
rel = httpClient.defaultPost(HttpUriContants.TYPE_ADD, req,String.class);
BaseResponse rtn = httpClient.defaultPost(HttpUriContants.TYPE_ADD, req,BaseResponse.class);
String rel= JSON.toJSONString(rtn);
return rel;
}
... ... @@ -64,8 +62,6 @@ public class TypeCtrl {
@RequestMapping("/update")
@ResponseBody
public String updateType(@RequestParam int id, @RequestParam String name) {
String rel = "";
log.info("update type id {} ,name {}", id, name);
JSONObject req=new JSONObject();
... ... @@ -73,8 +69,8 @@ public class TypeCtrl {
req.put("typeId",id);
req.put("typeName",name);
rel = httpClient.defaultPost(HttpUriContants.TYPE_UPDATE, req,String.class);
BaseResponse rtn = httpClient.defaultPost(HttpUriContants.TYPE_UPDATE, req,BaseResponse.class);
String rel= JSON.toJSONString(rtn);
return rel;
}
... ...
... ... @@ -322,7 +322,7 @@
dataType: 'json',
success: function (data) {
if (!data || data.code != 200) {
localAlert('删除失败', data.message);
localAlert('操作失败', data.message);
} else {
$("#myModal").modal('hide');
$("#hostGroupTable").table("load");
... ...
... ... @@ -77,19 +77,17 @@
<div class="container-fluid">
<div class="widget-box">
<!-- 树 -->
<div style="float: left;width: 300px;color: #D3D3D3;height: 600px;">
<div style="float: left;width: 300px;color: #D3D3D3;height: 650px;">
<div class="widget-title" style="height: 50px;">
<h5>监控类型</h5>
</div>
<div class="tree_container" style="height: 540px;color: black;overflow:auto">
<div class="tree_container" style="height: 600px;color: black;overflow:auto">
<div id="jstree" class="jstree jstree-default" role="tree" aria-multiselectable="true"
tabindex="0"></div>
</div>
</div>
<!-- 列表 -->
<div class="widget-content nopadding" style="margin-left:300px;">
<%-- <div class="widget-title" style="height: 50px;margin-top: 12px;"></div>--%>
<div class="widget-body">
<ul class="nav nav-tabs" style="margin-top:0px;height: 50px;">
<li class="active">
... ... @@ -1003,7 +1001,7 @@
})*/
</script>
<script type="text/javascript" src="<%=basePath %>/script/yoho.type.tree.js?v=20171211-27"></script>
<script type="text/javascript" src="<%=basePath %>/script/yoho.type.tree.js?v=20171211-29"></script>
... ...
... ... @@ -56,7 +56,7 @@ var addType = function (node) {
$('#modal_type_del').hide();
$('#modal_type_add').show();
$('#myModalLabel').html("添加类型");
$('#cb_new_type_isleaf').prop("checked", true);// 默认为子节点
//$('#cb_new_type_isleaf').prop("checked", true);// 默认为子节点
$('#tx_new_type_name').val("");
$('#tx_type_id').val(nodeId2id(node.id));
$('#tx_type_action').val("add");
... ...