| | |
| | | RequestContext.getCurrentInstance().execute("PF('dialog').show()"); |
| | | } |
| | | |
| | | public void btnPermissionClick() { |
| | | if (this.selectedList == null |
| | | || this.selectedList.size() == 0) { |
| | | FacesUtils.warn("请选择数据。"); |
| | | return; |
| | | } |
| | | if (this.selectedList.size() > 1) { |
| | | FacesUtils.warn("只能选择一个数据进行修改。"); |
| | | return; |
| | | } |
| | | this.baseRole = this.baseRoleService.getBaseRole(this.selectedList.get(0).getId()); |
| | | RequestContext.getCurrentInstance().execute("PF('btnDialog').show()"); |
| | | } |
| | | |
| | | public void userPermissionClick() { |
| | | if (this.selectedList == null |
| | | || this.selectedList.size() == 0) { |
| | | FacesUtils.warn("请选择数据。"); |
| | | return; |
| | | } |
| | | if (this.selectedList.size() > 1) { |
| | | FacesUtils.warn("只能选择一个数据进行修改。"); |
| | | return; |
| | | } |
| | | this.baseRole = this.baseRoleService.getBaseRole(this.selectedList.get(0).getId()); |
| | | RequestContext.getCurrentInstance().execute("PF('userDialog').show()"); |
| | | } |
| | | |
| | | public void onSaveBtnClick() { |
| | | try { |
| | | // 新建 |
| | |
| | | FacesUtils.warn("请选择角色权限。"); |
| | | return; |
| | | } |
| | | |
| | | baseRole.setUserPermission("自己"); |
| | | baseRole.setBtnPermission("新增,修改,删除,导入"); |
| | | this.baseRoleService.insertBaseRole(this.baseRole); |
| | | |
| | | FacesUtils.info("新建成功。"); |
| | |
| | | FacesUtils.warn("操作失败。"); |
| | | } |
| | | } |
| | | /** |
| | | * 人员管理按钮权限修改 |
| | | */ |
| | | public void onSaveBtnPermission() { |
| | | try { |
| | | if (this.baseRole == null) { |
| | | FacesUtils.warn("修改对象为空。"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (this.baseRole.getBtnPermissions() == null || this.baseRole.getBtnPermissions().size() == 0) { |
| | | FacesUtils.warn("请选择功能。"); |
| | | return; |
| | | } |
| | | |
| | | this.baseRoleService.updateUserMngPageBtn(this.baseRole); |
| | | |
| | | FacesUtils.info("修改成功。"); |
| | | RequestContext.getCurrentInstance().execute("PF('btnDialog').hide()"); |
| | | } catch (Exception e) { |
| | | logger.error("操作失败。", e); |
| | | FacesUtils.warn("操作失败。"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 人员管理人员可见权限修改 |
| | | */ |
| | | public void onSaveUserPermission() { |
| | | try { |
| | | if (this.baseRole == null) { |
| | | FacesUtils.warn("修改对象为空。"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (this.baseRole.getUserPermission() == null) { |
| | | FacesUtils.warn("请选择可见范围。"); |
| | | return; |
| | | } |
| | | |
| | | this.baseRoleService.updateUserMngPageBtn(this.baseRole); |
| | | |
| | | FacesUtils.info("修改成功。"); |
| | | RequestContext.getCurrentInstance().execute("PF('userDialog').hide()"); |
| | | } catch (Exception e) { |
| | | logger.error("操作失败。", e); |
| | | FacesUtils.warn("操作失败。"); |
| | | } |
| | | } |
| | | |
| | | public void onDeleteBtnClick() { |
| | | try { |