|
@@ -17,6 +17,11 @@ import {
|
|
} from '@angular/forms';
|
|
} from '@angular/forms';
|
|
import { textbookServer } from '../../../../services/textbook';
|
|
import { textbookServer } from '../../../../services/textbook';
|
|
import { CreatedService } from '../../../../services/created.service'
|
|
import { CreatedService } from '../../../../services/created.service'
|
|
|
|
+import{ContentComponent} from '../create/content/content.component'
|
|
|
|
+import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
|
|
+
|
|
|
|
+import { ViewChildren, QueryList } from '@angular/core';
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
interface course {
|
|
interface course {
|
|
@@ -30,6 +35,7 @@ interface course {
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-textbook-content',
|
|
selector: 'app-textbook-content',
|
|
imports: [
|
|
imports: [
|
|
|
|
+ NzCollapseModule,
|
|
CommonCompModule,
|
|
CommonCompModule,
|
|
ReactiveFormsModule,
|
|
ReactiveFormsModule,
|
|
NzSelectModule,
|
|
NzSelectModule,
|
|
@@ -37,6 +43,7 @@ interface course {
|
|
NzGridModule,
|
|
NzGridModule,
|
|
NzCheckboxModule,
|
|
NzCheckboxModule,
|
|
NzTableModule,
|
|
NzTableModule,
|
|
|
|
+ ContentComponent,
|
|
],
|
|
],
|
|
standalone: true,
|
|
standalone: true,
|
|
templateUrl: './textbook-content.component.html',
|
|
templateUrl: './textbook-content.component.html',
|
|
@@ -72,7 +79,7 @@ export class TextbookContentComponent implements OnInit {
|
|
private creatSev:CreatedService
|
|
private creatSev:CreatedService
|
|
) { }
|
|
) { }
|
|
|
|
|
|
-
|
|
|
|
|
|
+loading=false
|
|
/**扩展表记录 */
|
|
/**扩展表记录 */
|
|
eduTextbookVolumeList: Array<any> = []
|
|
eduTextbookVolumeList: Array<any> = []
|
|
/**获取扩展表记录 */
|
|
/**获取扩展表记录 */
|
|
@@ -101,6 +108,7 @@ export class TextbookContentComponent implements OnInit {
|
|
} else {
|
|
} else {
|
|
this.eduTextbookVolumeList[0] = list[0]
|
|
this.eduTextbookVolumeList[0] = list[0]
|
|
console.log(this.eduTextbookVolumeList)
|
|
console.log(this.eduTextbookVolumeList)
|
|
|
|
+ this.eduTextbookVolumeId=list[0]?.id
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -108,7 +116,8 @@ export class TextbookContentComponent implements OnInit {
|
|
typeNumber:any
|
|
typeNumber:any
|
|
/** 申报类型*/
|
|
/** 申报类型*/
|
|
type:any
|
|
type:any
|
|
-
|
|
|
|
|
|
+/** 单册时该册id*/
|
|
|
|
+ eduTextbookVolumeId:any
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit(): void {
|
|
ngAfterViewInit(): void {
|
|
@@ -204,6 +213,27 @@ export class TextbookContentComponent implements OnInit {
|
|
this.courses.splice(idx, 1);
|
|
this.courses.splice(idx, 1);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ViewChildren(ContentComponent) children: QueryList<ContentComponent> | any;
|
|
|
|
+
|
|
|
|
+ /**上传分册数据 */
|
|
|
|
+ async saveEduTextbookVolume(eduTextbookId?: any) {
|
|
|
|
+ console.log(eduTextbookId)
|
|
|
|
+ let arr = [] //存储返回的数组id
|
|
|
|
+ let isVrifly = true //默认都通过,若一项填写未完成,则不通过
|
|
|
|
+ return Promise.all(this.children.map(async (comp: any) => {
|
|
|
|
+ console.log(comp);
|
|
|
|
+ let req = await comp.saveEduTextbook(eduTextbookId||this.eduTextbook?.id)
|
|
|
|
+ console.log(req)
|
|
|
|
+ // arr.push(comp.saveEduTextbook())
|
|
|
|
+ //加上子组件返回是否填写完成的方法
|
|
|
|
+ // return arr
|
|
|
|
+ })).then(data => {
|
|
|
|
+ console.log(data);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
async saveEduTextbook(params: any, isComplete: boolean) {
|
|
async saveEduTextbook(params: any, isComplete: boolean) {
|
|
console.log(params);
|
|
console.log(params);
|
|
if (!this.eduTextbook) {
|
|
if (!this.eduTextbook) {
|
|
@@ -227,6 +257,7 @@ export class TextbookContentComponent implements OnInit {
|
|
params.influence && this.eduTextbook?.set('influence', params.influence);
|
|
params.influence && this.eduTextbook?.set('influence', params.influence);
|
|
this.eduTextbook?.set('courses', this.courses);
|
|
this.eduTextbook?.set('courses', this.courses);
|
|
await this.eduTextbook?.save();
|
|
await this.eduTextbook?.save();
|
|
|
|
+ await this.saveEduTextbookVolume()
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|