修复上次提交的问题(新增时报错,删除时按钮点不下去)
This commit is contained in:
@@ -127,6 +127,14 @@ public class DnsIpCfg extends BaseEntity<DnsIpCfg> {
|
|||||||
*/
|
*/
|
||||||
private String lable;
|
private String lable;
|
||||||
|
|
||||||
|
private String cfgIds;
|
||||||
|
|
||||||
|
public String getCfgIds() {
|
||||||
|
return cfgIds;
|
||||||
|
}
|
||||||
|
public void setCfgIds(String cfgIds) {
|
||||||
|
this.cfgIds = cfgIds;
|
||||||
|
}
|
||||||
public Long getCfgId() {
|
public Long getCfgId() {
|
||||||
return cfgId;
|
return cfgId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
dnsIpCfg.setIsValid(1);
|
dnsIpCfg.setIsValid(1);
|
||||||
dnsIpCfg.setCreateTime(now);
|
dnsIpCfg.setCreateTime(now);
|
||||||
dnsIpCfg.setCreator(UserUtils.getUser());
|
dnsIpCfg.setCreator(UserUtils.getUser());
|
||||||
|
dnsIpCfg.setIsAudit(1);
|
||||||
} else {//修改
|
} else {//修改
|
||||||
dnsIpCfg.setEditor(UserUtils.getUser());
|
dnsIpCfg.setEditor(UserUtils.getUser());
|
||||||
dnsIpCfg.setEditTime(now);
|
dnsIpCfg.setEditTime(now);
|
||||||
@@ -70,19 +71,26 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("delete")
|
@RequestMapping("delete")
|
||||||
public String delete(Model model, String cfgIds, RedirectAttributes redirectAttributes) {
|
public String delete(Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response, DnsIpCfg dnsIpCfg) {
|
||||||
|
String cfgIds = dnsIpCfg.getCfgIds();
|
||||||
if (!StringUtils.isEmpty(cfgIds)) {
|
if (!StringUtils.isEmpty(cfgIds)) {
|
||||||
try {
|
try {
|
||||||
dnsIpCfgService.delete(cfgIds);
|
dnsIpCfgService.delete(cfgIds);
|
||||||
addMessage(redirectAttributes, "删除成功");
|
addMessage(model, "删除成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
addMessage(redirectAttributes, "删除失败");
|
addMessage(model, "删除失败");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addMessage(redirectAttributes, "删除失败");
|
addMessage(model, "删除失败");
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/cfg/dnsIp/list";
|
|
||||||
|
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response, 30), dnsIpCfg);
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
|
||||||
|
addRequestAndServiceDictToModel(model);
|
||||||
|
return "/cfg/dnsIpCfgList";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addRequestAndServiceDictToModel(Model model) {
|
private void addRequestAndServiceDictToModel(Model model) {
|
||||||
|
|||||||
@@ -65,11 +65,15 @@
|
|||||||
if (checkboxes.length == 0) {
|
if (checkboxes.length == 0) {
|
||||||
alertx("请选择一条配置");
|
alertx("请选择一条配置");
|
||||||
} else {
|
} else {
|
||||||
var ids;
|
var ids = "";
|
||||||
checkboxes.each(function(){
|
checkboxes.each(function(){
|
||||||
ids = ids + $(this).attr("id") + ",";
|
ids = ids + $(this).attr("id") + ",";
|
||||||
});
|
});
|
||||||
confirmx("<spring:message code='confirm_message'/>", "${ctx}/cfg/dnsIp/delete?cfgIds=" + ids);
|
if (confirm("<spring:message code='confirm_message'/>")) {
|
||||||
|
$("#cfgIds").val(ids);
|
||||||
|
$("#searchForm").attr("action","${ctx}/cfg/dnsIp/delete");
|
||||||
|
$("#searchForm").submit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -99,6 +103,7 @@
|
|||||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${dnsIpCfg.isFilterAction }"/>
|
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${dnsIpCfg.isFilterAction }"/>
|
||||||
|
<input id="cfgIds" name="cfgIds" type="hidden"/>
|
||||||
<!-- 搜索内容与操作按钮栏 -->
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
|
|||||||
Reference in New Issue
Block a user