|
|
@ -48,11 +48,23 @@ export class GetOutOfLineDetailsComponent implements OnInit { |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
userName; |
|
|
|
userName; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isCarStop = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pageIndex = 0; |
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.userName = JSON.parse(sessionStorage.getItem("userdata")).userName; |
|
|
|
this.userName = JSON.parse(sessionStorage.getItem("userdata")).userName; |
|
|
|
|
|
|
|
console.log("预警数据", this.data); |
|
|
|
|
|
|
|
//进出口停车判断
|
|
|
|
|
|
|
|
if (this.data.violation.eventSystemName == "进出口停车") { |
|
|
|
|
|
|
|
this.isCarStop = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//是否是安信产生的预警进行判断
|
|
|
|
if (this.data.violatedItemSnapshot) { |
|
|
|
if (this.data.violatedItemSnapshot) { |
|
|
|
this.isAnxin = true; |
|
|
|
this.isAnxin = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成安信产生预警上面checkbox列表
|
|
|
|
let dataArr = []; |
|
|
|
let dataArr = []; |
|
|
|
for (const key in JSON.parse(this.data.violatedItemSnapshot)) { |
|
|
|
for (const key in JSON.parse(this.data.violatedItemSnapshot)) { |
|
|
|
const element = JSON.parse(this.data.violatedItemSnapshot)[key]; |
|
|
|
const element = JSON.parse(this.data.violatedItemSnapshot)[key]; |
|
|
@ -60,20 +72,26 @@ export class GetOutOfLineDetailsComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
this.coordinate = dataArr; |
|
|
|
this.coordinate = dataArr; |
|
|
|
this.currentCoordinate = JSON.parse(JSON.stringify(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]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.details = this.data.content1; |
|
|
|
this.details = this.data.content1; |
|
|
|
this.imgUrl = this.data.violateImage; |
|
|
|
|
|
|
|
|
|
|
|
if (this.isCarStop && this.isAnxin) { |
|
|
|
|
|
|
|
if (!this.data.violateImage2) { |
|
|
|
|
|
|
|
this.data.violateImage2 = this.data.violateImage; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.imgUrl = this.data.violateImage2; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.imgUrl = this.data.violateImage; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.vedioUrl = this.data.violateVideo; |
|
|
|
this.vedioUrl = this.data.violateVideo; |
|
|
|
this.content = this.data.handleRecord; |
|
|
|
this.content = this.data.handleRecord; |
|
|
|
|
|
|
|
|
|
|
@ -83,7 +101,41 @@ export class GetOutOfLineDetailsComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}, 0); |
|
|
|
}, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//进出口停车图片翻页
|
|
|
|
|
|
|
|
pageturning(type) { |
|
|
|
|
|
|
|
if (type == "last") { |
|
|
|
|
|
|
|
if (this.pageIndex === 0) { |
|
|
|
|
|
|
|
this.message.create("info", "已到第一张图片"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.pageIndex--; |
|
|
|
|
|
|
|
this.clearCanvas(this.data.violateImage2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (type == "next") { |
|
|
|
|
|
|
|
if (this.pageIndex === 1) { |
|
|
|
|
|
|
|
this.message.create("info", "图片已经到底了"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.pageIndex++; |
|
|
|
|
|
|
|
this.clearCanvas(this.data.violateImage); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//清空画布并且重新标绘
|
|
|
|
|
|
|
|
clearCanvas(url) { |
|
|
|
|
|
|
|
this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight); |
|
|
|
|
|
|
|
var img = new Image(); |
|
|
|
|
|
|
|
img.src = url; |
|
|
|
|
|
|
|
img.onload = () => { |
|
|
|
|
|
|
|
this.canvasWidth = img.width; |
|
|
|
|
|
|
|
this.canvasHeight = img.height; |
|
|
|
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
|
|
|
// 加载图片
|
|
|
|
|
|
|
|
this.ctx.drawImage(img, 0, 0, this.canvasWidth, this.canvasHeight); |
|
|
|
|
|
|
|
this.strokeRect(this.currentCoordinate); |
|
|
|
|
|
|
|
}, 0); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
canvasWidth = 0; |
|
|
|
canvasWidth = 0; |
|
|
|
canvasHeight = 0; |
|
|
|
canvasHeight = 0; |
|
|
|
ctx; |
|
|
|
ctx; |
|
|
@ -128,12 +180,7 @@ export class GetOutOfLineDetailsComponent implements OnInit { |
|
|
|
//如果当前矩形区域为错误区域,则左上角增加色块
|
|
|
|
//如果当前矩形区域为错误区域,则左上角增加色块
|
|
|
|
if (item.error) { |
|
|
|
if (item.error) { |
|
|
|
this.ctx.fillStyle = this.typeArr[item.id].color; |
|
|
|
this.ctx.fillStyle = this.typeArr[item.id].color; |
|
|
|
this.ctx.fillRect( |
|
|
|
this.ctx.fillRect(startPoint[0], startPoint[1], 10, 10); |
|
|
|
startPoint[0], |
|
|
|
|
|
|
|
startPoint[1], |
|
|
|
|
|
|
|
10, |
|
|
|
|
|
|
|
10 |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.ctx.fillStyle = this.typeArr[item.id].color; |
|
|
|
this.ctx.fillStyle = this.typeArr[item.id].color; |
|
|
|
this.ctx.font = "16px Verdana"; |
|
|
|
this.ctx.font = "16px Verdana"; |
|
|
|