Commit 4fe158fa by RuoYi

若依 2.4

parent a4c1912a
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
http://www.zi-han.net/theme/hplus http://www.zi-han.net/theme/hplus
http://webapplayers.com/inspinia_admin-v2.7.1 http://webapplayers.com/inspinia_admin-v2.7.1
阿里云优惠活动(2CPU 4GRAM 1M带宽 40G高效云盘):https://promotion.aliyun.com/ntms/act/vm/aliyun-group/buy.html?group=BphATfDhsQ 阿里云优惠活动(2CPU 4GRAM 1M带宽 40G高效云盘):https://promotion.aliyun.com/ntms/act/vm/aliyun-group/buy.html?group=BphATfDhsQ
云产品通用代金券,可叠加官网常规优惠使用:https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof 云产品通用1000元代金券,可叠加官网常规优惠使用 :https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=brki8iof
## 内置功能 ## 内置功能
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。 1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现。 2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限
3. 岗位管理:配置系统用户所属担任职务。 3. 岗位管理:配置系统用户所属担任职务。
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。 4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。 5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
...@@ -42,27 +42,27 @@ http://webapplayers.com/inspinia_admin-v2.7.1 ...@@ -42,27 +42,27 @@ http://webapplayers.com/inspinia_admin-v2.7.1
<table> <table>
<tr> <tr>
<td><img src="https://oscimg.oschina.net/oscnet/25b5e333768d013d45a990c152dbe4d9d6e.jpg"/></td> <td><img src="https://oscimg.oschina.net/oscnet/25b5e333768d013d45a990c152dbe4d9d6e.jpg"/></td>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/114553_jBTY_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132411_4c5I_1438828.png"/></td>
</tr> </tr>
<tr> <tr>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/114830_eIHp_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132436_rRBh_1438828.png"/></td>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/114854_Y5a2_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132442_umjM_1438828.png"/></td>
</tr> </tr>
<tr> <tr>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/114920_P8qv_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132449_OtY8_1438828.png"/></td>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/114946_O3jx_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132454_4Evz_1438828.png"/></td>
</tr> </tr>
<tr> <tr>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/115022_1Tnm_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132520_Zzkj_1438828.png"/></td>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/115051_XvMW_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132539_5bJe_1438828.png"/></td>
</tr> </tr>
<tr> <tr>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/115117_9TZ3_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132548_ne4U_1438828.png"/></td>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/115130_a5xO_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132557_Fab4_1438828.png"/></td>
</tr> </tr>
<tr> <tr>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/115151_EuYC_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132617_MLmV_1438828.png"/></td>
<td><img src="https://static.oschina.net/uploads/space/2018/0728/115212_QybT_1438828.png"/></td> <td><img src="https://static.oschina.net/uploads/space/2018/0902/132626_3iBs_1438828.png"/></td>
</tr> </tr>
</table> </table>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>RuoYi</artifactId> <artifactId>RuoYi</artifactId>
<version>2.3.0</version> <version>2.4.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>RuoYi</name> <name>RuoYi</name>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version> <version>2.0.4.RELEASE</version>
<relativePath /> <relativePath />
</parent> </parent>
......
package com.ruoyi.common.exception.user;
/**
* 用户账号已被删除
*
* @author ruoyi
*/
public class UserDeleteException extends UserException
{
private static final long serialVersionUID = 1L;
public UserDeleteException()
{
super("user.password.delete", null);
}
}
...@@ -11,8 +11,6 @@ import org.aspectj.lang.annotation.Pointcut; ...@@ -11,8 +11,6 @@ import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature; import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.ServletUtils;
...@@ -32,7 +30,6 @@ import com.ruoyi.project.system.user.domain.User; ...@@ -32,7 +30,6 @@ import com.ruoyi.project.system.user.domain.User;
*/ */
@Aspect @Aspect
@Component @Component
@EnableAsync
public class LogAspect public class LogAspect
{ {
private static final Logger log = LoggerFactory.getLogger(LogAspect.class); private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
...@@ -66,7 +63,6 @@ public class LogAspect ...@@ -66,7 +63,6 @@ public class LogAspect
handleLog(joinPoint, e); handleLog(joinPoint, e);
} }
@Async
protected void handleLog(final JoinPoint joinPoint, final Exception e) protected void handleLog(final JoinPoint joinPoint, final Exception e)
{ {
try try
......
package com.ruoyi.framework.datascope;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.system.role.domain.Role;
import com.ruoyi.project.system.user.domain.User;
/**
* 数据范围处理
*
* @author ruoyi
*/
public class DataScopeUtils
{
/**
* 全部数据权限
*/
public static final String DATA_SCOPE_ALL = "1";
/**
* 自定数据权限
*/
public static final String DATA_SCOPE_CUSTOM = "2";
/**
* 数据范围过滤
*
* @return 标准连接条件对象
*/
public static String dataScopeFilter()
{
return dataScopeFilter("u");
}
/**
* 数据范围过滤
*
* @param da 部门表别名
* @return 标准连接条件对象
*/
public static String dataScopeFilter(String da)
{
User user = ShiroUtils.getUser();
// 如果是超级管理员,则不过滤数据
if (user.isAdmin())
{
return StringUtils.EMPTY;
}
StringBuilder sqlString = new StringBuilder();
for (Role role : user.getRoles())
{
String dataScope = role.getDataScope();
if (DATA_SCOPE_ALL.equals(dataScope))
{
sqlString = new StringBuilder();
break;
}
else if (DATA_SCOPE_CUSTOM.equals(dataScope))
{
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", da, role.getRoleId()));
}
}
if (StringUtils.isNotBlank(sqlString.toString()))
{
return " AND (" + sqlString.substring(4) + ")";
}
return StringUtils.EMPTY;
}
}
package com.ruoyi.framework.shiro.realm; package com.ruoyi.framework.shiro.realm;
import java.util.HashSet;
import java.util.Set;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationInfo;
...@@ -17,6 +20,7 @@ import org.apache.shiro.subject.PrincipalCollection; ...@@ -17,6 +20,7 @@ import org.apache.shiro.subject.PrincipalCollection;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.ruoyi.common.exception.user.CaptchaException; import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.RoleBlockedException; import com.ruoyi.common.exception.user.RoleBlockedException;
import com.ruoyi.common.exception.user.UserBlockedException; import com.ruoyi.common.exception.user.UserBlockedException;
...@@ -53,12 +57,27 @@ public class UserRealm extends AuthorizingRealm ...@@ -53,12 +57,27 @@ public class UserRealm extends AuthorizingRealm
@Override @Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection arg0) protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection arg0)
{ {
Long userId = ShiroUtils.getUserId(); User user = ShiroUtils.getUser();
// 角色列表
Set<String> roles = new HashSet<String>();
// 功能列表
Set<String> menus = new HashSet<String>();
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
// 角色加入AuthorizationInfo认证对象 // 管理员拥有所有权限
info.setRoles(roleService.selectRoleKeys(userId)); if (user.isAdmin())
// 权限加入AuthorizationInfo认证对象 {
info.setStringPermissions(menuService.selectPermsByUserId(userId)); info.addRole("admin");
info.addStringPermission("*:*:*");
}
else
{
roles = roleService.selectRoleKeys(user.getUserId());
menus = menuService.selectPermsByUserId(user.getUserId());
// 角色加入AuthorizationInfo认证对象
info.setRoles(roles);
// 权限加入AuthorizationInfo认证对象
info.setStringPermissions(menus);
}
return info; return info;
} }
......
...@@ -8,6 +8,7 @@ import com.ruoyi.common.constant.ShiroConstants; ...@@ -8,6 +8,7 @@ import com.ruoyi.common.constant.ShiroConstants;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.exception.user.CaptchaException; import com.ruoyi.common.exception.user.CaptchaException;
import com.ruoyi.common.exception.user.UserBlockedException; import com.ruoyi.common.exception.user.UserBlockedException;
import com.ruoyi.common.exception.user.UserDeleteException;
import com.ruoyi.common.exception.user.UserNotExistsException; import com.ruoyi.common.exception.user.UserNotExistsException;
import com.ruoyi.common.exception.user.UserPasswordNotMatchException; import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
...@@ -80,19 +81,26 @@ public class LoginService ...@@ -80,19 +81,26 @@ public class LoginService
user = userService.selectUserByEmail(username); user = userService.selectUserByEmail(username);
} }
if (user == null || UserStatus.DELETED.getCode().equals(user.getDelFlag())) if (user == null)
{ {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists"))); AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists")));
throw new UserNotExistsException(); throw new UserNotExistsException();
} }
passwordService.validate(user, password); if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.delete")));
throw new UserDeleteException();
}
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
{ {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark()))); AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark())));
throw new UserBlockedException(user.getRemark()); throw new UserBlockedException(user.getRemark());
} }
passwordService.validate(user, password);
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
recordLoginInfo(user); recordLoginInfo(user);
return user; return user;
......
...@@ -111,4 +111,4 @@ public class BaseEntity implements Serializable ...@@ -111,4 +111,4 @@ public class BaseEntity implements Serializable
{ {
this.params = params; this.params = params;
} }
} }
\ No newline at end of file
...@@ -82,6 +82,7 @@ public class Config extends BaseEntity ...@@ -82,6 +82,7 @@ public class Config extends BaseEntity
this.configType = configType; this.configType = configType;
} }
@Override
public String toString() public String toString()
{ {
return "Config [configId=" + configId + ", configName=" + configName + ", configKey=" + configKey return "Config [configId=" + configId + ", configName=" + configName + ", configKey=" + configKey
......
...@@ -2,6 +2,7 @@ package com.ruoyi.project.system.dept.controller; ...@@ -2,6 +2,7 @@ package com.ruoyi.project.system.dept.controller;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -11,12 +12,14 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -11,12 +12,14 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.dept.domain.Dept; import com.ruoyi.project.system.dept.domain.Dept;
import com.ruoyi.project.system.dept.service.IDeptService; import com.ruoyi.project.system.dept.service.IDeptService;
import com.ruoyi.project.system.role.domain.Role;
/** /**
* 部门信息 * 部门信息
...@@ -142,4 +145,15 @@ public class DeptController extends BaseController ...@@ -142,4 +145,15 @@ public class DeptController extends BaseController
List<Map<String, Object>> tree = deptService.selectDeptTree(); List<Map<String, Object>> tree = deptService.selectDeptTree();
return tree; return tree;
} }
/**
* 加载角色部门(数据权限)列表树
*/
@GetMapping("/roleDeptTreeData")
@ResponseBody
public List<Map<String, Object>> deptTreeData(Role role)
{
List<Map<String, Object>> tree = deptService.roleDeptTreeData(role);
return tree;
}
} }
...@@ -10,24 +10,36 @@ import com.ruoyi.framework.web.domain.BaseEntity; ...@@ -10,24 +10,36 @@ import com.ruoyi.framework.web.domain.BaseEntity;
public class Dept extends BaseEntity public class Dept extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 部门ID */ /** 部门ID */
private Long deptId; private Long deptId;
/** 父部门ID */ /** 父部门ID */
private Long parentId; private Long parentId;
/** 祖级列表 */ /** 祖级列表 */
private String ancestors; private String ancestors;
/** 部门名称 */ /** 部门名称 */
private String deptName; private String deptName;
/** 显示顺序 */ /** 显示顺序 */
private String orderNum; private String orderNum;
/** 负责人 */ /** 负责人 */
private String leader; private String leader;
/** 联系电话 */ /** 联系电话 */
private String phone; private String phone;
/** 邮箱 */ /** 邮箱 */
private String email; private String email;
/** 部门状态:0正常,1停用 */ /** 部门状态:0正常,1停用 */
private String status; private String status;
/** 删除标志(0代表存在 2代表删除) */
private String delFlag;
/** 父部门名称 */ /** 父部门名称 */
private String parentName; private String parentName;
...@@ -121,6 +133,16 @@ public class Dept extends BaseEntity ...@@ -121,6 +133,16 @@ public class Dept extends BaseEntity
this.status = status; this.status = status;
} }
public String getDelFlag()
{
return delFlag;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getParentName() public String getParentName()
{ {
return parentName; return parentName;
......
...@@ -36,13 +36,6 @@ public interface DeptMapper ...@@ -36,13 +36,6 @@ public interface DeptMapper
public List<Dept> selectDeptList(Dept dept); public List<Dept> selectDeptList(Dept dept);
/** /**
* 查询部门所有数据
*
* @return 部门信息集合
*/
public List<Dept> selectDeptAll();
/**
* 删除部门管理信息 * 删除部门管理信息
* *
* @param deptId 部门ID * @param deptId 部门ID
...@@ -86,7 +79,16 @@ public interface DeptMapper ...@@ -86,7 +79,16 @@ public interface DeptMapper
* 校验部门名称是否唯一 * 校验部门名称是否唯一
* *
* @param deptName 部门名称 * @param deptName 部门名称
* @param parentId 父部门ID
* @return 结果 * @return 结果
*/ */
public Dept checkDeptNameUnique(String deptName); public Dept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
/**
* 根据角色ID查询部门
*
* @param roleId 角色ID
* @return 部门列表
*/
public List<String> selectRoleDeptTree(Long roleId);
} }
...@@ -9,8 +9,10 @@ import org.springframework.stereotype.Service; ...@@ -9,8 +9,10 @@ import org.springframework.stereotype.Service;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.framework.datascope.DataScopeUtils;
import com.ruoyi.project.system.dept.domain.Dept; import com.ruoyi.project.system.dept.domain.Dept;
import com.ruoyi.project.system.dept.mapper.DeptMapper; import com.ruoyi.project.system.dept.mapper.DeptMapper;
import com.ruoyi.project.system.role.domain.Role;
/** /**
* 部门管理 服务实现 * 部门管理 服务实现
...@@ -31,31 +33,60 @@ public class DeptServiceImpl implements IDeptService ...@@ -31,31 +33,60 @@ public class DeptServiceImpl implements IDeptService
@Override @Override
public List<Dept> selectDeptList(Dept dept) public List<Dept> selectDeptList(Dept dept)
{ {
dept.getParams().put("dataScope", DataScopeUtils.dataScopeFilter("d"));
return deptMapper.selectDeptList(dept); return deptMapper.selectDeptList(dept);
} }
/** /**
* 查询部门所有数据 * 查询部门管理树
* *
* @return 部门信息集合 * @return 所有部门信息
*/ */
@Override @Override
public List<Dept> selectDeptAll() public List<Map<String, Object>> selectDeptTree()
{ {
return deptMapper.selectDeptAll(); List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
List<Dept> deptList = selectDeptList(new Dept());
trees = getTrees(deptList, false, null);
return trees;
} }
/** /**
* 查询部门管理树 * 根据角色ID查询部门(数据权限)
* *
* @return 所有部门信息 * @param role 角色对象
* @return 部门列表(数据权限)
*/ */
@Override @Override
public List<Map<String, Object>> selectDeptTree() public List<Map<String, Object>> roleDeptTreeData(Role role)
{ {
Long roleId = role.getRoleId();
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
List<Dept> deptList = deptMapper.selectDeptAll(); List<Dept> deptList = selectDeptList(new Dept());
if (StringUtils.isNotNull(roleId))
{
List<String> roleDeptList = deptMapper.selectRoleDeptTree(roleId);
trees = getTrees(deptList, true, roleDeptList);
}
else
{
trees = getTrees(deptList, false, null);
}
return trees;
}
/**
* 对象转部门树
*
* @param menuList 部门列表
* @param isCheck 是否需要选中
* @param roleDeptList 角色已存在菜单列表
* @return
*/
public List<Map<String, Object>> getTrees(List<Dept> deptList, boolean isCheck, List<String> roleDeptList)
{
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
for (Dept dept : deptList) for (Dept dept : deptList)
{ {
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
...@@ -65,6 +96,14 @@ public class DeptServiceImpl implements IDeptService ...@@ -65,6 +96,14 @@ public class DeptServiceImpl implements IDeptService
deptMap.put("pId", dept.getParentId()); deptMap.put("pId", dept.getParentId());
deptMap.put("name", dept.getDeptName()); deptMap.put("name", dept.getDeptName());
deptMap.put("title", dept.getDeptName()); deptMap.put("title", dept.getDeptName());
if (isCheck)
{
deptMap.put("checked", roleDeptList.contains(dept.getDeptId() + dept.getDeptName()));
}
else
{
deptMap.put("checked", false);
}
trees.add(deptMap); trees.add(deptMap);
} }
} }
...@@ -185,7 +224,7 @@ public class DeptServiceImpl implements IDeptService ...@@ -185,7 +224,7 @@ public class DeptServiceImpl implements IDeptService
public String checkDeptNameUnique(Dept dept) public String checkDeptNameUnique(Dept dept)
{ {
Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
Dept info = deptMapper.checkDeptNameUnique(dept.getDeptName()); Dept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
{ {
return UserConstants.DEPT_NAME_NOT_UNIQUE; return UserConstants.DEPT_NAME_NOT_UNIQUE;
......
...@@ -2,7 +2,9 @@ package com.ruoyi.project.system.dept.service; ...@@ -2,7 +2,9 @@ package com.ruoyi.project.system.dept.service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.ruoyi.project.system.dept.domain.Dept; import com.ruoyi.project.system.dept.domain.Dept;
import com.ruoyi.project.system.role.domain.Role;
/** /**
* 部门管理 服务层 * 部门管理 服务层
...@@ -20,13 +22,6 @@ public interface IDeptService ...@@ -20,13 +22,6 @@ public interface IDeptService
public List<Dept> selectDeptList(Dept dept); public List<Dept> selectDeptList(Dept dept);
/** /**
* 查询部门所有数据
*
* @return 部门信息集合
*/
public List<Dept> selectDeptAll();
/**
* 查询部门管理树 * 查询部门管理树
* *
* @return 所有部门信息 * @return 所有部门信息
...@@ -34,6 +29,14 @@ public interface IDeptService ...@@ -34,6 +29,14 @@ public interface IDeptService
public List<Map<String, Object>> selectDeptTree(); public List<Map<String, Object>> selectDeptTree();
/** /**
* 根据角色ID查询菜单
*
* @param role 角色对象
* @return 菜单列表
*/
public List<Map<String, Object>> roleDeptTreeData(Role role);
/**
* 查询部门人数 * 查询部门人数
* *
* @param parentId 父部门ID * @param parentId 父部门ID
......
package com.ruoyi.project.system.menu.mapper; package com.ruoyi.project.system.menu.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.project.system.menu.domain.Menu; import com.ruoyi.project.system.menu.domain.Menu;
/** /**
...@@ -12,6 +13,20 @@ public interface MenuMapper ...@@ -12,6 +13,20 @@ public interface MenuMapper
{ {
/** /**
* 查询系统所有菜单(含按钮)
*
* @return 菜单列表
*/
public List<Menu> selectMenuAll();
/**
* 查询系统正常显示菜单(不含按钮)
*
* @return 菜单列表
*/
public List<Menu> selectMenuNormalAll();
/**
* 根据用户ID查询菜单 * 根据用户ID查询菜单
* *
* @param userId 用户ID * @param userId 用户ID
...@@ -44,13 +59,6 @@ public interface MenuMapper ...@@ -44,13 +59,6 @@ public interface MenuMapper
public List<Menu> selectMenuList(Menu menu); public List<Menu> selectMenuList(Menu menu);
/** /**
* 查询系统所有菜单
*
* @return 菜单列表
*/
public List<Menu> selectMenuAll();
/**
* 删除菜单管理信息 * 删除菜单管理信息
* *
* @param menuId 菜单ID * @param menuId 菜单ID
...@@ -94,8 +102,9 @@ public interface MenuMapper ...@@ -94,8 +102,9 @@ public interface MenuMapper
* 校验菜单名称是否唯一 * 校验菜单名称是否唯一
* *
* @param menuName 菜单名称 * @param menuName 菜单名称
* @param parentId 父菜单ID
* @return 结果 * @return 结果
*/ */
public Menu checkMenuNameUnique(String menuName); public Menu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
} }
...@@ -5,6 +5,7 @@ import java.util.Map; ...@@ -5,6 +5,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import com.ruoyi.project.system.menu.domain.Menu; import com.ruoyi.project.system.menu.domain.Menu;
import com.ruoyi.project.system.role.domain.Role; import com.ruoyi.project.system.role.domain.Role;
import com.ruoyi.project.system.user.domain.User;
/** /**
* 菜单 业务层 * 菜单 业务层
...@@ -17,10 +18,10 @@ public interface IMenuService ...@@ -17,10 +18,10 @@ public interface IMenuService
/** /**
* 根据用户ID查询菜单 * 根据用户ID查询菜单
* *
* @param userId 用户ID * @param user 用户信息
* @return 菜单列表 * @return 菜单列表
*/ */
public List<Menu> selectMenusByUserId(Long userId); public List<Menu> selectMenusByUser(User user);
/** /**
* 查询系统菜单列表 * 查询系统菜单列表
......
...@@ -6,6 +6,7 @@ import java.util.Arrays; ...@@ -6,6 +6,7 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -19,6 +20,7 @@ import com.ruoyi.project.system.menu.domain.Menu; ...@@ -19,6 +20,7 @@ import com.ruoyi.project.system.menu.domain.Menu;
import com.ruoyi.project.system.menu.mapper.MenuMapper; import com.ruoyi.project.system.menu.mapper.MenuMapper;
import com.ruoyi.project.system.role.domain.Role; import com.ruoyi.project.system.role.domain.Role;
import com.ruoyi.project.system.role.mapper.RoleMenuMapper; import com.ruoyi.project.system.role.mapper.RoleMenuMapper;
import com.ruoyi.project.system.user.domain.User;
/** /**
* 菜单 业务层处理 * 菜单 业务层处理
...@@ -37,15 +39,24 @@ public class MenuServiceImpl implements IMenuService ...@@ -37,15 +39,24 @@ public class MenuServiceImpl implements IMenuService
private RoleMenuMapper roleMenuMapper; private RoleMenuMapper roleMenuMapper;
/** /**
* 根据用户ID查询菜单 * 根据用户查询菜单
* *
* @param userId 用户ID * @param userId 用户信息
* @return 菜单列表 * @return 菜单列表
*/ */
@Override @Override
public List<Menu> selectMenusByUserId(Long userId) public List<Menu> selectMenusByUser(User user)
{ {
List<Menu> menus = menuMapper.selectMenusByUserId(userId); List<Menu> menus = new LinkedList<Menu>();
// 管理员显示所有菜单信息
if (user.isAdmin())
{
menus = menuMapper.selectMenuNormalAll();
}
else
{
menus = menuMapper.selectMenusByUserId(user.getUserId());
}
return TreeUtils.getChildPerms(menus, 0); return TreeUtils.getChildPerms(menus, 0);
} }
...@@ -281,7 +292,7 @@ public class MenuServiceImpl implements IMenuService ...@@ -281,7 +292,7 @@ public class MenuServiceImpl implements IMenuService
public String checkMenuNameUnique(Menu menu) public String checkMenuNameUnique(Menu menu)
{ {
Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
Menu info = menuMapper.checkMenuNameUnique(menu.getMenuName()); Menu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue())
{ {
return UserConstants.MENU_NAME_NOT_UNIQUE; return UserConstants.MENU_NAME_NOT_UNIQUE;
......
...@@ -116,6 +116,29 @@ public class RoleController extends BaseController ...@@ -116,6 +116,29 @@ public class RoleController extends BaseController
return toAjax(roleService.updateRole(role)); return toAjax(roleService.updateRole(role));
} }
/**
* 新增数据权限
*/
@GetMapping("/rule/{roleId}")
public String rule(@PathVariable("roleId") Long roleId, ModelMap mmap)
{
mmap.put("role", roleService.selectRoleById(roleId));
return prefix + "/rule";
}
/**
* 修改保存数据权限
*/
@RequiresPermissions("system:role:edit")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PostMapping("/rule")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
public AjaxResult ruleSave(Role role)
{
return toAjax(roleService.updateRule(role));
}
@RequiresPermissions("system:role:remove") @RequiresPermissions("system:role:remove")
@Log(title = "角色管理", businessType = BusinessType.DELETE) @Log(title = "角色管理", businessType = BusinessType.DELETE)
@PostMapping("/remove") @PostMapping("/remove")
...@@ -141,7 +164,7 @@ public class RoleController extends BaseController ...@@ -141,7 +164,7 @@ public class RoleController extends BaseController
{ {
return roleService.checkRoleNameUnique(role); return roleService.checkRoleNameUnique(role);
} }
/** /**
* 校验角色权限 * 校验角色权限
*/ */
......
...@@ -29,15 +29,26 @@ public class Role extends BaseEntity ...@@ -29,15 +29,26 @@ public class Role extends BaseEntity
@Excel(name = "角色排序") @Excel(name = "角色排序")
private String roleSort; private String roleSort;
/** 数据范围(1:所有数据权限;2:自定数据权限) */
@Excel(name = "数据范围")
private String dataScope;
/** 角色状态(0正常 1停用) */ /** 角色状态(0正常 1停用) */
@Excel(name = "角色状态") @Excel(name = "角色状态")
private String status; private String status;
/** 删除标志(0代表存在 2代表删除) */
private String delFlag;
/** 用户是否存在此角色标识 默认不存在 */ /** 用户是否存在此角色标识 默认不存在 */
private boolean flag = false; private boolean flag = false;
/** 菜单组 */ /** 菜单组 */
private Long[] menuIds; private Long[] menuIds;
/** 部门组(数据权限) */
private Long[] deptIds;
public Long getRoleId() public Long getRoleId()
{ {
return roleId; return roleId;
...@@ -48,6 +59,16 @@ public class Role extends BaseEntity ...@@ -48,6 +59,16 @@ public class Role extends BaseEntity
this.roleId = roleId; this.roleId = roleId;
} }
public String getDataScope()
{
return dataScope;
}
public void setDataScope(String dataScope)
{
this.dataScope = dataScope;
}
public String getRoleName() public String getRoleName()
{ {
return roleName; return roleName;
...@@ -83,6 +104,16 @@ public class Role extends BaseEntity ...@@ -83,6 +104,16 @@ public class Role extends BaseEntity
return status; return status;
} }
public String getDelFlag()
{
return delFlag;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public void setStatus(String status) public void setStatus(String status)
{ {
this.status = status; this.status = status;
...@@ -108,11 +139,22 @@ public class Role extends BaseEntity ...@@ -108,11 +139,22 @@ public class Role extends BaseEntity
this.menuIds = menuIds; this.menuIds = menuIds;
} }
public Long[] getDeptIds()
{
return deptIds;
}
public void setDeptIds(Long[] deptIds)
{
this.deptIds = deptIds;
}
@Override @Override
public String toString() public String toString()
{ {
return "Role [roleId=" + roleId + ", roleName=" + roleName + ", roleKey=" + roleKey + ", roleSort=" + roleSort return "Role [roleId=" + roleId + ", roleName=" + roleName + ", roleKey=" + roleKey + ", roleSort=" + roleSort
+ ", status=" + status + ", flag=" + flag + ", menuIds=" + Arrays.toString(menuIds) + "]"; + ", dataScope=" + dataScope + ", status=" + status + ", flag=" + flag + ", menuIds="
+ Arrays.toString(menuIds) + ", deptIds=" + Arrays.toString(deptIds) + "]";
} }
} }
package com.ruoyi.project.system.role.domain;
/**
* 角色和部门关联 sys_role_dept
*
* @author ruoyi
*/
public class RoleDept
{
/** 角色ID */
private Long roleId;
/** 部门ID */
private Long deptId;
public Long getRoleId()
{
return roleId;
}
public void setRoleId(Long roleId)
{
this.roleId = roleId;
}
public Long getDeptId()
{
return deptId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
@Override
public String toString()
{
return "RoleDept [roleId=" + roleId + ", deptId=" + deptId + "]";
}
}
package com.ruoyi.project.system.role.mapper;
import java.util.List;
import com.ruoyi.project.system.role.domain.RoleDept;
/**
* 角色与部门关联表 数据层
*
* @author ruoyi
*/
public interface RoleDeptMapper
{
/**
* 通过角色ID删除角色和部门关联
*
* @param roleId 角色ID
* @return 结果
*/
public int deleteRoleDeptByRoleId(Long roleId);
/**
* 批量删除角色部门关联信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteRoleDept(Long[] ids);
/**
* 查询部门使用数量
*
* @param deptId 部门ID
* @return 结果
*/
public int selectCountRoleDeptByDeptId(Long deptId);
/**
* 批量新增角色部门信息
*
* @param roleDeptList 角色部门列表
* @return 结果
*/
public int batchRoleDept(List<RoleDept> roleDeptList);
}
...@@ -28,13 +28,6 @@ public interface RoleMapper ...@@ -28,13 +28,6 @@ public interface RoleMapper
public List<Role> selectRolesByUserId(Long userId); public List<Role> selectRolesByUserId(Long userId);
/** /**
* 查询角色列表
*
* @return 角色列表
*/
public List<Role> selectRolesAll();
/**
* 通过角色ID查询角色 * 通过角色ID查询角色
* *
* @param roleId 角色ID * @param roleId 角色ID
......
...@@ -83,6 +83,14 @@ public interface IRoleService ...@@ -83,6 +83,14 @@ public interface IRoleService
* @return 结果 * @return 结果
*/ */
public int updateRole(Role role); public int updateRole(Role role);
/**
* 修改数据权限信息
*
* @param role 角色信息
* @return 结果
*/
public int updateRule(Role role);
/** /**
* 校验角色名称是否唯一 * 校验角色名称是否唯一
......
...@@ -11,8 +11,11 @@ import com.ruoyi.common.constant.UserConstants; ...@@ -11,8 +11,11 @@ import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.support.Convert; import com.ruoyi.common.support.Convert;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.framework.datascope.DataScopeUtils;
import com.ruoyi.project.system.role.domain.Role; import com.ruoyi.project.system.role.domain.Role;
import com.ruoyi.project.system.role.domain.RoleDept;
import com.ruoyi.project.system.role.domain.RoleMenu; import com.ruoyi.project.system.role.domain.RoleMenu;
import com.ruoyi.project.system.role.mapper.RoleDeptMapper;
import com.ruoyi.project.system.role.mapper.RoleMapper; import com.ruoyi.project.system.role.mapper.RoleMapper;
import com.ruoyi.project.system.role.mapper.RoleMenuMapper; import com.ruoyi.project.system.role.mapper.RoleMenuMapper;
import com.ruoyi.project.system.user.mapper.UserRoleMapper; import com.ruoyi.project.system.user.mapper.UserRoleMapper;
...@@ -35,6 +38,9 @@ public class RoleServiceImpl implements IRoleService ...@@ -35,6 +38,9 @@ public class RoleServiceImpl implements IRoleService
@Autowired @Autowired
private UserRoleMapper userRoleMapper; private UserRoleMapper userRoleMapper;
@Autowired
private RoleDeptMapper roleDeptMapper;
/** /**
* 根据条件分页查询角色数据 * 根据条件分页查询角色数据
* *
...@@ -44,6 +50,7 @@ public class RoleServiceImpl implements IRoleService ...@@ -44,6 +50,7 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public List<Role> selectRoleList(Role role) public List<Role> selectRoleList(Role role)
{ {
role.getParams().put("dataScope", DataScopeUtils.dataScopeFilter());
return roleMapper.selectRoleList(role); return roleMapper.selectRoleList(role);
} }
...@@ -78,7 +85,7 @@ public class RoleServiceImpl implements IRoleService ...@@ -78,7 +85,7 @@ public class RoleServiceImpl implements IRoleService
public List<Role> selectRolesByUserId(Long userId) public List<Role> selectRolesByUserId(Long userId)
{ {
List<Role> userRoles = roleMapper.selectRolesByUserId(userId); List<Role> userRoles = roleMapper.selectRolesByUserId(userId);
List<Role> roles = roleMapper.selectRolesAll(); List<Role> roles = selectRoleAll();
for (Role role : roles) for (Role role : roles)
{ {
for (Role userRole : userRoles) for (Role userRole : userRoles)
...@@ -101,7 +108,7 @@ public class RoleServiceImpl implements IRoleService ...@@ -101,7 +108,7 @@ public class RoleServiceImpl implements IRoleService
@Override @Override
public List<Role> selectRoleAll() public List<Role> selectRoleAll()
{ {
return roleMapper.selectRolesAll(); return selectRoleList(new Role());
} }
/** /**
...@@ -177,13 +184,31 @@ public class RoleServiceImpl implements IRoleService ...@@ -177,13 +184,31 @@ public class RoleServiceImpl implements IRoleService
role.setUpdateBy(ShiroUtils.getLoginName()); role.setUpdateBy(ShiroUtils.getLoginName());
// 修改角色信息 // 修改角色信息
roleMapper.updateRole(role); roleMapper.updateRole(role);
ShiroUtils.clearCachedAuthorizationInfo();
// 删除角色与菜单关联 // 删除角色与菜单关联
roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
ShiroUtils.clearCachedAuthorizationInfo();
return insertRoleMenu(role); return insertRoleMenu(role);
} }
/** /**
* 修改数据权限信息
*
* @param role 角色信息
* @return 结果
*/
@Override
public int updateRule(Role role)
{
role.setUpdateBy(ShiroUtils.getLoginName());
// 修改角色信息
roleMapper.updateRole(role);
// 删除角色与部门关联
roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
// 新增角色和部门信息(数据权限)
return insertRoleDept(role);
}
/**
* 新增角色菜单信息 * 新增角色菜单信息
* *
* @param role 角色对象 * @param role 角色对象
...@@ -208,6 +233,30 @@ public class RoleServiceImpl implements IRoleService ...@@ -208,6 +233,30 @@ public class RoleServiceImpl implements IRoleService
} }
/** /**
* 新增角色部门信息(数据权限)
*
* @param role 角色对象
*/
public int insertRoleDept(Role role)
{
int rows = 1;
// 新增角色与部门(数据权限)管理
List<RoleDept> list = new ArrayList<RoleDept>();
for (Long deptId : role.getDeptIds())
{
RoleDept rd = new RoleDept();
rd.setRoleId(role.getRoleId());
rd.setDeptId(deptId);
list.add(rd);
}
if (list.size() > 0)
{
rows = roleDeptMapper.batchRoleDept(list);
}
return rows;
}
/**
* 校验角色名称是否唯一 * 校验角色名称是否唯一
* *
* @param role 角色信息 * @param role 角色信息
...@@ -224,7 +273,7 @@ public class RoleServiceImpl implements IRoleService ...@@ -224,7 +273,7 @@ public class RoleServiceImpl implements IRoleService
} }
return UserConstants.ROLE_NAME_UNIQUE; return UserConstants.ROLE_NAME_UNIQUE;
} }
/** /**
* 校验角色权限是否唯一 * 校验角色权限是否唯一
* *
......
...@@ -32,7 +32,7 @@ public class IndexController extends BaseController ...@@ -32,7 +32,7 @@ public class IndexController extends BaseController
// 取身份信息 // 取身份信息
User user = getUser(); User user = getUser();
// 根据用户id取出菜单 // 根据用户id取出菜单
List<Menu> menus = menuService.selectMenusByUserId(user.getUserId()); List<Menu> menus = menuService.selectMenusByUser(user);
mmap.put("menus", menus); mmap.put("menus", menus);
mmap.put("user", user); mmap.put("user", user);
mmap.put("copyrightYear", ruoYiConfig.getCopyrightYear()); mmap.put("copyrightYear", ruoYiConfig.getCopyrightYear());
......
...@@ -2,10 +2,12 @@ package com.ruoyi.project.system.user.domain; ...@@ -2,10 +2,12 @@ package com.ruoyi.project.system.user.domain;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List;
import org.apache.shiro.crypto.SecureRandomNumberGenerator; import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity; import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.project.system.dept.domain.Dept; import com.ruoyi.project.system.dept.domain.Dept;
import com.ruoyi.project.system.role.domain.Role;
/** /**
* 用户对象 sys_user * 用户对象 sys_user
...@@ -73,6 +75,9 @@ public class User extends BaseEntity ...@@ -73,6 +75,9 @@ public class User extends BaseEntity
/** 部门对象 */ /** 部门对象 */
private Dept dept; private Dept dept;
/** 角色集合 */
private List<Role> roles;
/** 角色组 */ /** 角色组 */
private Long[] roleIds; private Long[] roleIds;
...@@ -260,6 +265,16 @@ public class User extends BaseEntity ...@@ -260,6 +265,16 @@ public class User extends BaseEntity
this.dept = dept; this.dept = dept;
} }
public List<Role> getRoles()
{
return roles;
}
public void setRoles(List<Role> roles)
{
this.roles = roles;
}
public Long[] getRoleIds() public Long[] getRoleIds()
{ {
return roleIds; return roleIds;
...@@ -287,7 +302,8 @@ public class User extends BaseEntity ...@@ -287,7 +302,8 @@ public class User extends BaseEntity
+ ", userName=" + userName + ", email=" + email + ", phonenumber=" + phonenumber + ", sex=" + sex + ", userName=" + userName + ", email=" + email + ", phonenumber=" + phonenumber + ", sex=" + sex
+ ", avatar=" + avatar + ", password=" + password + ", salt=" + salt + ", status=" + status + ", avatar=" + avatar + ", password=" + password + ", salt=" + salt + ", status=" + status
+ ", delFlag=" + delFlag + ", loginIp=" + loginIp + ", loginDate=" + loginDate + ", dept=" + dept + ", delFlag=" + delFlag + ", loginIp=" + loginIp + ", loginDate=" + loginDate + ", dept=" + dept
+ ", roleIds=" + Arrays.toString(roleIds) + ", postIds=" + Arrays.toString(postIds) + "]"; + ", roles=" + roles + ", roleIds=" + Arrays.toString(roleIds) + ", postIds=" + Arrays.toString(postIds)
+ "]";
} }
} }
...@@ -8,6 +8,7 @@ import com.ruoyi.common.constant.UserConstants; ...@@ -8,6 +8,7 @@ import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.support.Convert; import com.ruoyi.common.support.Convert;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.framework.datascope.DataScopeUtils;
import com.ruoyi.framework.shiro.service.PasswordService; import com.ruoyi.framework.shiro.service.PasswordService;
import com.ruoyi.project.system.post.domain.Post; import com.ruoyi.project.system.post.domain.Post;
import com.ruoyi.project.system.post.mapper.PostMapper; import com.ruoyi.project.system.post.mapper.PostMapper;
...@@ -56,6 +57,8 @@ public class UserServiceImpl implements IUserService ...@@ -56,6 +57,8 @@ public class UserServiceImpl implements IUserService
@Override @Override
public List<User> selectUserList(User user) public List<User> selectUserList(User user)
{ {
// 生成数据权限过滤条件
user.getParams().put("dataScope", DataScopeUtils.dataScopeFilter());
return userMapper.selectUserList(user); return userMapper.selectUserList(user);
} }
......
...@@ -3,7 +3,7 @@ ruoyi: ...@@ -3,7 +3,7 @@ ruoyi:
#名称 #名称
name: RuoYi name: RuoYi
#版本 #版本
version: 2.3.0 version: 2.4.0
#版权年份 #版权年份
copyrightYear: 2018 copyrightYear: 2018
#头像上传路径 #头像上传路径
......
...@@ -5,6 +5,7 @@ user.not.exists=用户不存在/密码错误 ...@@ -5,6 +5,7 @@ user.not.exists=用户不存在/密码错误
user.password.not.match=用户不存在/密码错误 user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次,{1} user.password.retry.limit.count=密码输入错误{0}次,{1}
user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟 user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
user.password.delete=对不起,您的账号已被删除
user.blocked=用户已封禁,原因:{0} user.blocked=用户已封禁,原因:{0}
role.blocked=角色已封禁,原因:{0} role.blocked=角色已封禁,原因:{0}
user.logout.success=退出成功 user.logout.success=退出成功
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<property name="log.path" value="/home/logs/ruoyi" /> <property name="log.path" value="/home/ruoyi/logs" />
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 --> <!-- 控制台输出 -->
......
...@@ -17,7 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -17,7 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectJobLogVo"> <sql id="selectJobLogVo">
select job_log_id, job_name, job_group, method_name, method_params, job_message, status, exception_info, create_time from sys_job_log select job_log_id, job_name, job_group, method_name, method_params, job_message, status, exception_info, create_time
from sys_job_log
</sql> </sql>
<select id="selectJobLogList" parameterType="JobLog" resultMap="JobLogResult"> <select id="selectJobLogList" parameterType="JobLog" resultMap="JobLogResult">
......
...@@ -21,7 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -21,7 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectJobVo"> <sql id="selectJobVo">
select job_id, job_name, job_group, method_name, method_params, cron_expression, misfire_policy, status, create_by, create_time, remark from sys_job select job_id, job_name, job_group, method_name, method_params, cron_expression, misfire_policy, status, create_by, create_time, remark
from sys_job
</sql> </sql>
<select id="selectJobList" parameterType="Job" resultMap="JobResult"> <select id="selectJobList" parameterType="Job" resultMap="JobResult">
......
...@@ -27,8 +27,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -27,8 +27,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectOnlineVo"> <sql id="selectOnlineVo">
select sessionId,login_name,dept_name,ipaddr,login_location,browser,os,status,status,start_timestamp,last_access_time,expire_time select sessionId, login_name, dept_name, ipaddr, login_location, browser, os, status, status, start_timestamp, last_access_time, expire_time
from sys_user_online from sys_user_online
</sql> </sql>
<select id="selectOnlineById" parameterType="String" resultMap="UserOnlineResult"> <select id="selectOnlineById" parameterType="String" resultMap="UserOnlineResult">
......
...@@ -22,10 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -22,10 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectOperLogVo"> <sql id="selectOperLogVo">
select select oper_id, title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time
oper_id, title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time from sys_oper_log
from
sys_oper_log
</sql> </sql>
<insert id="insertOperlog" parameterType="OperLog"> <insert id="insertOperlog" parameterType="OperLog">
......
...@@ -17,7 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -17,7 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectConfigVo"> <sql id="selectConfigVo">
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark from sys_config select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
from sys_config
</sql> </sql>
<!-- 查询条件 --> <!-- 查询条件 -->
......
...@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="phone" column="phone" /> <result property="phone" column="phone" />
<result property="email" column="email" /> <result property="email" column="email" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="parentName" column="parent_name" /> <result property="parentName" column="parent_name" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
...@@ -22,26 +23,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -22,26 +23,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDeptVo"> <sql id="selectDeptVo">
select t.dept_id, t.parent_id, t.ancestors, t.dept_name, t.order_num, t.leader, t.phone, t.email, t.status, t.create_by, t.create_time from sys_dept t select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d
</sql> </sql>
<select id="selectDeptAll" resultMap="DeptResult"> <select id="selectRoleDeptTree" parameterType="Long" resultType="String">
<include refid="selectDeptVo"/> select concat(d.dept_id, d.dept_name) as dept_name
from sys_dept d
left join sys_role_dept rd on d.dept_id = rd.dept_id
where d.del_flag = '0' and rd.role_id = #{roleId}
order by d.parent_id, d.order_num
</select> </select>
<select id="selectDeptList" parameterType="Dept" resultMap="DeptResult"> <select id="selectDeptList" parameterType="Dept" resultMap="DeptResult">
<include refid="selectDeptVo"/> <include refid="selectDeptVo"/>
<where> where d.del_flag = '0'
<if test="parentId != null and parentId != 0"> <if test="parentId != null and parentId != 0">
AND parent_id = #{parentId} AND parent_id = #{parentId}
</if> </if>
<if test="deptName != null and deptName != ''"> <if test="deptName != null and deptName != ''">
AND dept_name like concat('%', #{deptName}, '%') AND dept_name like concat('%', #{deptName}, '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND status = #{status} AND status = #{status}
</if> </if>
</where> <!-- 数据范围过滤 -->
${params.dataScope}
</select> </select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int"> <select id="checkDeptExistUser" parameterType="Long" resultType="int">
...@@ -50,22 +57,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -50,22 +57,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDeptCount" parameterType="Dept" resultType="int"> <select id="selectDeptCount" parameterType="Dept" resultType="int">
select count(1) from sys_dept select count(1) from sys_dept
<where> where del_flag = '0'
<if test="deptId != null and deptId != 0"> and dept_id = #{deptId} </if> <if test="deptId != null and deptId != 0"> and dept_id = #{deptId} </if>
<if test="parentId != null and parentId != 0"> and parent_id = #{parentId} </if> <if test="parentId != null and parentId != 0"> and parent_id = #{parentId} </if>
</where>
</select> </select>
<select id="checkDeptNameUnique" parameterType="String" resultMap="DeptResult"> <select id="checkDeptNameUnique" resultMap="DeptResult">
<include refid="selectDeptVo"/> <include refid="selectDeptVo"/>
where dept_name=#{deptName} where dept_name=#{deptName} and parent_id = #{parentId}
</select> </select>
<select id="selectDeptById" parameterType="Long" resultMap="DeptResult"> <select id="selectDeptById" parameterType="Long" resultMap="DeptResult">
select t.dept_id, t.parent_id, t.ancestors, t.dept_name, t.order_num, t.leader, t.phone, t.email, t.status, select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
(select dept_name from sys_dept where dept_id = t.parent_id) parent_name (select dept_name from sys_dept where dept_id = d.parent_id) parent_name
from sys_dept t from sys_dept d
where dept_id = #{deptId} where d.dept_id = #{deptId}
</select> </select>
<insert id="insertDept" parameterType="Dept"> <insert id="insertDept" parameterType="Dept">
...@@ -127,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -127,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteDeptById" parameterType="Long"> <delete id="deleteDeptById" parameterType="Long">
delete from sys_dept where dept_id = #{deptId} update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -21,7 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -21,7 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDictDataVo"> <sql id="selectDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from sys_dict_data select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from sys_dict_data
</sql> </sql>
<select id="selectDictDataList" parameterType="DictData" resultMap="DictDataResult"> <select id="selectDictDataList" parameterType="DictData" resultMap="DictDataResult">
......
...@@ -16,7 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -16,7 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDictTypeVo"> <sql id="selectDictTypeVo">
select dict_id, dict_name, dict_type, status, create_by, create_time, remark from sys_dict_type select dict_id, dict_name, dict_type, status, create_by, create_time, remark
from sys_dict_type
</sql> </sql>
<select id="selectDictTypeList" parameterType="DictType" resultMap="DictTypeResult"> <select id="selectDictTypeList" parameterType="DictType" resultMap="DictTypeResult">
......
...@@ -23,10 +23,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,10 +23,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectMenuVo"> <sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time from sys_menu select menu_id, menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time
from sys_menu
</sql> </sql>
<select id="selectMenusByUserId" parameterType="Long" resultMap="MenuResult"> <select id="selectMenusByUserId" parameterType="Long" resultMap="MenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.url, m.perms , m.menu_type, m.icon, m.order_num, m.create_time select distinct m.menu_id, m.parent_id, m.menu_name, m.url, m.perms , m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_role_menu rm on m.menu_id = rm.menu_id
...@@ -35,6 +36,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -35,6 +36,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where ur.user_id = #{userId} and m.menu_type in ('M', 'C') and m.visible = 0 AND ro.status = 0 where ur.user_id = #{userId} and m.menu_type in ('M', 'C') and m.visible = 0 AND ro.status = 0
order by m.order_num order by m.order_num
</select> </select>
<select id="selectMenuNormalAll" resultMap="MenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.url, m.perms , m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
where m.menu_type in ('M', 'C') and m.visible = 0
order by m.order_num
</select>
<select id="selectMenuAll" resultMap="MenuResult">
<include refid="selectMenuVo"/>
</select>
<select id="selectPermsByUserId" parameterType="Long" resultType="String"> <select id="selectPermsByUserId" parameterType="Long" resultType="String">
select distinct m.perms select distinct m.perms
...@@ -64,10 +76,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -64,10 +76,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectMenuAll" resultMap="MenuResult">
<include refid="selectMenuVo"/>
</select>
<delete id="deleteMenuById" parameterType="Long"> <delete id="deleteMenuById" parameterType="Long">
delete from sys_menu where menu_id = #{menuId} or parent_id = #{menuId} delete from sys_menu where menu_id = #{menuId} or parent_id = #{menuId}
</delete> </delete>
...@@ -83,9 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -83,9 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) from sys_menu where parent_id=#{menuId} select count(1) from sys_menu where parent_id=#{menuId}
</select> </select>
<select id="checkMenuNameUnique" parameterType="String" resultMap="MenuResult"> <select id="checkMenuNameUnique" parameterType="Menu" resultMap="MenuResult">
<include refid="selectMenuVo"/> <include refid="selectMenuVo"/>
where menu_name=#{menuName} where menu_name=#{menuName} and parent_id = #{parentId}
</select> </select>
<update id="updateMenu" parameterType="Menu"> <update id="updateMenu" parameterType="Menu">
......
...@@ -18,7 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -18,7 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectNoticeVo"> <sql id="selectNoticeVo">
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark from sys_notice select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark
from sys_notice
</sql> </sql>
<select id="selectNoticeById" parameterType="Long" resultMap="NoticeResult"> <select id="selectNoticeById" parameterType="Long" resultMap="NoticeResult">
......
...@@ -18,7 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -18,7 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectPostVo"> <sql id="selectPostVo">
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark from sys_post select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
from sys_post
</sql> </sql>
<select id="selectPostList" parameterType="Post" resultMap="PostResult"> <select id="selectPostList" parameterType="Post" resultMap="PostResult">
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.role.mapper.RoleDeptMapper">
<resultMap type="RoleDept" id="RoleDeptResult">
<result property="roleId" column="role_id" />
<result property="detpId" column="dept_id" />
</resultMap>
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
delete from sys_role_dept where role_id=#{roleId}
</delete>
<select id="selectCountRoleDeptByDeptId" resultType="Integer">
select count(1) from sys_role_dept where dept_id=#{detpId}
</select>
<delete id="deleteRoleDept" parameterType="Long">
delete from sys_role_dept where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<insert id="batchRoleDept">
insert into sys_role_dept(role_id, dept_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.deptId})
</foreach>
</insert>
</mapper>
\ No newline at end of file
...@@ -9,7 +9,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -9,7 +9,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="roleName" column="role_name" /> <result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" /> <result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" /> <result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
...@@ -17,56 +19,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -17,56 +19,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" /> <result property="remark" column="remark" />
</resultMap> </resultMap>
<sql id="selectRoleVo"> <sql id="selectRoleContactVo">
select role_id, role_name, role_key, role_sort, status, create_time, remark from sys_role select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope,
r.status, r.del_flag, r.create_time, r.remark
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
left join sys_dept d on u.dept_id = d.dept_id
</sql> </sql>
<sql id="selectRoleVo">
select r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status, r.del_flag, r.create_time, r.remark
from sys_role r
</sql>
<select id="selectRoleList" parameterType="Role" resultMap="RoleResult"> <select id="selectRoleList" parameterType="Role" resultMap="RoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleContactVo"/>
<where> where r.del_flag = '0'
<if test="roleName != null and roleName != ''"> <if test="roleName != null and roleName != ''">
AND role_name like concat('%', #{roleName}, '%') AND r.role_name like concat('%', #{roleName}, '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND status = #{status} AND r.status = #{status}
</if> </if>
<if test="roleKey != null and roleKey != ''"> <if test="roleKey != null and roleKey != ''">
AND role_key like concat('%', #{roleKey}, '%') AND r.role_key like concat('%', #{roleKey}, '%')
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="dataScope != null and dataScope != ''">
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d') AND r.data_scope = #{dataScope}
</if> </if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d') and date_format(r.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if> </if>
</where> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select> </select>
<select id="selectRolesByUserId" parameterType="Long" resultMap="RoleResult"> <select id="selectRolesByUserId" parameterType="Long" resultMap="RoleResult">
SELECT r.role_id, r.role_name, r.role_key <include refid="selectRoleContactVo"/>
FROM sys_user u WHERE r.del_flag = '0' and ur.user_id = #{userId}
LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id
LEFT JOIN sys_role r ON ur.role_id = r.role_id
WHERE ur.user_id = #{userId}
</select>
<select id="selectRolesAll" resultMap="RoleResult">
<include refid="selectRoleVo"/>
</select> </select>
<select id="selectRoleById" parameterType="Long" resultMap="RoleResult"> <select id="selectRoleById" parameterType="Long" resultMap="RoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where role_id = #{roleId} where r.del_flag = '0' and r.role_id = #{roleId}
</select> </select>
<select id="checkRoleNameUnique" parameterType="String" resultMap="RoleResult"> <select id="checkRoleNameUnique" parameterType="String" resultMap="RoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where role_name=#{roleName} where r.role_name=#{roleName}
</select> </select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="RoleResult"> <select id="checkRoleKeyUnique" parameterType="String" resultMap="RoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where role_key=#{roleKey} where r.role_key=#{roleKey}
</select> </select>
<delete id="deleteRoleById" parameterType="Long"> <delete id="deleteRoleById" parameterType="Long">
...@@ -74,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -74,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteRoleByIds" parameterType="Long"> <delete id="deleteRoleByIds" parameterType="Long">
delete from sys_role where role_id in update sys_role set del_flag = '2' where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")"> <foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId} #{roleId}
</foreach> </foreach>
...@@ -86,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -86,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if> <if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if> <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
<if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if> <if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if> <if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
...@@ -100,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -100,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roleName != null and roleName != ''">role_name,</if> <if test="roleName != null and roleName != ''">role_name,</if>
<if test="roleKey != null and roleKey != ''">role_key,</if> <if test="roleKey != null and roleKey != ''">role_key,</if>
<if test="roleSort != null and roleSort != ''">role_sort,</if> <if test="roleSort != null and roleSort != ''">role_sort,</if>
<if test="dataScope != null and dataScope != ''">data_scope,</if>
<if test="status != null and status != ''">status,</if> <if test="status != null and status != ''">status,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
...@@ -109,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -109,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roleName != null and roleName != ''">#{roleName},</if> <if test="roleName != null and roleName != ''">#{roleName},</if>
<if test="roleKey != null and roleKey != ''">#{roleKey},</if> <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
<if test="roleSort != null and roleSort != ''">#{roleSort},</if> <if test="roleSort != null and roleSort != ''">#{roleSort},</if>
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
......
...@@ -24,7 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -24,7 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<association property="dept" column="dept_id" javaType="Dept" resultMap="deptResult"/> <association property="dept" column="dept_id" javaType="Dept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap> </resultMap>
<resultMap id="deptResult" type="Dept"> <resultMap id="deptResult" type="Dept">
...@@ -35,12 +36,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -35,12 +36,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="status" column="dept_status" /> <result property="status" column="dept_status" />
</resultMap> </resultMap>
<resultMap id="RoleResult" type="Role">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="role_status" />
</resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.login_name, u.user_name, u.email, u.phonenumber, u.sex, u.avatar, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_time, u.remark, select u.user_id, u.dept_id, u.login_name, u.user_name, u.email, u.phonenumber, u.sex, u.avatar, u.password, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_time, u.remark,
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.status as dept_status d.dept_id, d.parent_id, d.dept_name, d.order_num, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
</sql> </sql>
<select id="selectUserList" parameterType="User" resultMap="UserResult"> <select id="selectUserList" parameterType="User" resultMap="UserResult">
...@@ -65,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -65,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null and deptId != 0"> <if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) )) AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) ))
</if> </if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select> </select>
<select id="selectUserByLoginName" parameterType="String" resultMap="UserResult"> <select id="selectUserByLoginName" parameterType="String" resultMap="UserResult">
......
/*! layer弹层组件拓展类 */
;!function(){layer.use("skin/layer.ext.css",function(){layer.layui_layer_extendlayerextjs=!0});var a=layer.cache||{},b=function(b){return a.skin?" "+a.skin+" "+a.skin+"-"+b:""};layer.prompt=function(a,c){a=a||{},"function"==typeof a&&(c=a);var d,e=2==a.formType?'<textarea class="layui-layer-input">'+(a.value||"")+"</textarea>":function(){return'<input type="'+(1==a.formType?"password":"text")+'" class="layui-layer-input" value="'+(a.value||"")+'">'}();return layer.open($.extend({btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:e,skin:"layui-layer-prompt"+b("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(b){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?layer.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(a.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",d,{tips:1}):c&&c(e,b,d)}},a))},layer.tab=function(a){a=a||{};var c=a.tab||{};return layer.open($.extend({type:1,skin:"layui-layer-tab"+b("tab"),title:function(){var a=c.length,b=1,d="";if(a>0)for(d='<span class="layui-layer-tabnow">'+c[0].title+"</span>";a>b;b++)d+="<span>"+c[b].title+"</span>";return d}(),content:'<ul class="layui-layer-tabmain">'+function(){var a=c.length,b=1,d="";if(a>0)for(d='<li class="layui-layer-tabli xubox_tab_layer">'+(c[0].content||"no content")+"</li>";a>b;b++)d+='<li class="layui-layer-tabli">'+(c[b].content||"no content")+"</li>";return d}()+"</ul>",success:function(a){var b=a.find(".layui-layer-title").children(),c=a.find(".layui-layer-tabmain").children();b.on("mousedown",function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;var b=$(this),d=b.index();b.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),c.eq(d).show().siblings().hide()})}},a))},layer.photos=function(a,c,d){function e(a,b,c){var d=new Image;d.onload=function(){d.onload=null,b(d)},d.onerror=function(a){d.onerror=null,c(a)},d.src=a}var f={};if(a=a||{},a.photos){var g=a.photos.constructor===Object,h=g?a.photos:{},i=h.data||[],j=h.start||0;if(f.imgIndex=j+1,g){if(0===i.length)return void layer.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var k=$(a.photos),l=k.find(a.img||"img");if(0===l.length)return;if(c||k.find(h.img||"img").each(function(b){var c=$(this);i.push({alt:c.attr("alt"),pid:c.attr("layer-pid"),src:c.attr("layer-src")||c.attr("src"),thumb:c.attr("src")}),c.on("click",function(){layer.photos($.extend(a,{photos:{start:b,data:i,tab:a.tab},full:a.full}),!0)})}),!c)return}f.imgprev=function(a){f.imgIndex--,f.imgIndex<1&&(f.imgIndex=i.length),f.tabimg(a)},f.imgnext=function(a,b){f.imgIndex++,f.imgIndex>i.length&&(f.imgIndex=1,b)||f.tabimg(a)},f.keyup=function(a){if(!f.end){var b=a.keyCode;a.preventDefault(),37===b?f.imgprev(!0):39===b?f.imgnext(!0):27===b&&layer.close(f.index)}},f.tabimg=function(b){i.length<=1||(h.start=f.imgIndex-1,layer.close(f.index),layer.photos(a,!0,b))},f.event=function(){f.bigimg.hover(function(){f.imgsee.show()},function(){f.imgsee.hide()}),f.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),f.imgprev()}),f.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),f.imgnext()}),$(document).on("keyup",f.keyup)},f.loadi=layer.load(1,{shade:"shade"in a?!1:.9,scrollbar:!1}),e(i[j].src,function(c){layer.close(f.loadi),f.index=layer.open($.extend({type:1,area:function(){var b=[c.width,c.height],d=[$(window).width()-100,$(window).height()-100];return!a.full&&b[0]>d[0]&&(b[0]=d[0],b[1]=b[0]*d[1]/b[0]),[b[0]+"px",b[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+b("photos"),content:'<div class="layui-layer-phimg"><img src="'+i[j].src+'" alt="'+(i[j].alt||"")+'" layer-pid="'+i[j].pid+'"><div class="layui-layer-imgsee">'+(i.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(d?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(i[j].alt||"")+"</a><em>"+f.imgIndex+"/"+i.length+"</em></span></div></div></div>",success:function(b,c){f.bigimg=b.find(".layui-layer-phimg"),f.imgsee=b.find(".layui-layer-imguide,.layui-layer-imgbar"),f.event(b),a.tab&&a.tab(i[j],b)},end:function(){f.end=!0,$(document).off("keyup",f.keyup)}},a))},function(){layer.close(f.loadi),layer.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["下一张","不看了"],yes:function(){i.length>1&&f.imgnext(!0,!0)}})})}}}();
/**
@Name: laydate 核心样式
@Author:贤心
@Site:http://sentsin.com/layui/laydate
**/
html{_background-image:url(about:blank); _background-attachment:fixed;}
.layer-date{display: inline-block!important;vertical-align:text-top;max-width:240px;}
.laydate_body .laydate_box, .laydate_body .laydate_box *{margin:0; padding:0;}
.laydate-icon,
.laydate-icon-default,
.laydate-icon-danlan,
.laydate-icon-dahong,
.laydate-icon-molv{height:34px; padding-right:20px;min-width:34px;vertical-align: text-top;border:1px solid #C6C6C6; background-repeat:no-repeat; background-position:right center; background-color:#fff; outline:0;}
.laydate-icon-default{ background-image:url(../skins/default/icon.png)}
.laydate-icon-danlan{border:1px solid #B1D2EC; background-image:url(../skins/danlan/icon.png)}
.laydate-icon-dahong{background-image:url(../skins/dahong/icon.png)}
.laydate-icon-molv{background-image:url(../skins/molv/icon.png)}
.laydate_body .laydate_box{width:240px; font:12px '\5B8B\4F53'; z-index:99999999; *margin:-2px 0 0 -2px; *overflow:hidden; _margin:0; _position:absolute!important; background-color:#fff;}
.laydate_body .laydate_box li{list-style:none;}
.laydate_body .laydate_box .laydate_void{cursor:text!important;}
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{text-decoration:none; blr:expression(this.onFocus=this.blur()); cursor:pointer;}
.laydate_body .laydate_box a:hover{text-decoration:none;}
.laydate_body .laydate_box cite, .laydate_body .laydate_box label{position:absolute; width:0; height:0; border-width:5px; border-style:dashed; border-color:transparent; overflow:hidden; cursor:pointer;}
.laydate_body .laydate_box .laydate_yms, .laydate_body .laydate_box .laydate_time{display:none;}
.laydate_body .laydate_box .laydate_show{display:block;}
.laydate_body .laydate_box input{outline:0; font-size:14px; background-color:#fff;}
.laydate_body .laydate_top{position:relative; height:26px; padding:5px; *width:100%; z-index:99;}
.laydate_body .laydate_ym{position:relative; float:left; height:24px; cursor:pointer;}
.laydate_body .laydate_ym input{float:left; height:24px; line-height:24px; text-align:center; border:none; cursor:pointer;}
.laydate_body .laydate_ym .laydate_yms{position:absolute; left: -1px; top: 24px; height:181px;}
.laydate_body .laydate_y{width:121px;}
.laydate_body .laydate_y input{width:64px; margin-right:15px;}
.laydate_body .laydate_y .laydate_yms{width:121px; text-align:center;}
.laydate_body .laydate_y .laydate_yms a{position:relative; display:block; height:20px;}
.laydate_body .laydate_y .laydate_yms ul{height:139px; padding:0; *overflow:hidden;}
.laydate_body .laydate_y .laydate_yms ul li{float:left; width:60px; height:20px; line-height: 20px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
.laydate_box *{box-sizing:content-box!important;}
.laydate_body .laydate_m{width:99px;float: right;margin-right:-2px;}
.laydate_body .laydate_m .laydate_yms{width:99px; padding:0;}
.laydate_body .laydate_m input{width:42px; margin-right:15px;}
.laydate_body .laydate_m .laydate_yms span{display:block; float:left; width:42px; margin: 5px 0 0 5px; line-height:24px; text-align:center; _display:inline;}
.laydate_body .laydate_choose{display:block; float:left; position:relative; width:20px; height:24px;}
.laydate_body .laydate_choose cite, .laydate_body .laydate_tab cite{left:50%; top:50%;}
.laydate_body .laydate_chtop cite{margin:-7px 0 0 -5px; border-bottom-style:solid;}
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{top:50%; margin:-2px 0 0 -5px; border-top-style:solid;}
.laydate_body .laydate_chprev cite{margin:-5px 0 0 -7px;}
.laydate_body .laydate_chnext cite{margin:-5px 0 0 -2px;}
.laydate_body .laydate_ym label{right:28px;}
.laydate_body .laydate_table{ width:230px; margin:0 5px; border-collapse:collapse; border-spacing:0px; }
.laydate_body .laydate_table td{width:31px; height:19px; line-height:19px; text-align: center; cursor:pointer; font-size: 12px;}
.laydate_body .laydate_table thead{height:22px; line-height:22px;}
.laydate_body .laydate_table thead th{font-weight:400; font-size:12px; text-align:center;}
.laydate_body .laydate_bottom{position:relative; height:22px; line-height:20px; padding:5px; font-size:12px;}
.laydate_body .laydate_bottom #laydate_hms{position: relative; z-index: 1; float:left; }
.laydate_body .laydate_time{ position:absolute; left:5px; bottom: 26px; width:129px; height:125px; *overflow:hidden;}
.laydate_body .laydate_time .laydate_hmsno{ padding:5px 0 0 5px;}
.laydate_body .laydate_time .laydate_hmsno span{display:block; float:left; width:24px; height:19px; line-height:19px; text-align:center; cursor:pointer; *margin-bottom:-5px;}
.laydate_body .laydate_time1{width:228px; height:154px;}
.laydate_body .laydate_time1 .laydate_hmsno{padding: 6px 0 0 8px;}
.laydate_body .laydate_time1 .laydate_hmsno span{width:21px; height:20px; line-height:20px;}
.laydate_body .laydate_msg{left:49px; bottom:67px; width:141px; height:auto; overflow: hidden;}
.laydate_body .laydate_msg p{padding:5px 10px;}
.laydate_body .laydate_bottom li{float:left; height:20px; line-height:20px; border-right:none; font-weight:900;}
.laydate_body .laydate_bottom .laydate_sj{width:33px; text-align:center; font-weight:400;}
.laydate_body .laydate_bottom input{float:left; width:21px; height:20px; line-height:20px; border:none; text-align:center; cursor:pointer; font-size:12px; font-weight:400;}
.laydate_body .laydate_bottom .laydte_hsmtex{height:20px; line-height:20px; text-align:center;}
.laydate_body .laydate_bottom .laydte_hsmtex span{position:absolute; width:20px; top:0; right:0px; cursor:pointer;}
.laydate_body .laydate_bottom .laydte_hsmtex span:hover{font-size:14px;}
.laydate_body .laydate_bottom .laydate_btn{position:absolute; right:5px; top:5px;}
.laydate_body .laydate_bottom .laydate_btn a{float:left; height:20px; padding:0 6px; _padding:0 5px;}
.laydate_body .laydate_bottom .laydate_v{position:absolute; left:10px; top:6px; font-family:Courier; z-index:0;}
/**
@Name: laydate皮肤:墨绿
@Author:贤心
@Site:http://sentsin.com/layui/laydate
**/
.laydate-icon{border:1px solid #ccc; background-image:url(icon.png)}
.laydate_body .laydate_bottom #laydate_hms,
.laydate_body .laydate_time{border:1px solid #ccc;}
.laydate_body .laydate_box,
.laydate_body .laydate_ym .laydate_yms,
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#00625A;}
.laydate_body .laydate_box input{background:none!important; color:#fff;}
.laydate_body .laydate_box .laydate_void{color:#00E8D7!important;}
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#00625A;}
.laydate_body .laydate_box a:hover{color:#666;}
.laydate_body .laydate_click{background-color:#009F95!important; color:#fff!important;}
.laydate_body .laydate_top{border-top:1px solid #009F95; background-color:#009F95}
.laydate_body .laydate_ym{border:1px solid #009F95; background-color:#009F95;}
.laydate_body .laydate_ym .laydate_yms{border:1px solid #009F95; background-color:#009F95; color:#fff;}
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #009F95;}
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #009F95; border-bottom:none;}
.laydate_body .laydate_choose{border-left:1px solid #009F95;}
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #009F95;}
.laydate_body .laydate_choose:hover,
.laydate_body .laydate_y .laydate_yms a:hover{background-color:#00C1B3;}
.laydate_body .laydate_chtop cite{border-bottom-color:#fff;}
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#fff;}
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#fff;}
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#fff;}
.laydate_body .laydate_table{width: 240px!important; margin: 0!important; border:1px solid #ccc; border-top:none; border-bottom:none;}
.laydate_body .laydate_table td{border:none; height:21px!important; line-height:21px!important; background-color:#fff; color:#00625A;}
.laydate_body .laydate_table .laydate_nothis{color:#999;}
.laydate_body .laydate_table thead{border-bottom:1px solid #ccc; height:21px!important; line-height:21px!important;}
.laydate_body .laydate_table thead th{}
.laydate_body .laydate_bottom{border:1px solid #ccc; border-top:none;}
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
.laydate_body .laydate_time{background-color:#fff;}
.laydate_body .laydate_time1{width: 226px!important; height: 152px!important;}
.laydate_body .laydate_bottom .laydate_sj{width:31px!important; border-right:1px solid #ccc; background-color:#fff;}
.laydate_body .laydate_bottom input{background-color:#fff; color:#00625A;}
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #ccc;}
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #ccc;}
.laydate_body .laydate_bottom .laydate_v{color:#999}
.laydate_body .laydate_bottom .laydate_btn a{border: 1px solid #ccc; border-right:none; background-color:#fff;}
.laydate_body .laydate_bottom .laydate_btn a:hover{background-color:#F6F6F6; color:#00625A;}
.laydate_body .laydate_m .laydate_yms span:hover,
.laydate_body .laydate_time .laydate_hmsno span:hover,
.laydate_body .laydate_y .laydate_yms ul li:hover,
.laydate_body .laydate_table td:hover{background-color:#00C1B3; color:#fff;}
/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window);
\ No newline at end of file
.layui-m-layer{position:relative;z-index:19891014}.layui-m-layer *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.layui-m-layermain,.layui-m-layershade{position:fixed;left:0;top:0;width:100%;height:100%}.layui-m-layershade{background-color:rgba(0,0,0,.7);pointer-events:auto}.layui-m-layermain{display:table;font-family:Helvetica,arial,sans-serif;pointer-events:none}.layui-m-layermain .layui-m-layersection{display:table-cell;vertical-align:middle;text-align:center}.layui-m-layerchild{position:relative;display:inline-block;text-align:left;background-color:#fff;font-size:14px;border-radius:5px;box-shadow:0 0 8px rgba(0,0,0,.1);pointer-events:auto;-webkit-overflow-scrolling:touch;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layui-m-anim-scale{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.layui-m-anim-scale{animation-name:layui-m-anim-scale;-webkit-animation-name:layui-m-anim-scale}@-webkit-keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layui-m-anim-up{0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.layui-m-anim-up{-webkit-animation-name:layui-m-anim-up;animation-name:layui-m-anim-up}.layui-m-layer0 .layui-m-layerchild{width:90%;max-width:640px}.layui-m-layer1 .layui-m-layerchild{border:none;border-radius:0}.layui-m-layer2 .layui-m-layerchild{width:auto;max-width:260px;min-width:40px;border:none;background:0 0;box-shadow:none;color:#fff}.layui-m-layerchild h3{padding:0 10px;height:60px;line-height:60px;font-size:16px;font-weight:400;border-radius:5px 5px 0 0;text-align:center}.layui-m-layerbtn span,.layui-m-layerchild h3{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-m-layercont{padding:50px 30px;line-height:22px;text-align:center}.layui-m-layer1 .layui-m-layercont{padding:0;text-align:left}.layui-m-layer2 .layui-m-layercont{text-align:center;padding:0;line-height:0}.layui-m-layer2 .layui-m-layercont i{width:25px;height:25px;margin-left:8px;display:inline-block;background-color:#fff;border-radius:100%;-webkit-animation:layui-m-anim-loading 1.4s infinite ease-in-out;animation:layui-m-anim-loading 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-m-layerbtn,.layui-m-layerbtn span{position:relative;text-align:center;border-radius:0 0 5px 5px}.layui-m-layer2 .layui-m-layercont p{margin-top:20px}@-webkit-keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}@keyframes layui-m-anim-loading{0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}}.layui-m-layer2 .layui-m-layercont i:first-child{margin-left:0;-webkit-animation-delay:-.32s;animation-delay:-.32s}.layui-m-layer2 .layui-m-layercont i.layui-m-layerload{-webkit-animation-delay:-.16s;animation-delay:-.16s}.layui-m-layer2 .layui-m-layercont>div{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px}
\ No newline at end of file
/*!
@Name: layer拓展样式
@Date: 2012.12.13
@Author: 贤心
@blog: sentsin.com
*/.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span{text-overflow:ellipsis;white-space:nowrap}.layui-layer-iconext{background:url(default/icon-ext.png) no-repeat}html #layui_layer_skinlayerextcss{display:none;position:absolute;width:1989px}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;overflow:hidden}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:43px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s;background:url(default/xubox_loading1.gif) center center no-repeat #000}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}
/*
* layer皮肤
* 作者:一☆隐☆一
* QQ:9073194
* 请保留这里的信息 谢谢!虽然你不保留我也不能把你怎么样!
*/
html #layui_layer_skinmoonstylecss {
display: none;
position: absolute;
width: 1989px;
}
body .layer-ext-moon[type="dialog"] {
min-width: 320px;
}
body .layer-ext-moon-msg[type="dialog"]{min-width:200px;}
body .layer-ext-moon .layui-layer-title {
background: #f6f6f6;
color: #212a31;
font-size: 16px;
font-weight: bold;
height: 46px;
line-height: 46px;
}
body .layer-ext-moon .layui-layer-content .layui-layer-ico {
height: 32px;
width: 32px;
top:18.5px;
}
body .layer-ext-moon .layui-layer-ico0 {
background: url(default.png) no-repeat -96px 0;
;
}
body .layer-ext-moon .layui-layer-ico1 {
background: url(default.png) no-repeat -224px 0;
;
}
body .layer-ext-moon .layui-layer-ico2 {
background: url(default.png) no-repeat -192px 0;
}
body .layer-ext-moon .layui-layer-ico3 {
background: url(default.png) no-repeat -160px 0;
}
body .layer-ext-moon .layui-layer-ico4 {
background: url(default.png) no-repeat -320px 0;
}
body .layer-ext-moon .layui-layer-ico5 {
background: url(default.png) no-repeat -288px 0;
}
body .layer-ext-moon .layui-layer-ico6 {
background: url(default.png) -256px 0;
}
body .layer-ext-moon .layui-layer-ico7 {
background: url(default.png) no-repeat -128px 0;
}
body .layer-ext-moon .layui-layer-setwin {
top: 15px;
right: 15px;
}
body .layer-ext-moon .layui-layer-setwin a {
width: 16px;
height: 16px;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-min cite:hover {
background-color: #56abe4;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-max {
background: url(default.png) no-repeat -80px 0;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-max:hover {
background: url(default.png) no-repeat -64px 0;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin {
background: url(default.png) no-repeat -32px 0;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin:hover {
background: url(default.png) no-repeat -16px 0;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2 {
background: url(default.png) 0 0;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover {
background: url(default.png) -48px 0;
}
body .layer-ext-moon .layui-layer-padding{padding-top: 24px;}
body .layer-ext-moon .layui-layer-btn {
padding: 15px 0;
background: #f0f4f7;
border-top: 1px #c7c7c7 solid;
}
body .layer-ext-moon .layui-layer-btn a {
font-size: 12px;
font-weight: normal;
margin: 0 3px;
margin-right: 7px;
margin-left: 7px;
padding: 6px 20px;
color: #fff;
border: 1px solid #0064b6;
background: #0071ce;
border-radius: 3px;
display: inline-block;
height: 20px;
line-height: 20px;
text-align: center;
vertical-align: middle;
background-repeat: no-repeat;
text-decoration: none;
outline: none;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
body .layer-ext-moon .layui-layer-btn .layui-layer-btn0 {
background: #0071ce;
}
body .layer-ext-moon .layui-layer-btn .layui-layer-btn1 {
background: #fff;
color: #404a58;
border: 1px solid #c0c4cd;
border-radius: 3px;
}
body .layer-ext-moon .layui-layer-btn .layui-layer-btn2 {
background: #f60;
color: #fff;
border: 1px solid #f60;
border-radius: 3px;
}
body .layer-ext-moon .layui-layer-btn .layui-layer-btn3 {
background: #f00;
color: #fff;
border: 1px solid #f00;
border-radius: 3px;
}
body .layer-ext-moon .layui-layer-title span.layui-layer-tabnow{
height:46px;
}
/*! /**
* ruoyi.css * 通用css样式布局处理
* Author: Ruoyi * Copyright (c) 2018 ruoyi
*/ */
/** 用户管理 样式布局 */ /** 用户管理 样式布局 */
.box { .box {
position: relative; position: relative;
border-radius: 3px; border-radius: 3px;
...@@ -25,15 +24,15 @@ ...@@ -25,15 +24,15 @@
} }
.btn-box-tool { .btn-box-tool {
padding: 5px; padding: 5px;
font-size: 12px; font-size: 12px;
background: transparent; background: transparent;
color: #97a0b3; color: #97a0b3;
} }
.open .btn-box-tool, .open .btn-box-tool,
.btn-box-tool:hover { .btn-box-tool:hover {
color: #606c84; color: #606c84;
} }
.box-main { .box-main {
...@@ -50,10 +49,10 @@ ...@@ -50,10 +49,10 @@
} }
.box-header .box-title { .box-header .box-title {
display: inline-block; display: inline-block;
font-size: 18px; font-size: 18px;
margin: 0; margin: 0;
line-height: 1; line-height: 1;
} }
.box-main>.box-header .box-title { .box-main>.box-header .box-title {
...@@ -137,85 +136,149 @@ label.error { ...@@ -137,85 +136,149 @@ label.error {
} }
.i-checks label.error, .check-box label.error, .radio-box label.error { .i-checks label.error, .check-box label.error, .radio-box label.error {
right:auto; right: auto;
width:150px; width: 150px;
left:210px; left: 210px;
top:1px; top: 1px;
max-width: none; max-width: none;
} }
/** 内联复选框&单选框 */ /** 复选框&单选框 */
.check-box,.radio-box { .check-box,.radio-box {
display:inline-block; display: inline-block;
box-sizing:border-box; box-sizing: border-box;
cursor:pointer; cursor: pointer;
position:relative; position: relative;
padding-right:20px; padding-left: 25px;
padding-top:7px; padding-right: 15px;
padding-top: 8px;
}
.icheckbox, .icheckbox-blue, .iradio, .iradio-blue, .iradio-purple {
position: absolute;
top: 8px;
left: 0
}
/* iCheck */
.icheckbox-blue,.iradio-blue {
display: block;
margin: 0;
padding: 0;
width: 18px;
height: 18px;
background: url(/img/blue.png) no-repeat;
border: none;
cursor: pointer
}
.icheckbox-blue,.icheckbox-blue.static:hover {
background-position: 0 0
}
.icheckbox-blue.hover,.icheckbox-blue:hover {
background-position: -20px 0
}
.icheckbox-blue.checked {
background-position: -40px 0
}
.icheckbox-blue.disabled {
background-position: -60px 0;
cursor: default
}
.icheckbox-blue.checked.disabled {
background-position: -80px 0
}
.iradio-blue,.iradio-blue.static:hover {
background-position: -100px 0
}
.iradio-blue.hover,.iradio-blue:hover {
background-position: -120px 0
}
.iradio-blue.checked {
background-position: -140px 0
}
.iradio-blue.disabled {
background-position: -160px 0;
cursor: default
}
.iradio-blue.checked.disabled {
background-position: -180px 0
} }
/** 遮罩层 */ /** 遮罩层 */
.loaderbox { .loaderbox {
display: inline-block; display: inline-block;
min-width: 125px; min-width: 125px;
padding: 10px; padding: 10px;
margin: 0 auto; margin: 0 auto;
color: #000 !important; color: #000 !important;
font-size: 13px; font-size: 13px;
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
border: 1px solid #ddd; border: 1px solid #ddd;
background-color: #eee; background-color: #eee;
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
-moz-border-radius: 2px; -moz-border-radius: 2px;
-ms-border-radius: 2px; -ms-border-radius: 2px;
-o-border-radius: 2px; -o-border-radius: 2px;
border-radius: 2px; border-radius: 2px;
-webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
} }
.loaderbox .loading-activity { .loaderbox .loading-activity {
float: left; float: left;
width: 18px; width: 18px;
height: 18px; height: 18px;
border: solid 2px transparent; border: solid 2px transparent;
border-top-color: #000; border-top-color: #000;
border-left-color: #000; border-left-color: #000;
border-radius: 10px; border-radius: 10px;
-webkit-animation: pace-spinner 400ms linear infinite; -webkit-animation: pace-spinner 400ms linear infinite;
-moz-animation: pace-spinner 400ms linear infinite; -moz-animation: pace-spinner 400ms linear infinite;
-ms-animation: pace-spinner 400ms linear infinite; -ms-animation: pace-spinner 400ms linear infinite;
-o-animation: pace-spinner 400ms linear infinite; -o-animation: pace-spinner 400ms linear infinite;
animation: pace-spinner 400ms linear infinite; animation: pace-spinner 400ms linear infinite;
} }
@media (max-width: 767px) { @media (max-width: 767px) {
.loading-activity { .loading-activity {
width: 18px; width: 18px;
height: 18px; height: 18px;
} }
} }
@-ms-keyframes pace-spinner { @-ms-keyframes pace-spinner {
0% { 0% {
-ms-transform: rotate(0deg); -ms-transform: rotate(0deg);
transform: rotate(0deg); transform: rotate(0deg);
} }
100% {
-ms-transform: rotate(360deg); 100% {
transform: rotate(360deg); -ms-transform: rotate(360deg);
} transform: rotate(360deg);
}
} }
@keyframes pace-spinner { @keyframes pace-spinner {
0% { 0% {
transform: rotate(0deg); transform: rotate(0deg);
} }
100% {
transform: rotate(360deg); 100% {
} transform: rotate(360deg);
}
} }
/** 表单查询条件 */ /** 表单查询条件 */
...@@ -236,12 +299,12 @@ li { ...@@ -236,12 +299,12 @@ li {
} }
label { label {
font-weight: normal; font-weight: normal;
} }
.container-div { .container-div {
padding:10px 35px; padding: 10px 35px;
height:100%; height: 100%;
} }
.container-div .row { .container-div .row {
...@@ -249,13 +312,13 @@ label { ...@@ -249,13 +312,13 @@ label {
} }
.select-info,.select-table { .select-info,.select-table {
width:100%; width: 100%;
background: #fff; background: #fff;
border-radius: 6px; border-radius: 6px;
margin-top:10px; margin-top: 10px;
padding-top: 5px; padding-top: 5px;
padding-bottom: 13px; padding-bottom: 13px;
box-shadow: 1px 1px 3px rgba(0,0,0,.2); box-shadow: 1px 1px 3px rgba(0,0,0,.2);
} }
.select-info { .select-info {
...@@ -263,97 +326,108 @@ label { ...@@ -263,97 +326,108 @@ label {
} }
.select-info .col-sm-6 .control-label { .select-info .col-sm-6 .control-label {
color:#333; color: #333;
} }
@media ( max-width : 768px) { @media ( max-width : 768px) {
.select-info { .select-info {
display: none; display: none;
} }
} }
.select-list li{ .select-list li {
float:left; float: left;
color:#333; color: #333;
margin: 5px 15px 5px 0px; margin: 5px 15px 5px 0px;
} }
.select-list li input{
border:1px solid #ddd; .select-list li input {
border: 1px solid #ddd;
border-radius: 4px; border-radius: 4px;
background: transparent; background: transparent;
outline: none; outline: none;
height: 30px; height: 30px;
width:280px; width: 280px;
padding-left:5px; padding-left: 5px;
} }
.select-list li .submit-btn{
border:0px; .select-list li .submit-btn {
border: 0px;
border-radius: 4px; border-radius: 4px;
background: transparent; background: transparent;
outline: none; outline: none;
width: 40px; width: 40px;
height: 23px; height: 23px;
} }
.select-list li select{
border:1px solid #ddd; .select-list li select {
border: 1px solid #ddd;
border-radius: 4px; border-radius: 4px;
background: transparent; background: transparent;
outline: none; outline: none;
height: 30px; height: 30px;
width:280px; width: 280px;
} }
.select-list .select-time input{ .select-list .select-time input {
width:133px; width: 133px;
} }
.select-time label,.select-time span,.select-time input{ .select-time label,.select-time span,.select-time input {
float:left; float: left;
} }
.select-time label{
margin-top: 5px; .select-time label {
margin-top: 5px;
} }
.select-time span{
display: block; .select-time span {
margin: 5px 5px; display: block;
margin: 5px 5px;
} }
.search-btn{
.search-btn {
background-color: #1ab394; background-color: #1ab394;
border-color: #1ab394; border-color: #1ab394;
color: #FFF; color: #FFF;
margin-bottom: 5px; margin-bottom: 5px;
display: inline-block; display: inline-block;
padding: 6px 12px; padding: 6px 12px;
margin-bottom: 0; margin-bottom: 0;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
line-height: 1.42857143; line-height: 1.42857143;
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
border-radius: 3px; border-radius: 3px;
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
} }
/** 表格查询数据 */ /** 表格查询数据 */
.table-striped{ .table-striped {
min-height:75%; min-height: 75%;
} }
.table-striped .bootstrap-table{
border:0px!important; .table-striped .bootstrap-table {
border: 0px!important;
} }
.table-striped .table, .fixed-table-container, table, .table-striped .table, .table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{
border-bottom: 1px solid #e7eaec!important; .table-striped .table, .fixed-table-container, table, .table-striped .table, .table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
background-color: transparent!important; border-bottom: 1px solid #e7eaec!important;
border: 0px; background-color: transparent!important;
border: 0px;
} }
.table-striped .table>thead>tr>th, .table-striped .table>tbody>tr>th{
.table-striped .table>thead>tr>th, .table-striped .table>tbody>tr>th {
border-bottom: 1px solid #ccc!important; border-bottom: 1px solid #ccc!important;
border-top: 0px!important; border-top: 0px!important;
} }
.table-striped .table>thead:first-child>tr:first-child>th{
color:#333; .table-striped .table>thead:first-child>tr:first-child>th {
color: #333;
} }
.table-bordered td,.table-bordered th { .table-bordered td,.table-bordered th {
border: 1px solid #ddd!important border: 1px solid #ddd!important
} }
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Copyright (c) 2018 ruoyi * Copyright (c) 2018 ruoyi
*/ */
$(function(){ $(function() {
// 复选框事件绑定 // select2复选框事件绑定
if ($.fn.select2 !== undefined) { if ($.fn.select2 !== undefined) {
$("select.form-control:not(.noselect2)").each(function () { $("select.form-control:not(.noselect2)").each(function () {
$(this).select2().on("change", function () { $(this).select2().on("change", function () {
...@@ -12,18 +12,21 @@ $(function(){ ...@@ -12,18 +12,21 @@ $(function(){
}) })
}) })
} }
if ($(".i-checks").length > 0) { // checkbox 事件绑定
$(".i-checks").iCheck({ if ($(".check-box").length > 0) {
checkboxClass: "icheckbox_square-green", $(".check-box").iCheck({
radioClass: "iradio_square-green", checkboxClass: 'icheckbox-blue',
radioClass: 'iradio-blue',
}) })
} }
// radio 事件绑定
if ($(".radio-box").length > 0) { if ($(".radio-box").length > 0) {
$(".radio-box").iCheck({ $(".radio-box").iCheck({
checkboxClass: "icheckbox_square-green", checkboxClass: 'icheckbox-blue',
radioClass: "iradio_square-green", radioClass: 'iradio-blue',
}) })
} }
// laydate 时间控件绑定
if ($(".select-time").length > 0) { if ($(".select-time").length > 0) {
layui.use('laydate', function() { layui.use('laydate', function() {
var laydate = layui.laydate; var laydate = layui.laydate;
...@@ -31,6 +34,19 @@ $(function(){ ...@@ -31,6 +34,19 @@ $(function(){
laydate.render({ elem: '#endTime', theme: 'molv' }); laydate.render({ elem: '#endTime', theme: 'molv' });
}); });
} }
// tree 关键字搜索绑定
if ($("#keyword").length > 0) {
$("#keyword").bind("focus", function focusKey(e) {
if ($("#keyword").hasClass("empty")) {
$("#keyword").removeClass("empty");
}
}).bind("blur", function blurKey(e) {
if ($("#keyword").val() === "") {
$("#keyword").addClass("empty");
}
$.tree.searchNode(e);
}).bind("input propertychange", $.tree.searchNode);
}
}); });
/** 创建选项卡 */ /** 创建选项卡 */
......
...@@ -6,14 +6,13 @@ ...@@ -6,14 +6,13 @@
<meta name="description" content=""> <meta name="description" content="">
<link rel="shortcut icon" href="favicon.ico"> <link rel="shortcut icon" href="favicon.ico">
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/> <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link th:href="@{/css/font-awesome.css}" rel="stylesheet"/> <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<!-- bootstrap-table 表格插件样式 --> <!-- bootstrap-table 表格插件样式 -->
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/> <link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/bootstrap-treetable/bootstrap-treetable.css}" rel="stylesheet"/> <link th:href="@{/ajax/libs/bootstrap-treetable/bootstrap-treetable.css}" rel="stylesheet"/>
<link th:href="@{/css/animate.css}" rel="stylesheet"/> <link th:href="@{/css/animate.css}" rel="stylesheet"/>
<link th:href="@{/css/style.css}" rel="stylesheet"/> <link th:href="@{/css/style.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/> <link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
<link th:href="@{/ruoyi/css/ry-ui.min.css}" rel="stylesheet"/> <link th:href="@{/ruoyi/css/ry-ui.min.css}" rel="stylesheet"/>
</head> </head>
<div th:fragment="footer"> <div th:fragment="footer">
...@@ -39,8 +38,8 @@ ...@@ -39,8 +38,8 @@
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script> <script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script> <script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script> <script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/common.js?v=2.3.0}"></script> <script th:src="@{/ruoyi/js/common.js?v=2.4.0}"></script>
<script th:src="@{/ruoyi/js/ry-ui.min.js?v=2.3.0}"></script> <script th:src="@{/ruoyi/js/ry-ui.min.js?v=2.4.0}"></script>
<script src="http://tajs.qq.com/stats?sId=62048022"></script> <script src="http://tajs.qq.com/stats?sId=62048022"></script>
<script th:inline="javascript"> var ctx = [[@{/}]]; </script> <script th:inline="javascript"> var ctx = [[@{/}]]; </script>
</div> </div>
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
<![endif]--> <![endif]-->
<link th:href="@{favicon.ico}" rel="stylesheet"/> <link th:href="@{favicon.ico}" rel="stylesheet"/>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/> <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link th:href="@{/css/font-awesome.css}" rel="stylesheet"/> <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link th:href="@{/css/animate.css}" rel="stylesheet"/> <link th:href="@{/css/animate.css}" rel="stylesheet"/>
<link th:href="@{/css/style.css}" rel="stylesheet"/> <link th:href="@{/css/style.css}" rel="stylesheet"/>
<link th:href="@{/ruoyi/css/ry-ui.min.css?v=2.3.0}" rel="stylesheet"/> <link th:href="@{/ruoyi/css/ry-ui.min.css?v=2.4.0}" rel="stylesheet"/>
<style type="text/css"> <style type="text/css">
.nav > li:hover .dropdown-menu {display: block;} .nav > li:hover .dropdown-menu {display: block;}
</style> </style>
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script> <script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script> <script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="http://tajs.qq.com/stats?sId=62048022"></script> <script src="http://tajs.qq.com/stats?sId=62048022"></script>
<script th:src="@{/ruoyi/js/ry-ui.min.js?v=2.3.0}"></script> <script th:src="@{/ruoyi/js/ry-ui.min.js?v=2.4.0}"></script>
<script th:src="@{/ruoyi/index.js}"></script> <script th:src="@{/ruoyi/index.js}"></script>
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script> <script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
</body> </body>
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
<meta name="keywords" content="若依管理系统"> <meta name="keywords" content="若依管理系统">
<meta name="description" content="RuoYi"> <meta name="description" content="RuoYi">
<link href="../static/css/bootstrap.min.css" th:href="@{css/bootstrap.min.css}" rel="stylesheet"/> <link href="../static/css/bootstrap.min.css" th:href="@{css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.css" th:href="@{css/font-awesome.css}" rel="stylesheet"/> <link href="../static/css/font-awesome.min.css" th:href="@{css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/style.css" th:href="@{css/style.css}" rel="stylesheet"/> <link href="../static/css/style.css" th:href="@{css/style.css}" rel="stylesheet"/>
<link href="../static/css/login.min.css" th:href="@{css/login.min.css}" rel="stylesheet"/> <link href="../static/css/login.min.css" th:href="@{css/login.min.css}" rel="stylesheet"/>
<link href="../static/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/> <link href="../static/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
<link href="../static/ruoyi/css/ry-ui.min.css" th:href="@{/ruoyi/css/ry-ui.min.css?v=2.3.0}" rel="stylesheet"/> <link href="../static/ruoyi/css/ry-ui.min.css" th:href="@{/ruoyi/css/ry-ui.min.css?v=2.4.0}" rel="stylesheet"/>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html" /> <meta http-equiv="refresh" content="0;ie.html" />
<![endif]--> <![endif]-->
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<script src="../static/ajax/libs/iCheck/icheck.min.js" th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script> <script src="../static/ajax/libs/iCheck/icheck.min.js" th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script> <script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="http://tajs.qq.com/stats?sId=62048022"></script> <script src="http://tajs.qq.com/stats?sId=62048022"></script>
<script src="../static/ruoyi/js/ry-ui.min.js" th:src="@{/ruoyi/js/ry-ui.min.js?v=2.3.0}"></script> <script src="../static/ruoyi/js/ry-ui.min.js" th:src="@{/ruoyi/js/ry-ui.min.js?v=2.4.0}"></script>
<script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script> <script src="../static/ruoyi/login.js" th:src="@{/ruoyi/login.js}"></script>
</body> </body>
</html> </html>
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8"> <meta charset="utf-8">
<head th:include="include :: header"></head> <head th:include="include :: header"></head>
<link href="/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-job-add"> <form class="form-horizontal m" id="form-job-add">
...@@ -39,9 +38,9 @@ ...@@ -39,9 +38,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">执行策略:</label> <label class="col-sm-3 control-label">执行策略:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<label class="checkbox-inline i-checks"> <input type="radio" name="misfirePolicy" value="1" /> 继续执行 </label> <label class="radio-box"> <input type="radio" name="misfirePolicy" value="1" /> 继续执行 </label>
<label class="checkbox-inline i-checks"> <input type="radio" name="misfirePolicy" value="2" /> 一次执行 </label> <label class="radio-box"> <input type="radio" name="misfirePolicy" value="2" /> 一次执行 </label>
<label class="checkbox-inline i-checks"> <input type="radio" name="misfirePolicy" value="3" /> 放弃执行 </label> <label class="radio-box"> <input type="radio" name="misfirePolicy" value="3" /> 放弃执行 </label>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -68,7 +67,6 @@ ...@@ -68,7 +67,6 @@
</form> </form>
</div> </div>
<div th:include="include::footer"></div> <div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "monitor/job" var prefix = ctx + "monitor/job"
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8"> <meta charset="utf-8">
<head th:include="include :: header"></head> <head th:include="include :: header"></head>
<link href="/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-job-edit" th:object="${job}"> <form class="form-horizontal m" id="form-job-edit" th:object="${job}">
...@@ -40,9 +39,9 @@ ...@@ -40,9 +39,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">执行策略:</label> <label class="col-sm-3 control-label">执行策略:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<label class="checkbox-inline i-checks"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="1" /> 继续执行 </label> <label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="1" /> 继续执行 </label>
<label class="checkbox-inline i-checks"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="2" /> 一次执行 </label> <label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="2" /> 一次执行 </label>
<label class="checkbox-inline i-checks"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="3" /> 放弃执行 </label> <label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="3" /> 放弃执行 </label>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -69,7 +68,6 @@ ...@@ -69,7 +68,6 @@
</form> </form>
</div> </div>
<div th:include="include::footer"></div> <div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "monitor/job" var prefix = ctx + "monitor/job"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">部门名称:</label> <label class="col-sm-3 control-label">部门名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" type="text" name="deptName"> <input class="form-control" type="text" name="deptName" id="deptName">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -73,6 +73,9 @@ ...@@ -73,6 +73,9 @@
type: "post", type: "post",
dataType: "json", dataType: "json",
data: { data: {
"parentId": function() {
return $("input[name='parentId']").val();
},
"deptName" : function() { "deptName" : function() {
return $.common.trim($("#deptName").val()); return $.common.trim($("#deptName").val());
} }
...@@ -105,9 +108,21 @@ ...@@ -105,9 +108,21 @@
/*部门管理-新增-选择父部门树*/ /*部门管理-新增-选择父部门树*/
function selectDeptTree() { function selectDeptTree() {
var deptId = $("#treeId").val(); var options = {
var url = prefix + "/selectDeptTree/" + deptId; title: '部门选择',
$.modal.open("选择部门", url, '380', '380'); width: "380",
height: "380",
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
} }
</script> </script>
</body> </body>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">部门名称:</label> <label class="col-sm-3 control-label">部门名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" type="text" name="deptName" th:field="*{deptName}"> <input class="form-control" type="text" name="deptName" th:field="*{deptName}" id="deptName">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -74,7 +74,10 @@ ...@@ -74,7 +74,10 @@
dataType: "json", dataType: "json",
data: { data: {
"deptId": function() { "deptId": function() {
return $.common.trim($("#deptId").val()); return $("#deptId").val();
},
"parentId": function() {
return $("input[name='parentId']").val();
}, },
"deptName": function() { "deptName": function() {
return $.common.trim($("#deptName").val()); return $.common.trim($("#deptName").val());
...@@ -108,9 +111,21 @@ ...@@ -108,9 +111,21 @@
/*部门管理-修改-选择部门树*/ /*部门管理-修改-选择部门树*/
function selectDeptTree() { function selectDeptTree() {
var deptId = $("#treeId").val(); var options = {
var url = prefix + "/selectDeptTree/" + deptId; title: '部门选择',
$.modal.open("选择部门", url, '380', '380'); width: "380",
height: "380",
url: prefix + "/selectDeptTree/" + $("#treeId").val(),
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
} }
</script> </script>
</body> </body>
......
...@@ -10,173 +10,38 @@ button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;} ...@@ -10,173 +10,38 @@ button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
<body class="hold-transition box box-main"> <body class="hold-transition box box-main">
<input id="treeId" name="treeId" type="hidden" th:value="${dept.deptId}"/> <input id="treeId" name="treeId" type="hidden" th:value="${dept.deptId}"/>
<input id="treeName" name="treeName" type="hidden" th:value="${dept.deptName}"/> <input id="treeName" name="treeName" type="hidden" th:value="${dept.deptName}"/>
<div class="wrapper"><div class="treeShowHideButton" onclick="search();"> <div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
<label id="btnShow" title="显示搜索" style="display:none;"></label> <label id="btnShow" title="显示搜索" style="display:none;"></label>
<label id="btnHide" title="隐藏搜索"></label> <label id="btnHide" title="隐藏搜索"></label>
</div> </div>
<div class="treeSearchInput" id="search"> <div class="treeSearchInput" id="search">
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50"> <label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
<button class="btn" id="btn" onclick="searchNode()"> 搜索 </button> <button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
</div> </div>
<div class="treeExpandCollapse"> <div class="treeExpandCollapse">
<a href="javascript:" id="btnExpand">展开</a> / <a href="#" onclick="$.tree.expand()">展开</a> /
<a href="javascript:" id="btnCollapse">折叠</a> <a href="#" onclick="$.tree.collapse()">折叠</a>
</div> </div>
<div id="tree" class="ztree treeselect"></div> <div id="tree" class="ztree treeselect"></div>
</div> </div>
<div class="layui-layer-btn">
<a class="layui-layer-btn0" th:onclick="'javascript:loadObj()'"><i class="fa fa-check"></i> 确定</a>
<a class="layui-layer-btn1" onclick="$.modal.close()"><i class="fa fa-close"></i> 关闭</a>
</div>
<div th:include="include::footer"></div> <div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script> <script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script th:inline="javascript"> <script th:inline="javascript">
// 树结构初始化加载
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{enable:true}},
callback:{onClick:function(event, treeId, treeNode){
var treeId = treeNode.id;
var treeName = treeNode.name;
$("#treeId").val(treeId);
$("#treeName").val(treeName);
}}
}, tree, loadTree = function(){
$.get(ctx + "system/dept/treeData", function(data) {
var treeName = $("#treeName").val();
tree = $.fn.zTree.init($("#tree"), setting, data);
// 展开第一级节点
var nodes = tree.getNodesByParam("level", 0);
for (var i = 0; i < nodes.length; i++) {
tree.expandNode(nodes[i], true, false, false);
selectCheckNode(treeName,nodes[i]);
}
// 展开第二级节点
nodes = tree.getNodesByParam("level", 1);
for (var i = 0; i < nodes.length; i++) {
tree.expandNode(nodes[i], true, false, false);
selectCheckNode(treeName,nodes[i]);
}
// 展开第二级节点
nodes = tree.getNodesByParam("level", 2);
for (var i = 0; i < nodes.length; i++) {
tree.expandNode(nodes[i], true, false, false);
selectCheckNode(treeName,nodes[i]);
}
}, null, null, "正在加载,请稍后...");
};
$(function() { $(function() {
loadTree(); var url = ctx + "system/dept/treeData";
}); var options = {
url: url,
function selectCheckNode(treeName, node) { expandLevel: 2,
if(treeName == node.name){ onClick : zOnClick
tree.selectNode(node, true); };
} $.tree.init(options);
}
$('#btnExpand').click(function() {
tree.expandAll(true);
});
$('#btnCollapse').click(function() {
tree.expandAll(false);
}); });
function loadObj(){ function zOnClick(event, treeId, treeNode) {
var treeId = $("#treeId").val(); var treeId = treeNode.id;
var treeName = $("#treeName").val(); var treeName = treeNode.name;
parent.$("#treeId").val(treeId); $("#treeId").val(treeId);
parent.$("#treeName").val(treeName); $("#treeName").val(treeName);
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
}
var lastValue = "", nodeList = [], key = $("#keyword");
key.bind("focus", focusKey).bind("blur", blurKey).bind("change cut input propertychange", searchNode);
key.bind("keydown", function (e){if(e.which == 13){searchNode();}});
function focusKey(e) {
if (key.hasClass("empty")) {
key.removeClass("empty");
}
}
function blurKey(e) {
if (key.get(0).value === "") {
key.addClass("empty");
}
searchNode(e);
}
function searchNode() {
var value = $.trim(key.get(0).value);
var keyType = "name";
if (lastValue === value) {
return;
}
lastValue = value;
var nodes = tree.getNodes();
if (value == "") {
showAllNode(nodes);
return;
}
hideAllNode(nodes);
nodeList = tree.getNodesByParamFuzzy(keyType, value);
updateNodes(nodeList);
}
function hideAllNode(nodes){
var tree = $.fn.zTree.getZTreeObj("tree");
nodes = tree.transformToArray(nodes);
for(var i=nodes.length-1; i>=0; i--) {
tree.hideNode(nodes[i]);
}
}
function showAllNode(nodes){
nodes = tree.transformToArray(nodes);
for(var i=nodes.length-1; i>=0; i--) {
if(nodes[i].getParentNode()!=null){
tree.expandNode(nodes[i],false,false,false,false);
}else{
tree.expandNode(nodes[i],true,true,false,false);
}
tree.showNode(nodes[i]);
showAllNode(nodes[i].children);
}
}
function updateNodes(nodeList) {
tree.showNodes(nodeList);
for(var i=0, l=nodeList.length; i<l; i++) {
var treeNode = nodeList[i];
showChildren(treeNode);
showParent(treeNode)
}
}
function showChildren(treeNode){
if (treeNode.isParent){
for(var idx in treeNode.children){
var node = treeNode.children[idx];
tree.showNode(node);
showChildren(node);
}
}
}
function showParent(treeNode){
var parentNode;
while((parentNode = treeNode.getParentNode()) != null){
tree.showNode(parentNode);
tree.expandNode(parentNode, true, false, false);
treeNode = parentNode;
}
}
function search($this) {
$('#search').slideToggle(200);
$('#btnShow').toggle();
$('#btnHide').toggle();
$('#keyword').focus();
} }
</script> </script>
</body> </body>
......
...@@ -121,7 +121,12 @@ ...@@ -121,7 +121,12 @@
function queryParams(params) { function queryParams(params) {
return { return {
dictType: $("#dictType").val() dictType: $("#dictType").val(),
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
searchValue: params.search,
orderByColumn: params.sort,
isAsc: params.order
}; };
} }
</script> </script>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8"> <meta charset="utf-8">
<head th:include="include :: header"></head> <head th:include="include :: header"></head>
<link href="/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-menu-add"> <form class="form-horizontal m" id="form-menu-add">
...@@ -16,9 +15,9 @@ ...@@ -16,9 +15,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">菜单类型:</label> <label class="col-sm-3 control-label">菜单类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<label class="checkbox-inline i-checks"> <input type="radio" name="menuType" value="M" /> 目录 </label> <label class="radio-box"> <input type="radio" name="menuType" value="M" /> 目录 </label>
<label class="checkbox-inline i-checks"> <input type="radio" name="menuType" value="C" /> 菜单 </label> <label class="radio-box"> <input type="radio" name="menuType" value="C" /> 菜单 </label>
<label class="checkbox-inline i-checks"> <input type="radio" name="menuType" value="F" /> 按钮 </label> <label class="radio-box"> <input type="radio" name="menuType" value="F" /> 按钮 </label>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -74,7 +73,6 @@ ...@@ -74,7 +73,6 @@
</form> </form>
</div> </div>
<div th:include="include::footer"></div> <div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script> <script>
var prefix = ctx + "system/menu" var prefix = ctx + "system/menu"
$("#form-menu-add").validate({ $("#form-menu-add").validate({
...@@ -89,6 +87,9 @@ ...@@ -89,6 +87,9 @@
type: "post", type: "post",
dataType: "json", dataType: "json",
data: { data: {
"parentId": function() {
return $("input[name='parentId']").val();
},
"menuName" : function() { "menuName" : function() {
return $.common.trim($("#menuName").val()); return $.common.trim($("#menuName").val());
} }
...@@ -146,16 +147,25 @@ ...@@ -146,16 +147,25 @@
/*菜单管理-新增-选择菜单树*/ /*菜单管理-新增-选择菜单树*/
function selectMenuTree() { function selectMenuTree() {
var menuId = $("#treeId").val(); var treeId = $("#treeId").val();
if(menuId > 0) { var menuId = treeId > 0 ? treeId : 1;
var url = prefix + "/selectMenuTree/" + menuId; var url = prefix + "/selectMenuTree/" + menuId;
$.modal.open("选择菜单", url, '380', '380'); var options = {
} title: '菜单选择',
else { width: "380",
var url = prefix + "/selectMenuTree/1"; height: "380",
$.modal.open("选择菜单", url, '380', '380'); url: url,
} callBack: doSubmit
} };
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
</script> </script>
</body> </body>
</html> </html>
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8"> <meta charset="utf-8">
<head th:include="include :: header"></head> <head th:include="include :: header"></head>
<link href="/ajax/libs/iCheck/custom.css" th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-menu-edit" th:object="${menu}"> <form class="form-horizontal m" id="form-menu-edit" th:object="${menu}">
...@@ -17,9 +16,9 @@ ...@@ -17,9 +16,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">菜单类型:</label> <label class="col-sm-3 control-label">菜单类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<label class="checkbox-inline i-checks"> <input type="radio" th:field="*{menuType}" name="menuType" value="M" /> 目录 </label> <label class="radio-box"> <input type="radio" th:field="*{menuType}" name="menuType" value="M" /> 目录 </label>
<label class="checkbox-inline i-checks"> <input type="radio" th:field="*{menuType}" name="menuType" value="C" /> 菜单 </label> <label class="radio-box"> <input type="radio" th:field="*{menuType}" name="menuType" value="C" /> 菜单 </label>
<label class="checkbox-inline i-checks"> <input type="radio" th:field="*{menuType}" name="menuType" value="F" /> 按钮 </label> <label class="radio-box"> <input type="radio" th:field="*{menuType}" name="menuType" value="F" /> 按钮 </label>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -75,11 +74,10 @@ ...@@ -75,11 +74,10 @@
</form> </form>
</div> </div>
<div th:include="include::footer"></div> <div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
<script> <script>
var prefix = ctx + "system/menu" var prefix = ctx + "system/menu"
$(document).ready(function() { $(function() {
var menuType = $('input[name="menuType"]:checked').val(); var menuType = $('input[name="menuType"]:checked').val();
menuVisible(menuType); menuVisible(menuType);
}); });
...@@ -99,6 +97,9 @@ ...@@ -99,6 +97,9 @@
"menuId": function() { "menuId": function() {
return $("#menuId").val(); return $("#menuId").val();
}, },
"parentId": function() {
return $("input[name='parentId']").val();
},
"menuName": function() { "menuName": function() {
return $.common.trim($("#menuName").val()); return $.common.trim($("#menuName").val());
} }
...@@ -171,6 +172,31 @@ ...@@ -171,6 +172,31 @@
$.modal.alertError("主菜单不能选择"); $.modal.alertError("主菜单不能选择");
} }
} }
function selectMenuTree() {
var menuId = $("#treeId").val();
if(menuId > 0) {
var url = prefix + "/selectMenuTree/" + menuId;
var options = {
title: '菜单选择',
width: "380",
height: "380",
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
else {
$.modal.alertError("主菜单不能选择");
}
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
layer.close(index);
}
</script> </script>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment