master
fanluyan 2 years ago
parent 4bef8b53a3
commit dba1b1f602

@ -160,7 +160,7 @@
</div> </div>
</div> </div>
<div class="alarmPic"> <div class="alarmPic">
<div class="imgshow" @click="handleBigPicbox(photoPic)"> <div class="imgshow" @click="handleBigPicbox(selectRow)">
<img ref="picJpg" :src="photoPic" /> <img ref="picJpg" :src="photoPic" />
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> <canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
</div> </div>
@ -175,6 +175,7 @@
<div v-if="showBigpic" class="showPic" @click="closePic"> <div v-if="showBigpic" class="showPic" @click="closePic">
<div class="picboxI"> <div class="picboxI">
<img class="maskPic" :src="bigPhotoPic" /> <img class="maskPic" :src="bigPhotoPic" />
<!-- <canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> -->
<i @click="closePic" class="el-icon-circle-close"></i> <i @click="closePic" class="el-icon-circle-close"></i>
</div> </div>
</div> </div>
@ -218,6 +219,7 @@ export default {
showBigpic: false, showBigpic: false,
textInfo: "", textInfo: "",
bigPhotoPic: "", // bigPhotoPic: "", //
selectRow: {},
}; };
}, },
mounted() { mounted() {
@ -231,8 +233,12 @@ export default {
}, },
methods: { methods: {
handleBigPicbox(val) { handleBigPicbox(val) {
this.bigPhotoPic = val; console.log(val);
this.bigPhotoPic = val.path;
this.showBigpic = true; this.showBigpic = true;
this.$nextTick(() => {
this.drawline(val);
});
}, },
closePic() { closePic() {
this.showBigpic = false; this.showBigpic = false;
@ -291,7 +297,10 @@ export default {
this.tableData = res.data.list; this.tableData = res.data.list;
this.total = res.data.total; this.total = res.data.total;
this.photoPic = res.data.list[0].path; this.photoPic = res.data.list[0].path;
this.drawline(res.data.list[0]);
this.selectRow = res.data.list[0];
console.log(this.selectRow);
this.drawline(this.selectRow);
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
@ -322,14 +331,12 @@ export default {
this.canvas.width = this.imgpic.offsetWidth; // this.canvas.width = this.imgpic.offsetWidth; //
this.canvas.height = this.imgpic.offsetHeight; // this.canvas.height = this.imgpic.offsetHeight; //
this.ctx = this.canvas.getContext("2d"); this.ctx = this.canvas.getContext("2d");
this.ctx.beginPath(); this.ctx.beginPath();
//线 //线
this.ctx.strokeStyle = "#ff0000"; this.ctx.strokeStyle = "#ff0000";
// 线 // 线
this.ctx.lineWidth = 1; this.ctx.lineWidth = 1;
this.ctx.rect(925, 548, 108, 506); this.ctx.rect(925, 548, 108, 506);
// //
var scaleX = this.canvas.width / data.photoWidth, //this.iw var scaleX = this.canvas.width / data.photoWidth, //this.iw
scaleY = this.canvas.height / data.photoHeight; //this.ih scaleY = this.canvas.height / data.photoHeight; //this.ih
@ -354,6 +361,7 @@ export default {
//this.$refs.multipleTable.toggleRowSelection(row); //this.$refs.multipleTable.toggleRowSelection(row);
console.log(row); console.log(row);
this.photoPic = row.path; this.photoPic = row.path;
this.selectRow = row;
// //
if (row.isread == 0) { if (row.isread == 0) {
readAlarm({ readAlarm({
@ -452,6 +460,14 @@ export default {
max-height: 720px; max-height: 720px;
margin: auto; margin: auto;
} }
.myCanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: pointer;
}
.el-icon-circle-close { .el-icon-circle-close {
position: absolute; position: absolute;
right: -24px; right: -24px;

Loading…
Cancel
Save