|
@@ -26,6 +26,8 @@ import { NzRadioModule } from 'ng-zorro-antd/radio';
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
|
import { textbookServer } from '../../../services/textbook';
|
|
|
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
|
+import { NzSpinModule } from 'ng-zorro-antd/spin';
|
|
|
+
|
|
|
interface nodes {
|
|
|
title: string;
|
|
|
key: string;
|
|
@@ -58,7 +60,7 @@ interface depart {
|
|
|
NzEmptyModule,
|
|
|
NzModalModule,
|
|
|
NzRadioModule,
|
|
|
- NzSelectModule,
|
|
|
+ NzSelectModule,NzSpinModule
|
|
|
],
|
|
|
standalone: true,
|
|
|
})
|
|
@@ -81,6 +83,9 @@ export class PageRoleComponent implements OnInit {
|
|
|
checkedAll: boolean = false; //全选
|
|
|
indeterminate = false;
|
|
|
loading = false;
|
|
|
+ pageSize: number = 10;
|
|
|
+ pageIndex: number = 1;
|
|
|
+ profileLength:number = 0
|
|
|
|
|
|
isVisible: boolean = false;
|
|
|
activatedNode: NzTreeNode | any; //当前选择节点
|
|
@@ -145,7 +150,7 @@ export class PageRoleComponent implements OnInit {
|
|
|
query.equalTo('objectId', this.tbookSer.profile.user.department?.objectId);
|
|
|
query.select('code', 'name', 'branch', 'parent', 'type', 'hasChildren');
|
|
|
let r = await query.first();
|
|
|
- this.nodes = [
|
|
|
+ let n = [
|
|
|
{
|
|
|
title: this.tbookSer.profile.user.department.name,
|
|
|
key: this.tbookSer.profile.user.department?.objectId,
|
|
@@ -161,6 +166,7 @@ export class PageRoleComponent implements OnInit {
|
|
|
type: r?.get('branch'),
|
|
|
},
|
|
|
];
|
|
|
+ this.nodes = n
|
|
|
let query2 = new Parse.Query('Department');
|
|
|
query2.select('name');
|
|
|
query2.equalTo('parent', null);
|
|
@@ -247,6 +253,10 @@ export class PageRoleComponent implements OnInit {
|
|
|
async getProfile() {
|
|
|
this.profiles = [];
|
|
|
this.loading = true;
|
|
|
+ let childrens = [this.currentDepart.key]
|
|
|
+ if(!this.checkedShowFilter){
|
|
|
+ childrens = await this.tbookSer.getChild(this.currentDepart.key)
|
|
|
+ }
|
|
|
let queryParams = {
|
|
|
where: {
|
|
|
$or: [
|
|
@@ -256,7 +266,7 @@ export class PageRoleComponent implements OnInit {
|
|
|
where: {
|
|
|
$or: [
|
|
|
{
|
|
|
- department: { $eq: this.currentDepart.key },
|
|
|
+ department: { $in: [childrens] },
|
|
|
},
|
|
|
],
|
|
|
},
|
|
@@ -269,17 +279,36 @@ export class PageRoleComponent implements OnInit {
|
|
|
};
|
|
|
let query = Parse.Query.fromJSON('Profile', queryParams);
|
|
|
query.include('user');
|
|
|
+ if(this.tbookSer.profile.identity == '工作联系人'){
|
|
|
+ query.containedIn('identity',['个人','高校联系人','评审专家'])
|
|
|
+ }else if(this.tbookSer.profile.identity == '高校联系人'){
|
|
|
+ query.containedIn('identity',['个人','评审专家'])
|
|
|
+ }
|
|
|
query.notEqualTo('identity', '国家级管理员');
|
|
|
+ query.notEqualTo('isDeleted', true);
|
|
|
+ this.profileLength = await query.count()
|
|
|
+ query.limit(this.pageSize)
|
|
|
+ query.skip((this.pageIndex - 1) * this.pageSize)
|
|
|
let r = await query.find();
|
|
|
- let profiles: any[] = [];
|
|
|
- r.forEach((item) => {
|
|
|
- let _item = item.toJSON();
|
|
|
- _item['checked'] = false;
|
|
|
- profiles.push(_item);
|
|
|
- });
|
|
|
- this.profiles = profiles;
|
|
|
+ // let profiles: any[] = [];
|
|
|
+ // r.forEach((item) => {
|
|
|
+ // let _item = item.toJSON();
|
|
|
+ // _item['checked'] = false;
|
|
|
+ // profiles.push(_item);
|
|
|
+ // });
|
|
|
+ this.profiles = r;
|
|
|
this.loading = false;
|
|
|
}
|
|
|
+ //分页切换
|
|
|
+ pageIndexChange(e: any) {
|
|
|
+ console.log(e);
|
|
|
+ this.pageIndex = e;
|
|
|
+ this.getProfile();
|
|
|
+ }
|
|
|
+ onChecked(){
|
|
|
+ this.pageIndex = 1;
|
|
|
+ this.getProfile()
|
|
|
+ }
|
|
|
//搜索触发
|
|
|
onSearch(event: NzFormatEmitEvent) {
|
|
|
console.log(event);
|
|
@@ -366,6 +395,7 @@ export class PageRoleComponent implements OnInit {
|
|
|
console.log(this.parentMap);
|
|
|
this.editType = type;
|
|
|
this.isVisible = true;
|
|
|
+ this.resetChange()
|
|
|
}
|
|
|
async onPre(data?: any, index?: number) {
|
|
|
console.log(data);
|