IJ:IJ笔记1
| ylbtech-笔记-IJ:IJ笔记1 |
| 1. 下拉框返回顶部 |
<form:select id="type" path="baseId" class="input-medium">
<form:option value="" label=""/><form:options items="${typeList}" htmlEscape="false"/>
</form:select>
| 2. 树返回顶部 |
<tr>
<td class="width-15" class="active"><label class="pull-right"><font color="red">*</font>归属区域:</label></td>
<td class="width-35"><sys:treeselect id="area" name="area.id" value="${office.area.id}" labelName="area.name" labelValue="${office.area.name}"
title="区域" url="/sys/area/treeData" cssClass="form-control required"/></td>
</tr>
@RequiresPermissions("user")
@ResponseBody
@RequestMapping(value = "treeData")
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId, HttpServletResponse response) {
List<Map<String, Object>> mapList = Lists.newArrayList();
List<Area> list = areaService.findAll();
for (int i=0; i<list.size(); i++){
Area e = list.get(i);
if (StringUtils.isBlank(extId) || (extId!=null && !extId.equals(e.getId()) && e.getParentIds().indexOf(","+extId+",")==-1)){
Map<String, Object> map = Maps.newHashMap();
map.put("id", e.getId());
map.put("pId", e.getParentId());
map.put("name", e.getName());
mapList.add(map);
}
}
return mapList;
}
<sys:treeselect id="office" name="baseId" value="${office.parent.id}" labelName="parent.name" labelValue="${office.parent.name}"
title="机构" url="/sys/office/treeData" extId="${office.id}" cssClass="form-control" allowClear="${office.currentUser.admin}"/>
<tr>
<td class="width-15 active"><label class="pull-right">上级机构:</label></td>
<td class="width-35"><sys:treeselect id="office" name="parent.id" value="${office.parent.id}" labelName="parent.name" labelValue="${office.parent.name}"
title="机构" url="/sys/office/treeData" extId="${office.id}" cssClass="form-control" allowClear="${office.currentUser.admin}"/></td>
</tr>
<tr>
<td class="width-15" class="active"><label class="pull-right">主负责人:</label></td>
<td class="width-35">
<sys:treeselect id="primaryPerson" name="primaryPerson.id" value="${office.primaryPerson.id}" labelName="office.primaryPerson.name" labelValue="${office.primaryPerson.name}"
title="用户" url="/sys/office/treeData?type=3" cssClass="form-control" allowClear="true" notAllowSelectParent="true"/></td>
</tr>
<tr>
<td class="width-15 active"><label class="pull-right">副负责人:</label></td>
<td class="width-35">
<sys:treeselect id="deputyPerson" name="deputyPerson.id" value="${office.deputyPerson.id}" labelName="office.deputyPerson.name" labelValue="${office.deputyPerson.name}"
title="用户" url="/sys/office/treeData?type=3" cssClass="form-control" allowClear="true" notAllowSelectParent="true"/></td>
</tr>
/**
* 获取机构JSON数据。
* @param extId 排除的ID
* @param type 类型(1:公司;2:部门/小组/其它:3:用户)
* @param grade 显示级别
* @param response
* @return
*/
@RequiresPermissions("user")
@ResponseBody
@RequestMapping(value = "treeData")
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId, @RequestParam(required=false) String type,
@RequestParam(required=false) Long grade, @RequestParam(required=false) Boolean isAll, HttpServletResponse response) {
List<Map<String, Object>> mapList = Lists.newArrayList();
List<Office> list = officeService.findList(isAll);
for (int i=0; i<list.size(); i++){
Office e = list.get(i);
if ((StringUtils.isBlank(extId) || (extId!=null && !extId.equals(e.getId()) && e.getParentIds().indexOf(","+extId+",")==-1))
&& (type == null || (type != null && (type.equals("1") ? type.equals(e.getType()) : true)))
&& (grade == null || (grade != null && Integer.parseInt(e.getGrade()) <= grade.intValue()))
&& Global.YES.equals(e.getUseable())){
Map<String, Object> map = Maps.newHashMap();
map.put("id", e.getId());
map.put("pId", e.getParentId());
map.put("pIds", e.getParentIds());
map.put("name", e.getName());
if (type != null && "3".equals(type)){
map.put("isParent", true);
}
mapList.add(map);
}
}
return mapList;
}
| 3. 下拉框返回顶部 |
<span>类型:</span>
<form:select id="type" path="type" class="input-medium">
<form:option value="" label=""/><form:options items="${typeList}" htmlEscape="false"/>
</form:select>
1.0、
@RequiresPermissions("sys:dict:list")
@RequestMapping(value = {"list", ""})
public String list(Dict dict, HttpServletRequest request, HttpServletResponse response, Model model) {
List<String> typeList = dictService.findTypeList();
model.addAttribute("typeList", typeList);
//Page<Dict> page = dictService.findPage(new Page<Dict>(request, response), dict);
//model.addAttribute("page", page);
return "modules/sys/dictList";
}
/**
* 查询字段类型列表
* @return
*/
public List<String> findTypeList(){
return dao.findTypeList(new Dict());
}
1.0.2、
/**
* 字典DAO接口
* @author
* @version 2014-05-16
*/
@MyBatisDao
public interface DictDao extends CrudDao<Dict> { public List<String> findTypeList(Dict dict); }
| 4. 树2返回顶部 |
<form id="listForm" method="post">
<table id="treeTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
<thead><tr><th><input type="checkbox" class="i-checks"></th><th>名称</th><th>链接</th><th style="text-align:center;">排序</th><th>可见</th><th>权限标识</th><shiro:hasPermission name="sys:menu:edit"><th>操作</th></shiro:hasPermission></tr></thead>
<tbody><c:forEach items="${list}" var="menu">
<tr id="${menu.id}" pId="${menu.parent.id ne '1'?menu.parent.id:'0'}">
<td> <input type="checkbox" id="${menu.id}" class="i-checks"></td>
<td nowrap><i class="icon-${not empty menu.icon?menu.icon:' hide'}"></i><a href="#" onclick="openDialogView('查看菜单', '${ctx}/sys/menu/form?id=${menu.id}','800px', '500px')">${menu.name}</a></td>
<td title="${menu.href}">${fns:abbr(menu.href,30)}</td>
<td style="text-align:center;">
<shiro:hasPermission name="sys:menu:updateSort">
<input type="hidden" name="ids" value="${menu.id}"/>
<input name="sorts" type="text" value="${menu.sort}" class="form-control" style="width:100px;margin:0;padding:0;text-align:center;">
</shiro:hasPermission><shiro:lacksPermission name="sys:menu:updateSort">
${menu.sort}
</shiro:lacksPermission>
</td>
<td>${menu.isShow eq '1'?'显示':'隐藏'}</td>
<td title="${menu.permission}">${fns:abbr(menu.permission,30)}</td>
<td nowrap>
<shiro:hasPermission name="sys:menu:view">
<a href="#" onclick="openDialogView('查看菜单', '${ctx}/sys/menu/form?id=${menu.id}','800px', '500px')" class="btn btn-info btn-xs" ><i class="fa fa-search-plus"></i> 查看</a>
</shiro:hasPermission>
<shiro:hasPermission name="sys:menu:edit">
<a href="#" onclick="openDialog('修改菜单', '${ctx}/sys/menu/form?id=${menu.id}','800px', '500px')" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> 修改</a>
</shiro:hasPermission>
<shiro:hasPermission name="sys:menu:del">
<a href="${ctx}/sys/menu/delete?id=${menu.id}" onclick="return confirmx('要删除该菜单及所有子菜单项吗?', this.href)" class="btn btn-danger btn-xs" ><i class="fa fa-trash"></i> 删除</a>
</shiro:hasPermission>
<shiro:hasPermission name="sys:menu:add">
<a href="#" onclick="openDialog('添加下级菜单', '${ctx}/sys/menu/form?parent.id=${menu.id}','800px', '500px')" class="btn btn-primary btn-xs" ><i class="fa fa-plus"></i> 添加下级菜单</a>
</shiro:hasPermission>
</td>
</tr>
</c:forEach></tbody>
</table>
</form>
@RequiresPermissions("sys:menu:list")
@RequestMapping(value = {"list", ""})
public String list(Model model) {
List<Menu> list = Lists.newArrayList();
List<Menu> sourcelist = systemService.findAllMenu();
Menu.sortList(list, sourcelist, Menu.getRootId(), true);
model.addAttribute("list", list);
return "modules/sys/menuList";
}
public List<Menu> findAllMenu(){
return UserUtils.getMenuList();
}
/**
* 获取当前用户授权菜单
* @return
*/
public static List<Menu> getMenuList(){
@SuppressWarnings("unchecked")
List<Menu> menuList = (List<Menu>)getCache(CACHE_MENU_LIST);
if (menuList == null){
User user = getUser();
if (user.isAdmin()){
menuList = menuDao.findAllList(new Menu());
}else{
Menu m = new Menu();
m.setUserId(user.getId());
menuList = menuDao.findByUserId(m);
}
putCache(CACHE_MENU_LIST, menuList);
}
return menuList;
}
| 5.返回顶部 |
| 6.返回顶部 |
![]() |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
IJ:IJ笔记1的更多相关文章
- 使用Derby ij客户端工具
Derby是开源的.嵌入式的Java数据库程序,ij是Derby提供的客户端工具,相当于其他数据库提供的sqlplus工具. ij是纯Java的程序,不用安装,使用起来就像运行普通的Java应用程序一 ...
- [学习笔记] $Maximum$ $Minimum$ $identity$
\(Maximum\) \(Minimum\) \(identity\)学习笔记 比较好玩的一个科技.具体来说就是\(max(a,b)=a+b-min(a,b)\),这个式子是比较显然的,但是这个可以 ...
- Discrete.Differential.Geometry-An.Applied.Introduction(sig2008)笔记
-------------------------------------------------------------- Chapter 1: Introduction to Discrete D ...
- LuoguP4233 射命丸文的笔记
题目描述 求所有\(n\)个点带标号强连通竞赛图中哈密顿回路数量的平均值. 题解 因为要求平均数,所以我们可以把分母和分子单开来算. \(n\)个点的所有竞赛图的所有哈密顿回路个数是可以求出来的,就是 ...
- P4233 射命丸文的笔记
思路 题目要求求的是哈密顿回路的期望数量,实际上就是哈密顿回路的总数/有哈密顿回路的竞赛图的数量 n个点的所有竞赛图中哈密顿回路的总数为 \[ (n-1)! 2^{\frac{n(n-1)}{2}-n ...
- [Luogu4233]射命丸文的笔记
luogu description 对于\(x\in[1,n]\)求\(x\)点强联通竞赛图中的哈密顿回路的期望个数膜\(998244353\). \(n\le10^5\) sol 首先\(n\)点竞 ...
- FFT/NTT复习笔记&多项式&生成函数学习笔记Ⅱ
因为垃圾电脑太卡了就重开了一个... 前传:多项式Ⅰ u1s1 我预感还会有Ⅲ 多项式基础操作: 例题: 26. CF438E The Child and Binary Tree 感觉这题作为第一题还 ...
- 数学杂烩总结(多项式/形式幂级数+FWT+特征多项式+生成函数+斯特林数+二次剩余+单位根反演+置换群)
数学杂烩总结(多项式/形式幂级数+FWT+特征多项式+生成函数+斯特林数+二次剩余+单位根反演+置换群) 因为不会做目录所以请善用ctrl+F 本来想的是笔记之类的,写着写着就变成了资源整理 一些有的 ...
- Bestcoder#5 1003
Bestcoder#5 1003 Poor RukawTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Ja ...
随机推荐
- 关于MD5解密网站。www.cmd5.com
第一次听说这个网站,本人的名字居然也能够被解密,而且还是需要付费取得明文! 大家知道,md5加密是我们常用的加密方式,这个加密方式的好处在于不可逆.而且任何环境下算出的密文应该都是相同的,所以在大家登 ...
- 判断机型是否为iphoneX
判断机型是否为iphoneX isIPhoneX() { var u = navigator.userAgent; var isIOS ...
- 【转】Flex 布局
网页布局(layout)是CSS的一个重点应用. 布局的传统解决方案,基于盒状模型,依赖 display属性 + position属性 + float属性.它对于那些特殊布局非常不方便,比如,垂直居中 ...
- 数位dp备忘录
hdu 4734:把限制值化为数组形式,逐位求解 hdu 4507:类似于上题,其中求平方和的方法很妙 SPOJ BALNUM Balanced Numbers:经典数位dp,注意两点,1,不要把前 ...
- Navicat premium连接Oracle报ORA-12541错误
1:ORA-12541 原因:Oracle TNS监听服务没开 解决:
- Mozilla新特性只支持https网站
Mozilla的官方博客2015.4.30正式宣布了淘汰HTTP的方案. 其中包括:设定一个日期,所有的新特性将只提供给HTTPS网站:HTTP网站将逐步被禁止访问浏览器功能,尤其是那些与用户安全和隐 ...
- 九度oj 1179 阶乘
题目1179:阶乘 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:6010 解决:1756 题目描述: 输入n,求y1=1!+3!+...m!(m是小于等于n的最大奇数)y2=2!+4!+ ...
- Swift对象创建过程(PUT Object)——纠删码策略(二)
相应Object使用纠删码(EC)作为存储策略时,BaseObjectController类中PUT和GET需要调用的一些方法会被ECObjectController中相应函数覆盖. 在GET Obj ...
- 产品需求分析神器:KANO模型分析法
前言: 任何一个互联网产品,哪怕是一个简单的页面,也会涉及到很多的需求,产品经理也会经常遇到这样的情况:老板,业务提的各种新需求一下子都扎堆,哪个需求对用户来说最重要,用户对我们的新功能是否满意?开发 ...
- P3383 【模板】线性筛素数 洛谷
https://www.luogu.org/problem/show?pid=3383#sub 题目描述 如题,给定一个范围N,你需要处理M个某数字是否为质数的询问(每个数字均在范围1-N内) 输入输 ...
