mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 17:38:32 +08:00
调整
This commit is contained in:
parent
6d11ee4e9c
commit
b57707aaa4
@ -32,15 +32,6 @@ import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
/*
|
||||
ID varchar(40) not null,
|
||||
UID varchar(40) null,
|
||||
APPID varchar(40) null,
|
||||
USERNAME varchar(60) null,
|
||||
PASSWORD varchar(60) null,
|
||||
STATUS char(1) null
|
||||
constraint PK_ROLES primary key clustered (ID)
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_ACCOUNTS")
|
||||
public class Accounts extends JpaEntity implements Serializable {
|
||||
|
||||
@ -19,6 +19,8 @@ package org.dromara.maxkey.entity;
|
||||
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -29,7 +31,7 @@ import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_EMAIL_SENDERS")
|
||||
public class EmailSenders extends JpaEntity{
|
||||
public class EmailSenders extends JpaEntity implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -26,7 +26,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ExtraAttrs {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ExtraAttrs.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(ExtraAttrs.class);
|
||||
|
||||
ArrayList <ExtraAttr> extraAttrs ;
|
||||
|
||||
@ -43,7 +43,7 @@ public class ExtraAttrs {
|
||||
*/
|
||||
public ExtraAttrs(String arrayJsonString) {
|
||||
String extraAttrsJsonString= "{\"extraAttrs\":"+arrayJsonString+"}";
|
||||
_logger.debug("Extra Attrs Json String " +extraAttrsJsonString);
|
||||
_logger.debug("Extra Attrs Json String {}" ,extraAttrsJsonString);
|
||||
ExtraAttrs extraAttrs=JsonUtils.gsonStringToObject(extraAttrsJsonString, ExtraAttrs.class);
|
||||
this.extraAttrs=extraAttrs.getExtraAttrs();
|
||||
}
|
||||
@ -52,21 +52,21 @@ public class ExtraAttrs {
|
||||
|
||||
public void put(String attr,String value) {
|
||||
if(extraAttrs==null){
|
||||
extraAttrs=new ArrayList<ExtraAttr>();
|
||||
extraAttrs=new ArrayList<>();
|
||||
}
|
||||
this.extraAttrs.add(new ExtraAttr(attr,value));
|
||||
}
|
||||
|
||||
public void put(String attr,String type,String value) {
|
||||
if(extraAttrs==null){
|
||||
extraAttrs=new ArrayList<ExtraAttr>();
|
||||
extraAttrs=new ArrayList<>();
|
||||
}
|
||||
this.extraAttrs.add(new ExtraAttr(attr,type,value));
|
||||
}
|
||||
|
||||
public String get(String attr) {
|
||||
String value=null;
|
||||
if(extraAttrs!=null&& extraAttrs.size()!=0){
|
||||
if(extraAttrs!=null&& !extraAttrs.isEmpty()){
|
||||
for(ExtraAttr extraAttr :extraAttrs){
|
||||
if(extraAttr.getAttr().equals(attr)){
|
||||
value=extraAttr.getValue();
|
||||
@ -78,7 +78,7 @@ public class ExtraAttrs {
|
||||
|
||||
public String toJsonString(){
|
||||
String jsonString =JsonUtils.gsonToString(extraAttrs);
|
||||
_logger.debug("jsonString " +jsonString);
|
||||
_logger.debug("jsonString {}" ,jsonString);
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public class ExtraAttrs {
|
||||
for(ExtraAttr extraAttr :extraAttrs){
|
||||
extraAttrsHashMap.put(extraAttr.getAttr(), extraAttr.getValue());
|
||||
}
|
||||
_logger.debug("extraAttrs HashMap " +extraAttrsHashMap);
|
||||
_logger.debug("extraAttrs HashMap {}" , extraAttrsHashMap);
|
||||
return extraAttrsHashMap;
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class ExtraAttrs {
|
||||
for(ExtraAttr extraAttr :extraAttrs){
|
||||
properties.put(extraAttr.getAttr(), extraAttr.getValue());
|
||||
}
|
||||
_logger.debug("extraAttrs HashMap " +properties);
|
||||
_logger.debug("extraAttrs HashMap {}" , properties);
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,211 @@
|
||||
/*
|
||||
* Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package org.dromara.maxkey.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_ROLE_MEMBER")
|
||||
public class GroupMember extends UserInfo implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -8059639972590554760L;
|
||||
@Id
|
||||
@Column
|
||||
@GeneratedValue
|
||||
String id;
|
||||
@Column
|
||||
private String groupId;
|
||||
private String groupName;
|
||||
private String category;
|
||||
@Column
|
||||
private String memberId;
|
||||
private String memberName;
|
||||
@Column
|
||||
private String type;//User or Group
|
||||
|
||||
@Column
|
||||
private String instId;
|
||||
|
||||
private String instName;
|
||||
|
||||
public GroupMember(){
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param groupId
|
||||
* @param memberId
|
||||
* @param type
|
||||
*/
|
||||
public GroupMember(String groupId, String memberId, String type , String instId) {
|
||||
super();
|
||||
this.groupId = groupId;
|
||||
this.memberId = memberId;
|
||||
this.type = type;
|
||||
this.instId = instId;
|
||||
}
|
||||
|
||||
|
||||
public GroupMember(String groupId, String groupName, String memberId,
|
||||
String memberName, String type , String instId) {
|
||||
super();
|
||||
this.groupId = groupId;
|
||||
this.groupName = groupName;
|
||||
this.memberId = memberId;
|
||||
this.memberName = memberName;
|
||||
this.type = type;
|
||||
this.instId = instId;
|
||||
}
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the memberId
|
||||
*/
|
||||
public String getMemberId() {
|
||||
return memberId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param memberId the memberId to set
|
||||
*/
|
||||
public void setMemberId(String memberId) {
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type the type to set
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getMemberName() {
|
||||
return memberName;
|
||||
}
|
||||
|
||||
public void setMemberName(String memberName) {
|
||||
this.memberName = memberName;
|
||||
}
|
||||
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
|
||||
public String getInstId() {
|
||||
return instId;
|
||||
}
|
||||
|
||||
|
||||
public void setInstId(String instId) {
|
||||
this.instId = instId;
|
||||
}
|
||||
|
||||
|
||||
public String getInstName() {
|
||||
return instName;
|
||||
}
|
||||
|
||||
|
||||
public void setInstName(String instName) {
|
||||
this.instName = instName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("GroupMember [id=");
|
||||
builder.append(id);
|
||||
builder.append(", groupId=");
|
||||
builder.append(groupId);
|
||||
builder.append(", groupName=");
|
||||
builder.append(groupName);
|
||||
builder.append(", category=");
|
||||
builder.append(category);
|
||||
builder.append(", memberId=");
|
||||
builder.append(memberId);
|
||||
builder.append(", memberName=");
|
||||
builder.append(memberName);
|
||||
builder.append(", type=");
|
||||
builder.append(type);
|
||||
builder.append(", instId=");
|
||||
builder.append(instId);
|
||||
builder.append(", instName=");
|
||||
builder.append(instName);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -29,16 +29,9 @@ import jakarta.persistence.Table;
|
||||
|
||||
import org.dromara.maxkey.entity.apps.Apps;
|
||||
|
||||
|
||||
/*
|
||||
ID varchar(40) not null,
|
||||
ROLEID varchar(40) null,
|
||||
MENUID varchar(40) null
|
||||
constraint PK_ROLES primary key clustered (ID)
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_ROLE_PERMISSIONS")
|
||||
public class RolePermissions extends Apps implements Serializable{
|
||||
public class GroupPermissions extends Apps implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
@ -49,9 +42,9 @@ public class RolePermissions extends Apps implements Serializable{
|
||||
@GeneratedValue
|
||||
String id;
|
||||
@Column
|
||||
private String roleId;
|
||||
private String groupId;
|
||||
|
||||
private String roleName;
|
||||
private String groupName;
|
||||
|
||||
@Column
|
||||
private String appId;
|
||||
@ -63,7 +56,7 @@ public class RolePermissions extends Apps implements Serializable{
|
||||
|
||||
private String instName;
|
||||
|
||||
public RolePermissions(){
|
||||
public GroupPermissions(){
|
||||
super();
|
||||
}
|
||||
|
||||
@ -72,31 +65,32 @@ public class RolePermissions extends Apps implements Serializable{
|
||||
* @param groupId
|
||||
* @param appId
|
||||
*/
|
||||
public RolePermissions(String roleId, String appId, String instId) {
|
||||
public GroupPermissions(String groupId, String appId, String instId) {
|
||||
super();
|
||||
this.roleId = roleId;
|
||||
this.groupId = groupId;
|
||||
this.appId = appId;
|
||||
this.instId = instId;
|
||||
}
|
||||
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
|
||||
@ -158,12 +152,12 @@ public class RolePermissions extends Apps implements Serializable{
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("RolePermissions [id=");
|
||||
builder.append("GroupPermissions [id=");
|
||||
builder.append(id);
|
||||
builder.append(", roleId=");
|
||||
builder.append(roleId);
|
||||
builder.append(", roleName=");
|
||||
builder.append(roleName);
|
||||
builder.append(", groupId=");
|
||||
builder.append(groupId);
|
||||
builder.append(", groupName=");
|
||||
builder.append(groupName);
|
||||
builder.append(", appId=");
|
||||
builder.append(appId);
|
||||
builder.append(", appName=");
|
||||
@ -29,8 +29,8 @@ import org.dromara.maxkey.constants.ConstsStatus;
|
||||
import org.dromara.maxkey.web.WebContext;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_ROLE_PRIVILEGES")
|
||||
public class RolePrivileges extends JpaEntity implements Serializable {
|
||||
@Table(name = "MXK_GROUP_PRIVILEGES")
|
||||
public class GroupPrivileges extends JpaEntity implements Serializable {
|
||||
private static final long serialVersionUID = -8783585691243853899L;
|
||||
|
||||
@Id
|
||||
@ -40,7 +40,7 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
||||
@Column
|
||||
String appId;
|
||||
@Column
|
||||
String roleId;
|
||||
String groupId;
|
||||
@Column
|
||||
String resourceId;
|
||||
|
||||
@ -50,25 +50,25 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
||||
|
||||
private String instName;
|
||||
|
||||
public RolePrivileges() {
|
||||
public GroupPrivileges() {
|
||||
}
|
||||
|
||||
public RolePrivileges(String appId, String roleId, String instId) {
|
||||
public GroupPrivileges(String appId, String groupId, String instId) {
|
||||
this.appId = appId;
|
||||
this.roleId = roleId;
|
||||
this.groupId = groupId;
|
||||
this.instId = instId;
|
||||
}
|
||||
|
||||
/**
|
||||
* .
|
||||
* @param appId String
|
||||
* @param roleId String
|
||||
* @param groupId String
|
||||
* @param resourceId String
|
||||
*/
|
||||
public RolePrivileges(String appId, String roleId, String resourceId , String instId) {
|
||||
public GroupPrivileges(String appId, String groupId, String resourceId , String instId) {
|
||||
this.id = WebContext.genId();
|
||||
this.appId = appId;
|
||||
this.roleId = roleId;
|
||||
this.groupId = groupId;
|
||||
this.resourceId = resourceId;
|
||||
this.instId = instId;
|
||||
}
|
||||
@ -89,15 +89,15 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public String getRoleId() {
|
||||
return roleId;
|
||||
}
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setRoleId(String roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getResourceId() {
|
||||
public String getResourceId() {
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
||||
}
|
||||
|
||||
public String getUniqueId() {
|
||||
return appId + "_" + roleId + "_" + resourceId;
|
||||
return appId + "_" + groupId + "_" + resourceId;
|
||||
}
|
||||
|
||||
public String getInstId() {
|
||||
@ -140,8 +140,8 @@ public class RolePrivileges extends JpaEntity implements Serializable {
|
||||
builder.append(id);
|
||||
builder.append(", appId=");
|
||||
builder.append(appId);
|
||||
builder.append(", roleId=");
|
||||
builder.append(roleId);
|
||||
builder.append(", groupId=");
|
||||
builder.append(groupId);
|
||||
builder.append(", resourceId=");
|
||||
builder.append(resourceId);
|
||||
builder.append(", status=");
|
||||
302
maxkey-core/src/main/java/org/dromara/maxkey/entity/Groups.java
Normal file
302
maxkey-core/src/main/java/org/dromara/maxkey/entity/Groups.java
Normal file
@ -0,0 +1,302 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package org.dromara.maxkey.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_GROUPS")
|
||||
public class Groups extends JpaEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4660258495864814777L;
|
||||
|
||||
public class Category{
|
||||
public static final String DYNAMIC = "dynamic";
|
||||
|
||||
public static final String STATIC = "static";
|
||||
|
||||
public static final String APP = "app";
|
||||
}
|
||||
|
||||
|
||||
@Id
|
||||
@Column
|
||||
@GeneratedValue
|
||||
String id;
|
||||
|
||||
@Length(max = 60)
|
||||
@Column
|
||||
String groupCode;
|
||||
|
||||
@Length(max = 60)
|
||||
@Column
|
||||
String groupName;
|
||||
|
||||
@Column
|
||||
String category;
|
||||
|
||||
@Column
|
||||
String filters ;
|
||||
|
||||
@Column
|
||||
String orgIdsList;
|
||||
@Column
|
||||
String resumeTime;
|
||||
@Column
|
||||
String suspendTime;
|
||||
|
||||
@Column
|
||||
int isdefault;
|
||||
@Column
|
||||
String description;
|
||||
@Column
|
||||
String createdBy;
|
||||
@Column
|
||||
String createdDate;
|
||||
@Column
|
||||
String modifiedBy;
|
||||
@Column
|
||||
String modifiedDate;
|
||||
@Column
|
||||
int status;
|
||||
|
||||
@Column
|
||||
private String instId;
|
||||
|
||||
private String instName;
|
||||
|
||||
public Groups() {
|
||||
}
|
||||
|
||||
public Groups(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Groups.
|
||||
* @param id String
|
||||
* @param name String
|
||||
* @param isdefault int
|
||||
*/
|
||||
public Groups(String id,String groupCode, String groupName, int isdefault) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.groupCode = groupCode;
|
||||
this.groupName = groupName;
|
||||
this.isdefault = isdefault;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getGroupCode() {
|
||||
return groupCode;
|
||||
}
|
||||
|
||||
public void setGroupCode(String groupCode) {
|
||||
this.groupCode = groupCode;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public int getIsdefault() {
|
||||
return isdefault;
|
||||
}
|
||||
|
||||
public void setIsdefault(int isdefault) {
|
||||
this.isdefault = isdefault;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
public void setCreatedDate(String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
public String getModifiedBy() {
|
||||
return modifiedBy;
|
||||
}
|
||||
|
||||
public void setModifiedBy(String modifiedBy) {
|
||||
this.modifiedBy = modifiedBy;
|
||||
}
|
||||
|
||||
public String getModifiedDate() {
|
||||
return modifiedDate;
|
||||
}
|
||||
|
||||
public void setModifiedDate(String modifiedDate) {
|
||||
this.modifiedDate = modifiedDate;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* ROLE_ALL_USER must be
|
||||
* 1, dynamic
|
||||
* 2, all orgIdsList
|
||||
* 3, not filters
|
||||
*/
|
||||
public void setDefaultAllUser() {
|
||||
this.category = "dynamic";
|
||||
this.orgIdsList ="";
|
||||
this.filters ="";
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
public void setFilters(String filters) {
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
public String getOrgIdsList() {
|
||||
return orgIdsList;
|
||||
}
|
||||
|
||||
public void setOrgIdsList(String orgIdsList) {
|
||||
this.orgIdsList = orgIdsList;
|
||||
}
|
||||
|
||||
public String getResumeTime() {
|
||||
return resumeTime;
|
||||
}
|
||||
|
||||
public void setResumeTime(String resumeTime) {
|
||||
this.resumeTime = resumeTime;
|
||||
}
|
||||
|
||||
public String getSuspendTime() {
|
||||
return suspendTime;
|
||||
}
|
||||
|
||||
public void setSuspendTime(String suspendTime) {
|
||||
this.suspendTime = suspendTime;
|
||||
}
|
||||
|
||||
public String getInstId() {
|
||||
return instId;
|
||||
}
|
||||
|
||||
public void setInstId(String instId) {
|
||||
this.instId = instId;
|
||||
}
|
||||
|
||||
public String getInstName() {
|
||||
return instName;
|
||||
}
|
||||
|
||||
public void setInstName(String instName) {
|
||||
this.instName = instName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("Groups [id=");
|
||||
builder.append(id);
|
||||
builder.append(", groupCode=");
|
||||
builder.append(groupCode);
|
||||
builder.append(", groupName=");
|
||||
builder.append(groupName);
|
||||
builder.append(", category=");
|
||||
builder.append(category);
|
||||
builder.append(", filters=");
|
||||
builder.append(filters);
|
||||
builder.append(", orgIdsList=");
|
||||
builder.append(orgIdsList);
|
||||
builder.append(", resumeTime=");
|
||||
builder.append(resumeTime);
|
||||
builder.append(", suspendTime=");
|
||||
builder.append(suspendTime);
|
||||
builder.append(", isdefault=");
|
||||
builder.append(isdefault);
|
||||
builder.append(", description=");
|
||||
builder.append(description);
|
||||
builder.append(", createdBy=");
|
||||
builder.append(createdBy);
|
||||
builder.append(", createdDate=");
|
||||
builder.append(createdDate);
|
||||
builder.append(", modifiedBy=");
|
||||
builder.append(modifiedBy);
|
||||
builder.append(", modifiedDate=");
|
||||
builder.append(modifiedDate);
|
||||
builder.append(", status=");
|
||||
builder.append(status);
|
||||
builder.append(", instId=");
|
||||
builder.append(instId);
|
||||
builder.append(", instName=");
|
||||
builder.append(instName);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
package org.dromara.maxkey.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -31,7 +33,7 @@ import jakarta.persistence.Table;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_HISTORY_LOGIN_APPS")
|
||||
public class HistoryLoginApps extends JpaEntity {
|
||||
public class HistoryLoginApps extends JpaEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5085201575292304749L;
|
||||
@Id
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
package org.dromara.maxkey.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -27,7 +29,7 @@ import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_REGISTER")
|
||||
public class Register extends JpaEntity{
|
||||
public class Register extends JpaEntity implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -27,13 +27,6 @@ import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
|
||||
/*
|
||||
ID varchar(40) not null,
|
||||
APPROLEID varchar(40) null,
|
||||
USERID varchar(40) null
|
||||
constraint PK_ROLES primary key clustered (ID)
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_ROLE_MEMBER")
|
||||
public class RoleMember extends UserInfo implements Serializable{
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
package org.dromara.maxkey.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -31,7 +33,7 @@ import jakarta.persistence.Table;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_SOCIALS_ASSOCIATE")
|
||||
public class SocialsAssociate extends JpaEntity {
|
||||
public class SocialsAssociate extends JpaEntity implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
package org.dromara.maxkey.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
@ -36,7 +37,7 @@ import org.dromara.maxkey.util.DateUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_SYNCHRO_RELATED")
|
||||
public class SynchroRelated extends JpaEntity {
|
||||
public class SynchroRelated extends JpaEntity implements Serializable {
|
||||
private static final long serialVersionUID = 6993697309055585706L;
|
||||
|
||||
@Id
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
package org.dromara.maxkey.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@ -39,7 +41,7 @@ import org.dromara.maxkey.util.StringUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_USERINFO")
|
||||
public class UserInfo extends JpaEntity {
|
||||
public class UserInfo extends JpaEntity implements Serializable {
|
||||
private static final long serialVersionUID = 6402443942083382236L;
|
||||
|
||||
public static final String CLASS_TYPE = "UserInfo";
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
package org.dromara.maxkey.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -27,7 +29,7 @@ import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_USERINFO_ADJUNCT")
|
||||
public class UserInfoAdjoint extends JpaEntity {
|
||||
public class UserInfoAdjoint extends JpaEntity implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
package org.dromara.maxkey.entity.apps;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -27,7 +29,7 @@ import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_APPS_CAS_DETAILS")
|
||||
public class AppsCasDetails extends Apps {
|
||||
public class AppsCasDetails extends Apps implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
package org.dromara.maxkey.entity.apps;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -27,7 +29,7 @@ import jakarta.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_APPS_EXTENDAPI_DETAILS")
|
||||
public class AppsExtendApiDetails extends Apps {
|
||||
public class AppsExtendApiDetails extends Apps implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
|
||||
package org.dromara.maxkey.entity.apps;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -31,7 +33,7 @@ import jakarta.persistence.Table;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_APPS_FORM_BASED_DETAILS")
|
||||
public class AppsFormBasedDetails extends Apps {
|
||||
public class AppsFormBasedDetails extends Apps implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
*/
|
||||
package org.dromara.maxkey.entity.apps;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -34,7 +36,7 @@ import jakarta.persistence.Table;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_APPS_JWT_DETAILS")
|
||||
public class AppsJwtDetails extends Apps {
|
||||
public class AppsJwtDetails extends Apps implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -25,12 +25,14 @@ import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.maxkey.entity.apps.oauth2.provider.client.BaseClientDetails;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "MXK_APPS_OAUTH_CLIENT_DETAILS")
|
||||
public class AppsOAuth20Details extends Apps {
|
||||
public class AppsOAuth20Details extends Apps implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
package org.dromara.maxkey.entity.apps;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
@ -33,7 +34,7 @@ import jakarta.persistence.Table;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_APPS_SAML_V20_DETAILS")
|
||||
public class AppsSAML20Details extends Apps {
|
||||
public class AppsSAML20Details extends Apps implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
*/
|
||||
package org.dromara.maxkey.entity.apps;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.dromara.mybatis.jpa.entity.JpaEntity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@ -34,7 +36,7 @@ import jakarta.persistence.Table;
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "MXK_APPS_TOKEN_BASED_DETAILS")
|
||||
public class AppsTokenBasedDetails extends Apps {
|
||||
public class AppsTokenBasedDetails extends Apps implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -52,7 +52,7 @@ public class LoginRepository {
|
||||
|
||||
|
||||
|
||||
private static final String ROLES_SELECT_STATEMENT = "select distinct r.id,r.rolecode,r.rolename from mxk_userinfo u,mxk_roles r,mxk_role_member rm where u.id = ? and u.id=rm.memberid and rm.roleid=r.id ";
|
||||
private static final String ROLES_SELECT_STATEMENT = "select distinct g.id,g.groupcode,g.groupname from mxk_userinfo u,mxk_groups g,mxk_group_member gm where u.id = ? and u.id=gm.memberid and gm.groupid=g.id ";
|
||||
|
||||
private static final String DEFAULT_USERINFO_SELECT_STATEMENT = "select * from mxk_userinfo where username = ? ";
|
||||
|
||||
@ -60,7 +60,7 @@ public class LoginRepository {
|
||||
|
||||
private static final String DEFAULT_USERINFO_SELECT_STATEMENT_USERNAME_MOBILE_EMAIL = "select * from mxk_userinfo where (username = ? or mobile = ? or email = ?) ";
|
||||
|
||||
private static final String DEFAULT_MYAPPS_SELECT_STATEMENT = "select distinct app.id,app.appname from mxk_apps app,mxk_role_permissions pm,mxk_roles r where app.id=pm.appid and app.status = 1 and pm.roleid=r.id and r.id in(%s)";
|
||||
private static final String DEFAULT_MYAPPS_SELECT_STATEMENT = "select distinct app.id,app.appname from mxk_apps app,mxk_group_permissions gp,mxk_groups g where app.id=gp.appid and app.status = 1 and gp.groupid=g.id and g.id in(%s)";
|
||||
|
||||
protected JdbcTemplate jdbcTemplate;
|
||||
|
||||
@ -215,7 +215,7 @@ public class LoginRepository {
|
||||
public List<Roles> queryRoles(UserInfo userInfo) {
|
||||
List<Roles> listRoles = jdbcTemplate.query(ROLES_SELECT_STATEMENT, new RowMapper<Roles>() {
|
||||
public Roles mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
Roles role = new Roles(rs.getString("id"), rs.getString("rolecode"),rs.getString("rolename"), 0);
|
||||
Roles role = new Roles(rs.getString("id"), rs.getString("groupcode"),rs.getString("groupname"), 0);
|
||||
|
||||
return role;
|
||||
}
|
||||
|
||||
@ -22,6 +22,8 @@ package org.dromara.maxkey.persistence.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.entity.GroupMember;
|
||||
import org.dromara.maxkey.entity.Groups;
|
||||
import org.dromara.maxkey.entity.RoleMember;
|
||||
import org.dromara.maxkey.entity.Roles;
|
||||
import org.dromara.maxkey.entity.UserInfo;
|
||||
@ -32,20 +34,20 @@ import org.dromara.mybatis.jpa.IJpaMapper;
|
||||
*
|
||||
*/
|
||||
|
||||
public interface RoleMemberMapper extends IJpaMapper<RoleMember> {
|
||||
public interface GroupMemberMapper extends IJpaMapper<GroupMember> {
|
||||
|
||||
public List<RoleMember> memberInRole(RoleMember entity);
|
||||
public List<RoleMember> memberNotInRole(RoleMember entity);
|
||||
public List<GroupMember> memberIn(GroupMember entity);
|
||||
public List<GroupMember> memberNotIn(GroupMember entity);
|
||||
|
||||
public List<Roles> rolesNoMember(RoleMember entity);
|
||||
public List<Groups> noMember(GroupMember entity);
|
||||
|
||||
public int addDynamicRoleMember(Roles dynamicRole);
|
||||
public int addDynamicMember(Groups dynamicRole);
|
||||
|
||||
public int deleteDynamicRoleMember(Roles dynamicRole);
|
||||
public int deleteDynamicMember(Groups dynamicRole);
|
||||
|
||||
public int deleteByRoleId(String roleId);
|
||||
public int deleteByGroupId(String groupId);
|
||||
|
||||
public List<UserInfo> queryMemberByRoleId(String roleId);
|
||||
public List<UserInfo> queryMemberByGroupId(String groupId);
|
||||
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ package org.dromara.maxkey.persistence.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.entity.RolePermissions;
|
||||
import org.dromara.maxkey.entity.GroupPermissions;
|
||||
import org.dromara.mybatis.jpa.IJpaMapper;
|
||||
|
||||
/**
|
||||
@ -30,12 +30,12 @@ import org.dromara.mybatis.jpa.IJpaMapper;
|
||||
*
|
||||
*/
|
||||
|
||||
public interface RolePermissionsMapper extends IJpaMapper<RolePermissions> {
|
||||
public interface GroupPermissionsMapper extends IJpaMapper<GroupPermissions> {
|
||||
|
||||
public List<RolePermissions>appsInRole(RolePermissions entity);
|
||||
public List<GroupPermissions>appsInGroup(GroupPermissions entity);
|
||||
|
||||
|
||||
public List<RolePermissions> appsNotInRole(RolePermissions entity);
|
||||
public List<GroupPermissions> appsNotInGroup(GroupPermissions entity);
|
||||
|
||||
|
||||
}
|
||||
@ -22,7 +22,7 @@ package org.dromara.maxkey.persistence.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.entity.RolePrivileges;
|
||||
import org.dromara.maxkey.entity.GroupPrivileges;
|
||||
import org.dromara.mybatis.jpa.IJpaMapper;
|
||||
|
||||
/**
|
||||
@ -30,12 +30,12 @@ import org.dromara.mybatis.jpa.IJpaMapper;
|
||||
*
|
||||
*/
|
||||
|
||||
public interface RolePrivilegesMapper extends IJpaMapper<RolePrivileges> {
|
||||
public interface GroupPrivilegesMapper extends IJpaMapper<GroupPrivileges> {
|
||||
|
||||
public int insertRolePrivileges(List<RolePrivileges> rolePermissionsList);
|
||||
public int insertGroupPrivileges(List<GroupPrivileges> groupPrivilegesList);
|
||||
|
||||
public int deleteRolePrivileges(List<RolePrivileges> rolePermissionsList);
|
||||
public int deleteGroupPrivileges(List<GroupPrivileges> groupPrivilegesList);
|
||||
|
||||
public List<RolePrivileges> queryRolePrivileges(RolePrivileges rolePermissions);
|
||||
public List<GroupPrivileges> queryGroupPrivileges(GroupPrivileges groupPrivileges);
|
||||
|
||||
}
|
||||
@ -22,7 +22,7 @@ package org.dromara.maxkey.persistence.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.entity.Roles;
|
||||
import org.dromara.maxkey.entity.Groups;
|
||||
import org.dromara.mybatis.jpa.IJpaMapper;
|
||||
|
||||
/**
|
||||
@ -30,9 +30,9 @@ import org.dromara.mybatis.jpa.IJpaMapper;
|
||||
*
|
||||
*/
|
||||
|
||||
public interface RolesMapper extends IJpaMapper<Roles> {
|
||||
public interface GroupsMapper extends IJpaMapper<Groups> {
|
||||
|
||||
public List<Roles> queryDynamicRoles(Roles groups);
|
||||
public List<Groups> queryDynamic(Groups groups);
|
||||
|
||||
public List<Roles> queryRolesByUserId(String userId);
|
||||
public List<Groups> queryByUserId(String userId);
|
||||
}
|
||||
@ -19,10 +19,10 @@ package org.dromara.maxkey.persistence.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.entity.RoleMember;
|
||||
import org.dromara.maxkey.entity.Roles;
|
||||
import org.dromara.maxkey.entity.GroupMember;
|
||||
import org.dromara.maxkey.entity.Groups;
|
||||
import org.dromara.maxkey.entity.UserInfo;
|
||||
import org.dromara.maxkey.persistence.mapper.RoleMemberMapper;
|
||||
import org.dromara.maxkey.persistence.mapper.GroupMemberMapper;
|
||||
import org.dromara.mybatis.jpa.JpaService;
|
||||
import org.dromara.mybatis.jpa.entity.JpaPageResults;
|
||||
import org.slf4j.Logger;
|
||||
@ -30,46 +30,46 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class RoleMemberService extends JpaService<RoleMember>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(RoleMemberService.class);
|
||||
public class GroupMemberService extends JpaService<GroupMember>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(GroupMemberService.class);
|
||||
|
||||
public RoleMemberService() {
|
||||
super(RoleMemberMapper.class);
|
||||
public GroupMemberService() {
|
||||
super(GroupMemberMapper.class);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.connsec.db.service.BaseService#getMapper()
|
||||
*/
|
||||
@Override
|
||||
public RoleMemberMapper getMapper() {
|
||||
return (RoleMemberMapper)super.getMapper();
|
||||
public GroupMemberMapper getMapper() {
|
||||
return (GroupMemberMapper)super.getMapper();
|
||||
}
|
||||
|
||||
public int addDynamicRoleMember(Roles dynamicGroup) {
|
||||
return getMapper().addDynamicRoleMember(dynamicGroup);
|
||||
public int addDynamicMember(Groups dynamicGroup) {
|
||||
return getMapper().addDynamicMember(dynamicGroup);
|
||||
}
|
||||
|
||||
public int deleteDynamicRoleMember(Roles dynamicGroup) {
|
||||
return getMapper().deleteDynamicRoleMember(dynamicGroup);
|
||||
public int deleteDynamicMember(Groups dynamicGroup) {
|
||||
return getMapper().deleteDynamicMember(dynamicGroup);
|
||||
}
|
||||
|
||||
public int deleteByRoleId(String groupId) {
|
||||
return getMapper().deleteByRoleId(groupId);
|
||||
public int deleteByGroupId(String groupId) {
|
||||
return getMapper().deleteByGroupId(groupId);
|
||||
}
|
||||
|
||||
public List<UserInfo> queryMemberByRoleId(String groupId){
|
||||
return getMapper().queryMemberByRoleId(groupId);
|
||||
public List<UserInfo> queryMemberByGroupId(String groupId){
|
||||
return getMapper().queryMemberByGroupId(groupId);
|
||||
}
|
||||
|
||||
|
||||
public JpaPageResults<Roles> rolesNoMember(RoleMember entity) {
|
||||
public JpaPageResults<Groups> noMember(GroupMember entity) {
|
||||
entity.setPageResultSelectUUID(entity.generateId());
|
||||
entity.setStartRow(calculateStartRow(entity.getPageNumber() ,entity.getPageSize()));
|
||||
|
||||
entity.setPageable(true);
|
||||
List<Roles> resultslist = null;
|
||||
List<Groups> resultslist = null;
|
||||
try {
|
||||
resultslist = getMapper().rolesNoMember(entity);
|
||||
resultslist = getMapper().noMember(entity);
|
||||
} catch (Exception e) {
|
||||
_logger.error("queryPageResults Exception " , e);
|
||||
}
|
||||
@ -83,7 +83,7 @@ public class RoleMemberService extends JpaService<RoleMember>{
|
||||
totalCount = parseCount(getMapper().fetchPageResults(entity));
|
||||
}
|
||||
|
||||
return new JpaPageResults<Roles>(entity.getPageNumber(),entity.getPageSize(),totalPage,totalCount,resultslist);
|
||||
return new JpaPageResults<Groups>(entity.getPageNumber(),entity.getPageSize(),totalPage,totalCount,resultslist);
|
||||
}
|
||||
|
||||
}
|
||||
@ -17,16 +17,16 @@
|
||||
|
||||
package org.dromara.maxkey.persistence.service;
|
||||
|
||||
import org.dromara.maxkey.entity.RolePermissions;
|
||||
import org.dromara.maxkey.persistence.mapper.RolePermissionsMapper;
|
||||
import org.dromara.maxkey.entity.GroupPermissions;
|
||||
import org.dromara.maxkey.persistence.mapper.GroupPermissionsMapper;
|
||||
import org.dromara.mybatis.jpa.JpaService;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class RolePermissionssService extends JpaService<RolePermissions>{
|
||||
public class GroupPermissionssService extends JpaService<GroupPermissions>{
|
||||
|
||||
public RolePermissionssService() {
|
||||
super(RolePermissionsMapper.class);
|
||||
public GroupPermissionssService() {
|
||||
super(GroupPermissionsMapper.class);
|
||||
}
|
||||
|
||||
|
||||
@ -35,8 +35,8 @@ public class RolePermissionssService extends JpaService<RolePermissions>{
|
||||
* @see com.connsec.db.service.BaseService#getMapper()
|
||||
*/
|
||||
@Override
|
||||
public RolePermissionsMapper getMapper() {
|
||||
return (RolePermissionsMapper)super.getMapper();
|
||||
public GroupPermissionsMapper getMapper() {
|
||||
return (GroupPermissionsMapper)super.getMapper();
|
||||
}
|
||||
|
||||
}
|
||||
@ -19,40 +19,40 @@ package org.dromara.maxkey.persistence.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.entity.RolePrivileges;
|
||||
import org.dromara.maxkey.persistence.mapper.RolePrivilegesMapper;
|
||||
import org.dromara.maxkey.entity.GroupPrivileges;
|
||||
import org.dromara.maxkey.persistence.mapper.GroupPrivilegesMapper;
|
||||
import org.dromara.mybatis.jpa.JpaService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class RolePrivilegesService extends JpaService<RolePrivileges>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(RolePrivilegesService.class);
|
||||
public class GroupPrivilegesService extends JpaService<GroupPrivileges>{
|
||||
final static Logger _logger = LoggerFactory.getLogger(GroupPrivilegesService.class);
|
||||
|
||||
|
||||
public RolePrivilegesService() {
|
||||
super(RolePrivilegesMapper.class);
|
||||
public GroupPrivilegesService() {
|
||||
super(GroupPrivilegesMapper.class);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.connsec.db.service.BaseService#getMapper()
|
||||
*/
|
||||
@Override
|
||||
public RolePrivilegesMapper getMapper() {
|
||||
return (RolePrivilegesMapper)super.getMapper();
|
||||
public GroupPrivilegesMapper getMapper() {
|
||||
return (GroupPrivilegesMapper)super.getMapper();
|
||||
}
|
||||
|
||||
public boolean insertRolePrivileges(List<RolePrivileges> rolePermissionsList) {
|
||||
return getMapper().insertRolePrivileges(rolePermissionsList)>0;
|
||||
public boolean insertGroupPrivileges(List<GroupPrivileges> rolePermissionsList) {
|
||||
return getMapper().insertGroupPrivileges(rolePermissionsList)>0;
|
||||
};
|
||||
|
||||
public boolean deleteRolePrivileges(List<RolePrivileges> rolePermissionsList) {
|
||||
return getMapper().deleteRolePrivileges(rolePermissionsList)>=0;
|
||||
public boolean deleteGroupPrivileges(List<GroupPrivileges> rolePermissionsList) {
|
||||
return getMapper().deleteGroupPrivileges(rolePermissionsList)>=0;
|
||||
}
|
||||
|
||||
public List<RolePrivileges> queryRolePrivileges(RolePrivileges rolePermissions){
|
||||
return getMapper().queryRolePrivileges(rolePermissions);
|
||||
public List<GroupPrivileges> queryGroupPrivileges(GroupPrivileges rolePermissions){
|
||||
return getMapper().queryGroupPrivileges(rolePermissions);
|
||||
}
|
||||
|
||||
}
|
||||
@ -24,9 +24,10 @@ import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
import org.dromara.maxkey.constants.ConstsStatus;
|
||||
import org.dromara.maxkey.entity.Groups;
|
||||
import org.dromara.maxkey.entity.Institutions;
|
||||
import org.dromara.maxkey.entity.Roles;
|
||||
import org.dromara.maxkey.persistence.mapper.RolesMapper;
|
||||
import org.dromara.maxkey.persistence.mapper.GroupsMapper;
|
||||
import org.dromara.maxkey.util.StringUtils;
|
||||
import org.dromara.mybatis.jpa.JpaService;
|
||||
import org.slf4j.Logger;
|
||||
@ -37,57 +38,57 @@ import org.springframework.stereotype.Repository;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
@Repository
|
||||
public class RolesService extends JpaService<Roles> implements Serializable {
|
||||
public class GroupsService extends JpaService<Groups> implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -4156671926199393550L;
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(RolesService.class);
|
||||
final static Logger _logger = LoggerFactory.getLogger(GroupsService.class);
|
||||
@JsonIgnore
|
||||
@Autowired
|
||||
RoleMemberService roleMemberService;
|
||||
GroupMemberService service;
|
||||
|
||||
@Autowired
|
||||
InstitutionsService institutionsService;
|
||||
|
||||
public RolesService() {
|
||||
super(RolesMapper.class);
|
||||
public GroupsService() {
|
||||
super(GroupsMapper.class);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.connsec.db.service.BaseService#getMapper()
|
||||
*/
|
||||
@Override
|
||||
public RolesMapper getMapper() {
|
||||
return (RolesMapper)super.getMapper();
|
||||
public GroupsMapper getMapper() {
|
||||
return (GroupsMapper)super.getMapper();
|
||||
}
|
||||
|
||||
|
||||
public List<Roles> queryDynamicRoles(Roles groups){
|
||||
return this.getMapper().queryDynamicRoles(groups);
|
||||
public List<Groups> queryDynamicRoles(Groups groups){
|
||||
return this.getMapper().queryDynamic(groups);
|
||||
}
|
||||
|
||||
public boolean deleteById(String groupId) {
|
||||
this.remove(groupId);
|
||||
roleMemberService.deleteByRoleId(groupId);
|
||||
service.deleteByGroupId(groupId);
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<Roles> queryRolesByUserId(String userId){
|
||||
return this.getMapper().queryRolesByUserId(userId);
|
||||
public List<Groups> queryByUserId(String userId){
|
||||
return this.getMapper().queryByUserId(userId);
|
||||
}
|
||||
|
||||
public void refreshDynamicRoles(Roles dynamicRole){
|
||||
if(dynamicRole.getCategory().equals(Roles.Category.DYNAMIC)) {
|
||||
public void refreshDynamicRoles(Groups dynamicGroup){
|
||||
if(dynamicGroup.getCategory().equals(Roles.Category.DYNAMIC)) {
|
||||
boolean isDynamicTimeSupport = false;
|
||||
boolean isBetweenEffectiveTime = false;
|
||||
if(StringUtils.isNotBlank(dynamicRole.getResumeTime())
|
||||
&&StringUtils.isNotBlank(dynamicRole.getSuspendTime())
|
||||
&&!dynamicRole.getSuspendTime().equals("00:00")) {
|
||||
if(StringUtils.isNotBlank(dynamicGroup.getResumeTime())
|
||||
&&StringUtils.isNotBlank(dynamicGroup.getSuspendTime())
|
||||
&&!dynamicGroup.getSuspendTime().equals("00:00")) {
|
||||
LocalTime currentTime = LocalDateTime.now().toLocalTime();
|
||||
LocalTime resumeTime = LocalTime.parse(dynamicRole.getResumeTime());
|
||||
LocalTime suspendTime = LocalTime.parse(dynamicRole.getSuspendTime());
|
||||
LocalTime resumeTime = LocalTime.parse(dynamicGroup.getResumeTime());
|
||||
LocalTime suspendTime = LocalTime.parse(dynamicGroup.getSuspendTime());
|
||||
|
||||
_logger.info("currentTime: " + currentTime
|
||||
+ " , resumeTime : " + resumeTime
|
||||
@ -100,8 +101,8 @@ public class RolesService extends JpaService<Roles> implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(dynamicRole.getOrgIdsList())) {
|
||||
String []orgIds = dynamicRole.getOrgIdsList().split(",");
|
||||
if(StringUtils.isNotBlank(dynamicGroup.getOrgIdsList())) {
|
||||
String []orgIds = dynamicGroup.getOrgIdsList().split(",");
|
||||
StringBuffer orgIdFilters = new StringBuffer();
|
||||
for(String orgId : orgIds) {
|
||||
if(StringUtils.isNotBlank(orgId)) {
|
||||
@ -112,11 +113,11 @@ public class RolesService extends JpaService<Roles> implements Serializable {
|
||||
}
|
||||
}
|
||||
if(orgIdFilters.length() > 0) {
|
||||
dynamicRole.setOrgIdsList(orgIdFilters.toString());
|
||||
dynamicGroup.setOrgIdsList(orgIdFilters.toString());
|
||||
}
|
||||
}
|
||||
|
||||
String filters = dynamicRole.getFilters();
|
||||
String filters = dynamicGroup.getFilters();
|
||||
if(StringUtils.isNotBlank(filters)) {
|
||||
if(StringUtils.filtersSQLInjection(filters.toLowerCase())) {
|
||||
_logger.info("filters include SQL Injection Attack Risk.");
|
||||
@ -125,19 +126,19 @@ public class RolesService extends JpaService<Roles> implements Serializable {
|
||||
filters = filters.replace("&", " AND ");
|
||||
filters = filters.replace("|", " OR ");
|
||||
|
||||
dynamicRole.setFilters(filters);
|
||||
dynamicGroup.setFilters(filters);
|
||||
}
|
||||
|
||||
if(isDynamicTimeSupport) {
|
||||
if(isBetweenEffectiveTime) {
|
||||
roleMemberService.deleteDynamicRoleMember(dynamicRole);
|
||||
roleMemberService.addDynamicRoleMember(dynamicRole);
|
||||
service.deleteDynamicMember(dynamicGroup);
|
||||
service.addDynamicMember(dynamicGroup);
|
||||
}else {
|
||||
roleMemberService.deleteDynamicRoleMember(dynamicRole);
|
||||
service.deleteDynamicMember(dynamicGroup);
|
||||
}
|
||||
}else{
|
||||
roleMemberService.deleteDynamicRoleMember(dynamicRole);
|
||||
roleMemberService.addDynamicRoleMember(dynamicRole);
|
||||
service.deleteDynamicMember(dynamicGroup);
|
||||
service.addDynamicMember(dynamicGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,12 +147,12 @@ public class RolesService extends JpaService<Roles> implements Serializable {
|
||||
List<Institutions> instList =
|
||||
institutionsService.find("where status = ? ", new Object[]{ConstsStatus.ACTIVE}, new int[]{Types.INTEGER});
|
||||
for(Institutions inst : instList) {
|
||||
Roles role = new Roles();
|
||||
role.setInstId(inst.getId());
|
||||
List<Roles> rolesList = queryDynamicRoles(role);
|
||||
for(Roles r : rolesList) {
|
||||
_logger.debug("role " + rolesList);
|
||||
refreshDynamicRoles(r);
|
||||
Groups group = new Groups();
|
||||
group.setInstId(inst.getId());
|
||||
List<Groups> groupsList = queryDynamicRoles(group);
|
||||
for(Groups g : groupsList) {
|
||||
_logger.debug("role {}" , g);
|
||||
refreshDynamicRoles(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -23,8 +23,8 @@ import org.dromara.maxkey.entity.HistorySystemLogs;
|
||||
import org.dromara.maxkey.entity.Organizations;
|
||||
import org.dromara.maxkey.entity.Resources;
|
||||
import org.dromara.maxkey.entity.RoleMember;
|
||||
import org.dromara.maxkey.entity.RolePermissions;
|
||||
import org.dromara.maxkey.entity.RolePrivileges;
|
||||
import org.dromara.maxkey.entity.GroupPermissions;
|
||||
import org.dromara.maxkey.entity.GroupPrivileges;
|
||||
import org.dromara.maxkey.entity.Roles;
|
||||
import org.dromara.maxkey.entity.SocialsProvider;
|
||||
import org.dromara.maxkey.entity.Synchronizers;
|
||||
@ -68,16 +68,16 @@ public class HistorySystemLogsService extends JpaService<HistorySystemLogs>{
|
||||
message = buildMsg((Roles)entity);
|
||||
}else if(entity instanceof RoleMember) {
|
||||
message = buildMsg((RoleMember)entity);
|
||||
}else if(entity instanceof RolePermissions) {
|
||||
message = buildMsg((RolePermissions)entity);
|
||||
}else if(entity instanceof GroupPermissions) {
|
||||
message = buildMsg((GroupPermissions)entity);
|
||||
}else if(entity instanceof Resources) {
|
||||
message = buildMsg((Resources)entity);
|
||||
}else if(entity instanceof Synchronizers) {
|
||||
message = buildMsg((Synchronizers)entity);
|
||||
}else if(entity instanceof SocialsProvider) {
|
||||
message = buildMsg((SocialsProvider)entity);
|
||||
}else if(entity instanceof RolePrivileges) {
|
||||
message = buildMsg((RolePrivileges)entity);
|
||||
}else if(entity instanceof GroupPrivileges) {
|
||||
message = buildMsg((GroupPrivileges)entity);
|
||||
}else if(entity instanceof String) {
|
||||
message = entity.toString();
|
||||
}
|
||||
@ -157,18 +157,18 @@ public class HistorySystemLogsService extends JpaService<HistorySystemLogs>{
|
||||
.toString();
|
||||
}
|
||||
|
||||
public String buildMsg(RolePermissions permission) {
|
||||
public String buildMsg(GroupPermissions permission) {
|
||||
return new StringBuilder()
|
||||
.append(permission.getRoleName())
|
||||
.append(permission.getGroupName())
|
||||
.append("[")
|
||||
.append(permission.getAppName())
|
||||
.append("]")
|
||||
.toString();
|
||||
}
|
||||
|
||||
public String buildMsg(RolePrivileges privilege) {
|
||||
public String buildMsg(GroupPrivileges privilege) {
|
||||
return new StringBuilder()
|
||||
.append(privilege.getRoleId())
|
||||
.append(privilege.getGroupId())
|
||||
.append("[")
|
||||
.append(privilege.getResourceId())
|
||||
.append("]")
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="org.dromara.maxkey.persistence.mapper.RoleMemberMapper">
|
||||
<mapper namespace="org.dromara.maxkey.persistence.mapper.GroupMemberMapper">
|
||||
|
||||
<sql id="where_statement">
|
||||
<if test="id != null and id != ''">
|
||||
@ -11,12 +11,12 @@
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="memberInRole" parameterType="RoleMember" resultType="RoleMember">
|
||||
<select id="memberIn" parameterType="GroupMember" resultType="GroupMember">
|
||||
select distinct
|
||||
rm.id as id,
|
||||
r.id as roleid,
|
||||
r.rolename,
|
||||
r.category category,
|
||||
gm.id as id,
|
||||
g.id as groupid,
|
||||
g.groupname,
|
||||
g.category category,
|
||||
u.username,
|
||||
u.usertype,
|
||||
u.windowsaccount,
|
||||
@ -46,22 +46,22 @@
|
||||
u.jobtitle,
|
||||
u.joblevel,
|
||||
|
||||
rm.createddate,
|
||||
gm.createddate,
|
||||
|
||||
u.status
|
||||
from
|
||||
mxk_userinfo u,
|
||||
mxk_roles r,
|
||||
mxk_role_member rm
|
||||
mxk_groups g,
|
||||
mxk_group_member gm
|
||||
where u.instid = #{instId}
|
||||
and r.instid = #{instId}
|
||||
and rm.instid = #{instId}
|
||||
<if test="roleId != null and roleId != ''">
|
||||
and rm.roleid = #{roleId}
|
||||
and r.id = #{roleId}
|
||||
and g.instid = #{instId}
|
||||
and gm.instid = #{instId}
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and gm.groupid = #{groupId}
|
||||
and g.id = #{groupId}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and r.rolename = #{roleName}
|
||||
<if test="groupName != null and groupName != ''">
|
||||
and g.groupname = #{groupName}
|
||||
</if>
|
||||
<if test="username != null and username != ''">
|
||||
and u.username = #{username}
|
||||
@ -69,13 +69,13 @@
|
||||
<if test="displayName != null and displayName != ''">
|
||||
and u.displayname like '%${displayName}%'
|
||||
</if>
|
||||
and rm.type in( 'USER','USER-DYNAMIC')
|
||||
and rm.roleid = r.id
|
||||
and rm.memberid = u.id
|
||||
and gm.type in( 'USER','USER-DYNAMIC')
|
||||
and gm.groupid = g.id
|
||||
and gm.memberid = u.id
|
||||
</select>
|
||||
|
||||
|
||||
<select id="memberNotInRole" parameterType="RoleMember" resultType="RoleMember">
|
||||
<select id="memberNotIn" parameterType="GroupMember" resultType="GroupMember">
|
||||
select distinct
|
||||
u.id,
|
||||
u.username,
|
||||
@ -119,17 +119,17 @@
|
||||
where
|
||||
u.id not in(
|
||||
select rm.memberid
|
||||
from mxk_roles r,mxk_role_member rm
|
||||
from mxk_groups g,mxk_group_member gm
|
||||
where 1 = 1
|
||||
<if test="roleId != null and roleId != ''">
|
||||
and rm.roleid = #{roleId}
|
||||
and r.id = #{roleId}
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and gm.groupid = #{groupId}
|
||||
and g.id = #{groupId}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and r.rolename = #{roleName}
|
||||
<if test="groupName != null and groupName != ''">
|
||||
and g.groupname = #{groupName}
|
||||
</if>
|
||||
and rm.type in( 'USER','USER-DYNAMIC')
|
||||
and rm.roleid = r.id
|
||||
and gm.type in( 'USER','USER-DYNAMIC')
|
||||
and gm.groupid = g.id
|
||||
)
|
||||
<if test="username != null and username != ''">
|
||||
and u.username = #{username}
|
||||
@ -139,71 +139,71 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="rolesNoMember" parameterType="RoleMember" resultType="Roles">
|
||||
<select id="noMember" parameterType="GroupMember" resultType="Groups">
|
||||
select distinct
|
||||
r.*
|
||||
g.*
|
||||
from
|
||||
mxk_roles r
|
||||
mxk_groups g
|
||||
where
|
||||
r.id not in(
|
||||
g.id not in(
|
||||
select
|
||||
rm.roleid
|
||||
from mxk_role_member rm,mxk_userinfo u
|
||||
where rm.memberid = u.id
|
||||
gm.groupid
|
||||
from mxk_group_member gm,mxk_userinfo u
|
||||
where gm.memberid = u.id
|
||||
<if test="username != null and username != ''">
|
||||
and u.username = #{username}
|
||||
</if>
|
||||
<if test="memberId != null and memberId != ''">
|
||||
and rm.memberid = #{memberid}
|
||||
and gm.memberid = #{memberid}
|
||||
</if>
|
||||
)
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and r.rolename = #{roleName}
|
||||
<if test="groupName != null and groupName != ''">
|
||||
and g.groupname = #{groupName}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- ROLE_MEMBER ROLE Member-->
|
||||
<select id="roleMemberInRole" parameterType="RoleMember" resultType="Roles">
|
||||
<select id="groupMemberInGroup" parameterType="GroupMember" resultType="Groups">
|
||||
select distinct
|
||||
ig.*
|
||||
from
|
||||
mxk_roles ir,
|
||||
mxk_roles r,
|
||||
mxk_role_member rm
|
||||
mxk_groups ig,
|
||||
mxk_groups g,
|
||||
mxk_group_member gm
|
||||
where
|
||||
1 = 1
|
||||
and rm.roleid = g.id
|
||||
and rm.memberid = ig.id
|
||||
and rm.type = 'ROLE'
|
||||
<if test="roleId != null and roleId != ''">
|
||||
and rm.roleid = #{roleId}
|
||||
and r.id = #{roleId}
|
||||
and gm.groupid = g.id
|
||||
and gm.memberid = ig.id
|
||||
and gm.type = 'ROLE'
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and gm.groupid = #{groupId}
|
||||
and g.id = #{groupId}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and r.rolename = #{roleName}
|
||||
<if test="groupName != null and groupName != ''">
|
||||
and g.groupname = #{groupName}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="addDynamicRoleMember" parameterType="Roles" >
|
||||
insert into mxk_role_member(
|
||||
<update id="addDynamicGroupMember" parameterType="Groups" >
|
||||
insert into mxk_group_member(
|
||||
id,
|
||||
roleid,
|
||||
groupid,
|
||||
memberid,
|
||||
type,
|
||||
instid
|
||||
)
|
||||
select
|
||||
concat('${id}_',u.id) id,
|
||||
'${id}' roleid,
|
||||
'${id}' groupid,
|
||||
u.id memberid,
|
||||
'USER-DYNAMIC' type,
|
||||
'${instId}' instid
|
||||
from mxk_userinfo u
|
||||
where not exists(
|
||||
select 1 from mxk_role_member rm
|
||||
where rm.roleid=#{id}
|
||||
and rm.memberid=u.id
|
||||
and rm.type='USER-DYNAMIC'
|
||||
select 1 from mxk_group_member gm
|
||||
where gm.groupid=#{id}
|
||||
and gm.memberid=u.id
|
||||
and gm.type='USER-DYNAMIC'
|
||||
)
|
||||
<if test="filters != null and filters != ''">
|
||||
and (${filters})
|
||||
@ -213,15 +213,15 @@
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="deleteDynamicRoleMember" parameterType="Roles" >
|
||||
delete from mxk_role_member rm
|
||||
<delete id="deleteDynamicGroupMember" parameterType="Groups" >
|
||||
delete from mxk_group_member gm
|
||||
where type = 'user-dynamic'
|
||||
and rm.roleid=#{id}
|
||||
and gm.groupid=#{id}
|
||||
and not exists(
|
||||
select 1
|
||||
from mxk_userinfo u
|
||||
where 1 = 1
|
||||
and u.id=rm.memberid
|
||||
and u.id=gm.memberid
|
||||
<if test="filters != null and filters != ''">
|
||||
and (${filters})
|
||||
</if>
|
||||
@ -231,10 +231,10 @@
|
||||
)
|
||||
</delete>
|
||||
|
||||
<select id="queryMemberByRoleId" parameterType="string" resultType="UserInfo">
|
||||
<select id="queryMemberByGroupId" parameterType="string" resultType="UserInfo">
|
||||
select distinct
|
||||
r.roleId,
|
||||
r.roleName,
|
||||
g.groupId,
|
||||
g.groupName,
|
||||
u.id,
|
||||
u.username,
|
||||
u.usertype,
|
||||
@ -264,24 +264,24 @@
|
||||
u.department,
|
||||
u.jobtitle,
|
||||
u.joblevel,
|
||||
rm.createddate,
|
||||
gm.createddate,
|
||||
u.status
|
||||
from
|
||||
mxk_userinfo u,
|
||||
mxk_roles r,
|
||||
mxk_role_member rm
|
||||
mxk_groups g,
|
||||
mxk_group_member gm
|
||||
where 1 = 1
|
||||
and rm.roleid = #{value}
|
||||
and gm.groupid = #{value}
|
||||
and g.id = #{value}
|
||||
and rm.type in( 'USER','USER-DYNAMIC')
|
||||
and rm.roleid = r.id
|
||||
and rm.memberid = u.id
|
||||
and gm.type in( 'USER','USER-DYNAMIC')
|
||||
and gm.groupid = g.id
|
||||
and gm.memberid = u.id
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteByRoleId" parameterType="string" >
|
||||
delete from mxk_role_member rm
|
||||
where rm.roleid = #{value} and roleId != 'ROLE_ALL_USER'
|
||||
<delete id="deleteByGroupId" parameterType="string" >
|
||||
delete from mxk_group_member gm
|
||||
where gm.groupid = #{value} and groupId != 'ROLE_ALL_USER'
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="org.dromara.maxkey.persistence.mapper.RolePermissionsMapper" >
|
||||
<mapper namespace="org.dromara.maxkey.persistence.mapper.GroupPermissionsMapper" >
|
||||
|
||||
<sql id="where_statement">
|
||||
<if test="id != null and id != ''">
|
||||
@ -18,11 +18,11 @@
|
||||
</sql>
|
||||
|
||||
<!-- AppGroup -->
|
||||
<select id="appsInRole" parameterType="RolePermissions" resultType="RolePermissions">
|
||||
<select id="appsInGroup" parameterType="GroupPermissions" resultType="GroupPermissions">
|
||||
select
|
||||
p.id,
|
||||
p.roleid,
|
||||
r.rolename,
|
||||
p.groupid,
|
||||
r.groupname,
|
||||
apps.id appid,
|
||||
apps.appname,
|
||||
apps.icon,
|
||||
@ -34,22 +34,22 @@
|
||||
apps.vendorurl
|
||||
from
|
||||
mxk_apps apps,
|
||||
mxk_role_permissions p,
|
||||
mxk_roles r
|
||||
mxk_group_permissions p,
|
||||
mxk_groups r
|
||||
where
|
||||
apps.instid = #{instId}
|
||||
and p.instid = #{instId}
|
||||
and r.instid = #{instId}
|
||||
and p.appid = apps.id
|
||||
and p.roleid = r.id
|
||||
<if test="roleId != null and roleId != ''">
|
||||
and p.roleid = #{roleId}
|
||||
and r.id = #{roleId}
|
||||
and p.groupid = r.id
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and p.groupid = #{groupId}
|
||||
and r.id = #{groupId}
|
||||
</if>
|
||||
<include refid="where_statement"/>
|
||||
</select>
|
||||
|
||||
<select id="appsNotInRole" parameterType="RolePermissions" resultType="RolePermissions">
|
||||
<select id="appsNotInGroup" parameterType="GroupPermissions" resultType="GroupPermissions">
|
||||
select
|
||||
*
|
||||
from
|
||||
@ -60,9 +60,9 @@
|
||||
select
|
||||
appid
|
||||
from
|
||||
mxk_role_permissions
|
||||
mxk_group_permissions
|
||||
where
|
||||
roleid = #{roleId}
|
||||
groupid = #{groupId}
|
||||
)
|
||||
<include refid="where_statement"/>
|
||||
</select>
|
||||
@ -1,6 +1,6 @@
|
||||
<?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="org.dromara.maxkey.persistence.mapper.RolePrivilegesMapper">
|
||||
<mapper namespace="org.dromara.maxkey.persistence.mapper.GroupPrivilegesMapper">
|
||||
|
||||
<sql id="where_statement">
|
||||
<if test="id != null and id != ''">
|
||||
@ -11,18 +11,18 @@
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="queryRolePrivileges" parameterType="RolePrivileges" resultType="RolePrivileges">
|
||||
<select id="queryGroupPrivileges" parameterType="GroupPrivileges" resultType="GroupPrivileges">
|
||||
select
|
||||
*
|
||||
from
|
||||
mxk_role_privileges
|
||||
mxk_group_privileges
|
||||
where instid = #{instId}
|
||||
and status = 1
|
||||
<if test="id != null and id != ''">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleId != null and roleId != ''">
|
||||
and roleid = #{roleId}
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and groupid = #{groupId}
|
||||
</if>
|
||||
<if test="appId != null and appId != ''">
|
||||
and appid = #{appId}
|
||||
@ -30,8 +30,8 @@
|
||||
|
||||
</select>
|
||||
|
||||
<update id="deleteRolePrivileges" parameterType="java.util.List">
|
||||
update mxk_role_privileges
|
||||
<update id="deleteGroupPrivileges" parameterType="java.util.List">
|
||||
update mxk_group_privileges
|
||||
set status = 9
|
||||
where 1 = 1 and
|
||||
<foreach item="item" collection="list" open="(" separator="or" close=")">
|
||||
@ -39,11 +39,11 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<insert id="insertRolePrivileges" parameterType="java.util.List">
|
||||
insert into mxk_role_privileges ( id,appid,roleid,resourceid,status,instid)
|
||||
<insert id="insertGroupPrivileges" parameterType="java.util.List">
|
||||
insert into mxk_role_privileges ( id,appid,groupid,resourceid,status,instid)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.id},#{item.appId},#{item.roleId},#{item.resourceId},#{item.status},#{item.instId})
|
||||
(#{item.id},#{item.appId},#{item.groupId},#{item.resourceId},#{item.status},#{item.instId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@ -1,53 +1,53 @@
|
||||
<?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="org.dromara.maxkey.persistence.mapper.RolesMapper">
|
||||
<mapper namespace="org.dromara.maxkey.persistence.mapper.GroupsMapper">
|
||||
|
||||
<sql id="where_statement">
|
||||
<if test="id != null and id != ''">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and rolename like '%${roleName}%'
|
||||
<if test="groupName != null and groupName != ''">
|
||||
and groupname like '%${groupName}%'
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<select id="fetchPageResults" parameterType="Roles" resultType="Roles">
|
||||
<select id="fetchPageResults" parameterType="Groups" resultType="Groups">
|
||||
select
|
||||
*
|
||||
from
|
||||
mxk_roles
|
||||
mxk_groups
|
||||
where instid = #{instId}
|
||||
<include refid="where_statement"/>
|
||||
</select>
|
||||
|
||||
<select id="queryDynamicRoles" parameterType="Roles" resultType="Roles">
|
||||
<select id="queryDynamicRoles" parameterType="Groups" resultType="Groups">
|
||||
select
|
||||
*
|
||||
from
|
||||
mxk_roles
|
||||
mxk_groups
|
||||
where instid = #{instId}
|
||||
and category = 'dynamic'
|
||||
<include refid="where_statement"/>
|
||||
</select>
|
||||
|
||||
|
||||
<update id="logisticDelete" parameterType="Roles" >
|
||||
update mxk_roles set
|
||||
<update id="logisticDelete" parameterType="Groups" >
|
||||
update mxk_groups set
|
||||
status = '2'
|
||||
where instid = #{instId}
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleName != roleName">
|
||||
and rolename = #{roleName}
|
||||
<if test="groupName != groupName">
|
||||
and groupname = #{groupName}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="logisticBatchDelete" parameterType="java.util.List">
|
||||
update mxk_roles
|
||||
update mxk_groups
|
||||
set status='2'
|
||||
where instid = #{instId}
|
||||
and id in
|
||||
@ -59,19 +59,19 @@
|
||||
|
||||
<select id="queryRolesByUserId" parameterType="string" resultType="Roles">
|
||||
select distinct
|
||||
r.*
|
||||
g.*
|
||||
from
|
||||
mxk_userinfo u,
|
||||
mxk_roles r,
|
||||
mxk_role_member rm
|
||||
mxk_groups g,
|
||||
mxk_group_member gm
|
||||
where u.instid = #{instId}
|
||||
and r.instid = #{instId}
|
||||
and rm.instid = #{instId}
|
||||
and rm.memberid = #{value}
|
||||
and g.instid = #{instId}
|
||||
and gm.instid = #{instId}
|
||||
and gm.memberid = #{value}
|
||||
and u.id = #{value}
|
||||
and rm.type in( 'USER','USER-DYNAMIC')
|
||||
and rm.groupid = r.id
|
||||
and rm.memberid = u.id
|
||||
and gm.type in( 'USER','USER-DYNAMIC')
|
||||
and gm.groupid = g.id
|
||||
and gm.memberid = u.id
|
||||
</select>
|
||||
|
||||
|
||||
@ -23,10 +23,10 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.dromara.maxkey.entity.Roles;
|
||||
import org.dromara.maxkey.entity.Groups;
|
||||
import org.dromara.maxkey.entity.UserInfo;
|
||||
import org.dromara.maxkey.persistence.service.RoleMemberService;
|
||||
import org.dromara.maxkey.persistence.service.RolesService;
|
||||
import org.dromara.maxkey.persistence.service.GroupMemberService;
|
||||
import org.dromara.maxkey.persistence.service.GroupsService;
|
||||
import org.dromara.maxkey.util.DateUtils;
|
||||
import org.dromara.maxkey.util.StringUtils;
|
||||
import org.dromara.maxkey.web.apis.identity.scim.resources.ScimGroup;
|
||||
@ -56,18 +56,18 @@ public class ScimGroupController {
|
||||
final static Logger _logger = LoggerFactory.getLogger(ScimGroupController.class);
|
||||
|
||||
@Autowired
|
||||
RolesService rolesService;
|
||||
GroupsService groupsService;
|
||||
|
||||
@Autowired
|
||||
RoleMemberService roleMemberService;
|
||||
GroupMemberService groupMemberService;
|
||||
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
public MappingJacksonValue get(@PathVariable String id,
|
||||
@RequestParam(required = false) String attributes) {
|
||||
_logger.debug("ScimGroup id {} , attributes {}", id , attributes);
|
||||
Roles role = rolesService.get(id);
|
||||
ScimGroup scimGroup = role2ScimGroup(role);
|
||||
List<UserInfo> userList = roleMemberService.queryMemberByRoleId(id);
|
||||
Groups group = groupsService.get(id);
|
||||
ScimGroup scimGroup = group2ScimGroup(group);
|
||||
List<UserInfo> userList = groupMemberService.queryMemberByGroupId(id);
|
||||
if(userList != null && userList.size() > 0) {
|
||||
Set<ScimMemberRef> members = new HashSet<ScimMemberRef>();
|
||||
for (UserInfo user : userList) {
|
||||
@ -83,9 +83,9 @@ public class ScimGroupController {
|
||||
@RequestParam(required = false) String attributes,
|
||||
UriComponentsBuilder builder) throws IOException {
|
||||
_logger.debug("ScimGroup content {} , attributes {}", scimGroup , attributes);
|
||||
Roles role =scimGroup2Role(scimGroup);
|
||||
rolesService.insert(role);
|
||||
return get(role.getId(),attributes);
|
||||
Groups group =scimGroup2Role(scimGroup);
|
||||
groupsService.insert(group);
|
||||
return get(group.getId(),attributes);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
|
||||
@ -94,16 +94,16 @@ public class ScimGroupController {
|
||||
@RequestParam(required = false) String attributes)
|
||||
throws IOException {
|
||||
_logger.debug("ScimGroup content {} , attributes {}", scimGroup , attributes);
|
||||
Roles role =scimGroup2Role(scimGroup);
|
||||
rolesService.update(role);
|
||||
return get(role.getId(),attributes);
|
||||
Groups group =scimGroup2Role(scimGroup);
|
||||
groupsService.update(group);
|
||||
return get(group.getId(),attributes);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public void delete(@PathVariable final String id) {
|
||||
_logger.debug("ScimGroup id {} " , id);
|
||||
rolesService.remove(id);
|
||||
groupsService.remove(id);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET)
|
||||
@ -115,14 +115,14 @@ public class ScimGroupController {
|
||||
public MappingJacksonValue searchWithPost(@ModelAttribute ScimParameters requestParameters) {
|
||||
requestParameters.parse();
|
||||
_logger.debug("requestParameters {} ",requestParameters);
|
||||
Roles queryModel = new Roles();
|
||||
Groups queryModel = new Groups();
|
||||
queryModel.setPageSize(requestParameters.getCount());
|
||||
queryModel.calculate(requestParameters.getStartIndex());
|
||||
|
||||
JpaPageResults<Roles> orgResults = rolesService.fetchPageResults(queryModel);
|
||||
JpaPageResults<Groups> orgResults = groupsService.fetchPageResults(queryModel);
|
||||
List<ScimGroup> resultList = new ArrayList<ScimGroup>();
|
||||
for(Roles group : orgResults.getRows()) {
|
||||
resultList.add(role2ScimGroup(group));
|
||||
for(Groups group : orgResults.getRows()) {
|
||||
resultList.add(group2ScimGroup(group));
|
||||
}
|
||||
ScimSearchResult<ScimGroup> scimSearchResult =
|
||||
new ScimSearchResult<ScimGroup>(
|
||||
@ -133,11 +133,11 @@ public class ScimGroupController {
|
||||
return new MappingJacksonValue(scimSearchResult);
|
||||
}
|
||||
|
||||
public ScimGroup role2ScimGroup(Roles group) {
|
||||
public ScimGroup group2ScimGroup(Groups group) {
|
||||
ScimGroup scimGroup = new ScimGroup();
|
||||
scimGroup.setId(group.getId());
|
||||
scimGroup.setExternalId(group.getId());
|
||||
scimGroup.setDisplayName(group.getRoleName());
|
||||
scimGroup.setDisplayName(group.getGroupName());
|
||||
|
||||
ScimMeta meta = new ScimMeta("Group");
|
||||
if(StringUtils.isNotBlank(group.getCreatedDate())){
|
||||
@ -153,10 +153,10 @@ public class ScimGroupController {
|
||||
return scimGroup;
|
||||
}
|
||||
|
||||
public Roles scimGroup2Role(ScimGroup scimGroup) {
|
||||
Roles role = new Roles();
|
||||
role.setId(scimGroup.getId());
|
||||
role.setRoleName(scimGroup.getDisplayName());
|
||||
return role;
|
||||
public Groups scimGroup2Role(ScimGroup scimGroup) {
|
||||
Groups group = new Groups();
|
||||
group.setId(scimGroup.getId());
|
||||
group.setGroupName(scimGroup.getDisplayName());
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,9 +21,9 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.dromara.maxkey.constants.ConstsStatus;
|
||||
import org.dromara.maxkey.entity.Roles;
|
||||
import org.dromara.maxkey.entity.Groups;
|
||||
import org.dromara.maxkey.entity.UserInfo;
|
||||
import org.dromara.maxkey.persistence.service.RolesService;
|
||||
import org.dromara.maxkey.persistence.service.GroupsService;
|
||||
import org.dromara.maxkey.persistence.service.UserInfoService;
|
||||
import org.dromara.maxkey.util.DateUtils;
|
||||
import org.dromara.maxkey.util.StringUtils;
|
||||
@ -72,7 +72,7 @@ public class ScimUserController {
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
@Autowired
|
||||
RolesService rolesService;
|
||||
GroupsService groupsService;
|
||||
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
public MappingJacksonValue get(@PathVariable String id,
|
||||
@ -172,9 +172,9 @@ public class ScimUserController {
|
||||
|
||||
List<String> groupsList=new ArrayList<String>();
|
||||
List<ScimGroupRef> groups = new ArrayList<ScimGroupRef>();
|
||||
for(Roles role : rolesService.queryRolesByUserId(userInfo.getId())){
|
||||
groupsList.add(role.getId());
|
||||
groups.add(new ScimGroupRef(role.getId(),role.getRoleName()));
|
||||
for(Groups group : groupsService.queryByUserId(userInfo.getId())){
|
||||
groupsList.add(group.getId());
|
||||
groups.add(new ScimGroupRef(group.getId(),group.getGroupName()));
|
||||
|
||||
}
|
||||
scimUser.setGroup(groupsList);
|
||||
|
||||
@ -16,4 +16,4 @@
|
||||
|
||||
import { BaseEntity } from './BaseEntity';
|
||||
|
||||
export class RoleMembers extends BaseEntity {}
|
||||
export class GroupMembers extends BaseEntity {}
|
||||
@ -18,7 +18,7 @@ import format from 'date-fns/format';
|
||||
|
||||
import { BaseEntity } from './BaseEntity';
|
||||
|
||||
export class Roles extends BaseEntity {
|
||||
export class Groups extends BaseEntity {
|
||||
roleCode!: String;
|
||||
roleName!: String;
|
||||
category!: String;
|
||||
@ -22,12 +22,6 @@ import { NzIconModule } from 'ng-zorro-antd/icon';
|
||||
|
||||
import { PermissionsEditerComponent } from './permissions/permissions-editer/permissions-editer.component';
|
||||
import { PermissionsComponent } from './permissions/permissions.component';
|
||||
import { MemberRolesEditerComponent } from './role-members/member-roles-editer/member-roles-editer.component';
|
||||
import { RoleMembersEditerComponent } from './role-members/role-members-editer/role-members-editer.component';
|
||||
import { RoleMembersComponent } from './role-members/role-members.component';
|
||||
import { RoleEditerComponent } from './roles/role-editer/role-editer.component';
|
||||
import { RolesComponent } from './roles/roles.component';
|
||||
import { SelectRolesComponent } from './roles/select-roles/select-roles.component';
|
||||
import { SessionsComponent } from './sessions/sessions.component';
|
||||
|
||||
const routes: Routes = [
|
||||
@ -35,31 +29,13 @@ const routes: Routes = [
|
||||
path: 'sessions',
|
||||
component: SessionsComponent
|
||||
},
|
||||
{
|
||||
path: 'roles',
|
||||
component: RolesComponent
|
||||
},
|
||||
{
|
||||
path: 'rolemembers',
|
||||
component: RoleMembersComponent
|
||||
},
|
||||
{
|
||||
path: 'permissions',
|
||||
component: PermissionsComponent
|
||||
}
|
||||
];
|
||||
|
||||
const COMPONENTS = [
|
||||
RolesComponent,
|
||||
RoleMembersComponent,
|
||||
PermissionsComponent,
|
||||
RoleEditerComponent,
|
||||
SessionsComponent,
|
||||
SelectRolesComponent,
|
||||
RoleMembersEditerComponent,
|
||||
PermissionsEditerComponent,
|
||||
MemberRolesEditerComponent
|
||||
];
|
||||
const COMPONENTS = [PermissionsComponent, SessionsComponent, PermissionsEditerComponent];
|
||||
|
||||
@NgModule({
|
||||
declarations: [...COMPONENTS],
|
||||
|
||||
@ -24,14 +24,14 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
|
||||
import { RolePermissionsService } from '../../../../service/role-permissions.service';
|
||||
import { GroupPermissionsService } from '../../../../service/group-permissions.service';
|
||||
@Component({
|
||||
selector: 'app-permissions-editer',
|
||||
templateUrl: './permissions-editer.component.html',
|
||||
styleUrls: ['./permissions-editer.component.less']
|
||||
})
|
||||
export class PermissionsEditerComponent implements OnInit {
|
||||
@Input() roleId?: String;
|
||||
@Input() groupId?: String;
|
||||
@Input() isEdit?: boolean;
|
||||
|
||||
query: {
|
||||
@ -39,7 +39,7 @@ export class PermissionsEditerComponent implements OnInit {
|
||||
appName: String;
|
||||
displayName: String;
|
||||
username: String;
|
||||
roleId: String;
|
||||
groupId: String;
|
||||
startDate: String;
|
||||
endDate: String;
|
||||
startDatePicker: Date;
|
||||
@ -63,7 +63,7 @@ export class PermissionsEditerComponent implements OnInit {
|
||||
appName: '',
|
||||
displayName: '',
|
||||
username: '',
|
||||
roleId: '',
|
||||
groupId: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
startDatePicker: addDays(new Date(), -30),
|
||||
@ -86,7 +86,7 @@ export class PermissionsEditerComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalRef: NzModalRef,
|
||||
private rolePermissionsService: RolePermissionsService,
|
||||
private groupPermissionsService: GroupPermissionsService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@ -95,8 +95,8 @@ export class PermissionsEditerComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.roleId) {
|
||||
this.query.params.roleId = this.roleId;
|
||||
if (this.groupId) {
|
||||
this.query.params.groupId = this.groupId;
|
||||
this.fetch();
|
||||
}
|
||||
}
|
||||
@ -126,7 +126,7 @@ export class PermissionsEditerComponent implements OnInit {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.rolePermissionsService.memberOut(this.query.params).subscribe(res => {
|
||||
this.groupPermissionsService.memberOut(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -171,7 +171,7 @@ export class PermissionsEditerComponent implements OnInit {
|
||||
memberIds = `${memberIds},${selectedData[i].id}`;
|
||||
memberNames = `${memberNames},${selectedData[i].username}`;
|
||||
}
|
||||
this.rolePermissionsService.add({ roleId: this.roleId, appId: memberIds, appName: memberNames }).subscribe(res => {
|
||||
this.groupPermissionsService.add({ groupId: this.groupId, appId: memberIds, appName: memberNames }).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<nz-form-control>
|
||||
<nz-input-group nzSearch [nzAddOnAfter]="suffixButton">
|
||||
<input nz-input [(ngModel)]="query.params.roleName" [ngModelOptions]="{ standalone: true }"
|
||||
name="roleName" readonly placeholder="" id="roleName" />
|
||||
name="roleName" readonly placeholder="" id="roleName" />
|
||||
</nz-input-group>
|
||||
<ng-template #suffixButton>
|
||||
<button nz-button nzType="primary" (click)="onSelect($event)" nzSearch>{{ 'mxk.text.select' | i18n
|
||||
@ -23,7 +23,7 @@
|
||||
<nz-form-label nzFor="name">{{ 'mxk.apps.name' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.appName" [ngModelOptions]="{ standalone: true }" name="appName"
|
||||
placeholder="" id="appName" />
|
||||
placeholder="" id="appName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@ -48,68 +48,69 @@
|
||||
</div>
|
||||
|
||||
<div nz-col nzMd="24" nzSm="24">
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber"
|
||||
[nzLoading]="this.query.tableLoading" (nzQueryParams)="onQueryParamsChange($event)">
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)">
|
||||
<thead>
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.apps.icon' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.apps.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.apps.category' | i18n }}</th>
|
||||
<th nzAlign="center" class="table_cell_action_1">{{ 'mxk.text.action' | i18n }}</th>
|
||||
</tr>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.apps.icon' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.apps.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.apps.category' | i18n }}</th>
|
||||
<th nzAlign="center" class="table_cell_action_1">{{ 'mxk.text.action' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left"> {{ data.roleName }}</td>
|
||||
<td nzAlign="center"><img height="30" border="0px" src="{{ data.iconBase64 }}" /></td>
|
||||
<td nzAlign="left"> {{ data.appName }}</td>
|
||||
<td nzAlign="left">
|
||||
<div *ngIf="data.category == 'none'">{{ 'mxk.apps.category.none' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1011'">{{ 'mxk.apps.category.1011' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1012'">{{ 'mxk.apps.category.1012' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1013'">{{ 'mxk.apps.category.1013' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1014'">{{ 'mxk.apps.category.1014' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1015'">{{ 'mxk.apps.category.1015' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1016'">{{ 'mxk.apps.category.1016' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1017'">{{ 'mxk.apps.category.1017' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1111'">{{ 'mxk.apps.category.1111' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1112'">{{ 'mxk.apps.category.1112' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1113'">{{ 'mxk.apps.category.1113' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1114'">{{ 'mxk.apps.category.1114' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1211'">{{ 'mxk.apps.category.1211' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1212'">{{ 'mxk.apps.category.1212' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1213'">{{ 'mxk.apps.category.1213' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1214'">{{ 'mxk.apps.category.1214' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1215'">{{ 'mxk.apps.category.1215' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1311'">{{ 'mxk.apps.category.1311' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1411'">{{ 'mxk.apps.category.1411' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1511'">{{ 'mxk.apps.category.1511' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1512'">{{ 'mxk.apps.category.1512' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1611'">{{ 'mxk.apps.category.1611' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1711'">{{ 'mxk.apps.category.1711' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1712'">{{ 'mxk.apps.category.1712' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1811'">{{ 'mxk.apps.category.1811' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1812'">{{ 'mxk.apps.category.1812' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1911'">{{ 'mxk.apps.category.1911' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1912'">{{ 'mxk.apps.category.1912' | i18n }}</div>
|
||||
</td>
|
||||
<td nzAlign="center" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button nz-button type="button" (click)="onDelete($event, data.id)" nzDanger>{{ 'mxk.text.delete' | i18n
|
||||
}}</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<td nzAlign="left"> {{ data.groupName }}</td>
|
||||
<td nzAlign="center"><img height="30" border="0px" src="{{ data.iconBase64 }}" /></td>
|
||||
<td nzAlign="left"> {{ data.appName }}</td>
|
||||
<td nzAlign="left">
|
||||
<div *ngIf="data.category == 'none'">{{ 'mxk.apps.category.none' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1011'">{{ 'mxk.apps.category.1011' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1012'">{{ 'mxk.apps.category.1012' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1013'">{{ 'mxk.apps.category.1013' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1014'">{{ 'mxk.apps.category.1014' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1015'">{{ 'mxk.apps.category.1015' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1016'">{{ 'mxk.apps.category.1016' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1017'">{{ 'mxk.apps.category.1017' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1111'">{{ 'mxk.apps.category.1111' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1112'">{{ 'mxk.apps.category.1112' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1113'">{{ 'mxk.apps.category.1113' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1114'">{{ 'mxk.apps.category.1114' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1211'">{{ 'mxk.apps.category.1211' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1212'">{{ 'mxk.apps.category.1212' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1213'">{{ 'mxk.apps.category.1213' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1214'">{{ 'mxk.apps.category.1214' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1215'">{{ 'mxk.apps.category.1215' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1311'">{{ 'mxk.apps.category.1311' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1411'">{{ 'mxk.apps.category.1411' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1511'">{{ 'mxk.apps.category.1511' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1512'">{{ 'mxk.apps.category.1512' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1611'">{{ 'mxk.apps.category.1611' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1711'">{{ 'mxk.apps.category.1711' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1712'">{{ 'mxk.apps.category.1712' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1811'">{{ 'mxk.apps.category.1811' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1812'">{{ 'mxk.apps.category.1812' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1911'">{{ 'mxk.apps.category.1911' | i18n }}</div>
|
||||
<div *ngIf="data.category == '1912'">{{ 'mxk.apps.category.1912' | i18n }}</div>
|
||||
</td>
|
||||
<td nzAlign="center" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button nz-button type="button" (click)="onDelete($event, data.id)" nzDanger>{{ 'mxk.text.delete' | i18n
|
||||
}}</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
</nz-card>
|
||||
@ -27,9 +27,9 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||
|
||||
import { RolePermissionsService } from '../../../service/role-permissions.service';
|
||||
import { GroupPermissionsService } from '../../../service/group-permissions.service';
|
||||
import { set2String } from '../../../shared/index';
|
||||
import { SelectRolesComponent } from '../roles/select-roles/select-roles.component';
|
||||
import { SelectGroupsComponent } from '../../idm/groups/select-groups/select-groups.component';
|
||||
import { PermissionsEditerComponent } from './permissions-editer/permissions-editer.component';
|
||||
|
||||
@Component({
|
||||
@ -42,8 +42,8 @@ export class PermissionsComponent implements OnInit {
|
||||
params: {
|
||||
displayName: String;
|
||||
username: String;
|
||||
roleId: String;
|
||||
roleName: String;
|
||||
groupId: String;
|
||||
groupName: String;
|
||||
appName: String;
|
||||
appId: String;
|
||||
startDate: String;
|
||||
@ -69,8 +69,8 @@ export class PermissionsComponent implements OnInit {
|
||||
params: {
|
||||
displayName: '',
|
||||
username: '',
|
||||
roleId: '',
|
||||
roleName: '',
|
||||
groupId: '',
|
||||
groupName: '',
|
||||
appName: '',
|
||||
appId: '',
|
||||
startDate: '',
|
||||
@ -96,7 +96,7 @@ export class PermissionsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalService: NzModalService,
|
||||
private rolePermissionsService: RolePermissionsService,
|
||||
private groupPermissionsService: GroupPermissionsService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@ -107,9 +107,9 @@ export class PermissionsComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.route.snapshot.queryParams['roleId']) {
|
||||
this.query.params.roleId = this.route.snapshot.queryParams['roleId'];
|
||||
this.query.params.roleName = this.route.snapshot.queryParams['roleName'];
|
||||
if (this.route.snapshot.queryParams['groupId']) {
|
||||
this.query.params.groupId = this.route.snapshot.queryParams['groupId'];
|
||||
this.query.params.groupName = this.route.snapshot.queryParams['groupName'];
|
||||
}
|
||||
this.query.tableInitialize = false;
|
||||
}
|
||||
@ -130,7 +130,7 @@ export class PermissionsComponent implements OnInit {
|
||||
|
||||
onBatchDelete(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
this.rolePermissionsService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||
this.groupPermissionsService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||
this.fetch();
|
||||
@ -148,7 +148,7 @@ export class PermissionsComponent implements OnInit {
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {
|
||||
isEdit: false,
|
||||
roleId: this.query.params.roleId
|
||||
groupId: this.query.params.groupId
|
||||
},
|
||||
nzWidth: 700,
|
||||
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
|
||||
@ -164,7 +164,7 @@ export class PermissionsComponent implements OnInit {
|
||||
onSelect(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
const modal = this.modalService.create({
|
||||
nzContent: SelectRolesComponent,
|
||||
nzContent: SelectGroupsComponent,
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {},
|
||||
nzWidth: 700,
|
||||
@ -173,8 +173,8 @@ export class PermissionsComponent implements OnInit {
|
||||
// Return a result when closed
|
||||
modal.afterClose.subscribe(result => {
|
||||
if (result.refresh) {
|
||||
this.query.params.roleName = result.data.roleName;
|
||||
this.query.params.roleId = result.data.id;
|
||||
this.query.params.groupName = result.data.groupName;
|
||||
this.query.params.groupId = result.data.id;
|
||||
console.log(result);
|
||||
this.fetch();
|
||||
}
|
||||
@ -183,7 +183,7 @@ export class PermissionsComponent implements OnInit {
|
||||
|
||||
onDelete(e: MouseEvent, deleteId: String): void {
|
||||
e.preventDefault();
|
||||
this.rolePermissionsService.delete(deleteId).subscribe(res => {
|
||||
this.groupPermissionsService.delete(deleteId).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||
this.fetch();
|
||||
@ -207,7 +207,7 @@ export class PermissionsComponent implements OnInit {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.rolePermissionsService.member(this.query.params).subscribe(res => {
|
||||
this.groupPermissionsService.member(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
|
||||
@ -1,106 +0,0 @@
|
||||
<page-header> </page-header>
|
||||
|
||||
<nz-card [nzBordered]="false">
|
||||
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="16" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.roleName"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="roleName"
|
||||
placeholder=""
|
||||
id="roleName"
|
||||
/>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
||||
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">{{ 'mxk.text.add' | i18n }}</button>
|
||||
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">{{
|
||||
'mxk.text.delete' | i18n
|
||||
}}</button>
|
||||
</div>
|
||||
<nz-table
|
||||
#dynamicTable
|
||||
nzTableLayout="auto"
|
||||
nzSize="small"
|
||||
nzBordered
|
||||
nzShowSizeChanger
|
||||
[nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false"
|
||||
[nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber"
|
||||
[nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)"
|
||||
nzWidth="100%"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate" (nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.category' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.text.description' | i18n }}</th>
|
||||
<th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td
|
||||
[nzChecked]="query.tableCheckedId.has(data.id)"
|
||||
[nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"
|
||||
></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left" nzBreakWord="false">{{ data.roleName }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'app'"> {{ 'mxk.roles.category.app' | i18n }}</td>
|
||||
<td nzAlign="left">{{ data.description }}</td>
|
||||
<td nzAlign="center" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button nz-button type="button" (click)="onEdit($event, data.id)">{{ 'mxk.text.edit' | i18n }}</button>
|
||||
<button nz-button nz-dropdown [nzDropdownMenu]="menuMoreAction">
|
||||
{{ 'mxk.text.moreaction' | i18n }}
|
||||
<i nz-icon nzType="down"></i>
|
||||
</button>
|
||||
|
||||
<nz-dropdown-menu #menuMoreAction="nzDropdownMenu">
|
||||
<ul nz-menu>
|
||||
<li nz-menu-item (click)="onMembers($event, data.id, data.roleName)">{{ 'mxk.roles.member' | i18n }}</li>
|
||||
<li nz-menu-item (click)="onPermissions($event, data.id, data.roleName)">{{ 'mxk.roles.permissions' | i18n }}</li>
|
||||
<li
|
||||
nz-menu-item
|
||||
*ngIf="data.roleCode != 'ROLE_ADMINISTRATORS' && data.roleCode != 'ROLE_ALL_USER' && data.roleCode != 'ROLE_MANAGERS'"
|
||||
(click)="onDelete($event, data.id)"
|
||||
nzDanger
|
||||
>{{ 'mxk.text.delete' | i18n }}</li
|
||||
>
|
||||
</ul>
|
||||
</nz-dropdown-menu>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</nz-card>
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RoleMembersEditerComponent } from './role-members-editer.component';
|
||||
import { RoleMembersEditerComponent } from './group-members-editer.component';
|
||||
|
||||
describe('GroupMembersEditerComponent', () => {
|
||||
let component: GroupMembersEditerComponent;
|
||||
@ -24,15 +24,15 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
|
||||
import { Roles } from '../../../../entity/Roles';
|
||||
import { RoleMembersService } from '../../../../service/role-members.service';
|
||||
import { Groups } from '../../../../entity/Groups';
|
||||
import { GroupMembersService } from '../../../../service/group-members.service';
|
||||
@Component({
|
||||
selector: 'app-role-members-editer',
|
||||
templateUrl: './role-members-editer.component.html',
|
||||
styleUrls: ['./role-members-editer.component.less']
|
||||
selector: 'app-group-members-editer',
|
||||
templateUrl: './group-members-editer.component.html',
|
||||
styleUrls: ['./group-members-editer.component.less']
|
||||
})
|
||||
export class RoleMembersEditerComponent implements OnInit {
|
||||
@Input() roleId?: String;
|
||||
export class GroupMembersEditerComponent implements OnInit {
|
||||
@Input() groupId?: String;
|
||||
@Input() isEdit?: boolean;
|
||||
|
||||
query: {
|
||||
@ -40,7 +40,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
||||
name: String;
|
||||
displayName: String;
|
||||
username: String;
|
||||
roleId: String;
|
||||
groupId: String;
|
||||
startDate: String;
|
||||
endDate: String;
|
||||
startDatePicker: Date;
|
||||
@ -64,7 +64,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
||||
name: '',
|
||||
displayName: '',
|
||||
username: '',
|
||||
roleId: '',
|
||||
groupId: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
startDatePicker: addDays(new Date(), -30),
|
||||
@ -87,7 +87,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalRef: NzModalRef,
|
||||
private roleMembersService: RoleMembersService,
|
||||
private groupMembersService: GroupMembersService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@ -96,8 +96,8 @@ export class RoleMembersEditerComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.roleId) {
|
||||
this.query.params.roleId = this.roleId;
|
||||
if (this.groupId) {
|
||||
this.query.params.groupId = this.groupId;
|
||||
this.fetch();
|
||||
}
|
||||
}
|
||||
@ -127,7 +127,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.roleMembersService.memberOut(this.query.params).subscribe(res => {
|
||||
this.groupMembersService.memberOut(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -172,7 +172,7 @@ export class RoleMembersEditerComponent implements OnInit {
|
||||
memberIds = `${memberIds},${selectedData[i].id}`;
|
||||
memberNames = `${memberNames},${selectedData[i].username}`;
|
||||
}
|
||||
this.roleMembersService.add({ type: 'USER', roleId: this.roleId, memberId: memberIds, memberName: memberNames }).subscribe(res => {
|
||||
this.groupMembersService.add({ type: 'USER', groupId: this.groupId, memberId: memberIds, memberName: memberNames }).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -5,11 +5,11 @@
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 24, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="8" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="roleName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-label nzFor="groupName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<nz-input-group nzSearch [nzAddOnAfter]="suffixButton">
|
||||
<input nz-input [(ngModel)]="query.params.roleName" [ngModelOptions]="{ standalone: true }"
|
||||
name="roleName" readonly placeholder="" id="roleName" />
|
||||
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }"
|
||||
name="groupName" readonly placeholder="" id="groupName" />
|
||||
</nz-input-group>
|
||||
<ng-template #suffixButton>
|
||||
<button nz-button nzType="primary" (click)="onSelect($event)" nzSearch>{{ 'mxk.text.select' | i18n
|
||||
@ -23,7 +23,7 @@
|
||||
<nz-form-label nzFor="name">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username"
|
||||
placeholder="" id="username" />
|
||||
placeholder="" id="username" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@ -47,45 +47,46 @@
|
||||
</div>
|
||||
|
||||
<div nz-col nzMd="24" nzSm="24">
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber"
|
||||
[nzLoading]="this.query.tableLoading" (nzQueryParams)="onQueryParamsChange($event)">
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)">
|
||||
<thead>
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.username' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.displayName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.department' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.jobTitle' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.gender' | i18n }}</th>
|
||||
<th nzAlign="center" class="table_cell_action_1">{{ 'mxk.text.action' | i18n }}</th>
|
||||
</tr>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.username' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.displayName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.department' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.jobTitle' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.gender' | i18n }}</th>
|
||||
<th nzAlign="center" class="table_cell_action_1">{{ 'mxk.text.action' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left"> {{ data.roleName }}</td>
|
||||
<td nzAlign="left"> {{ data.username }}</td>
|
||||
<td nzAlign="left"> {{ data.displayName }}</td>
|
||||
<td nzAlign="left"> {{ data.department }}</td>
|
||||
<td nzAlign="left"> {{ data.jobTitle }}</td>
|
||||
<td nzAlign="center"> {{ data.gender == 1 ? ('mxk.users.gender.female' | i18n) : ('mxk.users.gender.male' |
|
||||
i18n) }}</td>
|
||||
<td nzAlign="center" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button *ngIf="data.category == 'static'" nz-button type="button" (click)="onDelete($event, data.id)"
|
||||
nzDanger>{{
|
||||
'mxk.text.delete' | i18n
|
||||
}}</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<td nzAlign="left"> {{ data.groupName }}</td>
|
||||
<td nzAlign="left"> {{ data.username }}</td>
|
||||
<td nzAlign="left"> {{ data.displayName }}</td>
|
||||
<td nzAlign="left"> {{ data.department }}</td>
|
||||
<td nzAlign="left"> {{ data.jobTitle }}</td>
|
||||
<td nzAlign="center"> {{ data.gender == 1 ? ('mxk.users.gender.female' | i18n) : ('mxk.users.gender.male' |
|
||||
i18n) }}</td>
|
||||
<td nzAlign="center" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button *ngIf="data.category == 'static'" nz-button type="button" (click)="onDelete($event, data.id)"
|
||||
nzDanger>{{
|
||||
'mxk.text.delete' | i18n
|
||||
}}</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
</nz-card>
|
||||
@ -27,24 +27,24 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||
|
||||
import { RoleMembersService } from '../../../service/role-members.service';
|
||||
import { GroupMembersService } from '../../../service/group-members.service';
|
||||
import { set2String } from '../../../shared/index';
|
||||
import { SelectRolesComponent } from '../roles/select-roles/select-roles.component';
|
||||
import { MemberRolesEditerComponent } from './member-roles-editer/member-roles-editer.component';
|
||||
import { RoleMembersEditerComponent } from './role-members-editer/role-members-editer.component';
|
||||
import { SelectGroupsComponent } from '../groups/select-groups/select-groups.component';
|
||||
import { GroupMembersEditerComponent } from './group-members-editer/group-members-editer.component';
|
||||
import { MemberGroupsEditerComponent } from './member-groups-editer/member-groups-editer.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-role-members',
|
||||
templateUrl: './role-members.component.html',
|
||||
styleUrls: ['./role-members.component.less']
|
||||
selector: 'app-group-members',
|
||||
templateUrl: './group-members.component.html',
|
||||
styleUrls: ['./group-members.component.less']
|
||||
})
|
||||
export class RoleMembersComponent implements OnInit {
|
||||
export class GroupMembersComponent implements OnInit {
|
||||
query: {
|
||||
params: {
|
||||
roleName: String;
|
||||
groupName: String;
|
||||
displayName: String;
|
||||
username: String;
|
||||
roleId: String;
|
||||
groupId: String;
|
||||
appName: String;
|
||||
appId: String;
|
||||
startDate: String;
|
||||
@ -68,10 +68,10 @@ export class RoleMembersComponent implements OnInit {
|
||||
checked: boolean;
|
||||
} = {
|
||||
params: {
|
||||
roleName: '',
|
||||
groupName: '',
|
||||
displayName: '',
|
||||
username: '',
|
||||
roleId: '',
|
||||
groupId: '',
|
||||
appName: '',
|
||||
appId: '',
|
||||
startDate: '',
|
||||
@ -97,7 +97,7 @@ export class RoleMembersComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalService: NzModalService,
|
||||
private roleMembersService: RoleMembersService,
|
||||
private groupMembersService: GroupMembersService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@ -110,9 +110,9 @@ export class RoleMembersComponent implements OnInit {
|
||||
if (this.route.snapshot.queryParams['username']) {
|
||||
this.query.params.username = this.route.snapshot.queryParams['username'];
|
||||
}
|
||||
if (this.route.snapshot.queryParams['roleId']) {
|
||||
this.query.params.roleId = this.route.snapshot.queryParams['roleId'];
|
||||
this.query.params.roleName = this.route.snapshot.queryParams['roleName'];
|
||||
if (this.route.snapshot.queryParams['groupId']) {
|
||||
this.query.params.groupId = this.route.snapshot.queryParams['groupId'];
|
||||
this.query.params.groupName = this.route.snapshot.queryParams['groupName'];
|
||||
}
|
||||
this.query.tableInitialize = false;
|
||||
}
|
||||
@ -131,14 +131,14 @@ export class RoleMembersComponent implements OnInit {
|
||||
|
||||
onReset(): void {
|
||||
this.query.params.username = '';
|
||||
this.query.params.roleId = '';
|
||||
this.query.params.roleName = '';
|
||||
this.query.params.groupId = '';
|
||||
this.query.params.groupName = '';
|
||||
this.fetch();
|
||||
}
|
||||
|
||||
onBatchDelete(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
this.roleMembersService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||
this.groupMembersService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||
this.fetch();
|
||||
@ -153,7 +153,7 @@ export class RoleMembersComponent implements OnInit {
|
||||
e.preventDefault();
|
||||
if (this.query.params.username != '') {
|
||||
const modal = this.modalService.create({
|
||||
nzContent: MemberRolesEditerComponent,
|
||||
nzContent: MemberGroupsEditerComponent,
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {
|
||||
username: this.query.params.username
|
||||
@ -167,13 +167,13 @@ export class RoleMembersComponent implements OnInit {
|
||||
this.fetch();
|
||||
}
|
||||
});
|
||||
} else if (this.query.params.roleId != '') {
|
||||
} else if (this.query.params.groupId != '') {
|
||||
const modal = this.modalService.create({
|
||||
nzContent: RoleMembersEditerComponent,
|
||||
nzContent: GroupMembersEditerComponent,
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {
|
||||
isEdit: false,
|
||||
roleId: this.query.params.roleId
|
||||
groupId: this.query.params.groupId
|
||||
},
|
||||
nzWidth: 700,
|
||||
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
|
||||
@ -191,7 +191,7 @@ export class RoleMembersComponent implements OnInit {
|
||||
e.preventDefault();
|
||||
|
||||
const modal = this.modalService.create({
|
||||
nzContent: SelectRolesComponent,
|
||||
nzContent: SelectGroupsComponent,
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {},
|
||||
nzWidth: 700,
|
||||
@ -200,8 +200,8 @@ export class RoleMembersComponent implements OnInit {
|
||||
// Return a result when closed
|
||||
modal.afterClose.subscribe(result => {
|
||||
if (result.refresh) {
|
||||
this.query.params.roleName = result.data.roleName;
|
||||
this.query.params.roleId = result.data.id;
|
||||
this.query.params.groupName = result.data.groupName;
|
||||
this.query.params.groupId = result.data.id;
|
||||
console.log(result);
|
||||
this.fetch();
|
||||
}
|
||||
@ -210,7 +210,7 @@ export class RoleMembersComponent implements OnInit {
|
||||
|
||||
onDelete(e: MouseEvent, deleteId: String): void {
|
||||
e.preventDefault();
|
||||
this.roleMembersService.delete(deleteId).subscribe(res => {
|
||||
this.groupMembersService.delete(deleteId).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||
this.fetch();
|
||||
@ -234,7 +234,7 @@ export class RoleMembersComponent implements OnInit {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.roleMembersService.member(this.query.params).subscribe(res => {
|
||||
this.groupMembersService.member(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -5,17 +5,17 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.roleName" [ngModelOptions]="{ standalone: true }"
|
||||
name="roleName" placeholder="" id="roleName" />
|
||||
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }" name="groupName"
|
||||
placeholder="" id="groupName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{
|
||||
'mxk.text.query' | i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{
|
||||
'mxk.text.reset' | i18n }}</button>
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n
|
||||
}}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n
|
||||
}}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
||||
@ -23,32 +23,32 @@
|
||||
</div>
|
||||
</form>
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber"
|
||||
[nzLoading]="this.query.tableLoading" (nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.category' | i18n }}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.category' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left"> {{ data.roleName }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'app'"> {{ 'mxk.roles.category.app' | i18n }}</td>
|
||||
</tr>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left"> {{ data.roleName }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'app'"> {{ 'mxk.roles.category.app' | i18n }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
<div *nzModalFooter style="display: none">
|
||||
<button nz-button nzType="default" (click)="onClose($event)">{{ 'mxk.text.close' | i18n }}</button>
|
||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.submit' | i18n }}</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -24,18 +24,18 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
|
||||
import { RoleMembersService } from '../../../../service/role-members.service';
|
||||
import { GroupMembersService } from '../../../../service/group-members.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-member-roles-editer',
|
||||
templateUrl: './member-roles-editer.component.html',
|
||||
styleUrls: ['./member-roles-editer.component.less']
|
||||
selector: 'app-member-groups-editer',
|
||||
templateUrl: './member-groups-editer.component.html',
|
||||
styleUrls: ['./member-groups-editer.component.less']
|
||||
})
|
||||
export class MemberRolesEditerComponent implements OnInit {
|
||||
export class MemberGroupsEditerComponent implements OnInit {
|
||||
@Input() username?: String;
|
||||
query: {
|
||||
params: {
|
||||
roleName: String;
|
||||
groupName: String;
|
||||
username: String;
|
||||
protocol: String;
|
||||
startDate: String;
|
||||
@ -58,7 +58,7 @@ export class MemberRolesEditerComponent implements OnInit {
|
||||
checked: boolean;
|
||||
} = {
|
||||
params: {
|
||||
roleName: '',
|
||||
groupName: '',
|
||||
username: '',
|
||||
protocol: '',
|
||||
startDate: '',
|
||||
@ -83,7 +83,7 @@ export class MemberRolesEditerComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalRef: NzModalRef,
|
||||
private roleMembersService: RoleMembersService,
|
||||
private groupMembersService: GroupMembersService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@ -123,7 +123,7 @@ export class MemberRolesEditerComponent implements OnInit {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.roleMembersService.rolesNoMember(this.query.params).subscribe(res => {
|
||||
this.groupMembersService.noMember(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -168,7 +168,7 @@ export class MemberRolesEditerComponent implements OnInit {
|
||||
roleIds = `${roleIds},${selectedData[i].id}`;
|
||||
roleNames = `${roleNames},${selectedData[i].name}`;
|
||||
}
|
||||
this.roleMembersService.addMember2Roles({ username: this.username, roleId: roleIds, roleName: roleNames }).subscribe(res => {
|
||||
this.groupMembersService.addMember2Roles({ username: this.username, roleId: roleIds, roleName: roleNames }).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -22,14 +22,14 @@ import format from 'date-fns/format';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
|
||||
import { Roles } from '../../../../entity/Roles';
|
||||
import { Groups } from '../../../../entity/Groups';
|
||||
import { TreeNodes } from '../../../../entity/TreeNodes';
|
||||
import { GroupsService } from '../../../../service/Groups.service';
|
||||
import { OrganizationsService } from '../../../../service/organizations.service';
|
||||
import { RolesService } from '../../../../service/roles.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-role-editer',
|
||||
templateUrl: './role-editer.component.html',
|
||||
selector: 'app-group-editer',
|
||||
templateUrl: './group-editer.component.html',
|
||||
styles: [
|
||||
`
|
||||
nz-form-item {
|
||||
@ -37,18 +37,18 @@ import { RolesService } from '../../../../service/roles.service';
|
||||
}
|
||||
`
|
||||
],
|
||||
styleUrls: ['./role-editer.component.less']
|
||||
styleUrls: ['./group-editer.component.less']
|
||||
})
|
||||
export class RoleEditerComponent implements OnInit {
|
||||
export class GroupEditerComponent implements OnInit {
|
||||
@Input() id?: String;
|
||||
@Input() isEdit?: boolean;
|
||||
|
||||
form: {
|
||||
submitting: boolean;
|
||||
model: Roles;
|
||||
model: Groups;
|
||||
} = {
|
||||
submitting: false,
|
||||
model: new Roles()
|
||||
model: new Groups()
|
||||
};
|
||||
|
||||
// TreeNodes
|
||||
@ -60,7 +60,7 @@ export class RoleEditerComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalRef: NzModalRef,
|
||||
private rolesService: RolesService,
|
||||
private groupsService: GroupsService,
|
||||
private orgsService: OrganizationsService,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@ -71,7 +71,7 @@ export class RoleEditerComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
this.tree();
|
||||
if (this.isEdit) {
|
||||
this.rolesService.get(`${this.id}`).subscribe(res => {
|
||||
this.groupsService.get(`${this.id}`).subscribe(res => {
|
||||
this.form.model.init(res.data);
|
||||
this.selectValues = this.form.model.orgIdsList.split(',');
|
||||
this.cdr.detectChanges();
|
||||
@ -103,7 +103,7 @@ export class RoleEditerComponent implements OnInit {
|
||||
this.form.model.orgIdsList = `${this.form.model.orgIdsList + value},`;
|
||||
});
|
||||
|
||||
(this.isEdit ? this.rolesService.update(this.form.model) : this.rolesService.add(this.form.model)).subscribe(res => {
|
||||
(this.isEdit ? this.groupsService.update(this.form.model) : this.groupsService.add(this.form.model)).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi(this.isEdit ? 'mxk.alert.update.success' : 'mxk.alert.add.success'));
|
||||
} else {
|
||||
@ -0,0 +1,85 @@
|
||||
<page-header> </page-header>
|
||||
|
||||
<nz-card [nzBordered]="false">
|
||||
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="16" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="name">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }"
|
||||
name="groupName" placeholder="" id="groupName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||
i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
||||
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">{{ 'mxk.text.add' | i18n }}</button>
|
||||
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">{{
|
||||
'mxk.text.delete' | i18n
|
||||
}}</button>
|
||||
</div>
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.category' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.text.description' | i18n }}</th>
|
||||
<th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left" nzBreakWord="false">{{ data.groupName }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'app'"> {{ 'mxk.roles.category.app' | i18n }}</td>
|
||||
<td nzAlign="left">{{ data.description }}</td>
|
||||
<td nzAlign="center" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button nz-button type="button" (click)="onEdit($event, data.id)">{{ 'mxk.text.edit' | i18n }}</button>
|
||||
<button nz-button nz-dropdown [nzDropdownMenu]="menuMoreAction">
|
||||
{{ 'mxk.text.moreaction' | i18n }}
|
||||
<i nz-icon nzType="down"></i>
|
||||
</button>
|
||||
|
||||
<nz-dropdown-menu #menuMoreAction="nzDropdownMenu">
|
||||
<ul nz-menu>
|
||||
<li nz-menu-item (click)="onMembers($event, data.id, data.groupName)">{{ 'mxk.roles.member' | i18n }}
|
||||
</li>
|
||||
<li nz-menu-item (click)="onPermissions($event, data.id, data.groupName)">{{ 'mxk.roles.permissions' |
|
||||
i18n }}</li>
|
||||
<li nz-menu-item
|
||||
*ngIf="data.roleCode != 'ROLE_ADMINISTRATORS' && data.roleCode != 'ROLE_ALL_USER' && data.roleCode != 'ROLE_MANAGERS'"
|
||||
(click)="onDelete($event, data.id)" nzDanger>{{ 'mxk.text.delete' | i18n }}</li>
|
||||
</ul>
|
||||
</nz-dropdown-menu>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</nz-card>
|
||||
@ -25,19 +25,19 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
|
||||
import { RolesService } from '../../../service/roles.service';
|
||||
import { GroupsService } from '../../../service/Groups.service';
|
||||
import { set2String } from '../../../shared/index';
|
||||
import { RoleEditerComponent } from './role-editer/role-editer.component';
|
||||
import { GroupEditerComponent } from './group-editer/group-editer.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-roles',
|
||||
templateUrl: './roles.component.html',
|
||||
styleUrls: ['./roles.component.less']
|
||||
selector: 'app-groups',
|
||||
templateUrl: './groups.component.html',
|
||||
styleUrls: ['./groups.component.less']
|
||||
})
|
||||
export class RolesComponent implements OnInit {
|
||||
export class GroupsComponent implements OnInit {
|
||||
query: {
|
||||
params: {
|
||||
roleName: String;
|
||||
groupName: String;
|
||||
displayName: String;
|
||||
employeeNumber: String;
|
||||
startDate: String;
|
||||
@ -60,7 +60,7 @@ export class RolesComponent implements OnInit {
|
||||
checked: boolean;
|
||||
} = {
|
||||
params: {
|
||||
roleName: '',
|
||||
groupName: '',
|
||||
displayName: '',
|
||||
employeeNumber: '',
|
||||
startDate: '',
|
||||
@ -86,7 +86,7 @@ export class RolesComponent implements OnInit {
|
||||
constructor(
|
||||
private modalService: NzModalService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private rolesService: RolesService,
|
||||
private groupsService: GroupsService,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
private router: Router,
|
||||
@ -112,7 +112,7 @@ export class RolesComponent implements OnInit {
|
||||
|
||||
onBatchDelete(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
this.rolesService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||
this.groupsService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||
this.fetch();
|
||||
@ -126,7 +126,7 @@ export class RolesComponent implements OnInit {
|
||||
onAdd(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
const modal = this.modalService.create({
|
||||
nzContent: RoleEditerComponent,
|
||||
nzContent: GroupEditerComponent,
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {
|
||||
isEdit: false,
|
||||
@ -146,7 +146,7 @@ export class RolesComponent implements OnInit {
|
||||
e.preventDefault();
|
||||
|
||||
const modal = this.modalService.create({
|
||||
nzContent: RoleEditerComponent,
|
||||
nzContent: GroupEditerComponent,
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {
|
||||
isEdit: true,
|
||||
@ -164,7 +164,7 @@ export class RolesComponent implements OnInit {
|
||||
|
||||
onDelete(e: MouseEvent, deleteId: String): void {
|
||||
e.preventDefault();
|
||||
this.rolesService.delete(deleteId).subscribe(res => {
|
||||
this.groupsService.delete(deleteId).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||
this.fetch();
|
||||
@ -196,7 +196,7 @@ export class RolesComponent implements OnInit {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.rolesService.fetch(this.query.params).subscribe(res => {
|
||||
this.groupsService.fetch(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -4,19 +4,19 @@
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="14" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="roleName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-label nzFor="groupName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.roleName" [ngModelOptions]="{ standalone: true }" name="roleName"
|
||||
placeholder="" id="roleName" />
|
||||
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }" name="groupName"
|
||||
placeholder="" id="groupName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n
|
||||
}}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n
|
||||
}}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
||||
@ -25,31 +25,31 @@
|
||||
</form>
|
||||
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger [nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
[nzFrontPagination]="false" [nzTotal]="query.results.records" [nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize" [nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.category' | i18n }}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.name' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.roles.category' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left"> {{ data.roleName }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||
</tr>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left"> {{ data.groupName }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
<div *nzModalFooter style="display: none">
|
||||
<button nz-button nzType="default" (click)="onClose($event)">{{ 'mxk.text.close' | i18n }}</button>
|
||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.submit' | i18n }}</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -23,17 +23,17 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
|
||||
import { RolesService } from '../../../../service/roles.service';
|
||||
import { GroupsService } from '../../../../service/Groups.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-select-roles',
|
||||
templateUrl: './select-roles.component.html',
|
||||
styleUrls: ['./select-roles.component.less']
|
||||
selector: 'app-select-groups',
|
||||
templateUrl: './select-groups.component.html',
|
||||
styleUrls: ['./select-groups.component.less']
|
||||
})
|
||||
export class SelectRolesComponent implements OnInit {
|
||||
export class SelectGroupsComponent implements OnInit {
|
||||
query: {
|
||||
params: {
|
||||
roleName: String;
|
||||
groupName: String;
|
||||
displayName: String;
|
||||
protocol: String;
|
||||
startDate: String;
|
||||
@ -56,7 +56,7 @@ export class SelectRolesComponent implements OnInit {
|
||||
checked: boolean;
|
||||
} = {
|
||||
params: {
|
||||
roleName: '',
|
||||
groupName: '',
|
||||
displayName: '',
|
||||
protocol: '',
|
||||
startDate: '',
|
||||
@ -81,7 +81,7 @@ export class SelectRolesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalRef: NzModalRef,
|
||||
private rolesService: RolesService,
|
||||
private groupsService: GroupsService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@ -117,7 +117,7 @@ export class SelectRolesComponent implements OnInit {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.rolesService.fetch(this.query.params).subscribe(res => {
|
||||
this.groupsService.fetch(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { SharedModule } from '@shared';
|
||||
import { NzIconModule } from 'ng-zorro-antd/icon';
|
||||
|
||||
import { GroupMembersEditerComponent } from './group-members/group-members-editer/group-members-editer.component';
|
||||
import { GroupMembersComponent } from './group-members/group-members.component';
|
||||
import { MemberGroupsEditerComponent } from './group-members/member-groups-editer/member-groups-editer.component';
|
||||
import { GroupEditerComponent } from './groups/group-editer/group-editer.component';
|
||||
import { GroupsComponent } from './groups/groups.component';
|
||||
import { SelectGroupsComponent } from './groups/select-groups/select-groups.component';
|
||||
import { OrganizationsComponent } from './organizations/organizations.component';
|
||||
import { UsersComponent } from './users/users.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: 'organizations', component: OrganizationsComponent },
|
||||
{ path: 'users', component: UsersComponent },
|
||||
{ path: 'groups', component: GroupsComponent },
|
||||
{ path: 'groupmembers', component: GroupMembersComponent }
|
||||
];
|
||||
|
||||
const COMPONENTS = [
|
||||
//UsersComponent,
|
||||
OrganizationsComponent,
|
||||
GroupsComponent,
|
||||
GroupMembersComponent,
|
||||
SelectGroupsComponent,
|
||||
GroupMembersEditerComponent,
|
||||
MemberGroupsEditerComponent,
|
||||
GroupEditerComponent
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
declarations: [...COMPONENTS],
|
||||
imports: [FormsModule, NzIconModule, SharedModule, CommonModule, RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class IdmModule {}
|
||||
@ -26,8 +26,8 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||
import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select';
|
||||
|
||||
import { Organizations } from '../../../entity/Organizations';
|
||||
import { OrganizationsService } from '../../../service/organizations.service';
|
||||
import { Organizations } from '../../../../entity/Organizations';
|
||||
import { OrganizationsService } from '../../../../service/organizations.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-organization-editer',
|
||||
@ -26,10 +26,10 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||
|
||||
import { PageResults } from '../../entity/PageResults';
|
||||
import { TreeNodes } from '../../entity/TreeNodes';
|
||||
import { OrganizationsService } from '../../service/organizations.service';
|
||||
import { set2String } from '../../shared/index';
|
||||
import { PageResults } from '../../../entity/PageResults';
|
||||
import { TreeNodes } from '../../../entity/TreeNodes';
|
||||
import { OrganizationsService } from '../../../service/organizations.service';
|
||||
import { set2String } from '../../../shared/index';
|
||||
import { OrganizationEditerComponent } from './organization-editer/organization-editer.component';
|
||||
|
||||
@Component({
|
||||
@ -21,9 +21,9 @@ import { ALAIN_I18N_TOKEN, SettingsService } from '@delon/theme';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
|
||||
import { ChangePassword } from '../../../entity/ChangePassword';
|
||||
import { PasswordService } from '../../../service/password.service';
|
||||
import { UsersService } from '../../../service/users.service';
|
||||
import { ChangePassword } from '../../../../entity/ChangePassword';
|
||||
import { PasswordService } from '../../../../service/password.service';
|
||||
import { UsersService } from '../../../../service/users.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-password',
|
||||
@ -7,15 +7,15 @@
|
||||
<nz-form-label nzFor="name">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username"
|
||||
placeholder="" id="username" />
|
||||
placeholder="" id="username" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 10" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n
|
||||
}}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n
|
||||
}}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.confirm' | i18n }}</button>
|
||||
@ -25,7 +25,7 @@
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="6" nzSm="24">
|
||||
<nz-tree nzShowLine="false" [nzCheckable]="treeNodes.checkable" nzBlockNode [nzData]="treeNodes.nodes"
|
||||
(nzClick)="activeNode($event)" (nzDblClick)="openFolder($event)" [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
|
||||
(nzClick)="activeNode($event)" (nzDblClick)="openFolder($event)" [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
|
||||
<ng-template #nzTreeTemplate let-node let-origin="origin">
|
||||
<span class="custom-node">
|
||||
<span *ngIf="!node.isLeaf">
|
||||
@ -41,38 +41,38 @@
|
||||
</div>
|
||||
<div nz-col nzMd="18" nzSm="24">
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered sizeChanger="true" nzShowSizeChanger
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
<th nzAlign="center" style="display: none">{{ 'mxk.text.id' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.username' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.displayName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.employeeNumber' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.department' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.jobTitle' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.gender' | i18n }}</th>
|
||||
</tr>
|
||||
<th nzAlign="center" style="display: none">{{ 'mxk.text.id' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.username' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.displayName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.employeeNumber' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.department' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.jobTitle' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.gender' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left"> {{ data.username }}</td>
|
||||
<td nzAlign="left"> {{ data.displayName }}</td>
|
||||
<td nzAlign="left"> {{ data.employeeNumber }}</td>
|
||||
<td nzAlign="left"> {{ data.department }}</td>
|
||||
<td nzAlign="left"> {{ data.jobTitle }}</td>
|
||||
<td nzAlign="center"> {{ data.gender == 1 ? ('mxk.users.gender.female' | i18n) : ('mxk.users.gender.male' |
|
||||
i18n) }}</td>
|
||||
</tr>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left"> {{ data.username }}</td>
|
||||
<td nzAlign="left"> {{ data.displayName }}</td>
|
||||
<td nzAlign="left"> {{ data.employeeNumber }}</td>
|
||||
<td nzAlign="left"> {{ data.department }}</td>
|
||||
<td nzAlign="left"> {{ data.jobTitle }}</td>
|
||||
<td nzAlign="center"> {{ data.gender == 1 ? ('mxk.users.gender.female' | i18n) : ('mxk.users.gender.male' |
|
||||
i18n) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</div>
|
||||
@ -80,4 +80,4 @@
|
||||
<button nz-button nzType="default" (click)="onClose($event)">{{ 'mxk.text.close' | i18n }}</button>
|
||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.submit' | i18n }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -24,10 +24,10 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||
|
||||
import { TreeNodes } from '../../../entity/TreeNodes';
|
||||
import { OrganizationsService } from '../../../service/organizations.service';
|
||||
import { UsersService } from '../../../service/users.service';
|
||||
import { set2String } from '../../../shared/index';
|
||||
import { TreeNodes } from '../../../../entity/TreeNodes';
|
||||
import { OrganizationsService } from '../../../../service/organizations.service';
|
||||
import { UsersService } from '../../../../service/users.service';
|
||||
import { set2String } from '../../../../shared/index';
|
||||
|
||||
@Component({
|
||||
selector: 'app-select-user',
|
||||
@ -26,8 +26,8 @@ import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/
|
||||
import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select';
|
||||
import { NzUploadFile, NzUploadChangeParam } from 'ng-zorro-antd/upload';
|
||||
|
||||
import { Users } from '../../../entity/Users';
|
||||
import { UsersService } from '../../../service/users.service';
|
||||
import { Users } from '../../../../entity/Users';
|
||||
import { UsersService } from '../../../../service/users.service';
|
||||
|
||||
const getBase64 = (file: File): Promise<string | ArrayBuffer | null> =>
|
||||
new Promise((resolve, reject) => {
|
||||
@ -0,0 +1,159 @@
|
||||
<page-header> </page-header>
|
||||
|
||||
<nz-card [nzBordered]="false">
|
||||
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 24, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="16" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="name">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username"
|
||||
placeholder="" id="username" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||
i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</nz-card>
|
||||
<nz-card [nzBordered]="false">
|
||||
<div nz-row>
|
||||
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
||||
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">
|
||||
{{ 'mxk.text.add' | i18n }}
|
||||
</button>
|
||||
<button nz-button type="button" [nzType]="'primary'" (click)="changePassword($event)">
|
||||
{{ 'mxk.text.changepassword' | i18n }}
|
||||
</button>
|
||||
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">
|
||||
{{ 'mxk.text.delete' | i18n }}
|
||||
</button>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="6" class="grid-border">
|
||||
<nz-tree nzShowLine="false" [nzCheckable]="treeNodes.checkable" nzBlockNode [nzData]="treeNodes.nodes"
|
||||
(nzClick)="activeNode($event)" (nzDblClick)="openFolder($event)" [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
|
||||
<ng-template #nzTreeTemplate let-node let-origin="origin">
|
||||
<span class="custom-node">
|
||||
<span *ngIf="!node.isLeaf" (contextmenu)="contextMenu($event, menu)">
|
||||
<i nz-icon [nzType]="node.isExpanded ? 'folder-open' : 'folder'" (click)="openFolder(node)"></i>
|
||||
<span class="folder-name">{{ node.title + (origin.type == 'virtual' ? '_v' : '') }}</span>
|
||||
</span>
|
||||
<span *ngIf="node.isLeaf" (contextmenu)="contextMenu($event, menu)">
|
||||
<i nz-icon nzType="file"></i>
|
||||
<span class="file-name">{{ node.title + (origin.type == 'virtual' ? '_v' : '') }}</span>
|
||||
</span>
|
||||
</span>
|
||||
</ng-template>
|
||||
<nz-dropdown-menu #menu="nzDropdownMenu">
|
||||
<ul nz-menu>
|
||||
<li nz-menu-item (click)="selectDropdown()">Action 1</li>
|
||||
<li nz-menu-item (click)="selectDropdown()">Action 2</li>
|
||||
</ul>
|
||||
</nz-dropdown-menu>
|
||||
</div>
|
||||
<div nz-col nzMd="18" nzSm="24" class="grid-border">
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered sizeChanger="true" nzShowSizeChanger
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
<th nzAlign="center" style="display: none">{{ 'mxk.text.id' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.username' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.displayName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.employeeNumber' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.department' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.jobTitle' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.gender' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.text.status' | i18n }}</th>
|
||||
<th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left"> {{ data.username }}</td>
|
||||
<td nzAlign="left"> {{ data.displayName }}</td>
|
||||
<td nzAlign="left"> {{ data.employeeNumber }}</td>
|
||||
<td nzAlign="left"> {{ data.department }}</td>
|
||||
<td nzAlign="left"> {{ data.jobTitle }}</td>
|
||||
<td nzAlign="center"> {{ data.gender == 1 ? ('mxk.users.gender.female' | i18n) : ('mxk.users.gender.male' |
|
||||
i18n) }}</td>
|
||||
<td nzAlign="center">
|
||||
<a title="{{ 'mxk.users.status.active' | i18n }}" *ngIf="data.status == 1">
|
||||
<i nz-icon nzType="check-circle" nzTheme="fill" style="color: green"> </i>
|
||||
</a>
|
||||
<a title="{{ 'mxk.users.status.inactive' | i18n }}" *ngIf="data.status == 2">
|
||||
<i nz-icon nzType="warning" nzTheme="fill" style="color: gray"></i>
|
||||
</a>
|
||||
<a title="{{ 'mxk.users.status.forbidden' | i18n }}" *ngIf="data.status == 4">
|
||||
<i nz-icon nzType="stop" nzTheme="fill" style="color: gray"></i>
|
||||
</a>
|
||||
<a title="{{ 'mxk.users.status.lock' | i18n }}" *ngIf="data.status == 5">
|
||||
<i nz-icon nzType="lock" nzTheme="fill" style="color: orange"></i>
|
||||
</a>
|
||||
<a title="{{ 'mxk.users.status.delete' | i18n }}" *ngIf="data.status == 9">
|
||||
<i nz-icon nzType="close-circle" nzTheme="fill" style="color: red"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td nzAlign="center" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button nz-button type="button" (click)="onEdit($event, data.id)">
|
||||
{{ 'mxk.text.edit' | i18n }}
|
||||
</button>
|
||||
<button *ngIf="data.status == 9" nz-button nz-dropdown>
|
||||
{{ 'mxk.text.moreaction' | i18n }}
|
||||
<i nz-icon nzType="down"></i>
|
||||
</button>
|
||||
<button *ngIf="data.status !== 9" nz-button nz-dropdown [nzDropdownMenu]="menuMoreAction">
|
||||
{{ 'mxk.text.moreaction' | i18n }}
|
||||
<i nz-icon nzType="down"></i>
|
||||
</button>
|
||||
<nz-dropdown-menu #menuMoreAction="nzDropdownMenu">
|
||||
<ul nz-menu>
|
||||
<li nz-menu-item *ngIf="data.status == 1"
|
||||
(click)="onNavToUrl($event, data.id, data.username, 'roles')">{{
|
||||
'mxk.text.roles' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 1" (click)="changePasswordById($event, data.id)">{{
|
||||
'mxk.text.changepassword' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 1" (click)="onUpdateStatus($event, data.id, 5)">{{
|
||||
'mxk.text.lock' | i18n }}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 1" (click)="onUpdateStatus($event, data.id, 4)">{{
|
||||
'mxk.text.disable' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 2" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||
'mxk.text.enable' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 4" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||
'mxk.text.enable' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 5" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||
'mxk.text.unlock' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item (click)="onDelete($event, data.id)" nzDanger>{{ 'mxk.text.delete' | i18n }}</li>
|
||||
</ul>
|
||||
</nz-dropdown-menu>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
@ -28,11 +28,11 @@ import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
|
||||
import { Users } from 'src/app/entity/Users';
|
||||
|
||||
import { PageResults } from '../../entity/PageResults';
|
||||
import { TreeNodes } from '../../entity/TreeNodes';
|
||||
import { OrganizationsService } from '../../service/organizations.service';
|
||||
import { UsersService } from '../../service/users.service';
|
||||
import { set2String } from '../../shared/index';
|
||||
import { PageResults } from '../../../entity/PageResults';
|
||||
import { TreeNodes } from '../../../entity/TreeNodes';
|
||||
import { OrganizationsService } from '../../../service/organizations.service';
|
||||
import { UsersService } from '../../../service/users.service';
|
||||
import { set2String } from '../../../shared/index';
|
||||
import { PasswordComponent } from './password/password.component';
|
||||
import { UserEditerComponent } from './user-editer/user-editer.component';
|
||||
|
||||
@ -20,8 +20,6 @@ import { RouterModule, Routes } from '@angular/router';
|
||||
import { SharedModule } from '@shared';
|
||||
import { NzIconModule } from 'ng-zorro-antd/icon';
|
||||
|
||||
import { RolesComponent } from '../access/roles/roles.component';
|
||||
import { SelectRolesComponent } from '../access/roles/select-roles/select-roles.component';
|
||||
import { PrivilegesComponent } from './privileges/privileges.component';
|
||||
import { ResourceEditerComponent } from './resources/resource-editer/resource-editer.component';
|
||||
import { ResourcesComponent } from './resources/resources.component';
|
||||
|
||||
@ -5,16 +5,10 @@
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="10" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="roleName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-label nzFor="groupName">{{ 'mxk.roles.name' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.roleName"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="roleName"
|
||||
placeholder=""
|
||||
id="roleName"
|
||||
/>
|
||||
<input nz-input [(ngModel)]="query.params.groupName" [ngModelOptions]="{ standalone: true }"
|
||||
name="groupName" placeholder="" id="groupName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@ -23,28 +17,23 @@
|
||||
<nz-form-label nzFor="name">{{ 'mxk.resources.appName' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<nz-input-group nzSearch [nzAddOnAfter]="suffixButton">
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.appName"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="appName"
|
||||
readonly
|
||||
placeholder=""
|
||||
id="appName"
|
||||
/>
|
||||
<input nz-input [(ngModel)]="query.params.appName" [ngModelOptions]="{ standalone: true }" name="appName"
|
||||
readonly placeholder="" id="appName" />
|
||||
</nz-input-group>
|
||||
<ng-template #suffixButton>
|
||||
<button nz-button nzType="primary" (click)="onSelect($event)" nzSearch>{{ 'mxk.text.select' | i18n }}</button>
|
||||
<button nz-button nzType="primary" (click)="onSelect($event)" nzSearch>{{ 'mxk.text.select' | i18n
|
||||
}}</button>
|
||||
</ng-template>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 4" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' | i18n }}</button>
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||
i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button
|
||||
>
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -55,21 +44,11 @@
|
||||
</div>
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col [nzSpan]="10" class="grid-border">
|
||||
<nz-table
|
||||
#dynamicTable
|
||||
nzTableLayout="auto"
|
||||
nzSize="small"
|
||||
nzBordered
|
||||
nzShowSizeChanger
|
||||
[nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false"
|
||||
[nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber"
|
||||
[nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)"
|
||||
>
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate" (nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
@ -82,15 +61,12 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td
|
||||
[nzChecked]="query.tableCheckedId.has(data.id)"
|
||||
[nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"
|
||||
></td>
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left" nzBreakWord="false">{{ data.roleName }}</td>
|
||||
<td nzAlign="left" nzBreakWord="false">{{ data.groupName }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'dynamic'"> {{ 'mxk.roles.category.dynamic' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.category == 'static'"> {{ 'mxk.roles.category.static' | i18n }}</td>
|
||||
</tr>
|
||||
@ -98,16 +74,9 @@
|
||||
</nz-table>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="14" class="grid-border">
|
||||
<nz-tree
|
||||
#nzTreeComponent
|
||||
nzShowLine="false"
|
||||
[nzCheckable]="treeNodes.checkable"
|
||||
[nzCheckedKeys]="treeNodes.checkedKeys"
|
||||
nzBlockNode
|
||||
[nzData]="treeNodes.nodes"
|
||||
(nzDblClick)="openFolder($event)"
|
||||
[nzTreeTemplate]="nzTreeTemplate"
|
||||
></nz-tree>
|
||||
<nz-tree #nzTreeComponent nzShowLine="false" [nzCheckable]="treeNodes.checkable"
|
||||
[nzCheckedKeys]="treeNodes.checkedKeys" nzBlockNode [nzData]="treeNodes.nodes" (nzDblClick)="openFolder($event)"
|
||||
[nzTreeTemplate]="nzTreeTemplate"></nz-tree>
|
||||
<ng-template #nzTreeTemplate let-node let-origin="origin">
|
||||
<span class="custom-node">
|
||||
<span *ngIf="!node.isLeaf">
|
||||
@ -122,4 +91,4 @@
|
||||
</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
</nz-card>
|
||||
@ -36,9 +36,9 @@ import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions, NzTreeComponent } from 'ng-zorro-antd/tree';
|
||||
|
||||
import { TreeNodes } from '../../../entity/TreeNodes';
|
||||
import { GroupsService } from '../../../service/Groups.service';
|
||||
import { GroupPrivilegesService } from '../../../service/group-privileges.service';
|
||||
import { ResourcesService } from '../../../service/resources.service';
|
||||
import { RolePrivilegesService } from '../../../service/role-privileges.service';
|
||||
import { RolesService } from '../../../service/roles.service';
|
||||
import { set2String } from '../../../shared/index';
|
||||
import { SelectAppsComponent } from '../../apps/select-apps/select-apps.component';
|
||||
|
||||
@ -51,7 +51,7 @@ export class PrivilegesComponent implements OnInit {
|
||||
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
|
||||
query: {
|
||||
params: {
|
||||
roleName: String;
|
||||
groupName: String;
|
||||
displayName: String;
|
||||
employeeNumber: String;
|
||||
appId: String;
|
||||
@ -76,7 +76,7 @@ export class PrivilegesComponent implements OnInit {
|
||||
checked: boolean;
|
||||
} = {
|
||||
params: {
|
||||
roleName: '',
|
||||
groupName: '',
|
||||
displayName: '',
|
||||
employeeNumber: '',
|
||||
appId: '',
|
||||
@ -105,9 +105,9 @@ export class PrivilegesComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private modalService: NzModalService,
|
||||
private rolePrivilegesService: RolePrivilegesService,
|
||||
private groupPrivilegesService: GroupPrivilegesService,
|
||||
private resourcesService: ResourcesService,
|
||||
private rolesService: RolesService,
|
||||
private groupsService: GroupsService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@ -155,7 +155,7 @@ export class PrivilegesComponent implements OnInit {
|
||||
if (this.query.params.appId == '' || _roleId == '' || _resourceId == '') {
|
||||
return;
|
||||
}
|
||||
this.rolePrivilegesService.update({ appId: this.query.params.appId, roleId: _roleId, resourceId: _resourceId }).subscribe(res => {
|
||||
this.groupPrivilegesService.update({ appId: this.query.params.appId, roleId: _roleId, resourceId: _resourceId }).subscribe(res => {
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
if (res.code == 0) {
|
||||
@ -181,7 +181,7 @@ export class PrivilegesComponent implements OnInit {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.rolesService.fetch(this.query.params).subscribe(res => {
|
||||
this.groupsService.fetch(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
@ -236,7 +236,7 @@ export class PrivilegesComponent implements OnInit {
|
||||
this.onTableAllChecked(false);
|
||||
this.updateTableCheckedSet(id, checked);
|
||||
this.refreshTableCheckedStatus();
|
||||
this.rolePrivilegesService.getByParams({ appId: this.query.params.appId, roleId: id }).subscribe(res => {
|
||||
this.groupPrivilegesService.getByParams({ appId: this.query.params.appId, roleId: id }).subscribe(res => {
|
||||
this.treeNodes.checkedKeys = [];
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
this.treeNodes.checkedKeys.push(res.data[i].resourceId);
|
||||
|
||||
@ -25,8 +25,6 @@ import { LayoutBasicComponent } from '../layout/basic/basic.component';
|
||||
import { LayoutBlankComponent } from '../layout/blank/blank.component';
|
||||
import { AccountsComponent } from './accounts/accounts.component';
|
||||
import { AppsComponent } from './apps/apps.component';
|
||||
import { OrganizationsComponent } from './organizations/organizations.component';
|
||||
import { UsersComponent } from './users/users.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
@ -43,8 +41,7 @@ const routes: Routes = [
|
||||
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule),
|
||||
data: { preload: true }
|
||||
},
|
||||
{ path: 'organizations', component: OrganizationsComponent },
|
||||
{ path: 'users', component: UsersComponent },
|
||||
{ path: 'idm', loadChildren: () => import('./idm/idm.module').then(m => m.IdmModule) },
|
||||
{ path: 'accounts', component: AccountsComponent },
|
||||
{ path: 'apps', component: AppsComponent },
|
||||
{ path: 'access', loadChildren: () => import('./access/access.module').then(m => m.AccessModule) },
|
||||
|
||||
@ -30,13 +30,7 @@ import { AppTokenBasedDetailsEditerComponent } from './apps/app-token-based-deta
|
||||
import { AppsComponent } from './apps/apps.component';
|
||||
import { SelectAppsComponent } from './apps/select-apps/select-apps.component';
|
||||
import { SelectProtocolComponent } from './apps/select-protocol/select-protocol.component';
|
||||
import { OrganizationEditerComponent } from './organizations/organization-editer/organization-editer.component';
|
||||
import { OrganizationsComponent } from './organizations/organizations.component';
|
||||
import { RouteRoutingModule } from './routes-routing.module';
|
||||
import { PasswordComponent } from './users/password/password.component';
|
||||
import { SelectUserComponent } from './users/select-user/select-user.component';
|
||||
import { UserEditerComponent } from './users/user-editer/user-editer.component';
|
||||
import { UsersComponent } from './users/users.component';
|
||||
|
||||
const COMPONENTS: Array<Type<null>> = [];
|
||||
|
||||
@ -44,15 +38,10 @@ const COMPONENTS: Array<Type<null>> = [];
|
||||
imports: [SharedModule, RouteRoutingModule],
|
||||
declarations: [
|
||||
...COMPONENTS,
|
||||
UsersComponent,
|
||||
AppsComponent,
|
||||
AccountsComponent,
|
||||
OrganizationsComponent,
|
||||
SelectAppsComponent,
|
||||
OrganizationEditerComponent,
|
||||
UserEditerComponent,
|
||||
AccountEditerComponent,
|
||||
SelectUserComponent,
|
||||
SelectProtocolComponent,
|
||||
AppCasDetailsEditerComponent,
|
||||
AppFormBasedDetailsEditerComponent,
|
||||
@ -61,8 +50,7 @@ const COMPONENTS: Array<Type<null>> = [];
|
||||
AppSaml20DetailsEditerComponent,
|
||||
AppTokenBasedDetailsEditerComponent,
|
||||
AppExtendApiDetailsEditerComponent,
|
||||
AppBasicDetailsEditerComponent,
|
||||
PasswordComponent
|
||||
AppBasicDetailsEditerComponent
|
||||
]
|
||||
})
|
||||
export class RoutesModule {}
|
||||
|
||||
@ -1,159 +0,0 @@
|
||||
<page-header> </page-header>
|
||||
|
||||
<nz-card [nzBordered]="false">
|
||||
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 24, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="16" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="name">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username"
|
||||
placeholder="" id="username" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{ 'mxk.text.reset' |
|
||||
i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</nz-card>
|
||||
<nz-card [nzBordered]="false">
|
||||
<div nz-row>
|
||||
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
||||
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">
|
||||
{{ 'mxk.text.add' | i18n }}
|
||||
</button>
|
||||
<button nz-button type="button" [nzType]="'primary'" (click)="changePassword($event)">
|
||||
{{ 'mxk.text.changepassword' | i18n }}
|
||||
</button>
|
||||
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">
|
||||
{{ 'mxk.text.delete' | i18n }}
|
||||
</button>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="6" class="grid-border">
|
||||
<nz-tree nzShowLine="false" [nzCheckable]="treeNodes.checkable" nzBlockNode [nzData]="treeNodes.nodes"
|
||||
(nzClick)="activeNode($event)" (nzDblClick)="openFolder($event)" [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
|
||||
<ng-template #nzTreeTemplate let-node let-origin="origin">
|
||||
<span class="custom-node">
|
||||
<span *ngIf="!node.isLeaf" (contextmenu)="contextMenu($event, menu)">
|
||||
<i nz-icon [nzType]="node.isExpanded ? 'folder-open' : 'folder'" (click)="openFolder(node)"></i>
|
||||
<span class="folder-name">{{ node.title + (origin.type == 'virtual' ? '_v' : '') }}</span>
|
||||
</span>
|
||||
<span *ngIf="node.isLeaf" (contextmenu)="contextMenu($event, menu)">
|
||||
<i nz-icon nzType="file"></i>
|
||||
<span class="file-name">{{ node.title + (origin.type == 'virtual' ? '_v' : '') }}</span>
|
||||
</span>
|
||||
</span>
|
||||
</ng-template>
|
||||
<nz-dropdown-menu #menu="nzDropdownMenu">
|
||||
<ul nz-menu>
|
||||
<li nz-menu-item (click)="selectDropdown()">Action 1</li>
|
||||
<li nz-menu-item (click)="selectDropdown()">Action 2</li>
|
||||
</ul>
|
||||
</nz-dropdown-menu>
|
||||
</div>
|
||||
<div nz-col nzMd="18" nzSm="24" class="grid-border">
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered sizeChanger="true" nzShowSizeChanger
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
<th nzAlign="center" style="display: none">{{ 'mxk.text.id' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.username' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.displayName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.employeeNumber' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.department' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.jobTitle' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.users.gender' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.text.status' | i18n }}</th>
|
||||
<th nzAlign="center" class="table_cell_action_2">{{ 'mxk.text.action' | i18n }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left"> {{ data.username }}</td>
|
||||
<td nzAlign="left"> {{ data.displayName }}</td>
|
||||
<td nzAlign="left"> {{ data.employeeNumber }}</td>
|
||||
<td nzAlign="left"> {{ data.department }}</td>
|
||||
<td nzAlign="left"> {{ data.jobTitle }}</td>
|
||||
<td nzAlign="center"> {{ data.gender == 1 ? ('mxk.users.gender.female' | i18n) : ('mxk.users.gender.male' |
|
||||
i18n) }}</td>
|
||||
<td nzAlign="center">
|
||||
<a title="{{ 'mxk.users.status.active' | i18n }}" *ngIf="data.status == 1">
|
||||
<i nz-icon nzType="check-circle" nzTheme="fill" style="color: green"> </i>
|
||||
</a>
|
||||
<a title="{{ 'mxk.users.status.inactive' | i18n }}" *ngIf="data.status == 2">
|
||||
<i nz-icon nzType="warning" nzTheme="fill" style="color: gray"></i>
|
||||
</a>
|
||||
<a title="{{ 'mxk.users.status.forbidden' | i18n }}" *ngIf="data.status == 4">
|
||||
<i nz-icon nzType="stop" nzTheme="fill" style="color: gray"></i>
|
||||
</a>
|
||||
<a title="{{ 'mxk.users.status.lock' | i18n }}" *ngIf="data.status == 5">
|
||||
<i nz-icon nzType="lock" nzTheme="fill" style="color: orange"></i>
|
||||
</a>
|
||||
<a title="{{ 'mxk.users.status.delete' | i18n }}" *ngIf="data.status == 9">
|
||||
<i nz-icon nzType="close-circle" nzTheme="fill" style="color: red"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td nzAlign="center" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button nz-button type="button" (click)="onEdit($event, data.id)">
|
||||
{{ 'mxk.text.edit' | i18n }}
|
||||
</button>
|
||||
<button *ngIf="data.status == 9" nz-button nz-dropdown>
|
||||
{{ 'mxk.text.moreaction' | i18n }}
|
||||
<i nz-icon nzType="down"></i>
|
||||
</button>
|
||||
<button *ngIf="data.status !== 9" nz-button nz-dropdown [nzDropdownMenu]="menuMoreAction">
|
||||
{{ 'mxk.text.moreaction' | i18n }}
|
||||
<i nz-icon nzType="down"></i>
|
||||
</button>
|
||||
<nz-dropdown-menu #menuMoreAction="nzDropdownMenu">
|
||||
<ul nz-menu>
|
||||
<li nz-menu-item *ngIf="data.status == 1"
|
||||
(click)="onNavToUrl($event, data.id, data.username, 'roles')">{{
|
||||
'mxk.text.roles' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 1" (click)="changePasswordById($event, data.id)">{{
|
||||
'mxk.text.changepassword' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 1" (click)="onUpdateStatus($event, data.id, 5)">{{
|
||||
'mxk.text.lock' | i18n }}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 1" (click)="onUpdateStatus($event, data.id, 4)">{{
|
||||
'mxk.text.disable' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 2" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||
'mxk.text.enable' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 4" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||
'mxk.text.enable' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item *ngIf="data.status == 5" (click)="onUpdateStatus($event, data.id, 1)">{{
|
||||
'mxk.text.unlock' | i18n
|
||||
}}</li>
|
||||
<li nz-menu-item (click)="onDelete($event, data.id)" nzDanger>{{ 'mxk.text.delete' | i18n }}</li>
|
||||
</ul>
|
||||
</nz-dropdown-menu>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
@ -17,14 +17,14 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Roles } from '../entity/Roles';
|
||||
import { Groups } from '../entity/Groups';
|
||||
import { BaseService } from './base.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RolesService extends BaseService<Roles> {
|
||||
export class GroupsService extends BaseService<Groups> {
|
||||
constructor(private _httpClient: HttpClient) {
|
||||
super(_httpClient, '/access/roles');
|
||||
super(_httpClient, '/access/groups');
|
||||
}
|
||||
}
|
||||
@ -19,28 +19,28 @@ import { Injectable } from '@angular/core';
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { GroupMembers } from '../entity/GroupMembers';
|
||||
import { Message } from '../entity/Message';
|
||||
import { PageResults } from '../entity/PageResults';
|
||||
import { RoleMembers } from '../entity/RoleMembers';
|
||||
import { BaseService } from './base.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RoleMembersService extends BaseService<RoleMembers> {
|
||||
export class GroupMembersService extends BaseService<GroupMembers> {
|
||||
constructor(private _httpClient: HttpClient) {
|
||||
super(_httpClient, '/access/rolemembers');
|
||||
this.server.urls.member = '/memberInRole';
|
||||
this.server.urls.memberOut = '/memberNotInRole';
|
||||
super(_httpClient, '/access/groupmembers');
|
||||
this.server.urls.member = '/memberIn';
|
||||
this.server.urls.memberOut = '/memberNotIn';
|
||||
}
|
||||
|
||||
rolesNoMember(params: NzSafeAny): Observable<Message<PageResults>> {
|
||||
return this.http.get<Message<PageResults>>(`${this.server.urls.base}/rolesNoMember`, {
|
||||
noMember(params: NzSafeAny): Observable<Message<PageResults>> {
|
||||
return this.http.get<Message<PageResults>>(`${this.server.urls.base}/noMember`, {
|
||||
params: this.parseParams(params)
|
||||
});
|
||||
}
|
||||
|
||||
addMember2Roles(body: any): Observable<Message<PageResults>> {
|
||||
return this.http.post<Message<PageResults>>(`${`${this.server.urls.base}/addMember2Roles`}`, body);
|
||||
return this.http.post<Message<PageResults>>(`${`${this.server.urls.base}/addMember2Groups`}`, body);
|
||||
}
|
||||
}
|
||||
@ -19,17 +19,17 @@ import { Injectable } from '@angular/core';
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { GroupMembers } from '../entity/GroupMembers';
|
||||
import { Message } from '../entity/Message';
|
||||
import { RoleMembers } from '../entity/RoleMembers';
|
||||
import { BaseService } from './base.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RolePermissionsService extends BaseService<RoleMembers> {
|
||||
export class GroupPermissionsService extends BaseService<GroupMembers> {
|
||||
constructor(private _httpClient: HttpClient) {
|
||||
super(_httpClient, '/access/permissions');
|
||||
this.server.urls.member = '/appsInRole';
|
||||
this.server.urls.memberOut = '/appsNotInRole';
|
||||
this.server.urls.member = '/appsInGroup';
|
||||
this.server.urls.memberOut = '/appsNotInGroup';
|
||||
}
|
||||
}
|
||||
@ -19,14 +19,14 @@ import { Injectable } from '@angular/core';
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { GroupMembers } from '../entity/GroupMembers';
|
||||
import { Message } from '../entity/Message';
|
||||
import { RoleMembers } from '../entity/RoleMembers';
|
||||
import { BaseService } from './base.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RolePrivilegesService extends BaseService<RoleMembers> {
|
||||
export class GroupPrivilegesService extends BaseService<GroupMembers> {
|
||||
constructor(private _httpClient: HttpClient) {
|
||||
super(_httpClient, '/permissions/privileges');
|
||||
this.server.urls.load = '/get';
|
||||
@ -19,5 +19,5 @@ export const CONSTS = {
|
||||
INST: 'inst',
|
||||
REDIRECT_URI: 'redirect_uri',
|
||||
REMEMBER: 'remember',
|
||||
VERSION: 'v3.5.19 GA'
|
||||
VERSION: 'v4.0.0 RC1'
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user