From 988b872884bd44f628c29cd61c630e95e94a67d9 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 25 Dec 2020 10:52:13 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=A2=9E=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=80=83=E7=94=9F=E6=A0=87=E6=B3=A8=E7=9A=84=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF=E7=B4=A0=E6=9D=90=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/canvas-share-data.service.ts | 6 + .../collection-tools.component.ts | 168 +++++++++++++++--- 2 files changed, 148 insertions(+), 26 deletions(-) diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index ae0a38f..7b40b58 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -18,8 +18,14 @@ export class CanvasShareDataService { // 总平面图/建筑 楼层 selectStorey: any = {area: '', details: ''}; // 选择当前 楼层 数据 + originalcompanyBuildingData: any; // 单位/建筑 数据 + originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据 + + + examOriginaleveryStoreyData: any; // 考生答卷 总平面图/楼层/区域 楼层数据 + // 总平面图/建筑 楼层 // 处置 节点 diff --git a/src/app/ui/collection-tools-examinee/collection-tools.component.ts b/src/app/ui/collection-tools-examinee/collection-tools.component.ts index ee09fcf..24bcc7e 100644 --- a/src/app/ui/collection-tools-examinee/collection-tools.component.ts +++ b/src/app/ui/collection-tools-examinee/collection-tools.component.ts @@ -565,7 +565,6 @@ export class CollectionToolsExamineeComponent implements OnInit { saveNum :any = [] saveSite(){ if (this.selectingSitePlan && this.selectingSitePlan.id) { - this.saveNum = [] let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); SitePlanData.data = JSON.stringify(SitePlanData.data) let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); @@ -575,21 +574,114 @@ export class CollectionToolsExamineeComponent implements OnInit { let adjoinArr = [] //毗邻数组 if(this.pattern){//如果是基本信息编辑模式 + //如果是单位 总平面图 + if(this.checkedBuildingIndex==-1){ + //保存平面图数据 + this.http.post("/api/SitePlanData",SitePlanData,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + if(this.saveNum.length == 5){ + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功','确定',config); + } + },err=>{ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('平面图数据保存失败','确定',config); + }) + + //保存建筑数据 + this.http.post("/api/CompanyData",CompanyData,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + if(this.saveNum.length == 5){ + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功','确定',config); + } + },err=>{ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('单位数据保存失败','确定',config); + }) + + }else{ //如果是建筑 + + //建筑平面图数据 + this.http.post("/api/BuildingAreaData",SitePlanData,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + if(this.saveNum.length == 5){ + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功','确定',config); + } + },err=>{ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('平面图数据保存失败','确定',config); + }) + + //建筑数据 + this.http.post("/api/BuildingData",CompanyData,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + if(this.saveNum.length == 5){ + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功','确定',config); + } + },err=>{ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('单位数据保存失败','确定',config); + }) + + + } + + return true }else{//如果是想定作业编辑模式 - const dialogRef = this.dialog.open(saveOneDialogExaminee, { - data: { - allDisposalNode: this.canvasData.allDisposalNode, - selectedBuildingData:this.beforeOneCheckedBuilding, - selectedSiteData:this.selectingSitePlan, - siteOrbuilding:this.checkedBuildingIndex, - disasterId: this.allFirePlan[0].id || '' - } - }); + console.log(SitePlanData) + // const dialogRef = this.dialog.open(saveOneDialogExaminee, { + // data: { + // allDisposalNode: this.canvasData.allDisposalNode, + // selectedBuildingData:this.beforeOneCheckedBuilding, + // selectedSiteData:this.selectingSitePlan, + // siteOrbuilding:this.checkedBuildingIndex, + // disasterId: this.allFirePlan[0].id || '' + // } + // }); - dialogRef.afterClosed().subscribe(result => { - console.log('The dialog was closed'); - }); + // dialogRef.afterClosed().subscribe(result => { + // console.log('The dialog was closed'); + // }); } } else { //if @@ -980,10 +1072,44 @@ export class CollectionToolsExamineeComponent implements OnInit { this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0" this.canvasData.originaleveryStoreyData.sitePlanId? null : this.canvasData.originaleveryStoreyData.sitePlanId = e.id || null - this.renovateTreeData() + + + let examParams = { + sitePlanId : e.id, + examinationId : this.route.snapshot.queryParams.examId + } + this.http.get('/api/ExamSitePlanData',{params:examParams}).subscribe((data:any)=>{ + console.log("cnm1",data) + this.canvasData.examOriginaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.examOriginaleveryStoreyData.data? this.canvasData.examOriginaleveryStoreyData.data = JSON.parse(this.canvasData.examOriginaleveryStoreyData.data) : this.canvasData.examOriginaleveryStoreyData.data = {} + this.canvasData.examOriginaleveryStoreyData.version? null : this.canvasData.examOriginaleveryStoreyData.version = "2.0" + this.canvasData.examOriginaleveryStoreyData.buildingAreaId? null : this.canvasData.examOriginaleveryStoreyData.buildingAreaId = e.id || null + this.renovateTreeData() + }) + }) + } + //获取 建筑 楼层数据 + getBuildingStorey (e) { + let params = {buildingAreaId: e.id} + this.http.get(`/api/BuildingAreaData`,{params}).subscribe((data:any)=>{ + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0" + this.canvasData.originaleveryStoreyData.buildingAreaId? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null + let examParams = { + buildingAreaId : e.id, + examinationId : this.route.snapshot.queryParams.examId + } + this.http.get('/api/ExamBuildingAreaData',{params:examParams}).subscribe((data:any)=>{ + console.log("cnm2",data) + this.canvasData.examOriginaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.examOriginaleveryStoreyData.data? this.canvasData.examOriginaleveryStoreyData.data = JSON.parse(this.canvasData.examOriginaleveryStoreyData.data) : this.canvasData.examOriginaleveryStoreyData.data = {} + this.canvasData.examOriginaleveryStoreyData.version? null : this.canvasData.examOriginaleveryStoreyData.version = "2.0" + this.canvasData.examOriginaleveryStoreyData.buildingAreaId? null : this.canvasData.examOriginaleveryStoreyData.buildingAreaId = e.id || null + this.renovateTreeData() + }) }) } - //获取 建筑 数据 getBuildingData (e) { return new Promise ((resolve,reject)=>{ @@ -997,17 +1123,7 @@ export class CollectionToolsExamineeComponent implements OnInit { }) } - //获取 建筑 楼层数据 - getBuildingStorey (e) { - let params = {buildingAreaId: e.id} - this.http.get(`/api/BuildingAreaData`,{params}).subscribe((data:any)=>{ - this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 - this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} - this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0" - this.canvasData.originaleveryStoreyData.buildingAreaId? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null - this.renovateTreeData() - }) - } + //点击选中 平面图 楼层/区域 时 selectSitePlan (item,index) {