Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev
Conflicts:
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
ruoyi-ui/src/api/system/role.js
ruoyi-ui/src/api/system/user.js
ruoyi-ui/src/assets/styles/ruoyi.scss
ruoyi-ui/src/router/index.js
ruoyi-ui/src/views/system/role/index.vue
ruoyi-ui/src/views/system/user/index.vue
| | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | /** |
| | | * è§è²ä¿¡æ¯ |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | |
| | | { |
| | | return AjaxResult.success(roleService.selectRoleAll()); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·²åé
ç¨æ·è§è²å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectAllocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æªåé
ç¨æ·è§è²å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUnallocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * åæ¶ææç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | | public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) |
| | | { |
| | | return toAjax(roleService.deleteAuthUser(userRole)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éåæ¶ææç¨æ· |
| | | */ |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | | public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | return toAjax(roleService.deleteAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹ééæ©ç¨æ·ææ |
| | | */ |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/selectAll") |
| | | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
| | | } |
| | | } |
| | |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | return toAjax(userService.updateUserStatus(user)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç¼å·è·åææè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·ææè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) |
| | | { |
| | | userService.insertUserAuth(userId, roleIds); |
| | | return success(); |
| | | } |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private Long[] postIds; |
| | | |
| | | /** è§è²ID */ |
| | | @TableField(exist = false) |
| | | private Long roleId; |
| | | |
| | | public SysUser(Long userId) |
| | | { |
| | | this.userId = userId; |
| | |
| | | public List<SysUser> selectUserList(SysUser sysUser); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢æªå·²é
ç¨æ·è§è²å表 |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | | */ |
| | | public List<SysUser> selectAllocatedList(SysUser user); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢æªåé
ç¨æ·è§è²å表 |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | | */ |
| | | public List<SysUser> selectUnallocatedList(SysUser user); |
| | | |
| | | /** |
| | | * éè¿ç¨æ·åæ¥è¯¢ç¨æ· |
| | | * |
| | | * @param userName ç¨æ·å |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.mybatisplus.core.IServicePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | public List<SysRole> selectRoleList(SysRole role); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢è§è² |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢è§è²å表 |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | * @return è§è²å表 |
| | | */ |
| | | public List<SysRole> selectRolesByUserId(Long userId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢è§è²æé |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | * @return æéå表 |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteRoleByIds(Long[] roleIds); |
| | | |
| | | /** |
| | | * åæ¶ææç¨æ·è§è² |
| | | * |
| | | * @param userRole ç¨æ·åè§è²å
³èä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteAuthUser(SysUserRole userRole); |
| | | |
| | | /** |
| | | * æ¹éåæ¶ææç¨æ·è§è² |
| | | * |
| | | * @param roleId è§è²ID |
| | | * @param userIds éè¦åæ¶ææçç¨æ·æ°æ®ID |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteAuthUsers(Long roleId, Long[] userIds); |
| | | |
| | | /** |
| | | * æ¹ééæ©ææç¨æ·è§è² |
| | | * |
| | | * @param roleId è§è²ID |
| | | * @param userIds éè¦å é¤çç¨æ·æ°æ®ID |
| | | * @return ç»æ |
| | | */ |
| | | public int insertAuthUsers(Long roleId, Long[] userIds); |
| | | } |
| | |
| | | public List<SysUser> selectUserList(SysUser user); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢å·²åé
ç¨æ·è§è²å表 |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | | */ |
| | | public List<SysUser> selectAllocatedList(SysUser user); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢æªåé
ç¨æ·è§è²å表 |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | | */ |
| | | public List<SysUser> selectUnallocatedList(SysUser user); |
| | | |
| | | /** |
| | | * éè¿ç¨æ·åæ¥è¯¢ç¨æ· |
| | | * |
| | | * @param userName ç¨æ·å |
| | |
| | | public int updateUser(SysUser user); |
| | | |
| | | /** |
| | | * ç¨æ·ææè§è² |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | * @param roleIds è§è²ç» |
| | | */ |
| | | public void insertUserAuth(Long userId, Long[] roleIds); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ·ç¶æ |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | |
| | | * ä¿®æ¹ç¨æ·å¤´å |
| | | * |
| | | * @param userName ç¨æ·å |
| | | * @param avatar 头åå°å |
| | | * @param avatar 头åå°å |
| | | * @return ç»æ |
| | | */ |
| | | public boolean updateUserAvatar(String userName, String avatar); |
| | |
| | | /** |
| | | * 导å
¥ç¨æ·æ°æ® |
| | | * |
| | | * @param userList ç¨æ·æ°æ®å表 |
| | | * @param userList ç¨æ·æ°æ®å表 |
| | | * @param isUpdateSupport æ¯å¦æ´æ°æ¯æï¼å¦æå·²åå¨ï¼åè¿è¡æ´æ°æ°æ® |
| | | * @param operName æä½ç¨æ· |
| | | * @param operName æä½ç¨æ· |
| | | * @return ç»æ |
| | | */ |
| | | public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢è§è² |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | * @return è§è²å表 |
| | | */ |
| | | @Override |
| | | public List<SysRole> selectRolesByUserId(Long userId) |
| | | { |
| | | List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId); |
| | | List<SysRole> roles = selectRoleAll(); |
| | | for (SysRole role : roles) |
| | | { |
| | | for (SysRole userRole : userRoles) |
| | | { |
| | | if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) |
| | | { |
| | | role.setFlag(true); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return roles; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢æé |
| | | * |
| | | * @param userId ç¨æ·ID |
| | |
| | | roleDeptMapper.delete(new LambdaQueryWrapper<SysRoleDept>().in(SysRoleDept::getRoleId, ids)); |
| | | return baseMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * åæ¶ææç¨æ·è§è² |
| | | * |
| | | * @param userRole ç¨æ·åè§è²å
³èä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteAuthUser(SysUserRole userRole) |
| | | { |
| | | return userRoleMapper.deleteUserRoleInfo(userRole); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éåæ¶ææç¨æ·è§è² |
| | | * |
| | | * @param roleId è§è²ID |
| | | * @param userIds éè¦åæ¶ææçç¨æ·æ°æ®ID |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteAuthUsers(Long roleId, Long[] userIds) |
| | | { |
| | | return userRoleMapper.deleteUserRoleInfos(roleId, userIds); |
| | | } |
| | | |
| | | /** |
| | | * æ¹ééæ©ææç¨æ·è§è² |
| | | * |
| | | * @param roleId è§è²ID |
| | | * @param userIds éè¦å é¤çç¨æ·æ°æ®ID |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertAuthUsers(Long roleId, Long[] userIds) |
| | | { |
| | | // æ°å¢ç¨æ·ä¸è§è²ç®¡ç |
| | | List<SysUserRole> list = new ArrayList<SysUserRole>(); |
| | | for (Long userId : userIds) |
| | | { |
| | | SysUserRole ur = new SysUserRole(); |
| | | ur.setUserId(userId); |
| | | ur.setRoleId(roleId); |
| | | list.add(ur); |
| | | } |
| | | return userRoleMapper.batchUserRole(list); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢å·²åé
ç¨æ·è§è²å表 |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | public List<SysUser> selectAllocatedList(SysUser user) |
| | | { |
| | | return userMapper.selectAllocatedList(user); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢æªåé
ç¨æ·è§è²å表 |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | | * @return ç¨æ·ä¿¡æ¯éåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | public List<SysUser> selectUnallocatedList(SysUser user) |
| | | { |
| | | return userMapper.selectUnallocatedList(user); |
| | | } |
| | | |
| | | /** |
| | | * éè¿ç¨æ·åæ¥è¯¢ç¨æ· |
| | | * |
| | | * @param userName ç¨æ·å |
| | |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·ææè§è² |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | * @param roleIds è§è²ç» |
| | | */ |
| | | @Override |
| | | public void insertUserAuth(Long userId, Long[] roleIds) |
| | | { |
| | | userRoleMapper.deleteUserRoleByUserId(userId); |
| | | insertUserRole(userId, roleIds); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ·ç¶æ |
| | | * |
| | | * @param user ç¨æ·ä¿¡æ¯ |
| | |
| | | * ä¿®æ¹ç¨æ·å¤´å |
| | | * |
| | | * @param userName ç¨æ·å |
| | | * @param avatar 头åå°å |
| | | * @param avatar 头åå°å |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¨æ·è§è²ä¿¡æ¯ |
| | | * |
| | | * @param userId ç¨æ·ID |
| | | * @param roleIds è§è²ç» |
| | | */ |
| | | public void insertUserRole(Long userId, Long[] roleIds) |
| | | { |
| | | if (StringUtils.isNotNull(roleIds)) |
| | | { |
| | | // æ°å¢ç¨æ·ä¸è§è²ç®¡ç |
| | | List<SysUserRole> list = new ArrayList<SysUserRole>(); |
| | | for (Long roleId : roleIds) |
| | | { |
| | | SysUserRole ur = new SysUserRole(); |
| | | ur.setUserId(userId); |
| | | ur.setRoleId(roleId); |
| | | list.add(ur); |
| | | } |
| | | if (list.size() > 0) |
| | | { |
| | | userRoleMapper.batchUserRole(list); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éè¿ç¨æ·IDå é¤ç¨æ· |
| | | * |
| | | * @param userId ç¨æ·ID |
| | |
| | | /** |
| | | * 导å
¥ç¨æ·æ°æ® |
| | | * |
| | | * @param userList ç¨æ·æ°æ®å表 |
| | | * @param userList ç¨æ·æ°æ®å表 |
| | | * @param isUpdateSupport æ¯å¦æ´æ°æ¯æï¼å¦æå·²åå¨ï¼åè¿è¡æ´æ°æ°æ® |
| | | * @param operName æä½ç¨æ· |
| | | * @param operName æä½ç¨æ· |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | |
| | | r.data_scope, |
| | | r.status as role_status |
| | | from sys_user u |
| | | 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_role r on r.role_id = ur.role_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_role r on r.role_id = ur.role_id |
| | | </sql> |
| | | |
| | | <select id="selectPageUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | 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_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and r.role_id = #{roleId} |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | <if test="params.dataScope != null and params.dataScope != ''"> |
| | | AND ( ${params.dataScope} ) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | 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_role r on r.role_id = ur.role_id |
| | | where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL) |
| | | and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId}) |
| | | <if test="userName != null and userName != ''"> |
| | | AND u.user_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="phonenumber != null and phonenumber != ''"> |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | <if test="params.dataScope != null and params.dataScope != ''"> |
| | | AND ( ${params.dataScope} ) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_name = #{userName} |
| | |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | // æ¥è¯¢è§è²å·²ææç¨æ·å表 |
| | | export function allocatedUserList(query) { |
| | | return request({ |
| | | url: '/system/role/authUser/allocatedList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢è§è²æªææç¨æ·å表 |
| | | export function unallocatedUserList(query) { |
| | | return request({ |
| | | url: '/system/role/authUser/unallocatedList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // åæ¶ç¨æ·ææè§è² |
| | | export function authUserCancel(data) { |
| | | return request({ |
| | | url: '/system/role/authUser/cancel', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // æ¹éåæ¶ç¨æ·ææè§è² |
| | | export function authUserCancelAll(data) { |
| | | return request({ |
| | | url: '/system/role/authUser/cancelAll', |
| | | method: 'put', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // ææç¨æ·éæ© |
| | | export function authUserSelectAll(data) { |
| | | return request({ |
| | | url: '/system/role/authUser/selectAll', |
| | | method: 'put', |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢ææè§è² |
| | | export function getAuthRole(userId) { |
| | | return request({ |
| | | url: '/system/user/authRole/' + userId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // ä¿åææè§è² |
| | | export function updateAuthRole(data) { |
| | | return request({ |
| | | url: '/system/user/authRole', |
| | | method: 'put', |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | margin-left: 20px; |
| | | } |
| | | |
| | | .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { |
| | | font-family: inherit; |
| | | font-weight: 500; |
| | | line-height: 1.1; |
| | | color: inherit; |
| | | } |
| | | |
| | | .el-dialog:not(.is-fullscreen){ |
| | | margin-top: 6vh !important; |
| | | } |
| | |
| | | width: inherit; |
| | | } |
| | | |
| | | /** è¡¨æ ¼æ´å¤æä½ä¸ææ ·å¼ */ |
| | | .el-table .el-dropdown-link { |
| | | cursor: pointer; |
| | | color: #1890ff; |
| | | margin-left: 5px; |
| | | } |
| | | |
| | | .el-table .el-dropdown, .el-icon-arrow-down { |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .el-tree-node__content > .el-checkbox { |
| | | margin-right: 8px; |
| | | } |
| | |
| | | ] |
| | | }, |
| | | { |
| | | path: '/auth', |
| | | component: Layout, |
| | | hidden: true, |
| | | children: [ |
| | | { |
| | | path: 'role/:userId(\\d+)', |
| | | component: (resolve) => require(['@/views/system/user/authRole'], resolve), |
| | | name: 'AuthRole', |
| | | meta: { title: 'åé
è§è²'} |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: '/auth', |
| | | component: Layout, |
| | | hidden: true, |
| | | children: [ |
| | | { |
| | | path: 'user/:roleId(\\d+)', |
| | | component: (resolve) => require(['@/views/system/role/authUser'], resolve), |
| | | name: 'AuthUser', |
| | | meta: { title: 'åé
ç¨æ·'} |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: '/dict', |
| | | component: Layout, |
| | | hidden: true, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <el-form :model="queryParams" ref="queryForm" v-show="showSearch" :inline="true">
|
| | | <el-form-item label="ç¨æ·åç§°" prop="userName">
|
| | | <el-input
|
| | | v-model="queryParams.userName"
|
| | | placeholder="请è¾å
¥ç¨æ·åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ææºå·ç " prop="phonenumber">
|
| | | <el-input
|
| | | v-model="queryParams.phonenumber"
|
| | | placeholder="请è¾å
¥ææºå·ç "
|
| | | clearable
|
| | | size="small"
|
| | | style="width: 240px"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | |
|
| | | <el-row :gutter="10" class="mb8">
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | plain
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="openSelectUser"
|
| | | v-hasPermi="['system:role:add']"
|
| | | >æ·»å ç¨æ·</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | plain
|
| | | icon="el-icon-circle-close"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="cancelAuthUserAll"
|
| | | v-hasPermi="['system:role:remove']"
|
| | | >æ¹éåæ¶ææ</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="warning"
|
| | | plain
|
| | | icon="el-icon-close"
|
| | | size="mini"
|
| | | @click="handleClose"
|
| | | >å
³é</el-button>
|
| | | </el-col>
|
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="ç¨æ·åç§°" prop="userName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç¨æ·æµç§°" prop="nickName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="é®ç®±" prop="email" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ææº" prop="phonenumber" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç¶æ" align="center" prop="status">
|
| | | <template slot-scope="scope">
|
| | | <dict-tag :options="statusOptions" :value="scope.row.status"/>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ parseTime(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width">
|
| | | <template slot-scope="scope">
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-circle-close"
|
| | | @click="cancelAuthUser(scope.row)"
|
| | | v-hasPermi="['system:role:remove']"
|
| | | >åæ¶ææ</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | | <select-user ref="select" :roleId="queryParams.roleId" @ok="handleQuery" />
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role";
|
| | | import selectUser from "./selectUser";
|
| | |
|
| | | export default {
|
| | | name: "AuthUser",
|
| | | components: { selectUser },
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // éä¸ç¨æ·ç»
|
| | | userIds: [],
|
| | | // éå¤ä¸ªç¦ç¨
|
| | | multiple: true,
|
| | | // æ¾ç¤ºæç´¢æ¡ä»¶
|
| | | showSearch: true,
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // ç¨æ·è¡¨æ ¼æ°æ®
|
| | | userList: [],
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | roleId: undefined,
|
| | | userName: undefined,
|
| | | phonenumber: undefined
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | const roleId = this.$route.params && this.$route.params.roleId;
|
| | | if (roleId) {
|
| | | this.queryParams.roleId = roleId;
|
| | | this.getList();
|
| | | this.getDicts("sys_normal_disable").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | /** æ¥è¯¢ææç¨æ·å表 */
|
| | | getList() {
|
| | | this.loading = true;
|
| | | allocatedUserList(this.queryParams).then(response => {
|
| | | this.userList = response.rows;
|
| | | this.total = response.total;
|
| | | this.loading = false;
|
| | | }
|
| | | );
|
| | | },
|
| | | // è¿åæé®
|
| | | handleClose() {
|
| | | this.$store.dispatch("tagsView/delView", this.$route);
|
| | | this.$router.push({ path: "/system/role" });
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.userIds = selection.map(item => item.userId)
|
| | | this.multiple = !selection.length
|
| | | },
|
| | | /** æå¼ææç¨æ·è¡¨å¼¹çª */
|
| | | openSelectUser() {
|
| | | this.$refs.select.show();
|
| | | },
|
| | | /** åæ¶æææé®æä½ */
|
| | | cancelAuthUser(row) {
|
| | | const roleId = this.queryParams.roleId;
|
| | | this.$confirm('确认è¦åæ¶è¯¥ç¨æ·"' + row.userName + '"è§è²åï¼', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(function() {
|
| | | return authUserCancel({ userId: row.userId, roleId: roleId });
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("åæ¶æææå");
|
| | | }).catch(() => {});
|
| | | },
|
| | | /** æ¹éåæ¶æææé®æä½ */
|
| | | cancelAuthUserAll(row) {
|
| | | const roleId = this.queryParams.roleId;
|
| | | const userIds = this.userIds.join(",");
|
| | | this.$confirm('æ¯å¦åæ¶éä¸ç¨æ·æææ°æ®é¡¹?', "è¦å", {
|
| | | confirmButtonText: "ç¡®å®",
|
| | | cancelButtonText: "åæ¶",
|
| | | type: "warning"
|
| | | }).then(() => {
|
| | | return authUserCancelAll({ roleId: roleId, userIds: userIds });
|
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("åæ¶æææå");
|
| | | }).catch(() => {});
|
| | | }
|
| | | }
|
| | | };
|
| | | </script> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <template slot-scope="scope" v-if="scope.row.roleId !== 1"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-circle-check" |
| | | @click="handleDataScope(scope.row)" |
| | | v-hasPermi="['system:role:edit']" |
| | | >æ°æ®æé</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:role:remove']" |
| | | >å é¤</el-button> |
| | | <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"> |
| | | <span class="el-dropdown-link"> |
| | | <i class="el-icon-d-arrow-right el-icon--right"></i>æ´å¤ |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item command="handleDataScope" icon="el-icon-circle-check" |
| | | v-hasPermi="['system:role:edit']">æ°æ®æé</el-dropdown-item> |
| | | <el-dropdown-item command="handleAuthUser" icon="el-icon-user" |
| | | v-hasPermi="['system:role:edit']">åé
ç¨æ·</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | this.single = selection.length!=1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | // æ´å¤æä½è§¦å |
| | | handleCommand(command, row) { |
| | | switch (command) { |
| | | case "handleDataScope": |
| | | this.handleDataScope(row); |
| | | break; |
| | | case "handleAuthUser": |
| | | this.handleAuthUser(row); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | }, |
| | | // æ æéï¼å±å¼/æå ï¼ |
| | | handleCheckedTreeExpand(value, type) { |
| | | if (type == 'menu') { |
| | |
| | | this.title = "åé
æ°æ®æé"; |
| | | }); |
| | | }, |
| | | /** åé
ç¨æ·æä½ */ |
| | | handleAuthUser: function(row) { |
| | | const roleId = row.roleId; |
| | | this.$router.push("/auth/user/" + roleId); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm: function() { |
| | | this.$refs["form"].validate(valid => { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <!-- ææç¨æ· -->
|
| | | <el-dialog title="éæ©ç¨æ·" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
| | | <el-form :model="queryParams" ref="queryForm" :inline="true">
|
| | | <el-form-item label="ç¨æ·åç§°" prop="userName">
|
| | | <el-input
|
| | | v-model="queryParams.userName"
|
| | | placeholder="请è¾å
¥ç¨æ·åç§°"
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item label="ææºå·ç " prop="phonenumber">
|
| | | <el-input
|
| | | v-model="queryParams.phonenumber"
|
| | | placeholder="请è¾å
¥ææºå·ç "
|
| | | clearable
|
| | | size="small"
|
| | | @keyup.enter.native="handleQuery"
|
| | | />
|
| | | </el-form-item>
|
| | | <el-form-item>
|
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button>
|
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | <el-row>
|
| | | <el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
|
| | | <el-table-column type="selection" width="55"></el-table-column>
|
| | | <el-table-column label="ç¨æ·åç§°" prop="userName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç¨æ·æµç§°" prop="nickName" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="é®ç®±" prop="email" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ææº" prop="phonenumber" :show-overflow-tooltip="true" />
|
| | | <el-table-column label="ç¶æ" align="center" prop="status">
|
| | | <template slot-scope="scope">
|
| | | <dict-tag :options="statusOptions" :value="scope.row.status"/>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ parseTime(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | <pagination
|
| | | v-show="total>0"
|
| | | :total="total"
|
| | | :page.sync="queryParams.pageNum"
|
| | | :limit.sync="queryParams.pageSize"
|
| | | @pagination="getList"
|
| | | />
|
| | | </el-row>
|
| | | <div slot="footer" class="dialog-footer">
|
| | | <el-button type="primary" @click="handleSelectUser">ç¡® å®</el-button>
|
| | | <el-button @click="visible = false">å æ¶</el-button>
|
| | | </div>
|
| | | </el-dialog>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { unallocatedUserList, authUserSelectAll } from "@/api/system/role";
|
| | | export default {
|
| | | props: {
|
| | | // è§è²ç¼å·
|
| | | roleId: {
|
| | | type: Number
|
| | | }
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | visible: false,
|
| | | // é䏿°ç»å¼
|
| | | userIds: [],
|
| | | // æ»æ¡æ°
|
| | | total: 0,
|
| | | // æªææç¨æ·æ°æ®
|
| | | userList: [],
|
| | | // ç¶ææ°æ®åå
¸
|
| | | statusOptions: [],
|
| | | // æ¥è¯¢åæ°
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | roleId: undefined,
|
| | | userName: undefined,
|
| | | phonenumber: undefined
|
| | | }
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.getDicts("sys_normal_disable").then(response => {
|
| | | this.statusOptions = response.data;
|
| | | });
|
| | | },
|
| | | methods: {
|
| | | // æ¾ç¤ºå¼¹æ¡
|
| | | show() {
|
| | | this.queryParams.roleId = this.roleId;
|
| | | this.getList();
|
| | | this.visible = true;
|
| | | },
|
| | | clickRow(row) {
|
| | | this.$refs.table.toggleRowSelection(row);
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.userIds = selection.map(item => item.userId);
|
| | | },
|
| | | // æ¥è¯¢è¡¨æ°æ®
|
| | | getList() {
|
| | | unallocatedUserList(this.queryParams).then(res => {
|
| | | this.userList = res.rows;
|
| | | this.total = res.total;
|
| | | });
|
| | | },
|
| | | /** æç´¢æé®æä½ */
|
| | | handleQuery() {
|
| | | this.queryParams.pageNum = 1;
|
| | | this.getList();
|
| | | },
|
| | | /** éç½®æé®æä½ */
|
| | | resetQuery() {
|
| | | this.resetForm("queryForm");
|
| | | this.handleQuery();
|
| | | },
|
| | | /** éæ©ææç¨æ·æä½ */
|
| | | handleSelectUser() {
|
| | | const roleId = this.queryParams.roleId;
|
| | | const userIds = this.userIds.join(",");
|
| | | authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => {
|
| | | this.msgSuccess(res.msg);
|
| | | if (res.code === 200) {
|
| | | this.visible = false;
|
| | | this.$emit("ok");
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | };
|
| | | </script>
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <div class="app-container">
|
| | | <h4 class="form-header h4">åºæ¬ä¿¡æ¯</h4>
|
| | | <el-form ref="form" :model="form" label-width="80px">
|
| | | <el-row>
|
| | | <el-col :span="8" :offset="2">
|
| | | <el-form-item label="ç¨æ·æµç§°" prop="nickName">
|
| | | <el-input v-model="form.nickName" disabled />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | <el-col :span="8" :offset="2">
|
| | | <el-form-item label="ç»å½è´¦å·" prop="phonenumber">
|
| | | <el-input v-model="form.userName" disabled />
|
| | | </el-form-item>
|
| | | </el-col>
|
| | | </el-row>
|
| | | </el-form>
|
| | |
|
| | | <h4 class="form-header h4">è§è²ä¿¡æ¯</h4>
|
| | | <el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
|
| | | <el-table-column label="åºå·" type="index" align="center">
|
| | | <template slot-scope="scope">
|
| | | <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
|
| | | <el-table-column label="è§è²ç¼å·" align="center" prop="roleId" />
|
| | | <el-table-column label="è§è²åç§°" align="center" prop="roleName" />
|
| | | <el-table-column label="æéå符" align="center" prop="roleKey" />
|
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180">
|
| | | <template slot-scope="scope">
|
| | | <span>{{ parseTime(scope.row.createTime) }}</span>
|
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | | |
| | | <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
|
| | |
|
| | | <el-form label-width="100px">
|
| | | <el-form-item style="text-align: center;margin-left:-120px;margin-top:30px;">
|
| | | <el-button type="primary" @click="submitForm()">æäº¤</el-button>
|
| | | <el-button @click="close()">è¿å</el-button>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { getAuthRole, updateAuthRole } from "@/api/system/user";
|
| | |
|
| | | export default {
|
| | | name: "AuthRole",
|
| | | data() {
|
| | | return {
|
| | | // é®ç½©å±
|
| | | loading: true,
|
| | | // å页信æ¯
|
| | | total: 0,
|
| | | pageNum: 1,
|
| | | pageSize: 10,
|
| | | // éä¸è§è²ç¼å·
|
| | | roleIds:[],
|
| | | // è§è²ä¿¡æ¯
|
| | | roles: [],
|
| | | // ç¨æ·ä¿¡æ¯
|
| | | form: {}
|
| | | };
|
| | | },
|
| | | created() {
|
| | | const userId = this.$route.params && this.$route.params.userId;
|
| | | if (userId) {
|
| | | this.loading = true;
|
| | | getAuthRole(userId).then((response) => {
|
| | | this.form = response.user;
|
| | | this.roles = response.roles;
|
| | | this.total = this.roles.length;
|
| | | this.$nextTick(() => {
|
| | | this.roles.forEach((row) => {
|
| | | if (row.flag) {
|
| | | this.$refs.table.toggleRowSelection(row);
|
| | | }
|
| | | });
|
| | | });
|
| | | this.loading = false;
|
| | | });
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | /** åå»éä¸è¡æ°æ® */
|
| | | clickRow(row) {
|
| | | this.$refs.table.toggleRowSelection(row);
|
| | | },
|
| | | // å¤éæ¡é䏿°æ®
|
| | | handleSelectionChange(selection) {
|
| | | this.roleIds = selection.map((item) => item.roleId);
|
| | | },
|
| | | // ä¿åéä¸çæ°æ®ç¼å·
|
| | | getRowKey(row) {
|
| | | return row.roleId;
|
| | | },
|
| | | /** æäº¤æé® */
|
| | | submitForm() {
|
| | | const userId = this.form.userId;
|
| | | const roleIds = this.roleIds.join(",");
|
| | | updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
|
| | | this.msgSuccess("æææå");
|
| | | this.close();
|
| | | });
|
| | | },
|
| | | /** å
³éæé® */
|
| | | close() {
|
| | | this.$store.dispatch("tagsView/delView", this.$route);
|
| | | this.$router.push({ path: "/system/user" });
|
| | | },
|
| | | },
|
| | | };
|
| | | </script> |
| | |
| | | width="160" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <template slot-scope="scope" v-if="scope.row.userId !== 1"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | |
| | | v-hasPermi="['system:user:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | v-if="scope.row.userId !== 1" |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:user:remove']" |
| | | >å é¤</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-key" |
| | | @click="handleResetPwd(scope.row)" |
| | | v-hasPermi="['system:user:resetPwd']" |
| | | >éç½®</el-button> |
| | | <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"> |
| | | <span class="el-dropdown-link"> |
| | | <i class="el-icon-d-arrow-right el-icon--right"></i>æ´å¤ |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item command="handleResetPwd" icon="el-icon-key" |
| | | v-hasPermi="['system:user:resetPwd']">éç½®å¯ç </el-dropdown-item> |
| | | <el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check" |
| | | v-hasPermi="['system:user:edit']">åé
è§è²</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | this.single = selection.length != 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | | // æ´å¤æä½è§¦å |
| | | handleCommand(command, row) { |
| | | switch (command) { |
| | | case "handleResetPwd": |
| | | this.handleResetPwd(row); |
| | | break; |
| | | case "handleAuthRole": |
| | | this.handleAuthRole(row); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | |
| | | }); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** åé
è§è²æä½ */ |
| | | handleAuthRole: function(row) { |
| | | const userId = row.userId; |
| | | this.$router.push("/auth/role/" + userId); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm: function() { |
| | | this.$refs["form"].validate(valid => { |