From beaa0f7b577095b7f561a930615024ea6bf25bc9 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 18 Dec 2020 16:45:52 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=A4=84=E7=BD=AE=E8=8A=82=E7=82=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-test-score.component.ts | 4 +- .../collection-tools.component.ts | 242 +----------------- src/app/ui/collection-tools/save.ts | 24 +- 3 files changed, 17 insertions(+), 253 deletions(-) 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 b4709fa..f3c270e 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 @@ -1220,7 +1220,7 @@ export class AddPlanTwoDialog { sessionStorage.setItem('planId',this.selectedRadioData.id) sessionStorage.setItem('buildingTypeId',this.data.companyData.companyData.buildingTypes[0].id) sessionStorage.setItem('companyId',this.data.companyData.companyData.id) - window.open('/canvasTool?openType=2') + window.open('/canvasTool?openType=1') }else{ if(this.dataSource.length == 0){ this.dialogRef.close(); @@ -1254,7 +1254,7 @@ export class AddPlanTwoDialog { sessionStorage.setItem("companyId",this.data.companyData.companyData.id) sessionStorage.setItem("buildingTypeId",this.data.companyData.companyData.buildingTypes[0].id) sessionStorage.setItem("editable","1") - window.open('/canvasTool?openType=1') + window.open('/canvasTool?openType=2') }) } } diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 878c990..ac633df 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -739,247 +739,11 @@ export class CollectionToolsComponent implements OnInit { let adjoinArr = [] //毗邻数组 if(this.pattern){//如果是基本信息编辑模式 - for (const key in object) { - if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻 - - object[key].PropertyInfos.forEach(element => { - if(element.PropertyName == "方向"){ - adjoinArr.push(element.PropertyValue) - } - }); - } - } - - if((new Set(adjoinArr)).size != adjoinArr.length){ - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存失败,毗邻存在相同方向','确定',config); - return false - }else{ - //如果是单位 总平面图 - if(this.checkedBuildingIndex==-1){ - //保存平面图数据 - this.http.post("/api/SitePlanData",SitePlanData,{ - params:{ - companyId:this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - 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 => { - this.saveNum.push("1") - 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); - }) - - //批量保存单位毗邻 - let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() - this.http.post("/api/CompanyAdjoins/Batch",CompanyAdjoins,{ - params:{ - companyId:this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - 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); - }) - - //批量保存单位重点部位 - let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() - this.http.post("/api/CompanyImportantLocations/Batch",CompanyImportantLocations,{ - params:{ - companyId:this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - 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); - }) - - //批量保存单位消防设施素材 - let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() - this.http.post("/api/CompanyFacilityAssets/Batch",CompanyFacilityAssets,{ - params:{ - companyId:this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - 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 => { - this.saveNum.push("1") - 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 => { - this.saveNum.push("1") - 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); - }) - - //批量保存建筑毗邻 - let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() - this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => { - this.saveNum.push("1") - 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); - }) - - //批量保存建筑重点部位 - let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() - this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => { - this.saveNum.push("1") - 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); - }) - - //批量保存建筑消防设施素材 - let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() - this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => { - this.saveNum.push("1") - 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(saveOneDialog, { - data: {allDisposalNode: this.canvasData.allDisposalNode, + data: { + allDisposalNode: this.canvasData.allDisposalNode, selectedBuildingData:this.beforeOneCheckedBuilding, selectedSiteData:this.selectingSitePlan, siteOrbuilding:this.checkedBuildingIndex, diff --git a/src/app/ui/collection-tools/save.ts b/src/app/ui/collection-tools/save.ts index 5dc3b6b..413870a 100644 --- a/src/app/ui/collection-tools/save.ts +++ b/src/app/ui/collection-tools/save.ts @@ -82,7 +82,7 @@ export class saveOneDialog { } }) }) - // console.log(this.nodeItem.id) + } onNoClick(): void { this.dialogRef.close(); @@ -139,15 +139,15 @@ export class saveOneDialog { if(istrue){//如果该处置节点下已有同名数据节点 则只修改 2个接口 new Promise((resolve,reject)=>{ - this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { + // this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点") - }) + // }) }).then((values)=>{ - this.canvasData.sendMessage('send a message');//发布一条消息 + this.canvasData.sendMessage('send a message');//发布一条消息 // 保存平面图数据到当前节点 let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint)) postdata.Data = JSON.stringify(postdata.Data) - this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => { + this.http.post(`/api/ExamDisposalNodeData`,postdata).subscribe(data => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -164,14 +164,14 @@ export class saveOneDialog { }else{//需要3个接口 new Promise((resolve,reject)=>{ - this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { + // this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点") - }) + // }) }).then((values)=>{ console.log(values) postdata.level = putdata.level + 1 new Promise((resolve,reject) => { - this.http.post(`/api/DisposalNodes`,postdata).subscribe(data => { + this.http.post(`/api/ExamDisposalNodes`,postdata).subscribe(data => { resolve(data) }) }).then((data:any)=>{ @@ -183,7 +183,7 @@ export class saveOneDialog { disposalNodeId: data.id, planComponentId: sessionStorage.getItem("planId"), } - this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { + this.http.post(`/api/ExamDisposalNodeData`,objData).subscribe(data => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -255,7 +255,7 @@ export class saveOneDialog { dispositionNodeData.notes = this.canvasData.selectPanelPointBaseData.notes //1.先创建一个处置节点 然后 .then 2.创建数据节点到刚创建的处置节点 3.然后拿着创建好的数据节点的id 将平面图data保存 new Promise((resolve,reject) => { - this.http.post("/api/DisposalNodes",dispositionNodeData).subscribe((data:any) => { + this.http.post("/api/ExamDisposalNodes",dispositionNodeData).subscribe((data:any) => { resolve(data.id) }) }).then((id) => { @@ -264,7 +264,7 @@ export class saveOneDialog { new Promise((resolve,reject) => { postdata.parentId = id postdata.level = dispositionNodeData.level + 1 - this.http.post("/api/DisposalNodes",postdata).subscribe((data:any) => { + this.http.post("/api/ExamDisposalNodes",postdata).subscribe((data:any) => { resolve(data) }) }).then((data:any) => { @@ -280,7 +280,7 @@ export class saveOneDialog { planComponentId: sessionStorage.getItem("planId"), } - this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { + this.http.post(`/api/ExamDisposalNodeData`,objData).subscribe(data => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000