Browse Source

[新增]增加获取考生标注的基本信息素材的接口

master
邵佳豪 4 years ago
parent
commit
988b872884
  1. 6
      src/app/canvas-share-data.service.ts
  2. 168
      src/app/ui/collection-tools-examinee/collection-tools.component.ts

6
src/app/canvas-share-data.service.ts

@ -18,8 +18,14 @@ export class CanvasShareDataService {
// 总平面图/建筑 楼层
selectStorey: any = {area: '', details: ''}; // 选择当前 楼层 数据
originalcompanyBuildingData: any; // 单位/建筑 数据
originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据
examOriginaleveryStoreyData: any; // 考生答卷 总平面图/楼层/区域 楼层数据
// 总平面图/建筑 楼层
// 处置 节点

168
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) {

Loading…
Cancel
Save