|
@@ -36,38 +36,7 @@ export class TextbookDetailsComponent implements OnInit {
|
|
|
|
|
|
/**扩展表记录 */
|
|
|
eduTextbookVolumeList: Array<any> = []
|
|
|
-/**获取扩展表记录 */
|
|
|
-async getEduTextbookVolumeList() {
|
|
|
- if (this.textBook?.typeNumber && this.textBook?.typeNumber > 12) {
|
|
|
- this.textBook.typeNumber = 12
|
|
|
- }
|
|
|
- console.log(this.textBook?.type, this.textBook?.typeNumber)
|
|
|
- let query = new Parse.Query('EduTextbookVolume')
|
|
|
- query.equalTo('eduTextbook', this.textBook?.objectId)
|
|
|
- query.ascending('createdAt')//小到大
|
|
|
- query.notEqualTo('isDeleted', true)
|
|
|
- if (this.textBook?.type == '全册') {
|
|
|
- query.limit(this.textBook?.typeNumber)
|
|
|
- } else {
|
|
|
- query.limit(1)
|
|
|
- }
|
|
|
- let req = await query.find()
|
|
|
- let list = []
|
|
|
- for(let i in req){
|
|
|
- list.push(req[i].toJSON())
|
|
|
- }
|
|
|
- console.log(list)
|
|
|
- if (this.textBook?.type == '全册') {
|
|
|
- this.eduTextbookVolumeList = new Array(this.textBook?.typeNumber).fill({ objectId: '' })
|
|
|
- for (let i in list) {
|
|
|
- this.eduTextbookVolumeList[i] = list[i]
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.eduTextbookVolumeList[0] = list[0]
|
|
|
- console.log(this.eduTextbookVolumeList)
|
|
|
- }
|
|
|
|
|
|
-}
|
|
|
/** 册数*/
|
|
|
typeNumber:any
|
|
|
/** 申报类型*/
|
|
@@ -75,28 +44,21 @@ type:any
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
constructor(private router: Router, private activeRoute: ActivatedRoute) {}
|
|
|
|
|
|
ngOnInit() {
|
|
|
this.activeRoute.paramMap.subscribe(async (params) => {
|
|
|
this.user = Parse.User.current()
|
|
|
let id = params.get('id');
|
|
|
+ console.log(id)
|
|
|
if (id) {
|
|
|
let query = new Parse.Query('EduTextbook');
|
|
|
query.equalTo('objectId', id);
|
|
|
+ query.include('childrens')
|
|
|
let r = await query.first();
|
|
|
this.textBook = r?.toJSON()
|
|
|
console.log(this.textBook);
|
|
|
- this.getEduTextbookVolumeList()
|
|
|
+ this.eduTextbookVolumeList = this.textBook?.childrens
|
|
|
}
|
|
|
});
|
|
|
}
|