|
@@ -1,4 +1,4 @@
|
|
|
-import { Component, Input, OnInit } from '@angular/core';
|
|
|
+import { Component, Input, OnInit, QueryList, ViewChildren } from '@angular/core';
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
import { NzSpaceModule } from 'ng-zorro-antd/space';
|
|
|
import { CommonCompModule } from '../../../../services/common.modules';
|
|
@@ -6,7 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|
|
import { NzMessageModule } from 'ng-zorro-antd/message';
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
|
import Parse from 'parse';
|
|
|
-// import { textbookServer } from '../../../../services/textbook';
|
|
|
+import { textbookServer } from '../../../../services/textbook';
|
|
|
import { NzModalService } from 'ng-zorro-antd/modal';
|
|
|
import { MatDialog } from '@angular/material/dialog';
|
|
|
import { NzEmptyModule } from 'ng-zorro-antd/empty';
|
|
@@ -38,7 +38,10 @@ export class CollectTextbookComponent implements OnInit {
|
|
|
textbookList: Array<Parse.Object> = [];
|
|
|
count: number = 0;
|
|
|
timeDefaultValue = setHours(new Date(), 0);
|
|
|
-
|
|
|
+ @ViewChildren(UploadCollectComponent) children:
|
|
|
+ | QueryList<UploadCollectComponent>
|
|
|
+ | any;
|
|
|
+
|
|
|
@Input('limit') limit: number = 10;
|
|
|
pageIndex: number = 1;
|
|
|
loading: boolean = false;
|
|
@@ -89,12 +92,12 @@ export class CollectTextbookComponent implements OnInit {
|
|
|
}
|
|
|
statusMap: any = {}; //任务状态
|
|
|
|
|
|
- isVisible: boolean = false;
|
|
|
+ isVisiblePreview: boolean = false;
|
|
|
currentTextbook?: Parse.Object; //当前预览教材
|
|
|
|
|
|
constructor(
|
|
|
// private activeRoute: ActivatedRoute,
|
|
|
- // public tbookSer: textbookServer,
|
|
|
+ public tbookSer: textbookServer,
|
|
|
private msg: NzMessageService,
|
|
|
public dialog: MatDialog,
|
|
|
private route: Router,
|
|
@@ -245,7 +248,7 @@ export class CollectTextbookComponent implements OnInit {
|
|
|
|
|
|
onReview(data:Parse.Object){
|
|
|
this.currentTextbook = data;
|
|
|
- this.isVisible = true;
|
|
|
+ this.isVisiblePreview = true;
|
|
|
}
|
|
|
//短信提醒
|
|
|
async onEmitMsg(data:Parse.Object){
|
|
@@ -337,4 +340,75 @@ export class CollectTextbookComponent implements OnInit {
|
|
|
nzOnCancel: () => console.log('Cancel')
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /* 2025-2-18新增需求:国家级管理员新增修改教材源文件权限 */
|
|
|
+ //打开上传弹窗
|
|
|
+ isVisible: boolean = false; //编辑弹窗
|
|
|
+ btnLoading: boolean = false;
|
|
|
+ onEditModal(data: Parse.Object) {
|
|
|
+ // if (
|
|
|
+ // !data.get('eduProcess')?.get('collectStartData') ||
|
|
|
+ // !data.get('eduProcess')?.get('collectEndData') ||
|
|
|
+ // data.get('eduProcess')?.get('collectStartData') > new Date() ||
|
|
|
+ // data.get('eduProcess')?.get('collectEndData') < new Date()
|
|
|
+ // ) {
|
|
|
+ // this.msg.warning('非收集文件工作期内');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ this.currentTextbook = data;
|
|
|
+ this.isVisible = true;
|
|
|
+ }
|
|
|
+ async saveCollect(type: string): Promise<any> {
|
|
|
+ console.log(type);
|
|
|
+ this.btnLoading = true;
|
|
|
+ if (type == 'sbmit') {
|
|
|
+ this.modal.confirm({
|
|
|
+ nzTitle: '温馨提示',
|
|
|
+ nzContent: '由于“教材资源上传”工作阶段持续时间较短,教材资源一经上传将无法撤回或修改,请务必在确认无误之后再上传。',
|
|
|
+ nzOkText: '确定',
|
|
|
+ nzOkType: 'primary',
|
|
|
+ nzOkDanger: false,
|
|
|
+ nzOnOk: async () => {
|
|
|
+ let isVrifly = await this.saveEduTextbookVolume(type);
|
|
|
+ if (!isVrifly) {
|
|
|
+ this.btnLoading = false;
|
|
|
+ this.msg.warning('填写信息不完整');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.msg.success('提交成功');
|
|
|
+ this.btnLoading = false;
|
|
|
+ this.isVisible = false;
|
|
|
+ this.getTextbook(this.searchValue);
|
|
|
+ },
|
|
|
+ nzCancelText: '取消',
|
|
|
+ nzOnCancel: () => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ await this.saveEduTextbookVolume(type);
|
|
|
+ this.msg.success('保存成功');
|
|
|
+ this.btnLoading = false;
|
|
|
+ this.isVisible = false;
|
|
|
+ this.getTextbook(this.searchValue);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**上传分册数据 */
|
|
|
+ async saveEduTextbookVolume(type: string): Promise<any> {
|
|
|
+ let isVrifly = true; //默认都通过,若一项填写未完成,则不通过
|
|
|
+ return Promise.all(
|
|
|
+ this.children.map(async (comp: any) => {
|
|
|
+ let complete = await comp.submitForm(type);
|
|
|
+ console.log(comp?.eduTextbookVolume?.id + '===' + complete);
|
|
|
+ if (!complete) {
|
|
|
+ isVrifly = false;
|
|
|
+ }
|
|
|
+ return isVrifly;
|
|
|
+ })
|
|
|
+ ).then((data) => {
|
|
|
+ console.log(isVrifly);
|
|
|
+ return isVrifly;
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|