ylbtech-笔记-IJ:IJ笔记1
1. 下拉框返回顶部
1、
<form:select id="type" path="baseId" class="input-medium">
<form:option value="" label=""/><form:options items="${typeList}" htmlEscape="false"/>
</form:select>
2、
2. 树返回顶部
1、
<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>
1.0、
@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;
}
2.1、
<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}"/>
2.2、
<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>
2.3、
<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>
2.4、
<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>
2.0、
/**
* 获取机构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;
}
6、
3. 下拉框返回顶部
1、sys/dicList.jsp
<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";
}
1.0.1、
/**
* 查询字段类型列表
* @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); }
2、
4. 树2返回顶部
1、
<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>
1.0、
@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";
}
1.0.1、
    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;
}
1.0.2、
2、
3、
5.返回顶部
 
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

IJ:IJ笔记1的更多相关文章

  1. 使用Derby ij客户端工具

    Derby是开源的.嵌入式的Java数据库程序,ij是Derby提供的客户端工具,相当于其他数据库提供的sqlplus工具. ij是纯Java的程序,不用安装,使用起来就像运行普通的Java应用程序一 ...

  2. [学习笔记] $Maximum$ $Minimum$ $identity$

    \(Maximum\) \(Minimum\) \(identity\)学习笔记 比较好玩的一个科技.具体来说就是\(max(a,b)=a+b-min(a,b)\),这个式子是比较显然的,但是这个可以 ...

  3. Discrete.Differential.Geometry-An.Applied.Introduction(sig2008)笔记

    -------------------------------------------------------------- Chapter 1: Introduction to Discrete D ...

  4. LuoguP4233 射命丸文的笔记

    题目描述 求所有\(n\)个点带标号强连通竞赛图中哈密顿回路数量的平均值. 题解 因为要求平均数,所以我们可以把分母和分子单开来算. \(n\)个点的所有竞赛图的所有哈密顿回路个数是可以求出来的,就是 ...

  5. P4233 射命丸文的笔记

    思路 题目要求求的是哈密顿回路的期望数量,实际上就是哈密顿回路的总数/有哈密顿回路的竞赛图的数量 n个点的所有竞赛图中哈密顿回路的总数为 \[ (n-1)! 2^{\frac{n(n-1)}{2}-n ...

  6. [Luogu4233]射命丸文的笔记

    luogu description 对于\(x\in[1,n]\)求\(x\)点强联通竞赛图中的哈密顿回路的期望个数膜\(998244353\). \(n\le10^5\) sol 首先\(n\)点竞 ...

  7. FFT/NTT复习笔记&多项式&生成函数学习笔记Ⅱ

    因为垃圾电脑太卡了就重开了一个... 前传:多项式Ⅰ u1s1 我预感还会有Ⅲ 多项式基础操作: 例题: 26. CF438E The Child and Binary Tree 感觉这题作为第一题还 ...

  8. 数学杂烩总结(多项式/形式幂级数+FWT+特征多项式+生成函数+斯特林数+二次剩余+单位根反演+置换群)

    数学杂烩总结(多项式/形式幂级数+FWT+特征多项式+生成函数+斯特林数+二次剩余+单位根反演+置换群) 因为不会做目录所以请善用ctrl+F 本来想的是笔记之类的,写着写着就变成了资源整理 一些有的 ...

  9. Bestcoder#5 1003

    Bestcoder#5 1003 Poor RukawTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Ja ...

随机推荐

  1. PMP 学习心得

    前两天刚考完 PMP,松了一口气,终于考完了,虽然心里有点慌,不知道自己会不会过.学习 PMP 这三个月还是很充实的.不断的看视频,做题目,功夫不负有心人,也算是学到了一些东西.至少知道了一个项目的启 ...

  2. C# Task详解

    1.Task的优势 ThreadPool相比Thread来说具备了很多优势,但是ThreadPool却又存在一些使用上的不方便.比如: ◆ ThreadPool不支持线程的取消.完成.失败通知等交互性 ...

  3. Java之三大基础排序(冒泡、选择、插入)

    注:以下排序均为从小到大 一.冒泡排序 package com.yunche.testsort; import java.util.Arrays; /** * @ClassName: BubbleSo ...

  4. layer弹出层无法关闭问题

    parent.layer.closeAll();如果关闭指定弹出层,获取对应弹出层的索引,进行关闭

  5. ROS lesson 1

    ROS ROS官网 ROS 简介 ROS 是 Robot Operation System 的简写,并且 他诞生在2000年后,至今有10余年了,运行在 Linux(Ubuntu) 上 ROS 不是 ...

  6. Go:值类型、引用类型

    值类型,变量存的就是值本身: in系列t.float系列.bool.string.数组和struct 引用类型,变量存的是一个地址,这是地址存的才是值本身: 指针.slice.map.chan.int ...

  7. 【tips】xadmin - django第三方后台管理系统

    Django 为大家提供了一个完善的后台管理系统—admin,但是这个后台管理系统总体来说不太适合国人的习惯,所以有大神就使用 bootstrap 和 jQuery,为我们开发了一个第三 方的 Dja ...

  8. codeforces 372 Complete the Word(双指针)

    codeforces 372 Complete the Word(双指针) 题链 题意:给出一个字符串,其中'?'代表这个字符是可变的,要求一个连续的26位长的串,其中每个字母都只出现一次 #incl ...

  9. 《Noisy Activation Function》噪声激活函数(一)

    本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/51736830 Noisy Activa ...

  10. PhantomJS & headless browser & pdf

    PhantomJS http://phantomjs.org/ https://github.com/Medium/phantomjs https://github.com/Medium/phanto ...