From 7f9dfe8e52539726ccfe54031cc385136ff06aa2 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 23 Dec 2020 08:45:35 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=9F=BA=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=80=83=E9=A2=98=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-test-score.component.html | 14 ++-- .../create-test-score.component.ts | 78 ++++++++++++------- .../examiner-index.component.html | 2 +- .../examiner-index.component.ts | 59 ++++++++------ 4 files changed, 95 insertions(+), 58 deletions(-) diff --git a/src/app/examiner/create-test-score/create-test-score.component.html b/src/app/examiner/create-test-score/create-test-score.component.html index e694bb2..2b26b10 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.html +++ b/src/app/examiner/create-test-score/create-test-score.component.html @@ -66,7 +66,7 @@ [nzData]="unit.basicInfoNodes" nzCheckable nzMultiple - [nzCheckedKeys]="defaultCheckedKeys" + [nzCheckedKeys]="unit.basicInfoNodesKey" [nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]="defaultSelectedKeys" (nzClick)="nzEvent($event,key)" @@ -109,7 +109,7 @@ [nzData]="unit.aroundNodes" nzCheckable nzMultiple - [nzCheckedKeys]="defaultCheckedKeys" + [nzCheckedKeys]="unit.aroundNodesKey" [nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]="defaultSelectedKeys" (nzClick)="nzEvent($event,key)" @@ -152,7 +152,7 @@ [nzData]="unit.keySiteNodes" nzCheckable nzMultiple - [nzCheckedKeys]="defaultCheckedKeys" + [nzCheckedKeys]="unit.keySiteNodesKey" [nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]="defaultSelectedKeys" (nzClick)="nzEvent($event,key)" @@ -195,7 +195,7 @@ [nzData]="unit.funDivNodes" nzCheckable nzMultiple - [nzCheckedKeys]="defaultCheckedKeys" + [nzCheckedKeys]="unit.funDivNodesKey" [nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]="defaultSelectedKeys" (nzClick)="nzEvent($event,key)" @@ -238,7 +238,7 @@ [nzData]="unit.fireFacNodes" nzCheckable nzMultiple - [nzCheckedKeys]="defaultCheckedKeys" + [nzCheckedKeys]="unit.fireFacNodesKey" [nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]="defaultSelectedKeys" (nzClick)="nzEvent($event,key)" @@ -263,11 +263,11 @@ -
+
add_circle_outline添加预案
-
+
diff --git a/src/app/examiner/create-test-score/create-test-score.component.ts b/src/app/examiner/create-test-score/create-test-score.component.ts index 54b1ef1..547eef2 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.ts +++ b/src/app/examiner/create-test-score/create-test-score.component.ts @@ -27,42 +27,64 @@ export class CreateTestScoreComponent implements OnInit { }, 0); } - async ngOnInit(): Promise { - for (let y = 0, length = this.unitId.length; y < length; y++){ - let element = this.unitId[y] - element.score = 0 - element.basicInfoScore = 0 - element.basicInfoItemScore = 0 - element.basicInfoNodes = [] - element.aroundScore = 0 - element.aroundItemScore = 0 - element.aroundNodes = [] - element.keySiteScore = 0 - element.keySiteItemScore = 0 - element.keySiteNodes = [] - element.funDivScore = 0 - element.funDivItemScore = 0 - element.funDivNodes = [] - element.fireFacScore = 0 - element.fireFacItemScore = 0 - element.fireFacNodes = [] - } + ngOnInit(): void { + - this.getUnitData().then(()=>{ - this.getAround().then(()=>{ - this.getKeySite().then(()=>{ - this.getFunDiv().then(()=>{ - this.getFireFac() + + + if(this.route.snapshot.queryParams.pattern && this.route.snapshot.queryParams.pattern == 'edit'){ + this.getSoloPaper() + }else{ + this.unitId = JSON.parse(sessionStorage.getItem(sessionStorage.getItem('paperId'))) + for (let y = 0, length = this.unitId.length; y < length; y++){ + let element = this.unitId[y] + element.score = 0 + element.basicInfoScore = 0 + element.basicInfoItemScore = 0 + element.basicInfoNodes = [] + element.aroundScore = 0 + element.aroundItemScore = 0 + element.aroundNodes = [] + element.keySiteScore = 0 + element.keySiteItemScore = 0 + element.keySiteNodes = [] + element.funDivScore = 0 + element.funDivItemScore = 0 + element.funDivNodes = [] + element.fireFacScore = 0 + element.fireFacItemScore = 0 + element.fireFacNodes = [] + } + + this.getUnitData().then(()=>{ + this.getAround().then(()=>{ + this.getKeySite().then(()=>{ + this.getFunDiv().then(()=>{ + this.getFireFac() + }) }) }) }) - }) + this.getPaperPlans().then(()=>{ + this.planItemScore() + }) + } - this.getPaperPlans().then(()=>{ + + } + + //获得指定试卷信息。 + getSoloPaper(){ + this.http.get(`/api/Papers/${sessionStorage.getItem('paperId')}`).subscribe((data:any) => { + data.paperDataInfo.forEach(item => { + this.unitId.push(JSON.parse(item.originalData)) + }) + console.log('试卷信息',this.unitId) this.planItemScore() }) } + //获取所有考试设定 async getPaperPlans(){ @@ -90,7 +112,7 @@ export class CreateTestScoreComponent implements OnInit { clickUnitName(key){ this.selectedUnitIndex = key } - unitId:any = JSON.parse(sessionStorage.getItem(sessionStorage.getItem('paperId'))) + unitId:any = [] //获取单位基本信息 async getUnitData(){ diff --git a/src/app/examiner/examiner-index/examiner-index.component.html b/src/app/examiner/examiner-index/examiner-index.component.html index 896fc78..81b56d8 100644 --- a/src/app/examiner/examiner-index/examiner-index.component.html +++ b/src/app/examiner/examiner-index/examiner-index.component.html @@ -84,7 +84,7 @@ diff --git a/src/app/examiner/examiner-index/examiner-index.component.ts b/src/app/examiner/examiner-index/examiner-index.component.ts index c9e0d3b..fd0ca95 100644 --- a/src/app/examiner/examiner-index/examiner-index.component.ts +++ b/src/app/examiner/examiner-index/examiner-index.component.ts @@ -34,11 +34,18 @@ export class ExaminerIndexComponent implements OnInit { this.getunitdata(); this.getOrganizations(); this.getUnittype(); - this.getAlltabledate() - setInterval(()=>this.getAlltabledate(),60000) - //this.getHelp() + this.getAlltabledate(); + this.getProfiles() + } + //获取登录账号的个人资料 + Profiles:any + getProfiles(){ + this.http.get('/api/ExamAccounts/Profiles').subscribe((data:any) => { + console.log(data) + this.Profiles = data + sessionStorage.setItem('creatorData',JSON.stringify(data)) + }) } - displayedColumns: string[] = ['name','startTime','endTime', 'examzhong','scc']; tabledataSource:any accound @@ -115,6 +122,14 @@ export class ExaminerIndexComponent implements OnInit { ) } + + + //编辑试卷 + editPaper(item){ + // console.log(item) + sessionStorage.setItem("paperId",item.id) + this.router.navigateByUrl("/examiner/create-test-score?pattern=edit") + } //获得所有组织机构 getOrganizations(){ this.http.get('/api/Organizations').subscribe( @@ -135,25 +150,25 @@ export class ExaminerIndexComponent implements OnInit { ) } - //获得查询支队信息 - help(){ - let paramsdata:any = { - PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], - Sort: null, - SortType: null, + //获得查询支队信息 + help(){ + let paramsdata:any = { + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + Sort: null, + SortType: null, + } + //console.log(paramsdata) + this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{ + this.tabledataSource=data + console.log(this.tabledataSource) + }) + } + //分页事件 + chagePage(e){ + this.PageNumber = e.pageIndex+1 + this.getAlltabledate() } - //console.log(paramsdata) - this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{ - this.tabledataSource=data - console.log(this.tabledataSource) - }) - } - //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 - this.getAlltabledate() - } //获取表格信息 getAlltabledate(){ let paramsdata:any = {
预案名称{{item.status=="2"?"已结束":item.status=="0"?"未开考":"开考中"}} - 编辑 + 编辑 详情 删除