From 1421fbd8bedca352704c0f926e800156a3ef528f Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 23 Jul 2021 15:07:39 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E6=95=B0=E6=8D=AE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wait-examineer.component.ts | 102 +++++++++--------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts index 2ca7838..2a443eb 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts @@ -165,7 +165,7 @@ export class WaitExamineerComponent implements OnInit { differentContentOfBuildingsInfo: any//当前单位变更数据 之 建筑信息 differentContentOfFunction: any = []//当前单位变更数据 之 功能分区 differentContentOfPicture: any//当前单位变更数据 之 实景图 - bianzhi=false + bianzhi = false radioClick(e, item) { this.selectedItem = item console.log(item) @@ -179,23 +179,25 @@ export class WaitExamineerComponent implements OnInit { // 实景图 this.differentContentOfPicture = differentContent.filter(item => item.propertyName == 'realityImageGroups') - //建筑信息 - this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) - this.differentContentOfBuildingsInfo.childrens.forEach(element => { - element.childrens = element.childrens.filter(item => item.isObj == false) - }); - //功能分区 - let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) - this.differentContentOfFunction = [] - differentContentOfFunction.childrens.forEach(item => { - item.childrens.forEach(i => { - if (i.propertyName == "buildingFunctionalDivisions") { - i.propertyName = item.propertyName - this.differentContentOfFunction.push(i) - } - }); - }); + if (differentContent.filter(item => item.propertyName == 'buildings').length != 0) { + //建筑信息 + this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) + this.differentContentOfBuildingsInfo.childrens.forEach(element => { + element.childrens = element.childrens.filter(item => item.isObj == false) + }); + //功能分区 + let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) + this.differentContentOfFunction = [] + differentContentOfFunction.childrens.forEach(item => { + item.childrens.forEach(i => { + if (i.propertyName == "buildingFunctionalDivisions") { + i.propertyName = item.propertyName + this.differentContentOfFunction.push(i) + } + }); + }); + } } @@ -210,22 +212,22 @@ export class WaitExamineerComponent implements OnInit { this.id = item.id this.fetchUrl = '' this.viewer = {} - + if (item.contentType == 11) { - this.bianzhi=false + this.bianzhi = false window.setTimeout(() => { this.showtype = 3 sessionStorage.setItem('companyId', item.itemId) }, 0) } else if (item.contentType == 12) { - this.bianzhi=false + this.bianzhi = false //水源 this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data) => { this.waterData = data this.showtype = 12 }) } else if (item.contentType == 13) { - this.bianzhi=false + this.bianzhi = false //消防力量 this.http.get(`/api/CustomFireForce/${item.itemId}`).subscribe((data: any) => { if (data.forceType != 0) {//如果是其他消防力量 @@ -247,7 +249,7 @@ export class WaitExamineerComponent implements OnInit { }) } else if (item.contentType == 14) { - this.bianzhi=false + this.bianzhi = false //联动力量 this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data: any) => { @@ -261,35 +263,35 @@ export class WaitExamineerComponent implements OnInit { this.companyId = data.companyId this.companyName = data.companyName if (data.planType != 2 && data.planType != 1) { - if(data.planMode==2){ - this.bianzhi=true - this.src=`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false` + if (data.planMode == 2) { + this.bianzhi = true + this.src = `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false` //this.src=`/keyUnit/viewunitinfoplan?id=${data.companyId}&orName=${data.company.organizationId}&orId=${data.company.organizationName}` - }else{ - this.bianzhi=false - this.fetchUrl = data.attachmentUrls[0] - var index = this.fetchUrl.indexOf("\/") - if (this.fetchUrl.substr(0, index) == 'psw') { - this.showtype = 1 - var obj = document.getElementById('viewer') - if (obj != null) { - obj.innerHTML = '' - } - window.setTimeout(() => { - this.viewer = new photoViewer({ - container: document.querySelector('#viewer'), - panorama: '/api/Objects/PlanPlatform/' + this.fetchUrl, - - }); - }) - } else { - this.lookWord() - } + this.bianzhi = false + this.fetchUrl = data.attachmentUrls[0] + var index = this.fetchUrl.indexOf("\/") + if (this.fetchUrl.substr(0, index) == 'psw') { + this.showtype = 1 + var obj = document.getElementById('viewer') + if (obj != null) { + obj.innerHTML = '' + } + window.setTimeout(() => { + this.viewer = new photoViewer({ + container: document.querySelector('#viewer'), + panorama: '/api/Objects/PlanPlatform/' + this.fetchUrl, + + }); + }) + + } else { + this.lookWord() + } } - + } else { - this.bianzhi=false + this.bianzhi = false this.organizationName = item.organizationName this.planData = data this.handleData() @@ -319,13 +321,13 @@ export class WaitExamineerComponent implements OnInit { //毕升 lookWord() { this.showtype = 0 - let src + let src let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase() if (suffix == 'docx' || suffix == 'doc') { let arr = this.fetchUrl.split('.') arr[arr.length - 1] = 'pdf' - src = `/api/Objects/PlanPlatform/` + arr.join('.') - }else if (suffix == 'pdf') { + src = `/api/Objects/PlanPlatform/` + arr.join('.') + } else if (suffix == 'pdf') { src = `/api/Objects/PlanPlatform/` + this.fetchUrl } this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src); From 3ea8a5e5d96b92a53ad8fcef7c1d341b9bc15efb Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 23 Jul 2021 15:56:15 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E6=95=B0=E6=8D=AE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wait-examineer/wait-examineer.component.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.html b/src/app/plan-audit/wait-examineer/wait-examineer.component.html index f34bc4d..537091a 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.html +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.html @@ -125,7 +125,7 @@
- + @@ -167,7 +167,7 @@
- + @@ -203,7 +203,7 @@ - + @@ -235,7 +235,7 @@ - + From 81dbd0405cbd9b399cc110f2a825a47a5130a056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Sat, 24 Jul 2021 10:26:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20=E6=B6=88=E9=98=B2?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=BB=9F=E8=AE=A1=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/canvas-share-data.service.ts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index da9bb5d..4f40baa 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -28,17 +28,11 @@ export class CanvasShareDataService { originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据 // 总平面图/建筑 楼层 - - - - // 处置 节点 allDisposalNode: any = []; // 所有 处置节点 allNodeMarkers: any = { highlightMarkers: {}, markers: {} }; // 灾情 标签信息 selectPanelPoint: DisposalNodeData = new DisposalNodeData(); // 当前数据节点 selectPanelPointBaseData: any = { description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: '' }; // 当前 数据节点 对应 父级节点 - - isInheritSky: any; //缓存 节点 天气 customizeDisposalNode: any; // 新建 自定义数据节点 底图+名称 // 处置 节点 @@ -57,7 +51,6 @@ export class CanvasShareDataService { ['地下消火栓', '室外消火栓'], ['室内消火栓', '室内消火栓'], ['供水管网', '供水管网'], - ['湿式自动喷淋系统', '湿式自动喷淋系统'], ['水幕系统', '水幕系统'], ['消防泵房', '消防泵房'], ['水泵接合器(地上)', '水泵接合器'], @@ -81,6 +74,25 @@ export class CanvasShareDataService { ['泡沫管网', '消防管网'], ['DCS控制室', 'DCS控制室'], ['消防控制室', '消防控制室'], + ['水喷淋系统', '自动喷水灭火系统'], + ['湿式自动喷淋系统', '自动喷水灭火系统'], + ['干式自动喷淋系统', '自动喷水灭火系统'], + ['消防电话', '消防通信'], + ['扶梯', '自动扶梯'], + ['风机房', '风机房'], + ['风亭', '风亭'], + ['防火卷帘', '防火卷帘'], + ['手提式BC类干粉灭火器', '灭火器'], + ['推车式ABC干粉灭火器', '灭火器'], + ['手提式泡沫灭火器', '灭火器'], + ['推车式BC干粉灭火器', '灭火器'], + ['推车式灭火器', '灭火器'], + ['手提式二氧化碳灭火器', '灭火器'], + ['手提式ABC类干粉灭火器', '灭火器'], + ['手提式清水灭火器', '灭火器'], + ['手推式泡沫灭火器', '灭火器'], + ['推车式泡沫灭火器', '灭火器'], + ['灭火器', '灭火器'] ]); /** * 向其他组件发送信息 * From 272ae61296ff213f8a7be87d4de3d6e8b7e4a84e Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Sat, 24 Jul 2021 14:29:33 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=BB=BA=E7=AD=91=E4=BF=A1=E6=81=AF=E5=B7=AE=E5=BC=82=E5=AF=B9?= =?UTF-8?q?=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wait-examineer.component.html | 4 +- .../wait-examineer.component.ts | 46 ++++++++++++++++++- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.html b/src/app/plan-audit/wait-examineer/wait-examineer.component.html index 537091a..fa62fa4 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.html +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.html @@ -188,8 +188,8 @@ - - + +
{{i.displayName}} :
{{i.path[i.path.length - 2]}}-{{i.path[i.path.length - 1]}}: {{i.oldValue | differentContentTitle}} diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts index 2a443eb..a261c86 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts @@ -62,6 +62,9 @@ export class WaitExamineerComponent implements OnInit { } this.getAlltabledate() this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); + + + } planTypeIndex //平面图类型 选择是总平面图还是层平面图 @@ -174,6 +177,10 @@ export class WaitExamineerComponent implements OnInit { let differentContent = JSON.parse(this.selectedItem.differentContent) + + console.log('差异信息', differentContent) + + // 单位信息 this.differentContentOfUnitInfo = differentContent.filter(item => item.propertyName == 'basicInfo') // 实景图 @@ -183,9 +190,31 @@ export class WaitExamineerComponent implements OnInit { if (differentContent.filter(item => item.propertyName == 'buildings').length != 0) { //建筑信息 this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) + + function resolveDiff(list: Array, path?: Array): Array { + let resultList: Array = []; + 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 => { - 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])) this.differentContentOfFunction = [] @@ -799,4 +828,19 @@ export class remark { } } } +} + +class DiffItem { + newValue: any + oldValue: any + childrens: Array + operation: number + displayName: string + propertyName: string +} + +class Result { + path: string[] + oldValue: any + newValue: any } \ No newline at end of file