From baa3a53353fad63ce9a0b6abe7cc71cffcdcacb2 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 18 Dec 2020 15:43:01 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E4=BF=9D=E5=AD=98=E6=B6=88?= =?UTF-8?q?=E9=98=B2=E6=AF=8F=E5=B1=82=E8=AE=BE=E6=96=BD=E7=9A=84=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.ts | 2 +- .../collection-tools/examinationQuestions.ts | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 1ea80a4..878c990 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -1326,7 +1326,7 @@ export class CollectionToolsComponent implements OnInit { floorData:this.selectingSitePlan } let data = { treeData: treeData,oldRealData:this.storeyData ,buildFloorData:buildFloorData} - // let dialogRef = this.dialog.open(examinationQuestions,{data}); + let dialogRef = this.dialog.open(examinationQuestions,{data}); } //上传考题 diff --git a/src/app/ui/collection-tools/examinationQuestions.ts b/src/app/ui/collection-tools/examinationQuestions.ts index 0161439..ce064fc 100644 --- a/src/app/ui/collection-tools/examinationQuestions.ts +++ b/src/app/ui/collection-tools/examinationQuestions.ts @@ -26,7 +26,7 @@ export class examinationQuestions { ngOnInit(): void { this.renderData = this.data.treeData if(JSON.parse(sessionStorage.getItem('tree型数据')) && JSON.parse(sessionStorage.getItem('tree型数据'))[this.data.buildFloorData.floorData.id]){ - console.log(123,JSON.parse(sessionStorage.getItem('tree型数据'))[this.data.buildFloorData.floorData.id]) + // console.log(123,JSON.parse(sessionStorage.getItem('tree型数据'))[this.data.buildFloorData.floorData.id]) this.defaultCheckedKeys = JSON.parse(sessionStorage.getItem('tree型数据'))[this.data.buildFloorData.floorData.id] } this.data.treeData.forEach(element => { @@ -96,32 +96,38 @@ export class examinationQuestions { let data = JSON.parse(sessionStorage.getItem("试卷id")) if(data && data.length != 0){ + console.log(1) let ind = null data.forEach((item,index) => { if(item.key == obj.key){ - ind = index + ind = index + 1 } }) if(ind){ if(checkList.length != 0){ - data[ind].children = checkList + data[ind - 1].children = checkList }else{ - data.splice(ind,1) + data.splice(ind - 1,1) } }else{ data.push(obj) } sessionStorage.setItem("试卷id",JSON.stringify(data)) + }else{ + console.log(2) data = [] data[0] = obj - console.log(123,data) sessionStorage.setItem("试卷id",JSON.stringify(data)) } - + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('当层消防设施考题设置完成','确定',config); + // this.dialogRef.close() } }