告警信息查询

hn2.0
fanluyan 2 years ago
parent dea97c90a6
commit 6c71c318fa

@ -182,12 +182,34 @@
</div> </div>
</div> </div>
<div class="alarmPic"> <div class="alarmPic">
<div class="imgshow" @click="handleBigPicbox(selectRow)"> <div
class="imgshow"
v-loading="alarmLoading"
@click="handleBigPicbox(selectRow)"
>
<!-- @click="handleBigPicbox(selectRow)" -->
<div <div
class="picshow" class="picshow"
v-if="selectRow.path !== '' && tableData.length !== 0" v-if="selectRow.path !== '' && tableData.length !== 0"
> >
<img ref="picJpg" :src="photoPic" /> <!-- <div
class="nosee"
:style="'backgroundImage:url(' + photoPic + '!1280x720)'"
></div>
<viewer :options="OptionssalseImg" class="bigimgView">
<img
@load="imgOnload"
ref="picJpg"
class="animImg"
:src="photoPic + '!1280x720'"
/>
</viewer> -->
<img
@load="imgOnload"
ref="picJpg"
class="animImg"
:src="photoPic + '!1280x720'"
/>
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> <canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
</div> </div>
<img <img
@ -215,11 +237,18 @@
</div> </div>
</div> </div>
<!-- 点击出现大图 --> <!-- 点击出现大图 -->
<div v-if="showBigpic" class="showPic" @click="closePic"> <div
v-if="showBigpic"
class="showPic"
@click="closePic"
v-loading="canvasloading"
>
<div class="picboxI"> <div class="picboxI">
<img class="maskPic" :src="bigPhotoPic" /> <img @load="imgOnload" class="maskPic" :src="bigPhotoPic" />
<!-- <canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> --> <canvas id="myCanvas" class="myCanvas" ref="myCanvas2"></canvas>
<i @click="closePic" class="el-icon-circle-close"></i> </div>
<div class="viewClose">
<i @click="closePic" class="el-icon-close"></i>
</div> </div>
</div> </div>
<historyimg ref="historyimg_ref"></historyimg> <historyimg ref="historyimg_ref"></historyimg>
@ -243,6 +272,16 @@ export default {
}, },
data() { data() {
return { return {
OptionssalseImg: {
inline: false,
button: true,
navbar: false,
title: false,
toolbar: false,
tooltip: false,
zoomable: true,
url: "src",
},
dyOptions: [{ id: 0, name: "全部" }], // dyOptions: [{ id: 0, name: "全部" }], //
xlOptions: [{ id: 0, name: "全部" }], //线 xlOptions: [{ id: 0, name: "全部" }], //线
gtOptions: [{ id: 0, name: "全部" }], // gtOptions: [{ id: 0, name: "全部" }], //
@ -269,6 +308,8 @@ export default {
textInfo: "", textInfo: "",
bigPhotoPic: "", // bigPhotoPic: "", //
selectRow: {}, selectRow: {},
alarmLoading: false,
canvasloading: false,
}; };
}, },
mounted() { mounted() {
@ -286,13 +327,18 @@ export default {
this.getTableList(); this.getTableList();
}, },
methods: { methods: {
imgOnload() {
this.alarmLoading = false;
this.canvasloading = false;
},
handleBigPicbox(val) { handleBigPicbox(val) {
if (val.path !== "" && tableData.length !== 0) { this.canvasloading = true;
if (val.path !== "" && this.tableData.length !== 0) {
console.log(val); console.log(val);
this.bigPhotoPic = val.path; this.bigPhotoPic = val.path;
this.showBigpic = true; this.showBigpic = true;
this.$nextTick(() => { this.$nextTick(() => {
this.drawline(val); this.drawline2(val);
}); });
} }
}, },
@ -424,9 +470,42 @@ export default {
this.ctx.closePath(); this.ctx.closePath();
this.ctx.stroke(); this.ctx.stroke();
}, },
//
drawline2(data) {
this.canvas = this.$refs.myCanvas2;
this.imgpic = this.$refs.picJpg;
this.textInfo = data.enname;
this.canvas.width = this.imgpic.offsetWidth; //
this.canvas.height = this.imgpic.offsetHeight; //
this.ctx = this.canvas.getContext("2d");
this.ctx.beginPath();
//线
this.ctx.strokeStyle = "#ff0000";
// 线
this.ctx.lineWidth = 1;
//
var scaleX = this.canvas.width / data.photoWidth, //this.iw
scaleY = this.canvas.height / data.photoHeight; //this.ih
console.log(scaleX, scaleY);
var top = data.x * scaleX,
left = data.y * scaleY,
width = data.width * scaleX,
height = data.height * scaleY;
console.log(top, left, width, height);
// this.ctx.strokeStyle = "red"; //线
this.ctx.strokeRect(top, left, width, height); //
//this.ctx.strokeRect(data.x, data.y, data.width, data.height);
this.ctx.font = "24px normal";
this.ctx.fillStyle = "#ff0000";
this.ctx.fillText(this.textInfo, top, left + 24);
this.ctx.closePath();
this.ctx.stroke();
},
// //
handleRowClick(row) { handleRowClick(row) {
//this.$refs.multipleTable.toggleRowSelection(row); //this.$refs.multipleTable.toggleRowSelection(row);
this.alarmLoading = true;
console.log(row); console.log(row);
this.photoPic = row.path; this.photoPic = row.path;
this.selectRow = row; this.selectRow = row;
@ -560,13 +639,25 @@ export default {
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
} }
.el-icon-circle-close { }
.viewClose {
-webkit-app-region: no-drag;
background-color: rgba(0, 0, 0, 0.5);
border-radius: 50%;
cursor: pointer;
height: 80px;
overflow: hidden;
position: absolute;
right: -40px;
top: -40px;
transition: background-color 0.15s;
width: 80px;
.el-icon-close {
bottom: 16px;
left: 16px;
position: absolute; position: absolute;
right: -24px;
font-size: 48px;
color: #fff; color: #fff;
cursor: pointer; font-size: 18px;
top: -24px;
} }
} }
} }
@ -639,6 +730,20 @@ export default {
height: 100%; height: 100%;
position: relative; position: relative;
} }
.nosee {
position: absolute;
width: 100%;
height: 100%;
background-size: 100% 100%;
z-index: 2;
}
.bigimgView {
position: absolute;
width: 100%;
height: 100%;
z-index: 3;
opacity: 0;
}
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -650,6 +755,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
z-index: 2;
} }
} }
.editorBtn { .editorBtn {

@ -1,6 +1,9 @@
<template> <template>
<div class="thumb-example"> <div class="thumb-example">
<div class="picTop"> <div class="picTop">
<div class="bigimg" v-if="bigPicPath.indexOf('nopic') !== -1">
<img class="animImg" :src="bigPicPath" />
</div>
<div <div
class="bigimg" class="bigimg"
v-if=" v-if="
@ -8,17 +11,20 @@
bigPicPath.indexOf('videos') == -1 bigPicPath.indexOf('videos') == -1
" "
:style=" :style="
bigPicPath ? 'backgroundImage:url(' + bigPicPath + '!128x72)' : '' bigPicPath ? 'backgroundImage:url(' + bigPicPath + '!260x160)' : ''
" "
@click="handleBigPicbox(bigPicPath)"
> >
<img ref="picJpg" class="animImg" :src="bigPicPath" /> <!-- @click="handleBigPicbox(bigPicPath)" -->
<div
class="nosee"
:style="'backgroundImage:url(' + bigPicPath + '!1280x720)'"
></div>
<viewer :options="OptionssalseImg" class="bigimgView">
<img ref="picJpg" class="animImg" :src="bigPicPath + '!1280x720'" />
</viewer>
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> <canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
<!-- <p class="mark"> <!-- <img ref="picJpg" class="animImg" :src="bigPicPath + '!1280x720'" /> -->
{{ bigPicPath }}
<span>{{ this.activeSmall }}</span>
</p> -->
</div> </div>
<div <div
v-if=" v-if="
@ -44,9 +50,7 @@
autoplay autoplay
></video> ></video>
</div> </div>
<div class="bigimg" v-else>
<img class="animImg" :src="bigPicPath" />
</div>
<div class="arrow leftArrow" v-if="this.bigNum != 0" @click="leftClick"> <div class="arrow leftArrow" v-if="this.bigNum != 0" @click="leftClick">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
</div> </div>
@ -505,6 +509,20 @@ export default {
justify-content: center; justify-content: center;
position: relative; position: relative;
background-size: 100% 100%; background-size: 100% 100%;
.nosee {
width: 100%;
height: 100%;
position: absolute;
background-size: 100% 100%;
z-index: 2;
}
.bigimgView {
width: 100%;
height: 100%;
position: absolute;
z-index: 3;
opacity: 0;
}
.mark { .mark {
position: absolute; position: absolute;
bottom: 12px; bottom: 12px;
@ -523,6 +541,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
z-index: 2;
} }
} }
img { img {

@ -28,11 +28,11 @@ module.exports = defineConfig({
proxy: { proxy: {
"/api": { "/api": {
//表示拦截以/api开头的请求路径 //表示拦截以/api开头的请求路径
target: "http://47.96.238.157:8093", //阿里云服务器环境 // target: "http://47.96.238.157:8093", //阿里云服务器环境
//target: "http://180.166.218.222:40080", //dell target: "http://180.166.218.222:40080", //dell
changOrigin: true, //是否开启跨域 changOrigin: true, //是否开启跨域
pathRewrite: { pathRewrite: {
"^/api": "", //重写api把api变成空字符因为我们真正请求的路径是没有api的 "^/api": "/api", //重写api把api变成空字符因为我们真正请求的路径是没有api的
}, },
}, },
}, },

Loading…
Cancel
Save