Authored by zhaoqi

Merge branch 'dev_degrade'

@@ -131,4 +131,5 @@ public class HttpUriContants { @@ -131,4 +131,5 @@ public class HttpUriContants {
131 131
132 public static final String GET_DEGRADE_INFO = "/degrade/getList"; 132 public static final String GET_DEGRADE_INFO = "/degrade/getList";
133 public static final String EDIT_DEGRADE_INFO = "/degrade/change"; 133 public static final String EDIT_DEGRADE_INFO = "/degrade/change";
  134 + public static final String GET_DEGRADE_FUNCTION = "/degrade/getFunction";
134 } 135 }
@@ -22,4 +22,6 @@ public class DegradeConfig { @@ -22,4 +22,6 @@ public class DegradeConfig {
22 22
23 private String switchOn; 23 private String switchOn;
24 24
  25 + private String functionPointName;
  26 +
25 } 27 }
@@ -21,4 +21,6 @@ public class DegradeInfoReq extends PageRequest { @@ -21,4 +21,6 @@ public class DegradeInfoReq extends PageRequest {
21 private int id; 21 private int id;
22 22
23 private String configDesc; 23 private String configDesc;
  24 +
  25 + private String functionPointName;
24 } 26 }
@@ -3,11 +3,10 @@ package com.ui.ctrl; @@ -3,11 +3,10 @@ package com.ui.ctrl;
3 import com.ui.contants.HttpUriContants; 3 import com.ui.contants.HttpUriContants;
4 import com.ui.http.HttpRestClient; 4 import com.ui.http.HttpRestClient;
5 import com.ui.model.BaseResponse; 5 import com.ui.model.BaseResponse;
6 -import com.ui.model.domain.DegradeConfig;  
7 -import com.ui.model.rep.PageResponse;  
8 import com.ui.model.req.DegradeInfoReq; 6 import com.ui.model.req.DegradeInfoReq;
9 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Controller; 8 import org.springframework.stereotype.Controller;
  9 +import org.springframework.ui.Model;
