标签:rup delete get str als gets 通过 close mapping
前端到后端:
1.用AJAXdata传值,后端用实体类对应对象或者HttpServletRequest 接收String类型字段,如:
@ResponseBody
@RequestMapping("/insertOrUpdate")
public Object insertOrUpdate(Collecter collecter,HttpServletRequest request){
collecterService.insertOrUpdate(collecter);
int i;
String wgh = request.getParameter("wgh");
if(null!=wgh && ""!=wgh){
collGridService.deleteByUserCode(collecter.getId());
String[] wghArray =wgh.split(",");
for(i=0;i<wghArray.length;i++){
CollGrid collGrid = new CollGrid();
collGrid.setUserCode(collecter.getId());
collGrid.setWorkGridCode(wghArray[i]);
collGridService.insertOrUpdate(collGrid);
}
}
return null;
}
2.layui等插件弹出框url跳转路径后拼接属性和值,如:
/** 新增部门信息弹窗操作*/
$(‘#add‘).click(function () {
parent.layer.open({
type: 2,
closeBtn: 1, //显示关闭按钮
anim: 1,
shade: 0.3,
title: "新增职能部门",
shadeClose: false,
area: [‘1000px‘, ‘500px‘],
shift: 1,
scrollbar: false,
content:$path(‘/depart/addDepartHtml?departName=‘ + $("#departName").val() + ‘&departCode=‘ + $("#departCode").val()),
end:function () {
var tDepartCode = parentTree.ltree.getSelectedNode().departCode;
lTree.refreshSelectedParentNodes();
lTree.refreshChildNodes(lTree.zTree.getNodesByParam("departCode", tDepartCode)[0].tId);
parentTree.ltree.zTree.reAsyncChildNodes(null, "refresh");
}
});
});
后端到前端:
1.通过ModelAndView,Model赋值<K,V>,view客户端跳转url,如:
@GetMapping("/addDepartHtml")
public ModelAndView addDepartHtml(HttpServletRequest request){
ModelAndView model = new ModelAndView("yywh/depart/addDepart");
model.addObject("parentName",request.getParameter("departName"));
model.addObject("departCode",request.getParameter("departCode"));
/** 生成部门排序号*/
Long orderNum = Long.valueOf(request.getParameter("departCode"));
model.addObject("orderNum",departService.createOrderNum(orderNum));
return model;
}
标签:rup delete get str als gets 通过 close mapping
原文地址:https://www.cnblogs.com/hazsly/p/10249050.html