|
|
|
@ -47,11 +47,13 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
this.companyEachDetails = data[0].eachDetails |
|
|
|
|
this.companyBuiltInGrouping.forEach(element => { //循环单位内置分组项
|
|
|
|
|
element.selectBuiltInGrouping = [] |
|
|
|
|
element.facilityItems.forEach(elements => { |
|
|
|
|
element.facilityItems.forEach((elements,index) => { |
|
|
|
|
elements.total = element.facilityCount[index] |
|
|
|
|
elements.expanded = false}); |
|
|
|
|
}); |
|
|
|
|
}) //http
|
|
|
|
|
} //if
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -66,27 +68,24 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
//保存单位消防设施内置分组项
|
|
|
|
|
editCompanyGrouping(e) { |
|
|
|
|
let header = {groupId:e.id} |
|
|
|
|
if (e.facilityItems[e.facilityItems.length-1].isBuiltin) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); |
|
|
|
|
} else { |
|
|
|
|
let data = [] |
|
|
|
|
e.facilityItems.forEach((element,index) => { |
|
|
|
|
if (!element.isBuiltin) { |
|
|
|
|
data.push(element) |
|
|
|
|
let msg = { |
|
|
|
|
isBuiltin: element.isBuiltin, |
|
|
|
|
details: element.details, |
|
|
|
|
name: element.name, |
|
|
|
|
isEachFloor: element.isEachFloor, |
|
|
|
|
order: element.order} |
|
|
|
|
data.push(msg) |
|
|
|
|
if (index==e.facilityItems.length-1) { |
|
|
|
|
this.http.post('/api/CompanyAccount/CompanyFacilityItems/Batch',data,{params:header}).subscribe(data=>{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); }) |
|
|
|
|
} //if
|
|
|
|
|
|
|
|
|
|
} //if
|
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); |
|
|
|
|
}) } |
|
|
|
|
}); //forEach
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//checked单位消防设施内置分组项时
|
|
|
|
@ -151,36 +150,60 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
let data = this.companyEachDetails[e.name] |
|
|
|
|
if (data) { |
|
|
|
|
e.loopTable = [] |
|
|
|
|
for (let key in data) { |
|
|
|
|
let tableMsg = {name:data[key][0].sitePlanName, header:[], body:[]} |
|
|
|
|
data[key][0].propertyInfos.forEach(element => { //表头
|
|
|
|
|
if (element.propertyType!=3) {tableMsg.header.push(element.propertyName)} |
|
|
|
|
data.forEach(item => { |
|
|
|
|
let tableMsg = {name:item.name, header:[], body:[]} |
|
|
|
|
item.assets[0].propertyInfos.forEach(element => { //表头
|
|
|
|
|
if (element.propertyType!=3) { |
|
|
|
|
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
|
|
|
|
|
tableMsg.header.push(element.propertyName+unit)} |
|
|
|
|
}); |
|
|
|
|
data[key].forEach(element => { //表格内容
|
|
|
|
|
item.assets.forEach(element => { //表格内容
|
|
|
|
|
let everyBody = {} |
|
|
|
|
element.propertyInfos.forEach((elements,index) => { |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType==6) { everyBody[elements.propertyName] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
}); |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
|
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = elements.propertyValue } |
|
|
|
|
if (elements.propertyType==6) {
|
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName=='图片') {
|
|
|
|
|
let imgLength = [] |
|
|
|
|
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} }) |
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = String(imgLength.length) }
|
|
|
|
|
|
|
|
|
|
}); //propertyInfos
|
|
|
|
|
tableMsg.body.push(everyBody) |
|
|
|
|
}); |
|
|
|
|
}); //assets
|
|
|
|
|
e.loopTable.push(tableMsg) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} //有对应信息时
|
|
|
|
|
} //data有数据时
|
|
|
|
|
} else { //非逐层统计时
|
|
|
|
|
let data = this.companyDetails[e.name] |
|
|
|
|
if (data) {
|
|
|
|
|
e.header = [] |
|
|
|
|
e.body = [] |
|
|
|
|
data[0].propertyInfos.forEach(element => { //表头
|
|
|
|
|
if (element.propertyType!=3) {e.header.push(element.propertyName)} |
|
|
|
|
if (element.propertyType!=3) { |
|
|
|
|
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
|
|
|
|
|
e.header.push(element.propertyName+unit)} |
|
|
|
|
}); |
|
|
|
|
data.forEach(element => { //表格内容
|
|
|
|
|
let everyBody = {} |
|
|
|
|
element.propertyInfos.forEach((elements,index) => { |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType==6) { everyBody[elements.propertyName] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
|
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = elements.propertyValue } |
|
|
|
|
if (elements.propertyType==6) {
|
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName=='图片') {
|
|
|
|
|
let imgLength = [] |
|
|
|
|
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} }) |
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = String(imgLength.length) } |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
e.body.push(everyBody) |
|
|
|
|
}); |
|
|
|
@ -213,13 +236,16 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
element.buildingOptionalGroups = data[0].summary.buildingOptionalGroups |
|
|
|
|
element.buildingDetails = data[0].details |
|
|
|
|
element.buildingEachDetails = data[0].eachDetails |
|
|
|
|
element.buildingFacilityGroups.forEach(elements => { //循环每个建筑内置分组项
|
|
|
|
|
element.buildingFacilityGroups.forEach((elements) => { //循环每个建筑内置分组项
|
|
|
|
|
elements.selectBuiltInGrouping = [] |
|
|
|
|
elements.facilityItems.forEach(newElement => { newElement.expanded = false }); |
|
|
|
|
elements.facilityItems.forEach((newElement,index) => {
|
|
|
|
|
newElement.total = elements.facilityCount[index] |
|
|
|
|
newElement.expanded = false }); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//创建建筑消防设施内置分组项
|
|
|
|
@ -234,27 +260,24 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
//保存建筑消防设施内置分组项
|
|
|
|
|
editBuildingGrouping (e,item) { |
|
|
|
|
let header = {buildingId:e.id, groupId:item.id} |
|
|
|
|
if (item.facilityItems[item.facilityItems.length-1].isBuiltin) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); |
|
|
|
|
} else { |
|
|
|
|
let data = [] |
|
|
|
|
item.facilityItems.forEach((element,index) => { |
|
|
|
|
if (!element.isBuiltin) { |
|
|
|
|
data.push(element) |
|
|
|
|
let msg = { |
|
|
|
|
isBuiltin: element.isBuiltin, |
|
|
|
|
details: element.details, |
|
|
|
|
name: element.name, |
|
|
|
|
isEachFloor: element.isEachFloor, |
|
|
|
|
order: element.order} |
|
|
|
|
data.push(msg) |
|
|
|
|
if (index==item.facilityItems.length-1) { |
|
|
|
|
this.http.post('/api/CompanyAccount/BuildingFacilityItems/Batch',data,{params:header}).subscribe(data=>{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); }) |
|
|
|
|
} //if
|
|
|
|
|
|
|
|
|
|
} //if
|
|
|
|
|
this.snackBar.open('数据更新成功','确定',config); |
|
|
|
|
}) } |
|
|
|
|
}); //forEach
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//删除建筑消防设施内置分组项
|
|
|
|
@ -310,36 +333,60 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
let data = item.buildingEachDetails[e.name] |
|
|
|
|
if (data) { |
|
|
|
|
e.loopTable = [] |
|
|
|
|
for (let key in data) { |
|
|
|
|
let tableMsg = {name:data[key][0].buildingAreaName, header:[], body:[]} |
|
|
|
|
data[key][0].propertyInfos.forEach(element => { //表头
|
|
|
|
|
if (element.propertyType!=3) {tableMsg.header.push(element.propertyName)} |
|
|
|
|
data.forEach(item => { |
|
|
|
|
let tableMsg = {name:item.name, header:[], body:[]} |
|
|
|
|
item.assets[0].propertyInfos.forEach(element => { //表头
|
|
|
|
|
if (element.propertyType!=3) { |
|
|
|
|
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
|
|
|
|
|
tableMsg.header.push(element.propertyName+unit)} |
|
|
|
|
}); |
|
|
|
|
data[key].forEach(element => { //表格内容
|
|
|
|
|
item.assets.forEach(element => { //表格内容
|
|
|
|
|
let everyBody = {} |
|
|
|
|
element.propertyInfos.forEach((elements,index) => { |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType==6) { everyBody[elements.propertyName] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
}); |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
|
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = elements.propertyValue } |
|
|
|
|
if (elements.propertyType==6) {
|
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName=='图片') {
|
|
|
|
|
let imgLength = [] |
|
|
|
|
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} }) |
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = String(imgLength.length) } |
|
|
|
|
|
|
|
|
|
}); //propertyInfos
|
|
|
|
|
tableMsg.body.push(everyBody) |
|
|
|
|
}); |
|
|
|
|
}); //assets
|
|
|
|
|
e.loopTable.push(tableMsg) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} //有对应信息时
|
|
|
|
|
} //data有数据时
|
|
|
|
|
} else { //非逐层统计时
|
|
|
|
|
let data = item.buildingDetails[e.name] |
|
|
|
|
if (data) {
|
|
|
|
|
e.header = [] |
|
|
|
|
e.body = [] |
|
|
|
|
data[0].propertyInfos.forEach(element => { //表头
|
|
|
|
|
if (element.propertyType!=3) {e.header.push(element.propertyName)} |
|
|
|
|
if (element.propertyType!=3) { |
|
|
|
|
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
|
|
|
|
|
e.header.push(element.propertyName+unit)} |
|
|
|
|
}); |
|
|
|
|
data.forEach(element => { //表格内容
|
|
|
|
|
let everyBody = {} |
|
|
|
|
element.propertyInfos.forEach((elements,index) => { |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyType!=6) { everyBody[elements.propertyName] = elements.propertyValue+elements.physicalUnit } |
|
|
|
|
if (elements.propertyType==6) { everyBody[elements.propertyName] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
|
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = elements.propertyValue } |
|
|
|
|
if (elements.propertyType==6) {
|
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' } |
|
|
|
|
if (elements.propertyType!=3 && elements.propertyName=='图片') {
|
|
|
|
|
let imgLength = [] |
|
|
|
|
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} }) |
|
|
|
|
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
|
|
|
|
|
everyBody[elements.propertyName+unit] = String(imgLength.length) } |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
e.body.push(everyBody) |
|
|
|
|
}); |
|
|
|
@ -359,15 +406,16 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
if (newData) { |
|
|
|
|
let data = {name:e.name, images:[]} |
|
|
|
|
let imgName
|
|
|
|
|
for (let key in newData) { |
|
|
|
|
newData[key].forEach(element => { |
|
|
|
|
newData.forEach(item => { |
|
|
|
|
item.assets.forEach(element => { |
|
|
|
|
element.propertyInfos.forEach( elements => {
|
|
|
|
|
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue} |
|
|
|
|
if (elements.propertyType==3) { |
|
|
|
|
if (elements.propertyType===3) { |
|
|
|
|
elements.propertyName = imgName |
|
|
|
|
data.images.push(elements)} }); |
|
|
|
|
}); |
|
|
|
|
} //for
|
|
|
|
|
}); //newDate
|
|
|
|
|
|
|
|
|
|
if (data.images.length) { |
|
|
|
|
let dialogRef = this.dialog.open(ImagesData,{width:'1350px',height:'700px',data}); //打开图片弹窗
|
|
|
|
|
} else { |
|
|
|
@ -390,7 +438,7 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
newData.forEach(element => { |
|
|
|
|
element.propertyInfos.forEach(elements => {
|
|
|
|
|
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue} |
|
|
|
|
if (elements.propertyType==3) { |
|
|
|
|
if (elements.propertyType===3) { |
|
|
|
|
elements.propertyName = imgName |
|
|
|
|
data.images.push(elements)} }); |
|
|
|
|
}); |
|
|
|
@ -419,15 +467,16 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
if (newData) { |
|
|
|
|
let data = {name:e.name, images:[]} |
|
|
|
|
let imgName |
|
|
|
|
for (let key in newData) { |
|
|
|
|
newData[key].forEach(element => { |
|
|
|
|
element.propertyInfos.forEach(elements => {
|
|
|
|
|
newData.forEach(item => { |
|
|
|
|
item.assets.forEach(element => { |
|
|
|
|
element.propertyInfos.forEach( elements => {
|
|
|
|
|
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue} |
|
|
|
|
if (elements.propertyType==3) { |
|
|
|
|
if (elements.propertyType===3) { |
|
|
|
|
elements.propertyName = imgName |
|
|
|
|
data.images.push(elements)} }); |
|
|
|
|
}); |
|
|
|
|
} //for
|
|
|
|
|
}); //newDate
|
|
|
|
|
|
|
|
|
|
if (data.images.length) { |
|
|
|
|
let dialogRef = this.dialog.open(ImagesData,{width:'1350px',height:'700px',data}); //打开图片弹窗
|
|
|
|
|
} else { |
|
|
|
@ -450,9 +499,10 @@ export class FireFightingDeviceComponent implements OnInit {
|
|
|
|
|
newData.forEach(element => { |
|
|
|
|
element.propertyInfos.forEach(elements => {
|
|
|
|
|
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue} |
|
|
|
|
if (elements.propertyType==3)
|
|
|
|
|
if (elements.propertyType===3) { |
|
|
|
|
elements.propertyName = imgName |
|
|
|
|
{data.images.push(elements)} }); |
|
|
|
|
data.images.push(elements)}
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
if (data.images.length) { |
|
|
|
|
let dialogRef = this.dialog.open(ImagesData,{width:'1350px',height:'700px',data}); //打开图片弹窗
|
|
|
|
|