|
|
|
@ -68,6 +68,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
|
|
|
|
|
userName; //登录账号的用户名
|
|
|
|
|
isShowAxOtherRegion; //控制哪些用户可以看到ax全部
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
|
|
|
|
|
// 安信框选
|
|
|
|
|
this.userName = JSON.parse(sessionStorage.getItem("userdata")).userName; |
|
|
|
|
if (this.userName === "admin" || this.userName === "superadmin") { |
|
|
|
@ -75,32 +76,37 @@ export class GetOutOfLineDetailsComponent implements OnInit {
|
|
|
|
|
} else { |
|
|
|
|
this.isShowAxOtherRegion = false; |
|
|
|
|
} |
|
|
|
|
if (this.data.violatedItemSnapshot) { |
|
|
|
|
if ( |
|
|
|
|
this.data.violatedItemSnapshot && |
|
|
|
|
this.data.violation.eventSystemName.indexOf("证照") == -1 && |
|
|
|
|
this.data.violation.eventSystemName.indexOf("设备") == -1 |
|
|
|
|
) { |
|
|
|
|
this.isAnxin = true; |
|
|
|
|
} |
|
|
|
|
let dataArr = []; |
|
|
|
|
for (const key in JSON.parse(this.data.violatedItemSnapshot)) { |
|
|
|
|
const element = JSON.parse(this.data.violatedItemSnapshot)[key]; |
|
|
|
|
dataArr.push(element); |
|
|
|
|
} |
|
|
|
|
this.coordinate = dataArr; |
|
|
|
|
this.currentCoordinate = JSON.parse(JSON.stringify(this.coordinate)); |
|
|
|
|
console.log("坐标信息", this.coordinate); |
|
|
|
|
if (this.isAnxin) { |
|
|
|
|
let dataArr = []; |
|
|
|
|
for (const key in JSON.parse(this.data.violatedItemSnapshot)) { |
|
|
|
|
const element = JSON.parse(this.data.violatedItemSnapshot)[key]; |
|
|
|
|
dataArr.push(element); |
|
|
|
|
} |
|
|
|
|
this.coordinate = dataArr; |
|
|
|
|
this.currentCoordinate = JSON.parse(JSON.stringify(this.coordinate)); |
|
|
|
|
console.log("坐标信息", this.coordinate); |
|
|
|
|
|
|
|
|
|
let checkboxArr = []; |
|
|
|
|
this.coordinate.forEach((element) => { |
|
|
|
|
checkboxArr.push({ id: element.id, checked: true }); |
|
|
|
|
}); |
|
|
|
|
let checkboxArr = []; |
|
|
|
|
this.coordinate.forEach((element) => { |
|
|
|
|
checkboxArr.push({ id: element.id, checked: true }); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
for (let i = 0; i < checkboxArr.length; i++) { |
|
|
|
|
if (!this.legendList.some((e) => e.id == checkboxArr[i].id)) |
|
|
|
|
this.legendList.push(checkboxArr[i]); |
|
|
|
|
} |
|
|
|
|
setTimeout(() => { |
|
|
|
|
if (this.isAnxin == true) { |
|
|
|
|
this.canvasLabel(); |
|
|
|
|
for (let i = 0; i < checkboxArr.length; i++) { |
|
|
|
|
if (!this.legendList.some((e) => e.id == checkboxArr[i].id)) |
|
|
|
|
this.legendList.push(checkboxArr[i]); |
|
|
|
|
} |
|
|
|
|
}, 0); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.canvasLabel(); |
|
|
|
|
}, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 安信框选
|
|
|
|
|
|
|
|
|
|
console.log("预警信息", this.data); |
|
|
|
|