|
|
|
@ -35,18 +35,6 @@
|
|
|
|
|
:key="'col-' + index"
|
|
|
|
|
>
|
|
|
|
|
<div class="imgList" @click="handleShowHistory(item)">
|
|
|
|
|
<!-- <viewer
|
|
|
|
|
:options="OptionssalseImg"
|
|
|
|
|
v-if="item.path !== null && item.path.indexOf('videos') == -1"
|
|
|
|
|
class="bigpic"
|
|
|
|
|
:style="
|
|
|
|
|
item.path
|
|
|
|
|
? 'backgroundImage:url(' + item.path + '!128x72)'
|
|
|
|
|
: ''
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<img :src="item.path + '!1366x768'" />
|
|
|
|
|
</viewer> -->
|
|
|
|
|
<div
|
|
|
|
|
v-if="item.path !== null && item.path.indexOf('videos') == -1"
|
|
|
|
|
class="bigpic"
|
|
|
|
@ -56,7 +44,16 @@
|
|
|
|
|
: ''
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<img :src="item.path + '!1366x768'" />
|
|
|
|
|
<img
|
|
|
|
|
:src="item.path + '!1366x768'"
|
|
|
|
|
:id="'img' + index"
|
|
|
|
|
:ref="'imgref' + index"
|
|
|
|
|
/>
|
|
|
|
|
<canvas
|
|
|
|
|
:ref="'canvansref' + index"
|
|
|
|
|
:id="'canvas_' + index"
|
|
|
|
|
class="canvasAll"
|
|
|
|
|
></canvas>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
class="bigpic"
|
|
|
|
@ -302,7 +299,6 @@ export default {
|
|
|
|
|
//获取图片
|
|
|
|
|
getTerminalPhotoList(channelid, date, termId) {
|
|
|
|
|
this.terminalPhoto = [];
|
|
|
|
|
|
|
|
|
|
this.historyPicLoading = true;
|
|
|
|
|
getTerminalPhotoListJoggle({
|
|
|
|
|
channelid: channelid,
|
|
|
|
@ -373,6 +369,7 @@ export default {
|
|
|
|
|
//请求数据接口方法
|
|
|
|
|
getPicData() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.picList = [];
|
|
|
|
|
getPictureList({
|
|
|
|
|
pageindex: this.page,
|
|
|
|
|
pagesize: this.rowNum * this.colNum,
|
|
|
|
@ -382,6 +379,9 @@ export default {
|
|
|
|
|
this.totalPage = res.data.totalpage;
|
|
|
|
|
this.total = res.data.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.drawlineListAll(this.picList);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err);
|
|
|
|
@ -430,6 +430,58 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
this.isRuning = !this.isRuning;
|
|
|
|
|
},
|
|
|
|
|
//绘制所有的图片告警区域
|
|
|
|
|
drawlineListAll(val) {
|
|
|
|
|
console.log(val);
|
|
|
|
|
for (let i = 0; i < val.length; i++) {
|
|
|
|
|
if (val[i].isAlarm == 1) {
|
|
|
|
|
console.log(i);
|
|
|
|
|
console.log(document.getElementById("canvas_" + i));
|
|
|
|
|
console.log(document.getElementById("img" + i));
|
|
|
|
|
this.canvas = document.getElementById("canvas_" + i);
|
|
|
|
|
this.imgpic = document.getElementById("img" + i);
|
|
|
|
|
this.textInfo = val[i].alarmlist[0].enname;
|
|
|
|
|
console.log(this.textInfo);
|
|
|
|
|
console.log(this.imgpic.offsetWidth);
|
|
|
|
|
console.log(this.canvas);
|
|
|
|
|
this.canvas.width = this.imgpic.offsetWidth; //设置画布大小
|
|
|
|
|
this.canvas.height = this.imgpic.offsetHeight; //设置画布大小
|
|
|
|
|
console.log(this.canvas.width, this.canvas.height);
|
|
|
|
|
this.ctx = this.canvas.getContext("2d");
|
|
|
|
|
this.ctx.beginPath();
|
|
|
|
|
//设置线条颜色,必须放在绘制之前
|
|
|
|
|
this.ctx.strokeStyle = "#ff0000";
|
|
|
|
|
// 线宽设置,必须放在绘制之前
|
|
|
|
|
this.ctx.lineWidth = 1;
|
|
|
|
|
|
|
|
|
|
// 绘制矩形
|
|
|
|
|
var scaleX = this.canvas.width / val[i].alarmlist[0].photoWidth, //this.iw图片的宽
|
|
|
|
|
scaleY = this.canvas.height / val[i].alarmlist[0].photoHeight; //this.ih图片的高
|
|
|
|
|
console.log(scaleX, scaleY);
|
|
|
|
|
var top = val[i].alarmlist[0].x * scaleX,
|
|
|
|
|
left = val[i].alarmlist[0].y * scaleY,
|
|
|
|
|
width = val[i].alarmlist[0].width * scaleX,
|
|
|
|
|
height = val[i].alarmlist[0].height * scaleY;
|
|
|
|
|
console.log(top, left, width, height);
|
|
|
|
|
// this.ctx.strokeStyle = "red"; //线的颜色
|
|
|
|
|
this.ctx.strokeRect(top, left, width, height); //绘制路径矩形
|
|
|
|
|
//this.ctx.strokeRect(val[i].x, val[i].y, val[i].width, val[i].height);
|
|
|
|
|
this.ctx.font = "16px normal";
|
|
|
|
|
this.ctx.fillStyle = "#ff0000";
|
|
|
|
|
//this.ctx.fillText(this.textInfo, top, left + 24);
|
|
|
|
|
//距离上面有空间
|
|
|
|
|
if (left > 32) {
|
|
|
|
|
this.ctx.fillText(this.textInfo, top, left - 4);
|
|
|
|
|
} else if (this.canvas.height - left + height > 32) {
|
|
|
|
|
this.ctx.fillText(this.textInfo, top, height - 4);
|
|
|
|
|
}
|
|
|
|
|
this.ctx.closePath();
|
|
|
|
|
this.ctx.stroke();
|
|
|
|
|
} else {
|
|
|
|
|
console.log("没有告警");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
|
|
|
|
mounted() {
|
|
|
|
@ -516,12 +568,22 @@ export default {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
.canvasAll {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
z-index: 2;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 0;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
}
|
|
|
|
|
.picInfo {
|
|
|
|
|
position: absolute;
|
|
|
|
|
background: #169e8ca1;
|
|
|
|
@ -532,6 +594,7 @@ export default {
|
|
|
|
|
bottom: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
z-index: 4;
|
|
|
|
|
p {
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
}
|
|
|
|
|