Browse Source

[完善]完善进入编制工具逻辑

master
邵佳豪 4 years ago
parent
commit
889a66018e
  1. 2
      src/app/canvas-share-data.service.ts
  2. 2
      src/app/examiner/create-test-score/addPlanTwo.html
  3. 61
      src/app/examiner/create-test-score/create-test-score.component.ts
  4. 1
      src/app/pages/lockscreen/lockscreen.component.ts
  5. 1
      src/app/pages/login/login.component.ts
  6. 2
      src/app/ui/collection-tools/collection-tools.component.ts

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

@ -29,7 +29,7 @@ export class CanvasShareDataService {
/**
*
*/
gameMode: GameMode = GameMode.BasicInformation;
gameMode: GameMode = GameMode.Assignment;
facilityAssetsName = new Map<string, string>([
[ '消防水池', '消防水池'],

2
src/app/examiner/create-test-score/addPlanTwo.html

@ -57,7 +57,7 @@
预案名称
</p>
<div class="input">
<input type="text" placeholder="请输入自定义名称">
<input type="text" placeholder="请输入自定义名称" [(ngModel)]="customPlanName">
</div>
</div>
</div>

61
src/app/examiner/create-test-score/create-test-score.component.ts

@ -32,6 +32,9 @@ export class CreateTestScoreComponent implements OnInit {
})
})
})
// Promise.all([this.getUnitData(),this.getAround(),this.getKeySite(),this.getFunDiv()]).then(()=>{
// this.getFireFac()
// })
}
//当前选中的单位
selectedUnitIndex = 0
@ -231,7 +234,6 @@ export class CreateTestScoreComponent implements OnInit {
})
})
})
async function getAllArchitecture(buildingsdata){
for (let i = 0, length = buildingsdata.length; i < length; i++){
let id = {buildingId:buildingsdata[i].id}
@ -259,7 +261,7 @@ export class CreateTestScoreComponent implements OnInit {
})
element.aroundNodes = [...element.aroundNodes]
}
resolve('1')
resolve(1)
})
})
}
@ -271,6 +273,7 @@ export class CreateTestScoreComponent implements OnInit {
async getKeySite(){
let that = this
for (let y = 0, length = this.unitId.length; y < length; y++){
console.log("xiba")
let element = this.unitId[y]
element.keySiteScore = 0
element.keySiteItemScore = 0
@ -834,8 +837,9 @@ export class CreateTestScoreComponent implements OnInit {
i.children = newChildren
delete i.selected
})
console.log(111,item)
//建筑的重点部位模块处理
item.keySiteNodes.forEach((i,key) => {
item.keySiteNodes ? item.keySiteNodes.forEach((i,key) => {
i.selected ? i.selected = null : null
//如果顶级节点未选中则需要筛除没有选中的数据
if(!i.checked){
@ -909,9 +913,9 @@ export class CreateTestScoreComponent implements OnInit {
delete i.selected
})
}) : null
//建筑的功能分区模块处理
item.funDivNodes.forEach((i,key) => {
item.funDivNodes ? item.funDivNodes.forEach((i,key) => {
//如果顶级节点未选中则需要筛除没有选中的数据
if(!i.checked){
@ -966,9 +970,9 @@ export class CreateTestScoreComponent implements OnInit {
})
i.children = newChildren
delete i.selected
})
}) : null
//建筑的数据核验模块处理
item.fireFacNodes.forEach((i,key) => {
item.fireFacNodes ? item.fireFacNodes.forEach((i,key) => {
i.selected ? i.selected = null : null
//如果顶级节点未选中则需要筛除没有选中的数据
if(!i.checked){
@ -993,7 +997,7 @@ export class CreateTestScoreComponent implements OnInit {
})
i.children = newChildren
delete i.selected
})
}) : null
})
//循环每个建筑处理数据
@ -1005,15 +1009,15 @@ export class CreateTestScoreComponent implements OnInit {
paperDataInfo[key].id = null
paperDataInfo[key].paperId = null
paperDataInfo[key].companyId = item.id
paperDataInfo[key].basicInfoData = JSON.stringify(item.basicInfoNodes)
paperDataInfo[key].basicInfoData = item.basicInfoNodes ? JSON.stringify(item.basicInfoNodes) : '[]'
paperDataInfo[key].basicInfoScore = item.basicInfoScore
paperDataInfo[key].adjoinData = JSON.stringify(item.aroundNodes)
paperDataInfo[key].adjoinData = item.aroundNodes ? JSON.stringify(item.aroundNodes) : '[]'
paperDataInfo[key].adjoinScore = item.aroundScore
paperDataInfo[key].importLocationData = JSON.stringify(item.keySiteNodes)
paperDataInfo[key].importLocationData = item.keySiteNodes ? JSON.stringify(item.keySiteNodes) : '[]'
paperDataInfo[key].importLocationScore = item.keySiteScore
paperDataInfo[key].functionalDivisionData = JSON.stringify(item.funDivNodes)
paperDataInfo[key].functionalDivisionData = item.funDivNodes ? JSON.stringify(item.funDivNodes) : '[]'
paperDataInfo[key].functionalDivisionScore = item.funDivScore
paperDataInfo[key].facilityData = JSON.stringify(item.fireFacNodes)
paperDataInfo[key].facilityData = item.fireFacNodes ? JSON.stringify(item.fireFacNodes) : '[]'
paperDataInfo[key].facilityScore = item.fireFacScore
})
@ -1065,7 +1069,7 @@ export class AddPlanDialog {
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
this.dialogRef.close();
});
}
}
@ -1085,6 +1089,7 @@ export class AddPlanTwoDialog {
displayedColumns: string[] = ['select', 'name', 'people', 'time', 'level'];
dataSource : any //列表数据
selectedRadioData:any//当前选择的二维预案
customPlanName:any//自定义预案名称
radioChange(e){
this.selectedRadioData = e
}
@ -1113,8 +1118,8 @@ export class AddPlanTwoDialog {
confirm(){
if(this.planType){//如果选择的是已存在预案
if(this.selectedRadioData){
// console.log(this.selectedRadioData)
// console.log(this.data.companyData)
this.dialogRef.close();
sessionStorage.setItem('companyName',this.data.companyData.companyData.name)
sessionStorage.setItem('planId',this.selectedRadioData.id)
sessionStorage.setItem('buildingTypeId',this.data.companyData.companyData.buildingTypes[0].id)
sessionStorage.setItem('companyId',this.data.companyData.companyData.id)
@ -1125,8 +1130,30 @@ export class AddPlanTwoDialog {
config.duration = 3000
this.snackBar.open('请选择要添加的预案','确定',config);
}
}else{
}else{//如果选择的是自定义预案
let level = sessionStorage.getItem('level')
let body = {
id: "",
name: this.customPlanName,
planType:1,
planMode: 2,
planLevel:Number(level),
url: "",
attachmentUrls: null
}
this.http.post("/api/PlanComponents2D",body,{params:{
companyId : this.data.companyData.companyData.id
}}).subscribe((data:any)=>{
// console.log("创建成功")
this.dialogRef.close(data);
sessionStorage.setItem("planId",data.id);
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')
})
}
}
//取消

1
src/app/pages/lockscreen/lockscreen.component.ts

@ -33,6 +33,7 @@ export class LockscreenComponent implements OnInit {
sessionStorage.setItem("roleType",data.roleType);
sessionStorage.setItem("token",data.token);
sessionStorage.setItem("refreshToken",data.refreshToken);
sessionStorage.setItem("level",data.level);
this.token.startUp(); //登陆成功启动定时器刷新token
this.router.navigate(['/home/createexam-index']) //登陆成功跳转页面
},(err) => {this.errmsg = err})

1
src/app/pages/login/login.component.ts

@ -33,6 +33,7 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem("roleType",data.roleType);
sessionStorage.setItem("token",data.token);
sessionStorage.setItem("refreshToken",data.refreshToken);
sessionStorage.setItem("level",data.level);
this.token.startUp(); //登陆成功启动定时器刷新token
this.router.navigate(['/home/teachear']) //登陆成功跳转页面
},(err) => {this.errmsg = err})

2
src/app/ui/collection-tools/collection-tools.component.ts

@ -629,7 +629,7 @@ export class CollectionToolsComponent implements OnInit {
isSixbtn = true //控制想定作业编辑按钮
isxxx = true //控制查看编辑模式的编辑模式按钮
examMsg = { //单位,考试信息
conpanyName: '富丽华大酒店', //单位名称
conpanyName: sessionStorage.getItem('companyName'), //单位名称
keynote: '', //考试要点
grade: '', //分数
}

Loading…
Cancel
Save