Browse Source

[完善]安信坐标显示

beijing
邵佳豪 2 years ago
parent
commit
4e79fdc69f
  1. 8
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
  2. 48
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

8
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss

@ -93,8 +93,9 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column;
.imgbox { .imgbox {
flex: 1;
box-sizing: border-box; box-sizing: border-box;
padding: 0 12px; padding: 0 12px;
width: 100%; width: 100%;
@ -104,7 +105,10 @@
justify-content: center; justify-content: center;
position: relative; position: relative;
// margin-bottom: 12px; // margin-bottom: 12px;
flex-direction: column;
iframe{
flex: 1;
}
#canvas { #canvas {
position: absolute; position: absolute;
left: 50%; left: 50%;

48
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

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

Loading…
Cancel
Save