@RequestMapping("/uIElement/queryElementPermission.do") // @ResponseBody public void queryElementPermission(String url, HttpServletResponse response) throws IOException { if (url == null || "".equals(url)) { return; } response.setContentType("application/json"); List<String> elements = uIElementService.queryElement(url); StringBuilder builder = new StringBuilder("{"); for (String code : elements) { builder.append(code + ":true,"); } String aa = "{}"; if (builder.length() > 1) { aa = builder.substring(0, builder.length() - 1); aa = aa + "}"; } aa = "var Permision = {elements:" + aa + ",canShow: function(code) {if(!code){alert('请输入界面元素的code!');return;}if(this.elements[code]){return true;} else {return false;}}};"; PrintWriter out = response.getWriter(); out.write(aa); out.flush(); out.close(); }
@RequestMapping("/uIElement/queryAll.do") @ResponseBody public List<UIElement> queryAll(String navigation_id) { List<UIElement> uIElementes = uIElementService.query(Cnd.select().andEquals(M.UIElement.navigation_id, navigation_id)); return uIElementes; }
@RequestMapping("/uIElement/uncheckByFunRole.do") @ResponseBody public String uncheckByFunRole(String uIElement_id, String funRole_id) { uIElementService.uncheckByFunRole(uIElement_id, funRole_id); return "success"; }
@RequestMapping("/uIElement/queryByFunRole.do") @ResponseBody public List<UIElement> queryByFunRole(String navigation_id, String funRole_id) { List<UIElement> uIElementes = uIElementService.queryByFunRole(navigation_id, funRole_id); return uIElementes; }
@RequestMapping("/uIElement/destroy.do") @ResponseBody public UIElement destroy(@RequestBody UIElement uIElement) { uIElementService.delete(uIElement); return uIElement; }
@RequestMapping("/uIElement/deleteById.do") @ResponseBody public String deleteById(String id) { uIElementService.deleteById(id); return id; }
@RequestMapping("/uIElement/update.do") @ResponseBody public UIElement update(@RequestBody UIElement uIElement) { uIElementService.update(uIElement); return uIElement; }
@RequestMapping("/uIElement/load.do") public UIElement load(String id) { return uIElementService.get(id); }