chenjingyu 4 years ago
parent
commit
cc263b17c4
  1. 26
      src/app/canvas-share-data.service.ts
  2. 12
      src/app/plan-audit/wait-examineer/wait-examineer.component.html
  3. 50
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts

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

@ -28,17 +28,11 @@ export class CanvasShareDataService {
originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据 originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据
// 总平面图/建筑 楼层 // 总平面图/建筑 楼层
// 处置 节点 // 处置 节点
allDisposalNode: any = []; // 所有 处置节点 allDisposalNode: any = []; // 所有 处置节点
allNodeMarkers: any = { highlightMarkers: {}, markers: {} }; // 灾情 标签信息 allNodeMarkers: any = { highlightMarkers: {}, markers: {} }; // 灾情 标签信息
selectPanelPoint: DisposalNodeData = new DisposalNodeData(); // 当前数据节点 selectPanelPoint: DisposalNodeData = new DisposalNodeData(); // 当前数据节点
selectPanelPointBaseData: any = { description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: '' }; // 当前 数据节点 对应 父级节点 selectPanelPointBaseData: any = { description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: '' }; // 当前 数据节点 对应 父级节点
isInheritSky: any; //缓存 节点 天气
customizeDisposalNode: any; // 新建 自定义数据节点 底图+名称 customizeDisposalNode: any; // 新建 自定义数据节点 底图+名称
// 处置 节点 // 处置 节点
@ -57,7 +51,6 @@ export class CanvasShareDataService {
['地下消火栓', '室外消火栓'], ['地下消火栓', '室外消火栓'],
['室内消火栓', '室内消火栓'], ['室内消火栓', '室内消火栓'],
['供水管网', '供水管网'], ['供水管网', '供水管网'],
['湿式自动喷淋系统', '湿式自动喷淋系统'],
['水幕系统', '水幕系统'], ['水幕系统', '水幕系统'],
['消防泵房', '消防泵房'], ['消防泵房', '消防泵房'],
['水泵接合器(地上)', '水泵接合器'], ['水泵接合器(地上)', '水泵接合器'],
@ -81,6 +74,25 @@ export class CanvasShareDataService {
['泡沫管网', '消防管网'], ['泡沫管网', '消防管网'],
['DCS控制室', 'DCS控制室'], ['DCS控制室', 'DCS控制室'],
['消防控制室', '消防控制室'], ['消防控制室', '消防控制室'],
['水喷淋系统', '自动喷水灭火系统'],
['湿式自动喷淋系统', '自动喷水灭火系统'],
['干式自动喷淋系统', '自动喷水灭火系统'],
['消防电话', '消防通信'],
['扶梯', '自动扶梯'],
['风机房', '风机房'],
['风亭', '风亭'],
['防火卷帘', '防火卷帘'],
['手提式BC类干粉灭火器', '灭火器'],
['推车式ABC干粉灭火器', '灭火器'],
['手提式泡沫灭火器', '灭火器'],
['推车式BC干粉灭火器', '灭火器'],
['推车式灭火器', '灭火器'],
['手提式二氧化碳灭火器', '灭火器'],
['手提式ABC类干粉灭火器', '灭火器'],
['手提式清水灭火器', '灭火器'],
['手推式泡沫灭火器', '灭火器'],
['推车式泡沫灭火器', '灭火器'],
['灭火器', '灭火器']
]); ]);
/** * * /** * *

12
src/app/plan-audit/wait-examineer/wait-examineer.component.html

@ -127,7 +127,7 @@
<div *ngIf="showtype == 3" id="firefacilities" style="margin: 10px;"> <div *ngIf="showtype == 3" id="firefacilities" style="margin: 10px;">
<mat-accordion *ngIf="selectedItem.differentContent" class="tableContent" multi> <mat-accordion *ngIf="selectedItem.differentContent" class="tableContent" multi>
<!-- 基本信息 --> <!-- 基本信息 -->
<mat-expansion-panel *ngIf="this.differentContentOfUnitInfo.length != 0 && this.differentContentOfUnitInfo[0].childrens.length != 0" expanded> <mat-expansion-panel *ngIf="this.differentContentOfUnitInfo && this.differentContentOfUnitInfo.length != 0 && this.differentContentOfUnitInfo[0].childrens.length != 0" expanded>
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead" <mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead"
style="background-color: #2196F3;"> style="background-color: #2196F3;">
<mat-panel-title style="font-size: 16px;color: #FFFFFF;"> <mat-panel-title style="font-size: 16px;color: #FFFFFF;">
@ -169,7 +169,7 @@
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
<!-- 建筑信息 --> <!-- 建筑信息 -->
<mat-expansion-panel *ngIf="this.differentContentOfBuildingsInfo.childrens.length != 0" expanded> <mat-expansion-panel *ngIf="this.differentContentOfBuildingsInfo && this.differentContentOfBuildingsInfo.childrens.length != 0" expanded>
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead" <mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead"
style="background-color: #2196F3;"> style="background-color: #2196F3;">
<mat-panel-title style="font-size: 16px;color: #FFFFFF;"> <mat-panel-title style="font-size: 16px;color: #FFFFFF;">
@ -190,8 +190,8 @@
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<table> <table>
<tr *ngFor="let i of item.childrens"> <tr *ngFor="let i of item.difData">
<th>{{i.displayName}} </th> <th>{{i.path[i.path.length - 2]}}-{{i.path[i.path.length - 1]}}</th>
<td> <td>
<span class="spantext"></span> <span class="spantext"></span>
<span class="spantext buleColor">{{i.oldValue | differentContentTitle}}</span> <span class="spantext buleColor">{{i.oldValue | differentContentTitle}}</span>
@ -205,7 +205,7 @@
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
<!-- 功能分区 --> <!-- 功能分区 -->
<mat-expansion-panel *ngIf="this.differentContentOfFunction.length != 0" expanded> <mat-expansion-panel *ngIf="this.differentContentOfFunction && this.differentContentOfFunction.length != 0" expanded>
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead" <mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead"
style="background-color: #2196F3;"> style="background-color: #2196F3;">
<mat-panel-title style="font-size: 16px;color: #FFFFFF;"> <mat-panel-title style="font-size: 16px;color: #FFFFFF;">
@ -237,7 +237,7 @@
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
<!-- 实景图 --> <!-- 实景图 -->
<mat-expansion-panel *ngIf="this.differentContentOfPicture.length != 0 && this.differentContentOfPicture[0].childrens.length != 0" expanded> <mat-expansion-panel *ngIf="this.differentContentOfPicture && this.differentContentOfPicture.length != 0 && this.differentContentOfPicture[0].childrens.length != 0" expanded>
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead" <mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead"
style="background-color: #2196F3;"> style="background-color: #2196F3;">
<mat-panel-title style="font-size: 16px;color: #FFFFFF;"> <mat-panel-title style="font-size: 16px;color: #FFFFFF;">

50
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -62,6 +62,9 @@ export class WaitExamineerComponent implements OnInit {
} }
this.getAlltabledate() this.getAlltabledate()
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
} }
planTypeIndex //平面图类型 选择是总平面图还是层平面图 planTypeIndex //平面图类型 选择是总平面图还是层平面图
@ -177,16 +180,44 @@ export class WaitExamineerComponent implements OnInit {
let differentContent = JSON.parse(this.selectedItem.differentContent) let differentContent = JSON.parse(this.selectedItem.differentContent)
console.log('差异信息', differentContent)
// 单位信息 // 单位信息
this.differentContentOfUnitInfo = differentContent.filter(item => item.propertyName == 'basicInfo') this.differentContentOfUnitInfo = differentContent.filter(item => item.propertyName == 'basicInfo')
// 实景图 // 实景图
this.differentContentOfPicture = differentContent.filter(item => item.propertyName == 'realityImageGroups') this.differentContentOfPicture = differentContent.filter(item => item.propertyName == 'realityImageGroups')
if (differentContent.filter(item => item.propertyName == 'buildings').length != 0) {
//建筑信息 //建筑信息
this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
function resolveDiff(list: Array<DiffItem>, path?: Array<string>): Array<Result> {
let resultList: Array<Result> = [];
for (let i = 0; i < list.length; i++) {
if (path == null) path = [];
let item = list[i];
//递归最底层
if (!item.childrens.length) {
let res = new Result();
res.path = path.concat([item.displayName]);
res.oldValue = item.oldValue;
res.newValue = item.newValue;
resultList.push(res);
} else {
!!item.displayName && path.push(item.displayName);
let deepList = resolveDiff(item.childrens, path)
resultList = resultList.concat(deepList);
}
}
return resultList;
}
this.differentContentOfBuildingsInfo.childrens.forEach(element => { this.differentContentOfBuildingsInfo.childrens.forEach(element => {
element.childrens = element.childrens.filter(item => item.isObj == false) element.difData = resolveDiff(element.childrens)
}); });
// console.log('建筑信息', this.differentContentOfBuildingsInfo
//功能分区 //功能分区
let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
this.differentContentOfFunction = [] this.differentContentOfFunction = []
@ -198,7 +229,7 @@ export class WaitExamineerComponent implements OnInit {
} }
}); });
}); });
}
} }
@ -801,3 +832,18 @@ export class remark {
} }
} }
} }
class DiffItem {
newValue: any
oldValue: any
childrens: Array<DiffItem>
operation: number
displayName: string
propertyName: string
}
class Result {
path: string[]
oldValue: any
newValue: any
}
Loading…
Cancel
Save