11 import org.springframework.web.bind.annotation.RequestMapping; 10 import org.springframework.web.bind.annotation.RequestMapping;
12 import org.springframework.web.bind.annotation.ResponseBody; 11 import org.springframework.web.bind.annotation.ResponseBody;
13 import org.springframework.web.servlet.ModelAndView; 12 import org.springframework.web.servlet.ModelAndView;
@@ -23,13 +22,16 @@ public class DegradeInfoCtrl { @@ -23,13 +22,16 @@ public class DegradeInfoCtrl {
23 private HttpRestClient httpClient; 22 private HttpRestClient httpClient;
24 23
25 @RequestMapping("/info") 24 @RequestMapping("/info")
26 - public ModelAndView toDegradeList() { 25 + public ModelAndView toDegradeList(Model model) {
  26 + BaseResponse degradeFunction = httpClient.defaultPost(HttpUriContants.GET_DEGRADE_FUNCTION,null,BaseResponse.class);
  27 + model.addAttribute("functionPoints",degradeFunction.getData());
27 return new ModelAndView("degrade/degradeList"); 28 return new ModelAndView("degrade/degradeList");
28 } 29 }
29 30
30 @ResponseBody 31 @ResponseBody
31 @RequestMapping("/getList") 32 @RequestMapping("/getList")
32 public BaseResponse getDegradeInfoList(DegradeInfoReq req) { 33 public BaseResponse getDegradeInfoList(DegradeInfoReq req) {
  34 +
33 return httpClient.defaultPost(HttpUriContants.GET_DEGRADE_INFO,req,BaseResponse.class); 35 return httpClient.defaultPost(HttpUriContants.GET_DEGRADE_INFO,req,BaseResponse.class);
34 } 36 }
35 37
@@ -27,7 +27,12 @@ @@ -27,7 +27,12 @@
27 <input type="text" class="form-control" id="configDesc" name="configDesc" maxlength="200" size="40"/> 27 <input type="text" class="form-control" id="configDesc" name="configDesc" maxlength="200" size="40"/>
28 </div> 28 </div>
29 </div> 29 </div>
30 - 30 + <div class="form-group">
  31 + <label class="col-sm-2 control-label">功能点:</label>
  32 + <div class="col-sm-8">
  33 + <input type="text" class="form-control" id="functionPointName" name="functionPointName" maxlength="80" size="40"/>
  34 + </div>
  35 + </div>
31 <div class="form-group"> 36 <div class="form-group">
32 <label class="col-sm-2 control-label">配置级别:</label> 37 <label class="col-sm-2 control-label">配置级别:</label>
33 <div class="col-sm-8"> 38 <div class="col-sm-8">
@@ -38,7 +43,6 @@ @@ -38,7 +43,6 @@
38 </select> 43 </select>
39 </div> 44 </div>
40 </div> 45 </div>
41 -  
42 <div class="form-group"> 46 <div class="form-group">
43 <label class="col-sm-2 control-label">服务器:</label> 47 <label class="col-sm-2 control-label">服务器:</label>
44 <div class="col-sm-8"> 48 <div class="col-sm-8">
@@ -68,5 +72,6 @@ $(function(){ @@ -68,5 +72,6 @@ $(function(){
68 $("#degradeInfoForm #level").val(paramObj.level); 72 $("#degradeInfoForm #level").val(paramObj.level);
69 $("#degradeInfoForm #switchOn").val(paramObj.switchOn); 73 $("#degradeInfoForm #switchOn").val(paramObj.switchOn);
70 $("#degradeInfoForm #cloudType").val(paramObj.cloudType); 74 $("#degradeInfoForm #cloudType").val(paramObj.cloudType);
  75 + $("#degradeInfoForm #functionPointName").val(paramObj.functionPointName);
71 }) 76 })
72 </script> 77 </script>
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 <div class="widget-box"> 77 <div class="widget-box">
78 <div class="widget-title"> 78 <div class="widget-title">
79 79
80 - <h5>ZK配置</h5> 80 + <h5>降级服务筛选</h5>
81 81
82 </div> 82 </div>
83 <div class="widget-content nopadding"> 83 <div class="widget-content nopadding">
@@ -101,6 +101,15 @@ @@ -101,6 +101,15 @@
101 <input type="text" id="configShowName" name="configShowName" class="form-control" placeholder=""/> 101 <input type="text" id="configShowName" name="configShowName" class="form-control" placeholder=""/>
102 </div> 102 </div>
103 <div class="input-group" style="float: left;"> 103 <div class="input-group" style="float: left;">
  104 + <span class="input-group-addon">功能点:</span>
  105 + <select id="functionPoint" name="functionPoint" class="form-control">
  106 + <option value="">全部</option>
  107 + <c:forEach items="${functionPoints }" var="functionPoint">
  108 + <option value="${functionPoint }">${functionPoint }</option>
  109 + </c:forEach>
  110 + </select>
  111 + </div>
  112 + <div class="input-group" style="float: left;">
104 <span class="input-group-addon">级别:</span> 113 <span class="input-group-addon">级别:</span>
105 <select id="level" name="level" class="form-control"> 114 <select id="level" name="level" class="form-control">
106 <option value="">全部</option> 115 <option value="">全部</option>
@@ -153,9 +162,13 @@ @@ -153,9 +162,13 @@
153 field: "configShowName" 162 field: "configShowName"
154 }, { 163 }, {
155 title: "配置描述", 164 title: "配置描述",
156 - width:"30%", 165 + width:"20%",
157 field: "configDesc" 166 field: "configDesc"
158 }, { 167 }, {
  168 + title: "功能点",
  169 + width:"20%",
  170 + field: "functionPointName"
  171 + }, {
159 title: "级别", 172 title: "级别",
160 width:"5%", 173 width:"5%",
161 field: "level", 174 field: "level",
@@ -206,6 +219,7 @@ function updateDegradeInfo(rowData){ @@ -206,6 +219,7 @@ function updateDegradeInfo(rowData){
206 paramObj.level = rowData.level; 219 paramObj.level = rowData.level;
207 paramObj.switchOn = rowData.switchOn; 220 paramObj.switchOn = rowData.switchOn;
208 paramObj.cloudType = searchCloudType; 221 paramObj.cloudType = searchCloudType;
  222 + paramObj.functionPointName = rowData.functionPointName;
209 var dialog0 = $("<div>").appendTo($("body")); 223 var dialog0 = $("<div>").appendTo($("body"));
210 dialog0.dialog({ 224 dialog0.dialog({
211 size : "modal-lg", 225 size : "modal-lg",
@@ -226,10 +240,10 @@ function updateDegradeInfo(rowData){ @@ -226,10 +240,10 @@ function updateDegradeInfo(rowData){
226 var btn = $(this); 240 var btn = $(this);
227 $(dialog0).dialog("hide"); 241 $(dialog0).dialog("hide");
228 $("#degradeInfoForm").form("submit", { 242 $("#degradeInfoForm").form("submit", {
229 - submitUrl : contextPath + "/degrade/edit.do", 243 + submitUrl : contextPath + "degrade/edit.do",
230 submitData : { 244 submitData : {
231 id : rowData.id 245 id : rowData.id
232 - }, 246 + },
233 onBeforeSubmit : function() { 247 onBeforeSubmit : function() {
234 248
235 if (!$(this).form("validate")) { 249 if (!$(this).form("validate")) {
@@ -275,7 +289,8 @@ function updateDegradeInfo(rowData){ @@ -275,7 +289,8 @@ function updateDegradeInfo(rowData){
275 var cloudType = $("#cloudType").val(); 289 var cloudType = $("#cloudType").val();
276 var configName=$("#configName").val(); 290 var configName=$("#configName").val();
277 var configShowName=$("#configShowName").val(); 291 var configShowName=$("#configShowName").val();
278 - var switchOn= $("#switch").val();//=="0"?null:$("#switch").val(); 292 + var switchOn= $("#switch").val();
  293 + var functionPointName = $("#functionPoint").val();
279 searchCloudType = cloudType; 294 searchCloudType = cloudType;
280 295
281 $("#degradeInfoTable").table("load", { 296 $("#degradeInfoTable").table("load", {
@@ -283,7 +298,8 @@ function updateDegradeInfo(rowData){ @@ -283,7 +298,8 @@ function updateDegradeInfo(rowData){
283 'level': level , 298 'level': level ,
284 'configName': configName , 299 'configName': configName ,
285 'configShowName': configShowName , 300 'configShowName': configShowName ,
286 - 'switchOn' : switchOn 301 + 'switchOn' : switchOn,
  302 + 'functionPointName' : functionPointName
287 }); 303 });
288 }); 304 });
289 var searchCloudType=$("#cloudType").val(); 305 var searchCloudType=$("#cloudType").val();