|
@@ -14,6 +14,8 @@ import { DatePipe } from '@angular/common';
|
|
import { NzPopoverModule } from 'ng-zorro-antd/popover';
|
|
import { NzPopoverModule } from 'ng-zorro-antd/popover';
|
|
import { setHours } from 'date-fns';
|
|
import { setHours } from 'date-fns';
|
|
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
|
|
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
|
|
|
|
+import { UploadCollectComponent } from '../../../nav-province-contact/components/upload-collect/upload-collect.component';
|
|
|
|
+import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-collect-textbook',
|
|
selector: 'app-collect-textbook',
|
|
templateUrl: './collect-textbook.component.html',
|
|
templateUrl: './collect-textbook.component.html',
|
|
@@ -25,7 +27,9 @@ import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
|
|
NzMessageModule,
|
|
NzMessageModule,
|
|
NzEmptyModule,
|
|
NzEmptyModule,
|
|
NzPopoverModule,
|
|
NzPopoverModule,
|
|
- NzDatePickerModule
|
|
|
|
|
|
+ NzDatePickerModule,
|
|
|
|
+ UploadCollectComponent,
|
|
|
|
+ NzCollapseModule
|
|
],
|
|
],
|
|
providers: [DatePipe],
|
|
providers: [DatePipe],
|
|
standalone: true,
|
|
standalone: true,
|
|
@@ -74,15 +78,19 @@ export class CollectTextbookComponent implements OnInit {
|
|
}
|
|
}
|
|
return j || '-';
|
|
return j || '-';
|
|
}
|
|
}
|
|
- manageProfiles:any = {}
|
|
|
|
|
|
+ manageProfiles: any = {};
|
|
|
|
|
|
- formatMapProfile(list:Array<Parse.Object>):Array<string>{
|
|
|
|
- let arr:Array<string> = []
|
|
|
|
- list.forEach(item=>{
|
|
|
|
- arr.push(this.manageProfiles[item?.get('editionUnit')])
|
|
|
|
- })
|
|
|
|
- return [...new Set(arr)]
|
|
|
|
|
|
+ formatMapProfile(list: Array<Parse.Object>): Array<string> {
|
|
|
|
+ let arr: Array<string> = [];
|
|
|
|
+ list.forEach((item) => {
|
|
|
|
+ arr.push(this.manageProfiles[item?.get('editionUnit')]);
|
|
|
|
+ });
|
|
|
|
+ return [...new Set(arr)];
|
|
}
|
|
}
|
|
|
|
+ statusMap: any = {}; //任务状态
|
|
|
|
+
|
|
|
|
+ isVisible: boolean = false;
|
|
|
|
+ currentTextbook?: Parse.Object; //当前预览教材
|
|
|
|
|
|
constructor(
|
|
constructor(
|
|
// private activeRoute: ActivatedRoute,
|
|
// private activeRoute: ActivatedRoute,
|
|
@@ -137,35 +145,64 @@ export class CollectTextbookComponent implements OnInit {
|
|
query.equalTo('status', '400');
|
|
query.equalTo('status', '400');
|
|
query.equalTo('recommend', true);
|
|
query.equalTo('recommend', true);
|
|
query.notEqualTo('discard', true);
|
|
query.notEqualTo('discard', true);
|
|
- // query.exists('score');
|
|
|
|
- // query.equalTo('verify', true);
|
|
|
|
query.include('childrens');
|
|
query.include('childrens');
|
|
this.count = await query.count();
|
|
this.count = await query.count();
|
|
query.limit(this.limit);
|
|
query.limit(this.limit);
|
|
query.skip(this.limit * (this.pageIndex - 1));
|
|
query.skip(this.limit * (this.pageIndex - 1));
|
|
- // if (exported) {
|
|
|
|
- // query.limit(1000);
|
|
|
|
- // let r = await query.find();
|
|
|
|
- // this.loading = false;
|
|
|
|
- // return r;
|
|
|
|
- // }
|
|
|
|
this.textbookList = await query.find();
|
|
this.textbookList = await query.find();
|
|
//获取对应出版单位管理员
|
|
//获取对应出版单位管理员
|
|
- if(!review && this.textbookList.length > 0){
|
|
|
|
- let contains:Array<string> = []
|
|
|
|
- this.textbookList.forEach((childs:any)=>{
|
|
|
|
- childs.get('childrens').forEach((item:Parse.Object)=> contains.push(item.get('editionUnit')))
|
|
|
|
- })
|
|
|
|
- let queryProcess = new Parse.Query('EduProcess')
|
|
|
|
- queryProcess.notEqualTo('isDeleted',true)
|
|
|
|
- queryProcess.containedIn('name',[...new Set(contains)])
|
|
|
|
- queryProcess.include('profileSubmitted.user')
|
|
|
|
- queryProcess.select('profileSubmitted.user.name','name')
|
|
|
|
- let processList = await queryProcess.find()
|
|
|
|
|
|
+ if (!review && this.textbookList.length > 0) {
|
|
|
|
+ let contains: Array<string> = [];
|
|
|
|
+ this.textbookList.forEach((item: any) => {
|
|
|
|
+ item
|
|
|
|
+ .get('childrens')
|
|
|
|
+ .forEach((child: Parse.Object) =>
|
|
|
|
+ contains.push(child.get('editionUnit'))
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ this.statusMap[item.id] = {
|
|
|
|
+ status: '待上传',
|
|
|
|
+ color: '#1890ff',
|
|
|
|
+ btn: '提醒',
|
|
|
|
+ };
|
|
|
|
+ //是否保存
|
|
|
|
+ // let isSave = item?.get('childrens').some((child: Parse.Object) => {
|
|
|
|
+ // return child?.get('collectStatus') == '100';
|
|
|
|
+ // });
|
|
|
|
+ // if (isSave) {
|
|
|
|
+ // this.statusMap[item.id] = {
|
|
|
|
+ // status: '待上传',
|
|
|
|
+ // color: '#1890ff',
|
|
|
|
+ // btn: '提醒',
|
|
|
|
+ // };
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+ //是否提交
|
|
|
|
+ let isSbmit = item?.get('childrens').every((child: Parse.Object) => {
|
|
|
|
+ return child?.get('collectStatus') == '200';
|
|
|
|
+ });
|
|
|
|
+ console.log(isSbmit);
|
|
|
|
+ if (isSbmit) {
|
|
|
|
+ this.statusMap[item.id] = {
|
|
|
|
+ status: '已提交',
|
|
|
|
+ color: '#20c94e',
|
|
|
|
+ btn: '查看',
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ let queryProcess = new Parse.Query('EduProcess');
|
|
|
|
+ queryProcess.notEqualTo('isDeleted', true);
|
|
|
|
+ queryProcess.containedIn('name', [...new Set(contains)]);
|
|
|
|
+ queryProcess.include('profileSubmitted.user');
|
|
|
|
+ queryProcess.select('profileSubmitted.user.name', 'name');
|
|
|
|
+ let processList = await queryProcess.find();
|
|
console.log(processList);
|
|
console.log(processList);
|
|
- processList.forEach(i=>{
|
|
|
|
- this.manageProfiles[i?.get('name')] = i?.get('profileSubmitted')?.get('user')?.get('name')
|
|
|
|
- })
|
|
|
|
|
|
+ processList.forEach((i) => {
|
|
|
|
+ this.manageProfiles[i?.get('name')] = i
|
|
|
|
+ ?.get('profileSubmitted')
|
|
|
|
+ ?.get('user')
|
|
|
|
+ ?.get('name');
|
|
|
|
+ });
|
|
}
|
|
}
|
|
console.log(this.textbookList);
|
|
console.log(this.textbookList);
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -206,18 +243,27 @@ export class CollectTextbookComponent implements OnInit {
|
|
this.route.navigate([url]);
|
|
this.route.navigate([url]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ onReview(data:Parse.Object){
|
|
|
|
+ this.currentTextbook = data;
|
|
|
|
+ this.isVisible = true;
|
|
|
|
+ }
|
|
|
|
+ //短信提醒
|
|
|
|
+ onEmitMsg(data:Parse.Object){
|
|
|
|
+ console.log(data);
|
|
|
|
+ }
|
|
|
|
+
|
|
//打开编辑收集文件弹窗
|
|
//打开编辑收集文件弹窗
|
|
async openEditCollect() {
|
|
async openEditCollect() {
|
|
this.collectStartData = this.eduProcess?.get('collectStartData');
|
|
this.collectStartData = this.eduProcess?.get('collectStartData');
|
|
this.collectEndData = this.eduProcess?.get('collectEndData');
|
|
this.collectEndData = this.eduProcess?.get('collectEndData');
|
|
this.pageIndex = 1;
|
|
this.pageIndex = 1;
|
|
- this.searchValue = ''
|
|
|
|
|
|
+ this.searchValue = '';
|
|
this.getTextbook();
|
|
this.getTextbook();
|
|
|
|
|
|
this.showModal = true;
|
|
this.showModal = true;
|
|
}
|
|
}
|
|
handleCancel(): void {
|
|
handleCancel(): void {
|
|
- this.showModal = false
|
|
|
|
|
|
+ this.showModal = false;
|
|
}
|
|
}
|
|
//保存收集文件设置
|
|
//保存收集文件设置
|
|
async editCollect() {
|
|
async editCollect() {
|