|
@@ -55,7 +55,8 @@ interface depart {
|
|
|
NzCheckboxModule,
|
|
|
NzEmptyModule,
|
|
|
NzModalModule,
|
|
|
- NzRadioModule,NzTabsModule
|
|
|
+ NzRadioModule,
|
|
|
+ NzTabsModule,
|
|
|
],
|
|
|
standalone: true,
|
|
|
})
|
|
@@ -109,7 +110,10 @@ export class ProcessListComponent implements OnInit {
|
|
|
del: false,
|
|
|
};
|
|
|
}
|
|
|
- if(e?.get('collectStartData') && new Date() < new Date(e?.get('collectStartData'))){
|
|
|
+ if (
|
|
|
+ e?.get('collectStartData') &&
|
|
|
+ new Date() < new Date(e?.get('collectStartData'))
|
|
|
+ ) {
|
|
|
return {
|
|
|
title: '待收集',
|
|
|
color: 'default',
|
|
@@ -117,11 +121,14 @@ export class ProcessListComponent implements OnInit {
|
|
|
stop: false,
|
|
|
end: false,
|
|
|
del: false,
|
|
|
- collect:true
|
|
|
+ collect: true,
|
|
|
};
|
|
|
}
|
|
|
- if(e?.get('collectStartData') && new Date() > new Date(e?.get('collectStartData'))
|
|
|
- && new Date() < e?.get('collectEndData')){
|
|
|
+ if (
|
|
|
+ e?.get('collectStartData') &&
|
|
|
+ new Date() > new Date(e?.get('collectStartData')) &&
|
|
|
+ new Date() < e?.get('collectEndData')
|
|
|
+ ) {
|
|
|
return {
|
|
|
title: '收集中',
|
|
|
color: 'orange',
|
|
@@ -129,7 +136,7 @@ export class ProcessListComponent implements OnInit {
|
|
|
stop: false,
|
|
|
end: false,
|
|
|
del: false,
|
|
|
- collect:true
|
|
|
+ collect: true,
|
|
|
};
|
|
|
}
|
|
|
if (
|
|
@@ -212,9 +219,8 @@ export class ProcessListComponent implements OnInit {
|
|
|
}
|
|
|
return;
|
|
|
};
|
|
|
- editLoading:boolean = true
|
|
|
active: number = 0;
|
|
|
-
|
|
|
+ bindEduPrc: boolean = false;
|
|
|
constructor(
|
|
|
public tbookSer: textbookServer,
|
|
|
private route: Router,
|
|
@@ -235,7 +241,8 @@ export class ProcessListComponent implements OnInit {
|
|
|
ngOnInit(): void {
|
|
|
this.activeRoute.paramMap.subscribe(async (params) => {
|
|
|
// this.nodes = await this.getDepart();
|
|
|
- this.getEduProcess()
|
|
|
+ await this.getEduProcess();
|
|
|
+ if (this.eduProcessList.length > 0) this.bindEduPrc = true;
|
|
|
});
|
|
|
}
|
|
|
async getDepart(
|
|
@@ -249,7 +256,7 @@ export class ProcessListComponent implements OnInit {
|
|
|
query.select('code', 'name', 'branch', 'parent', 'type');
|
|
|
query.descending('createdAt');
|
|
|
query.limit(100);
|
|
|
- query.equalTo('objectId', this.tbookSer.profile.user.department?.objectId)
|
|
|
+ query.equalTo('objectId', this.tbookSer.profile.user.department?.objectId);
|
|
|
let res = await query.find();
|
|
|
res.forEach((item) => {
|
|
|
nodes.push({
|
|
@@ -264,8 +271,8 @@ export class ProcessListComponent implements OnInit {
|
|
|
async onSearch(e: string) {
|
|
|
this.nodes = await this.getDepart('', e);
|
|
|
}
|
|
|
- onSearchPro(e: string){
|
|
|
- this.getEduProcess()
|
|
|
+ onSearchPro(e: string) {
|
|
|
+ this.getEduProcess();
|
|
|
}
|
|
|
changeDepart(e: any) {
|
|
|
this.currentDepart = e;
|
|
@@ -275,30 +282,33 @@ export class ProcessListComponent implements OnInit {
|
|
|
async getEduProcess() {
|
|
|
this.eduProcessList = [];
|
|
|
this.loading = true;
|
|
|
- let query1= Parse.Query.fromJSON('EduProcess', {
|
|
|
+ let query1 = Parse.Query.fromJSON('EduProcess', {
|
|
|
where: {
|
|
|
$or: [
|
|
|
{
|
|
|
- name: { "$regex": `.*${this.searchValuePro}.*`},
|
|
|
+ name: { $regex: `.*${this.searchValuePro}.*` },
|
|
|
},
|
|
|
- ]
|
|
|
- }
|
|
|
+ ],
|
|
|
+ },
|
|
|
});
|
|
|
- let query2= Parse.Query.fromJSON('EduProcess', {
|
|
|
+ let query2 = Parse.Query.fromJSON('EduProcess', {
|
|
|
where: {
|
|
|
$or: [
|
|
|
{
|
|
|
- code: { "$regex": `.*${this.searchValuePro}.*`},
|
|
|
+ code: { $regex: `.*${this.searchValuePro}.*` },
|
|
|
},
|
|
|
- ]
|
|
|
- }
|
|
|
+ ],
|
|
|
+ },
|
|
|
});
|
|
|
- let query = Parse.Query.or(query1, query2)
|
|
|
+ let query = Parse.Query.or(query1, query2);
|
|
|
query.include('profileSubmitted', 'profileSubmitted.user');
|
|
|
query.notEqualTo('isDeleted', true);
|
|
|
- query.equalTo('department',this.tbookSer.profile.user.department?.objectId)
|
|
|
+ query.equalTo(
|
|
|
+ 'department',
|
|
|
+ this.tbookSer.profile.user.department?.objectId
|
|
|
+ );
|
|
|
query.descending('createdAt');
|
|
|
- query.equalTo('profileSubmitted',this.tbookSer?.profile?.objectId)
|
|
|
+ query.equalTo('profileSubmitted', this.tbookSer?.profile?.objectId);
|
|
|
let r = await query.find();
|
|
|
// let list: any[] = [];
|
|
|
r.forEach((item) => {
|
|
@@ -308,7 +318,6 @@ export class ProcessListComponent implements OnInit {
|
|
|
this.statusMap[item.id] = this.formatStatus(item);
|
|
|
});
|
|
|
this.eduProcessList = r;
|
|
|
- this.editLoading = false
|
|
|
this.loading = false;
|
|
|
}
|
|
|
//分页切换
|
|
@@ -373,45 +382,45 @@ export class ProcessListComponent implements OnInit {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //暂停流程
|
|
|
- async onStatusChange(
|
|
|
- data: Parse.Object,
|
|
|
- type: string,
|
|
|
- end?: boolean
|
|
|
- ): Promise<void> {
|
|
|
- console.log(data, type);
|
|
|
- switch (type) {
|
|
|
- case 'strat':
|
|
|
- if (data?.get('status') == '100') {
|
|
|
- data?.set('status', null);
|
|
|
- }
|
|
|
- if (data?.get('startDate') > new Date()) {
|
|
|
- data?.set('startDate', new Date());
|
|
|
- }
|
|
|
- if (data?.get('deadline') < new Date()) {
|
|
|
- data?.set(
|
|
|
- 'deadline',
|
|
|
- new Date(new Date().getTime() + 60 * 1000 * 60 * 24 * 7)
|
|
|
- );
|
|
|
- console.warn('结束时间延长一周之后');
|
|
|
- }
|
|
|
- break;
|
|
|
- case 'stop':
|
|
|
- data?.set('status', '100');
|
|
|
- break;
|
|
|
- case 'end':
|
|
|
- data?.set('status', '400');
|
|
|
- data?.set('deadline', new Date());
|
|
|
- break;
|
|
|
- case 'del':
|
|
|
- data?.set('isDeleted', true);
|
|
|
- break;
|
|
|
- }
|
|
|
- await data.save();
|
|
|
- if (end) {
|
|
|
- this.getEduProcess();
|
|
|
- }
|
|
|
+ //暂停流程
|
|
|
+ async onStatusChange(
|
|
|
+ data: Parse.Object,
|
|
|
+ type: string,
|
|
|
+ end?: boolean
|
|
|
+ ): Promise<void> {
|
|
|
+ console.log(data, type);
|
|
|
+ switch (type) {
|
|
|
+ case 'strat':
|
|
|
+ if (data?.get('status') == '100') {
|
|
|
+ data?.set('status', null);
|
|
|
+ }
|
|
|
+ if (data?.get('startDate') > new Date()) {
|
|
|
+ data?.set('startDate', new Date());
|
|
|
+ }
|
|
|
+ if (data?.get('deadline') < new Date()) {
|
|
|
+ data?.set(
|
|
|
+ 'deadline',
|
|
|
+ new Date(new Date().getTime() + 60 * 1000 * 60 * 24 * 7)
|
|
|
+ );
|
|
|
+ console.warn('结束时间延长一周之后');
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 'stop':
|
|
|
+ data?.set('status', '100');
|
|
|
+ break;
|
|
|
+ case 'end':
|
|
|
+ data?.set('status', '400');
|
|
|
+ data?.set('deadline', new Date());
|
|
|
+ break;
|
|
|
+ case 'del':
|
|
|
+ data?.set('isDeleted', true);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ await data.save();
|
|
|
+ if (end) {
|
|
|
+ this.getEduProcess();
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
toUrl(url: string, params?: object) {
|
|
|
if (params) {
|