Authored by zhaoqi

Merge branch 'dev_degrade'

... ... @@ -131,4 +131,5 @@ public class HttpUriContants {
public static final String GET_DEGRADE_INFO = "/degrade/getList";
public static final String EDIT_DEGRADE_INFO = "/degrade/change";
public static final String GET_DEGRADE_FUNCTION = "/degrade/getFunction";
}
... ...
... ... @@ -22,4 +22,6 @@ public class DegradeConfig {
private String switchOn;
private String functionPointName;
}
... ...
... ... @@ -21,4 +21,6 @@ public class DegradeInfoReq extends PageRequest {
private int id;
private String configDesc;
private String functionPointName;
}
... ...
... ... @@ -3,11 +3,10 @@ package com.ui.ctrl;
import com.ui.contants.HttpUriContants;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.domain.DegradeConfig;
import com.ui.model.rep.PageResponse;
import com.ui.model.req.DegradeInfoReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
... ... @@ -23,13 +22,16 @@ public class DegradeInfoCtrl {
private HttpRestClient httpClient;
@RequestMapping("/info")
public ModelAndView toDegradeList() {
public ModelAndView toDegradeList(Model model) {
BaseResponse degradeFunction = httpClient.defaultPost(HttpUriContants.GET_DEGRADE_FUNCTION,null,BaseResponse.class);
model.addAttribute("functionPoints",degradeFunction.getData());
return new ModelAndView("degrade/degradeList");
}
@ResponseBody
@RequestMapping("/getList")
public BaseResponse getDegradeInfoList(DegradeInfoReq req) {
return httpClient.defaultPost(HttpUriContants.GET_DEGRADE_INFO,req,BaseResponse.class);
}
... ...
... ... @@ -27,7 +27,12 @@
<input type="text" class="form-control" id="configDesc" name="configDesc" maxlength="200" size="40"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">功能点:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="functionPointName" name="functionPointName" maxlength="80" size="40"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">配置级别:</label>
<div class="col-sm-8">
... ... @@ -38,7 +43,6 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">服务器:</label>
<div class="col-sm-8">
... ... @@ -68,5 +72,6 @@ $(function(){
$("#degradeInfoForm #level").val(paramObj.level);
$("#degradeInfoForm #switchOn").val(paramObj.switchOn);
$("#degradeInfoForm #cloudType").val(paramObj.cloudType);
$("#degradeInfoForm #functionPointName").val(paramObj.functionPointName);
})
</script>
\ No newline at end of file
... ...
... ... @@ -77,7 +77,7 @@
<div class="widget-box">
<div class="widget-title">
<h5>ZK配置</h5>
<h5>降级服务筛选</h5>
</div>
<div class="widget-content nopadding">
... ... @@ -101,6 +101,15 @@
<input type="text" id="configShowName" name="configShowName" class="form-control" placeholder=""/>
</div>
<div class="input-group" style="float: left;">
<span class="input-group-addon">功能点:</span>
<select id="functionPoint" name="functionPoint" class="form-control">
<option value="">全部</option>
<c:forEach items="${functionPoints }" var="functionPoint">
<option value="${functionPoint }">${functionPoint }</option>
</c:forEach>
</select>
</div>
<div class="input-group" style="float: left;">
<span class="input-group-addon">级别:</span>
<select id="level" name="level" class="form-control">
<option value="">全部</option>
... ... @@ -153,9 +162,13 @@
field: "configShowName"
}, {
title: "配置描述",
width:"30%",
width:"20%",
field: "configDesc"
}, {
title: "功能点",
width:"20%",
field: "functionPointName"
}, {
title: "级别",
width:"5%",
field: "level",
... ... @@ -206,6 +219,7 @@ function updateDegradeInfo(rowData){
paramObj.level = rowData.level;
paramObj.switchOn = rowData.switchOn;
paramObj.cloudType = searchCloudType;
paramObj.functionPointName = rowData.functionPointName;
var dialog0 = $("<div>").appendTo($("body"));
dialog0.dialog({
size : "modal-lg",
... ... @@ -226,10 +240,10 @@ function updateDegradeInfo(rowData){
var btn = $(this);
$(dialog0).dialog("hide");
$("#degradeInfoForm").form("submit", {
submitUrl : contextPath + "/degrade/edit.do",
submitUrl : contextPath + "degrade/edit.do",
submitData : {
id : rowData.id
},
},
onBeforeSubmit : function() {
if (!$(this).form("validate")) {
... ... @@ -275,7 +289,8 @@ function updateDegradeInfo(rowData){
var cloudType = $("#cloudType").val();
var configName=$("#configName").val();
var configShowName=$("#configShowName").val();
var switchOn= $("#switch").val();//=="0"?null:$("#switch").val();
var switchOn= $("#switch").val();
var functionPointName = $("#functionPoint").val();
searchCloudType = cloudType;
$("#degradeInfoTable").table("load", {
... ... @@ -283,7 +298,8 @@ function updateDegradeInfo(rowData){
'level': level ,
'configName': configName ,
'configShowName': configShowName ,
'switchOn' : switchOn
'switchOn' : switchOn,
'functionPointName' : functionPointName
});
});
var searchCloudType=$("#cloudType").val();
... ...