|
@@ -69,6 +69,7 @@ export class PageRoleComponent implements OnInit {
|
|
|
queryParams: any | undefined;
|
|
|
fieldsArray: Array<any> | undefined;
|
|
|
searchValue: string = ''; //搜索内容
|
|
|
+ searchValueNode:string = ''
|
|
|
nodes: Array<nodes | any> = [];
|
|
|
currentDepart: nodes | any = null;
|
|
|
|
|
@@ -92,6 +93,7 @@ export class PageRoleComponent implements OnInit {
|
|
|
};
|
|
|
parentMap: Array<any> = [];
|
|
|
parentList: Array<any> = [];
|
|
|
+ radio:string = ''
|
|
|
|
|
|
constructor(
|
|
|
private route: Router,
|
|
@@ -124,11 +126,14 @@ export class PageRoleComponent implements OnInit {
|
|
|
}
|
|
|
async getDepart(
|
|
|
parent?: string,
|
|
|
- searchValue?: string
|
|
|
+ searchValue?: string,
|
|
|
+ filter?:boolean
|
|
|
): Promise<Array<nodes>> {
|
|
|
let nodes: any = [];
|
|
|
let query = new Parse.Query('Department');
|
|
|
- query.equalTo('parent', parent ? parent : undefined);
|
|
|
+ if(!filter){
|
|
|
+ query.equalTo('parent', parent ? parent : undefined);
|
|
|
+ }
|
|
|
searchValue && query.contains('name', searchValue);
|
|
|
query.notEqualTo('isDeleted', true);
|
|
|
query.select('code', 'name', 'branch', 'parent','type');
|
|
@@ -141,11 +146,15 @@ export class PageRoleComponent implements OnInit {
|
|
|
key: item.id,
|
|
|
children: [],
|
|
|
isParent: item.get('type') =='单位' ? true : false, //是否是最下级
|
|
|
- isLeaf: false,
|
|
|
+ isLeaf: item.get('type') =='单位' ? true : false,
|
|
|
});
|
|
|
});
|
|
|
return nodes;
|
|
|
}
|
|
|
+ //搜索
|
|
|
+ async onSearchNodes(e:string){
|
|
|
+ this.nodes = await this.getDepart('',e, e ? true : false);
|
|
|
+ }
|
|
|
//添加成员
|
|
|
addMember() {
|
|
|
this.message.warning('权限灰度中')
|
|
@@ -278,7 +287,8 @@ export class PageRoleComponent implements OnInit {
|
|
|
}
|
|
|
//选择所属类别下级列表
|
|
|
async onCheckedDepart(e: any, checked?: boolean) {
|
|
|
- console.log(e);
|
|
|
+ this.radio = e.key
|
|
|
+ console.log(this.radio);
|
|
|
if (checked) {
|
|
|
this.editObject = {
|
|
|
name: e.title,
|
|
@@ -289,6 +299,9 @@ export class PageRoleComponent implements OnInit {
|
|
|
};
|
|
|
return;
|
|
|
}
|
|
|
+ if(e.isLeaf){
|
|
|
+ return
|
|
|
+ }
|
|
|
this.parentMap.push({
|
|
|
title: e.title,
|
|
|
key: e.key,
|