diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index bb60189..60d854c 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -5,7 +5,7 @@
- +
@@ -48,8 +48,8 @@
- - + +
@@ -67,7 +67,7 @@ -
+
keyboard_arrow_up keyboard_arrow_down diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 878c990..2ec3e78 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -1891,20 +1891,23 @@ export class CollectionToolsComponent implements OnInit { //处置预案 + examType = this.route.snapshot.queryParams.openType // 预案类型 1=已存在/2=自定义 allFirePlan:any = []; //所有灾情 selectDisposalNode:string = ''; //当前点击tree节点 css选中样式 //获取所有灾情 getAllFirePlan () { + let api + this.examType == 1? api='/api/Disasters' : api='/api/ExamDisasters' let params = {componentId: sessionStorage.getItem('planId')} - this.http.get('/api/Disasters',{params:params}).subscribe((data:any)=>{ + this.http.get(api,{params:params}).subscribe((data:any)=>{ if (!data.length) { //该 单位没有灾情时 let msg = { name: '灾情', modifiedTime: new Date(), - planComponentId: sessionStorage.getItem('planId') + examPlanComponentId: sessionStorage.getItem('planId') } - this.http.post('/api/Disasters',msg).subscribe(data=>{ + this.http.post('/api/ExamDisasters',msg).subscribe(data=>{ this.allFirePlan.push(data) this.getDisposalNode() }) @@ -1917,13 +1920,11 @@ export class CollectionToolsComponent implements OnInit { //获取所有处置节点 getDisposalNode () { + let api + this.examType == 1? api='/api/DisposalNodes' : api='/api/ExamDisposalNodes' this.selectDisposalNode = '' let params = {disasterId: this.allFirePlan[0].id || ''} - // this.http.get('/api/DisasterData/Markers',{params:params}).subscribe(data=>{ //灾情标签信息 - // this.canvasData.allNodeMarkers = data - // this.mateFireForce() - // }) - this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //处置节点 + this.http.get(api,{params:params}).subscribe(data=>{ //处置节点 this.canvasData.allDisposalNode = data this.handleHybridTree() }) @@ -1961,9 +1962,11 @@ export class CollectionToolsComponent implements OnInit { //刷新 treeData 保存已展开节点 refurbishTreeData () { + let api + this.examType == 1? api='/api/DisposalNodes' : api='/api/ExamDisposalNodes' this.defaultExpandedKeys = [] let params = {disasterId: this.allFirePlan[0].id || ''} - this.http.get('/api/DisposalNodes',{params:params}).subscribe(nodeData=>{ //处置节点 + this.http.get(api,{params:params}).subscribe(nodeData=>{ //处置节点 this.canvasData.allDisposalNode = nodeData let oldTreeData = this.nzTreeComponent.getExpandedNodeList() oldTreeData.forEach(item=>{ @@ -2060,17 +2063,24 @@ export class CollectionToolsComponent implements OnInit { //选择 考试节点 countValue (e) { e.stopPropagation() - let data = {treeData: JSON.parse( JSON.stringify(this.treeData) ), oldTreeData: JSON.parse( JSON.stringify(this.canvasData.allDisposalNode) )} - let dialogRef = this.dialog.open(uploadDisposalNodes,{data}); - dialogRef.afterClosed().subscribe(data=>{ - if (data) { - sessionStorage.setItem('examNodeList',JSON.stringify(data)) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('节点保存成功','确定',config); - } - }) + if (this.canvasData.allDisposalNode.length) { + let data = {treeData: JSON.parse( JSON.stringify(this.treeData) ), oldTreeData: JSON.parse( JSON.stringify(this.canvasData.allDisposalNode) )} + let dialogRef = this.dialog.open(uploadDisposalNodes,{data}); + dialogRef.afterClosed().subscribe(data=>{ + if (data) { + sessionStorage.setItem('examNodeList',JSON.stringify(data)) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('节点保存成功','确定',config); + } + }) + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('暂无数据节点','确定',config); + } } //新建 处置预案 节点 @@ -2160,12 +2170,14 @@ export class CollectionToolsComponent implements OnInit { this.selectDisposalNode = e.parentId //选中 节点 if (this.canvasData.selectPanelPoint.DisposalNodeId != e.id) { //选择节点 不是当前节点时 + let api + this.examType == 1? api='/api/DisposalNodeData' : api='/api/ExamDisposalNodeData' let params = {nodeId: e.id} let parameter = { //查询 节点 对应 建筑/楼层 index,id buildingIndex: e.sitePlanId? -1 : this.allBuildings.findIndex(item=>{ return item.id===e.buildingId }), //总平面图/建筑 index storeyId: e.sitePlanId? e.sitePlanId : e.buildingAreaId, //楼层id } - this.http.get('/api/DisposalNodeData',{params:params}).subscribe(data=>{ + this.http.get(api,{params:params}).subscribe(data=>{ this.canvasData.selectPanelPoint = this.canvasData.deserialize(JSON.stringify(data || new DisposalNodeData())) //选择 当前 节点 this.canvasData.selectPanelPoint.Data = this.canvasData.deserialize(this.canvasData.selectPanelPoint.Data) this.seekPanelPoint(parameter)