组织管理,树结构禁用非部门节点
This commit is contained in:
parent
59d4fac4e2
commit
e011880672
|
|
@ -31,6 +31,7 @@ public class TreeSelect {
|
|||
private String type;
|
||||
private String canceled;
|
||||
private List<TreeSelect> children;
|
||||
private boolean disabled;
|
||||
|
||||
private String cancelSql;
|
||||
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
expandedKeys = companyTree.getChildren().stream().filter(item -> CollectionUtils.isNotEmpty(item.getChildren())).map(TreeSelect::getKey).collect(Collectors.toList());
|
||||
expandedKeys.add(companyTree.getKey());
|
||||
}
|
||||
|
||||
disableTreeItem(Collections.singletonList(companyTree),TreeSelect.DEPARTMENT);
|
||||
Map<String, Object> result = new HashMap<>(3);
|
||||
result.put("selectTree", companyTree);
|
||||
result.put("expandedKeys", expandedKeys);
|
||||
|
|
@ -509,6 +509,23 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 树节点是否禁用
|
||||
*
|
||||
* @param companyTreeList TreeSelect组件数据集合
|
||||
*/
|
||||
private void disableTreeItem(List<TreeSelect> companyTreeList, String enableTreeType) {
|
||||
if (CollectionUtils.isNotEmpty(companyTreeList)) {
|
||||
for (TreeSelect treeSelect : companyTreeList) {
|
||||
treeSelect.setDisabled(!enableTreeType.equals(treeSelect.getType()));
|
||||
List<TreeSelect> children = treeSelect.getChildren();
|
||||
if (CollectionUtils.isNotEmpty(children)) {
|
||||
disableTreeItem(children, enableTreeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void trueDimension(RecordSetTrans recordSetTrans,String versionId,String currentUser,String currentDate){
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.execute("delete from jcl_chart_subcompany where versionid = "+versionId);
|
||||
|
|
|
|||
Loading…
Reference in New Issue