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;
align-items: center;
justify-content: center;
flex-direction: column;
.imgbox {
flex: 1;
box-sizing: border-box;
padding: 0 12px;
width: 100%;
@ -104,7 +105,10 @@
justify-content: center;
position: relative;
// margin-bottom: 12px;
flex-direction: column;
iframe{
flex: 1;
}
#canvas {
position: absolute;
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; //登录账号的用户名
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);

Loading…
Cancel
Save