From 1ab99f9000d2d7ba77fc1bd904669e9cd6640b09 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Fri, 25 Dec 2020 13:50:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E8=80=83=E5=AE=98?= =?UTF-8?q?=E9=98=85=E5=8D=B7=E9=A6=96=E9=A1=B5=E9=9D=A2=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mark-papers-index.component.html | 21 +++++----- .../mark-papers-index.component.ts | 36 +++++++++++++++-- .../mark-papers-two.component.html | 19 ++++----- .../mark-papers-two.component.ts | 40 +++++++++++++++---- 4 files changed, 86 insertions(+), 30 deletions(-) diff --git a/src/app/examiner/mark-papers-index/mark-papers-index.component.html b/src/app/examiner/mark-papers-index/mark-papers-index.component.html index 679b091..8489564 100644 --- a/src/app/examiner/mark-papers-index/mark-papers-index.component.html +++ b/src/app/examiner/mark-papers-index/mark-papers-index.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-14 16:30:31 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-14 17:39:30 + * @LastEditTime: 2020-12-25 08:59:47 -->
@@ -35,21 +35,22 @@ - {{item.name}} - {{item.organization}} - {{item.startTime}} - {{item.overTime}} + {{item.title}} + 广西总队 + {{item.startTime|date:'yyyy-MM-dd HH:mm'}} + {{item.endTime|date:'yyyy-MM-dd HH:mm'}} - 阅卷 + 阅卷 - - + +
diff --git a/src/app/examiner/mark-papers-index/mark-papers-index.component.ts b/src/app/examiner/mark-papers-index/mark-papers-index.component.ts index c734389..62e2ce5 100644 --- a/src/app/examiner/mark-papers-index/mark-papers-index.component.ts +++ b/src/app/examiner/mark-papers-index/mark-papers-index.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-14 16:30:31 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-15 08:53:09 + * @LastEditTime: 2020-12-25 09:00:41 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import {HttpClient} from '@angular/common/http' @@ -36,19 +36,47 @@ export class MarkPapersIndexComponent implements OnInit { constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } ngOnInit(): void { + this.getAlltabledate() } - dataSource = ELEMENT_DATA; + dataSource markName//试卷名称 markDate//考试日期 + //分页 + @ViewChild(MatPaginator, {static: true}) + pageEvent: PageEvent; + paginator: MatPaginator; + length:any; //共多少条数据 + pageSize:any; //每页条数 + pageSizeOptions: number[] = [10] //设置每页条数 + PageNumber:any //第几页 //重置功能 resert(){ this.markName=undefined this.markDate=undefined } //点击阅卷跳转 - markTwo(e){ + markTwo(e,id){ console.log(e) - this.router.navigate(['/home/mark-papers-index/mark-papers-two'],{queryParams:{'level':e}}) + this.router.navigate(['/home/mark-papers-index/mark-papers-two'],{queryParams:{'level':e,'id':id}}) + } + //获取表格信息 + getAlltabledate(){ + let paramsdata:any = { + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + Sort: null, + SortType: null, + } + this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{ + this.dataSource=data.items + this.length=data.totalCount + console.log(this.dataSource) + }) + } + //分页事件 + chagePage(e){ + this.PageNumber = e.pageIndex+1 + this.getAlltabledate() } } diff --git a/src/app/examiner/mark-papers-two/mark-papers-two.component.html b/src/app/examiner/mark-papers-two/mark-papers-two.component.html index bef077e..d3e0535 100644 --- a/src/app/examiner/mark-papers-two/mark-papers-two.component.html +++ b/src/app/examiner/mark-papers-two/mark-papers-two.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-14 17:21:02 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-15 09:21:32 + * @LastEditTime: 2020-12-25 11:26:01 -->
@@ -30,10 +30,10 @@ {{item.name}} - {{item.organization}} - {{item.startTime}} - {{item.testState}} - {{item.mark}} + 广西总队 + {{item.endTime|date:'yyyy-MM-dd HH:mm'}} + {{item.isMarked== true?"已阅卷":"未阅卷"}} + 90 阅卷 @@ -41,10 +41,11 @@ - - + +
diff --git a/src/app/examiner/mark-papers-two/mark-papers-two.component.ts b/src/app/examiner/mark-papers-two/mark-papers-two.component.ts index cd6cb36..b940f09 100644 --- a/src/app/examiner/mark-papers-two/mark-papers-two.component.ts +++ b/src/app/examiner/mark-papers-two/mark-papers-two.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-14 17:21:02 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-15 09:16:29 + * @LastEditTime: 2020-12-25 09:15:42 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import {HttpClient} from '@angular/common/http' @@ -19,11 +19,6 @@ const ELEMENT_DATA = [ {name: "张三三", organization: '浦东支队', startTime: "2020-09-19 10:00", mark: '120',testState:'未阅卷'}, {name: "提亚马特", organization: '黄埔支队', startTime: "2020-09-19 10:00", mark: '100',testState:'已阅卷'}, {name: "艾泽拉斯", organization: '徐汇支队', startTime: "2020-09-19 10:00", mark: '90',testState:'已阅卷'}, - /* {name: "富华酒店", organization: '普陀支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'开考中'}, - {name: "立新加油站", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'开考中'}, - {name: "富华酒店", organization: '宝山支队', startTime: "2020-07-19 10:00", overTime: '2020-07-19 12:00',testState:'已结束'}, - {name: "裕达国际酒店", organization: '浦东支队', startTime: "2020-08-19 10:00", overTime: '2020-08-19 12:00',testState:'已结束'}, - {name: "锦德大酒店", organization: '长宁支队', startTime: "2019-09-19 10:00", overTime: '2019-09-19 12:00',testState:'已结束'}, */ ]; @Component({ @@ -38,12 +33,43 @@ export class MarkPapersTwoComponent implements OnInit { ngOnInit(): void { this.activatedRoute.queryParams.subscribe(param=>{ this.headtext=param.level + this.getid=param.id //console.log(headName) }); + this.getAlltabledate() } headtext - dataSource = ELEMENT_DATA; + getid//试卷id + dataSource markName//试卷名称 markDate//考试日期 + //分页 + @ViewChild(MatPaginator, {static: true}) + pageEvent: PageEvent; + paginator: MatPaginator; + length:any; //共多少条数据 + pageSize:any; //每页条数 + pageSizeOptions: number[] = [10] //设置每页条数 + PageNumber:any //第几页 + //获取表格信息 + getAlltabledate(){ + let paramsdata:any = { + PaperId:this.getid, + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + Sort: null, + SortType: null, + } + this.http.get("/api/Examinations",{params:paramsdata}).subscribe((data:any)=>{ + this.dataSource=data.items + this.length=data.totalCount + console.log(this.dataSource) + }) + } + //分页事件 + chagePage(e){ + this.PageNumber = e.pageIndex+1 + this.getAlltabledate() + } } From fe6f1a468599bd0e0f67f6d04e28e97ee8b50023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Fri, 25 Dec 2020 14:17:30 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E8=80=83=E7=94=9F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/working-area.component.ts | 79 +++++++++++++------ 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 1ce8484..2373856 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -277,7 +277,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.previewImage.position = this.backgroundImage.toLocal(this.mousePosition); } - if (this.backgroundImage !== null) { + if (this.circleShadow !== null && this.backgroundImage !== null) { this.circleShadow.position = this.backgroundImage.toLocal(this.mousePosition); this.refreshPreviewLineSegment(this.currentClickPoint.position, this.circleShadow.position); } @@ -479,30 +479,51 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // * 刷新工作区 // */ public async refresh() { - this.setPaintMode(PaintMode.endPaint); - this.resetCanvas(); - this.destroyBackgroundImage(); - if (!this.canvasData.selectStorey.imageUrl) { + this.loadExamineeData(); + // this.setPaintMode(PaintMode.endPaint); + // this.resetCanvas(); + // this.destroyBackgroundImage(); + // if (!this.canvasData.selectStorey.imageUrl) { - return; - } + // return; + // } - await this.createBackgroundImage(this.canvasData.selectStorey.imageUrl); - this.createFloorShape(this.canvasData.originaleveryStoreyData.data); - if (this.canvasData.gameMode === GameMode.Assignment) { - this.createNodeShape(this.canvasData.selectPanelPoint.Data); + // await this.createBackgroundImage(this.canvasData.selectStorey.imageUrl); + // this.createFloorShape(this.canvasData.originaleveryStoreyData.data); + // if (this.canvasData.gameMode === GameMode.Assignment) { + // this.createNodeShape(this.canvasData.selectPanelPoint.Data); + // } + } + /** + * 加载考生数据 + */ + public loadExamineeData() { + // 等待背景图下载完成并自动设置背景图缩放比例 + this.createBackground(); + this.refreshBackgroundImage(); + // 创建楼层数据图形(基本信息) + for (let key1 in this.canvasData.originaleveryStoreyData.data){ + for (let key2 in this.canvasData.hiddenBasicInfoFacilities){ + if (this.canvasData.originaleveryStoreyData.data[key1].Id==this.canvasData.hiddenBasicInfoFacilities[key2].Id) { + delete this.canvasData.originaleveryStoreyData.data[key1]; + } + } } - // await this.createBackground(this.canvasData.selectStorey.imageUrl); - + this.createFloorShape(this.canvasData.originaleveryStoreyData.data); + // 创建楼层数据图形(考生信息) + this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data); + // 创建节点数据图形(处置节点) + this.createNodeShape(this.canvasData.selectPanelPoint.Data); } /** * 异步创建背景图 */ - public async createBackground(imageUrl:string) { + public createBackground() { if (this.backgroundImage !== null) { - this.destroyBackgroundImage(); + this.backgroundImage.destroy(); + this.backgroundImage = null; } - await this.createBackgroundImage(imageUrl) + this.createBackgroundImage() } /** * 创建楼层图形 @@ -630,19 +651,16 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 创建背景图 */ - public async createBackgroundImage(imageUrl: string): Promise { - const image = await PIXI.Texture.fromURL(imageUrl); - this.backgroundImage = new PIXI.Sprite(image); + public createBackgroundImage(){ + this.backgroundImage = PIXI.Sprite.from('assets/images/noImg.png') this.backgroundImage.anchor.set(0.5); this.backgroundImage.x = this.app.view.width / 2; this.backgroundImage.y = this.app.view.height / 2; this.backgroundImage.interactive = true; this.backgroundImage.name = 'background'; this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle; - // const left = this.init.element.nativeElement.querySelector('.functionalDomainLeft').clientWidth; - // const right = this.init.element.nativeElement.querySelector('.functionalDomainRight').clientWidth; - const imageWidth = this.backgroundImage.texture.width; - const imageHeight = this.backgroundImage.texture.height; + const imageWidth = 665; + const imageHeight = 530; const appWidth = this.app.view.width - 470; const appHeight = this.app.view.height; @@ -934,14 +952,23 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 刷新背景图 */ - public refreshBackgroundImage(): void { + public async refreshBackgroundImage(): Promise { if (!this.canvasData.selectStorey.imageUrl) { this.backgroundImage.visible = false; } else { - this.backgroundImage.texture = PIXI.Texture.from(this.canvasData.selectStorey.imageUrl); + this.backgroundImage.texture = await PIXI.Texture.fromURL(this.canvasData.selectStorey.imageUrl); + const imageWidth = this.backgroundImage.texture.width; + const imageHeight = this.backgroundImage.texture.height; + const appWidth = this.app.view.width - 470; + const appHeight = this.app.view.height; + + const wScale = appWidth / imageWidth; + const hScale = appHeight / imageHeight; + + const scale = wScale < hScale? wScale: hScale; + this.backgroundImage.scale.set(scale); this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle; this.backgroundImage.visible = true; - // this.refresh(); } } /** From bcde2fd9b878e0149e6a57466e6b0f39f45a3499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Fri, 25 Dec 2020 14:22:20 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=80=83=E7=94=9F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/working-area.component.ts | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 2373856..7a4dbeb 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -498,10 +498,17 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 加载考生数据 */ public loadExamineeData() { - // 等待背景图下载完成并自动设置背景图缩放比例 - this.createBackground(); - this.refreshBackgroundImage(); - // 创建楼层数据图形(基本信息) + this.createBackground();// 创建背景图 + this.refreshBackgroundImage();// 刷新背景图 + this.processinghiddenData();// 处理数据 + this.createFloorShape(this.canvasData.originaleveryStoreyData.data);// 基本信息 + this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);// 考生信息 + this.createNodeShape(this.canvasData.selectPanelPoint.Data);// 处置节点 + } + /** + * 处理隐藏数据 + */ + public processinghiddenData() { for (let key1 in this.canvasData.originaleveryStoreyData.data){ for (let key2 in this.canvasData.hiddenBasicInfoFacilities){ if (this.canvasData.originaleveryStoreyData.data[key1].Id==this.canvasData.hiddenBasicInfoFacilities[key2].Id) { @@ -509,11 +516,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV } } } - this.createFloorShape(this.canvasData.originaleveryStoreyData.data); - // 创建楼层数据图形(考生信息) - this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data); - // 创建节点数据图形(处置节点) - this.createNodeShape(this.canvasData.selectPanelPoint.Data); } /** * 异步创建背景图 From 8f7751ff798dd57dc2647fe3e8eccf96641e3e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Fri, 25 Dec 2020 14:56:29 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=9D=E5=AD=98/=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=80=83=E7=94=9F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/canvas-share-data.service.ts | 2 +- src/app/working-area/model/axImageShape.ts | 1 + .../working-area/working-area.component.ts | 22 ++++++++++++++----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index fa70878..4540e24 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -38,7 +38,7 @@ export class CanvasShareDataService { /** * 游戏模式 */ - gameMode: GameMode = GameMode.Assignment; + gameMode: GameMode = GameMode.Examinee; facilityAssetsName = new Map([ [ '消防水池', '消防水池'], diff --git a/src/app/working-area/model/axImageShape.ts b/src/app/working-area/model/axImageShape.ts index 67466be..b59bd9d 100644 --- a/src/app/working-area/model/axImageShape.ts +++ b/src/app/working-area/model/axImageShape.ts @@ -407,6 +407,7 @@ export class AxImageShape extends AxShape { IsFromBuilding : this.workingArea.canvasData.selectTemplateData.isFromBuilding, GameMode: this.workingArea.canvasData.gameMode, LinkedObjects: new Array(this.assetData.Id), + Tag: this.workingArea.canvasData.selectTemplateData.tag }; this.workingArea.paintingShape = new AxArrowConnector(tempData, this.workingArea,false,true); this.assetData.Pipelines.push(this.workingArea.paintingShape.assetData.Id); diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 7a4dbeb..3b313bd 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -401,8 +401,17 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.canvasData.selectPanelPoint.Data = new FloorNodeData(); } this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData; - } else if (obj.assetData.GameMode === GameMode.Examinee) { // 考生考试 - // this.canvasData.examOriginaleveryStoreyData.data[obj.assetData.Id] = obj.assetData; + } else if (obj.assetData.GameMode === GameMode.Examinee) { // 考生考试 + console.log(obj.assetData.Tag) + if (obj.assetData.Tag === 1) { + this.canvasData.examOriginaleveryStoreyData.data[obj.assetData.Id] = obj.assetData; + } else { + if (this.canvasData.selectPanelPoint.Data === undefined + || this.canvasData.selectPanelPoint.Data === null) { + this.canvasData.selectPanelPoint.Data = new FloorNodeData(); + } + this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData; + } } this.canvasData.isChange = true; }); @@ -718,7 +727,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV DrawMode : this.canvasData.selectTemplateData.drawMode, Thickness : this.canvasData.selectTemplateData.thickness, IsFromBuilding : this.canvasData.selectTemplateData.isFromBuilding, - GameMode : this.canvasData.gameMode + GameMode: this.canvasData.gameMode, + Tag: this.canvasData.selectTemplateData.tag }; const singleIcon = new AxImageShape(assetData, this); this.emit('createIcon', singleIcon); @@ -765,7 +775,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV DrawMode: this.canvasData.selectTemplateData.drawMode, Thickness: this.canvasData.selectTemplateData.thickness, IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding, - GameMode: this.canvasData.gameMode + GameMode: this.canvasData.gameMode, + Tag: this.canvasData.selectTemplateData.tag }; // const assetData1 = { // ImageUrl: this.canvasData.selectTemplateData.imageUrl, @@ -850,7 +861,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV DrawMode: this.canvasData.selectTemplateData.drawMode, Thickness: this.canvasData.selectTemplateData.thickness, IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding, - GameMode: this.canvasData.gameMode + GameMode: this.canvasData.gameMode, + Tag: this.canvasData.selectTemplateData.tag }; if (this.canvasData.selectTemplateData.name === '距离') { this.paintingShape = new AxArrowConnector(assetData2, this,true,true);