Browse Source

REPORT-22339 远程设计管理权限中,新建多个角色,进行删除时会提示,但是并未存在赋值

feature/big-screen
author 5 years ago
parent
commit
a7b0f60248
  1. 36
      designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java

36
designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java

@ -67,6 +67,12 @@ public abstract class AbstractManagerPane extends BasicPane {
*/ */
private List<RemoteDesignMember> addedMembers = new ArrayList<>(); private List<RemoteDesignMember> addedMembers = new ArrayList<>();
/**
* 具有设计权限的角色/用户
*/
private List<RemoteDesignMember> authorityMembers = new ArrayList<>();
/** /**
* 决策平台用户列表model * 决策平台用户列表model
*/ */
@ -211,6 +217,9 @@ public abstract class AbstractManagerPane extends BasicPane {
resetAddedMembers(); resetAddedMembers();
this.addedMembers.addAll(addedMembers); this.addedMembers.addAll(addedMembers);
resetAuthorityMembers();
this.authorityMembers.addAll(addedMembers);
// 刷新右侧面板 // 刷新右侧面板
addToAddedMemberList(); addToAddedMemberList();
@ -314,15 +323,15 @@ public abstract class AbstractManagerPane extends BasicPane {
private void addToMemberList() { private void addToMemberList() {
addingListModel.clear(); addingListModel.clear();
for (RemoteDesignMember addingMember : addingMembers) { for (RemoteDesignMember member : addingMembers) {
// 如果包含在右侧列表中,那么左侧列表默认选中 // 如果包含在右侧列表中,那么左侧列表默认选中
for (RemoteDesignMember addedMember : addedMembers){ if (addedMembers.contains(member)) {
if (addingMember.equals(addedMember)){ member.setSelected(true);
addingMember.setAuthority(addedMember.hasAuthority());
addingMember.setSelected(true);
} }
else {
member.setSelected(false);
} }
addingListModel.addElement(addingMember); addingListModel.addElement(member);
} }
addingList.revalidate(); addingList.revalidate();
addingList.repaint(); addingList.repaint();
@ -350,6 +359,10 @@ public abstract class AbstractManagerPane extends BasicPane {
addedMembers.clear(); addedMembers.clear();
} }
private void resetAuthorityMembers() {
authorityMembers.clear();
}
protected abstract Collection<RemoteDesignMember> getMembers(String userName, String keyWord); protected abstract Collection<RemoteDesignMember> getMembers(String userName, String keyWord);
protected abstract Collection<RemoteDesignMember> getMembers(String userName, String keyWord, int pageNum, int count); protected abstract Collection<RemoteDesignMember> getMembers(String userName, String keyWord, int pageNum, int count);
@ -376,6 +389,7 @@ public abstract class AbstractManagerPane extends BasicPane {
@Override @Override
protected void done() { protected void done() {
referAddingMemberList();
addToMemberList(); addToMemberList();
} }
}; };
@ -403,12 +417,22 @@ public abstract class AbstractManagerPane extends BasicPane {
@Override @Override
protected void done() { protected void done() {
referAddingMemberList();
addToMemberList(); addToMemberList();
} }
}; };
loadMoreWorker.execute(); loadMoreWorker.execute();
} }
// 检查左侧列表角色/用户是否有权限
private void referAddingMemberList() {
for (RemoteDesignMember member : addingMembers) {
if (authorityMembers.contains(member)){
member.setAuthority(true);
}
}
}
private void sync2AddedMembersFromAdding() { private void sync2AddedMembersFromAdding() {
RemoteDesignMember[] members = new RemoteDesignMember[addingListModel.getSize()]; RemoteDesignMember[] members = new RemoteDesignMember[addingListModel.getSize()];

Loading…
Cancel
Save