|
|
@ -77,11 +77,11 @@
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
|
|
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<!-- <el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" @click="handleListRow">{{
|
|
|
|
<el-button type="primary" @click="handleListRow">{{
|
|
|
|
tableShow ? "图片列表" : "表格列表"
|
|
|
|
tableShow ? "图片列表" : "表格列表"
|
|
|
|
}}</el-button>
|
|
|
|
}}</el-button>
|
|
|
|
</el-form-item> -->
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
@ -187,13 +187,17 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="alarmPic">
|
|
|
|
<div class="alarmPic">
|
|
|
|
<div class="imgshow" v-loading="alarmLoading">
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="imgshow"
|
|
|
|
|
|
|
|
v-loading="alarmLoading"
|
|
|
|
|
|
|
|
@click="handleBigPicbox(selectRow)"
|
|
|
|
|
|
|
|
>
|
|
|
|
<!-- @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"
|
|
|
|
v-viewer="OptionssalseImg"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<!-- v-viewer="OptionssalseImg" -->
|
|
|
|
<!-- <div
|
|
|
|
<!-- <div
|
|
|
|
class="nosee"
|
|
|
|
class="nosee"
|
|
|
|
:style="'backgroundImage:url(' + photoPic + '!1366x768)'"
|
|
|
|
:style="'backgroundImage:url(' + photoPic + '!1366x768)'"
|
|
|
@ -237,7 +241,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="pictureBox" v-else>
|
|
|
|
<div class="pictureBox" v-else v-loading="loading">
|
|
|
|
<div class="piclist" v-if="tableData.length !== 0">
|
|
|
|
<div class="piclist" v-if="tableData.length !== 0">
|
|
|
|
<el-card
|
|
|
|
<el-card
|
|
|
|
class="box-card imgList"
|
|
|
|
class="box-card imgList"
|
|
|
@ -245,10 +249,10 @@
|
|
|
|
:key="index"
|
|
|
|
:key="index"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="bigpic">
|
|
|
|
<div class="bigpic">
|
|
|
|
<div class="picshow">
|
|
|
|
<div class="picshow" @click="handlePicAlarm(item)">
|
|
|
|
<img :src="item.path + '!1366x768'" :ref="'picJpg' + index" />
|
|
|
|
<img :src="item.path + '!1366x768'" :ref="'picJpg' + index" />
|
|
|
|
<canvas
|
|
|
|
<canvas
|
|
|
|
id="myCanvas"
|
|
|
|
:id="'myCanvas' + index"
|
|
|
|
class="myCanvas"
|
|
|
|
class="myCanvas"
|
|
|
|
:ref="'myCanvas' + index"
|
|
|
|
:ref="'myCanvas' + index"
|
|
|
|
></canvas>
|
|
|
|
></canvas>
|
|
|
@ -305,15 +309,15 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 点击出现大图 -->
|
|
|
|
<!-- 点击出现大图 -->
|
|
|
|
|
|
|
|
<div v-if="showBigpic" class="showPic" v-loading="canvasloading">
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-if="showBigpic"
|
|
|
|
class="picboxI"
|
|
|
|
class="showPic"
|
|
|
|
@mousewheel.prevent="rollImg"
|
|
|
|
@click="closePic"
|
|
|
|
:style="{ transform: 'scale(' + zoomD + ')' }"
|
|
|
|
v-loading="canvasloading"
|
|
|
|
@mousedown="move"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="picboxI">
|
|
|
|
<img @load="imgOnload" class="maskPic img" :src="bigPhotoPic" />
|
|
|
|
<img @load="imgOnload" class="maskPic" :src="bigPhotoPic" />
|
|
|
|
<canvas id="myCanvas" class="myCanvas" ref="myCanvasbig"></canvas>
|
|
|
|
<canvas id="myCanvas" class="myCanvas" ref="myCanvas2"></canvas>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="viewClose">
|
|
|
|
<div class="viewClose">
|
|
|
|
<i @click="closePic" class="el-icon-close"></i>
|
|
|
|
<i @click="closePic" class="el-icon-close"></i>
|
|
|
@ -379,6 +383,8 @@ export default {
|
|
|
|
alarmLoading: false,
|
|
|
|
alarmLoading: false,
|
|
|
|
canvasloading: false,
|
|
|
|
canvasloading: false,
|
|
|
|
tableShow: true, //表格展示
|
|
|
|
tableShow: true, //表格展示
|
|
|
|
|
|
|
|
zoomD: 1,
|
|
|
|
|
|
|
|
canvansdata: "",
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
@ -386,6 +392,10 @@ export default {
|
|
|
|
// new Date(new Date().toLocaleDateString()).getTime(),
|
|
|
|
// new Date(new Date().toLocaleDateString()).getTime(),
|
|
|
|
// new Date().getTime(),
|
|
|
|
// new Date().getTime(),
|
|
|
|
// ]);
|
|
|
|
// ]);
|
|
|
|
|
|
|
|
// $("#elementToZoomOn").smartZoom({
|
|
|
|
|
|
|
|
// maxScale: 2,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
this.$set(
|
|
|
|
this.$set(
|
|
|
|
this.formdata,
|
|
|
|
this.formdata,
|
|
|
|
"starttime",
|
|
|
|
"starttime",
|
|
|
@ -396,8 +406,69 @@ export default {
|
|
|
|
this.getTableList();
|
|
|
|
this.getTableList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
//移动demo
|
|
|
|
|
|
|
|
move(e) {
|
|
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
// 获取元素
|
|
|
|
|
|
|
|
var personBox = document.querySelector(".picboxI");
|
|
|
|
|
|
|
|
var img = document.querySelector(".img");
|
|
|
|
|
|
|
|
var x = e.pageX - img.offsetLeft;
|
|
|
|
|
|
|
|
var y = e.pageY - img.offsetTop;
|
|
|
|
|
|
|
|
// 添加鼠标移动事件
|
|
|
|
|
|
|
|
personBox.addEventListener("mousemove", move);
|
|
|
|
|
|
|
|
function move(e) {
|
|
|
|
|
|
|
|
personBox.style.left = e.pageX - x + "px";
|
|
|
|
|
|
|
|
personBox.style.top = e.pageY - y + "px";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 添加鼠标抬起事件,鼠标抬起,将事件移除
|
|
|
|
|
|
|
|
img.addEventListener("mouseup", function () {
|
|
|
|
|
|
|
|
personBox.removeEventListener("mousemove", move);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// 鼠标离开父级元素,把事件移除
|
|
|
|
|
|
|
|
personBox.addEventListener("mouseout", function () {
|
|
|
|
|
|
|
|
personBox.removeEventListener("mousemove", move);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 缩放图片
|
|
|
|
|
|
|
|
rollImg(e) {
|
|
|
|
|
|
|
|
let direction = e.deltaY > 0 ? "down" : "up";
|
|
|
|
|
|
|
|
if (direction === "up") {
|
|
|
|
|
|
|
|
// 滑轮向上滚动
|
|
|
|
|
|
|
|
this.large();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 滑轮向下滚动
|
|
|
|
|
|
|
|
this.Small();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//大
|
|
|
|
|
|
|
|
large() {
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
if (this.zoomD < 6) {
|
|
|
|
|
|
|
|
this.zoomD += 0.1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(
|
|
|
|
|
|
|
|
".picboxI"
|
|
|
|
|
|
|
|
).style.transform = `matrix(${this.zoomD}, 0, 0,${this.zoomD}, 0, 0)`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.drawline2(this.canvansdata);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 小
|
|
|
|
|
|
|
|
Small() {
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
if (this.zoomD > 0.3) {
|
|
|
|
|
|
|
|
this.zoomD -= 0.1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
document.querySelector(
|
|
|
|
|
|
|
|
".picboxI"
|
|
|
|
|
|
|
|
).style.transform = `matrix(${this.zoomD}, 0, 0, ${this.zoomD}, 0, 0)`;
|
|
|
|
|
|
|
|
this.drawline2(this.canvansdata);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
handleBigPicbox(val) {
|
|
|
|
handleBigPicbox(val) {
|
|
|
|
this.canvasloading = true;
|
|
|
|
this.canvasloading = true;
|
|
|
|
|
|
|
|
this.canvansdata = val;
|
|
|
|
if (val.path !== "" && this.tableData.length !== 0) {
|
|
|
|
if (val.path !== "" && this.tableData.length !== 0) {
|
|
|
|
console.log(val);
|
|
|
|
console.log(val);
|
|
|
|
this.bigPhotoPic = val.path;
|
|
|
|
this.bigPhotoPic = val.path;
|
|
|
@ -409,6 +480,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
closePic() {
|
|
|
|
closePic() {
|
|
|
|
this.showBigpic = false;
|
|
|
|
this.showBigpic = false;
|
|
|
|
|
|
|
|
this.zoomD = 1;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//获取电压信息
|
|
|
|
//获取电压信息
|
|
|
|
getSearchdy() {
|
|
|
|
getSearchdy() {
|
|
|
@ -495,11 +567,13 @@ export default {
|
|
|
|
//点击分页
|
|
|
|
//点击分页
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
this.page = val;
|
|
|
|
this.page = val;
|
|
|
|
|
|
|
|
this.tableData = [];
|
|
|
|
this.getTableList();
|
|
|
|
this.getTableList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//每页条数
|
|
|
|
//每页条数
|
|
|
|
handleSizeChange(val) {
|
|
|
|
handleSizeChange(val) {
|
|
|
|
this.pageSize = val;
|
|
|
|
this.pageSize = val;
|
|
|
|
|
|
|
|
this.tableData = [];
|
|
|
|
this.getTableList();
|
|
|
|
this.getTableList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//绘制告警区域
|
|
|
|
//绘制告警区域
|
|
|
@ -527,15 +601,15 @@ export default {
|
|
|
|
// this.ctx.strokeStyle = "red"; //线的颜色
|
|
|
|
// this.ctx.strokeStyle = "red"; //线的颜色
|
|
|
|
this.ctx.strokeRect(top, left, width, height); //绘制路径矩形
|
|
|
|
this.ctx.strokeRect(top, left, width, height); //绘制路径矩形
|
|
|
|
//this.ctx.strokeRect(data.x, data.y, data.width, data.height);
|
|
|
|
//this.ctx.strokeRect(data.x, data.y, data.width, data.height);
|
|
|
|
this.ctx.font = "24px normal";
|
|
|
|
this.ctx.font = "16px normal";
|
|
|
|
this.ctx.fillStyle = "#ff0000";
|
|
|
|
this.ctx.fillStyle = "#ff0000";
|
|
|
|
console.log(top, left, width, height);
|
|
|
|
console.log(top, left, width, height);
|
|
|
|
console.log(this.canvas.width, this.canvas.height);
|
|
|
|
console.log(this.canvas.width, this.canvas.height);
|
|
|
|
//距离上面有空间
|
|
|
|
//距离上面有空间
|
|
|
|
if (left > 32) {
|
|
|
|
if (left > 32) {
|
|
|
|
this.ctx.fillText(this.textInfo, top, left - 14);
|
|
|
|
this.ctx.fillText(this.textInfo, top, left - 4);
|
|
|
|
} else if (this.canvas.height - left + height > 32) {
|
|
|
|
} else if (this.canvas.height - left + height > 32) {
|
|
|
|
this.ctx.fillText(this.textInfo, top, height - 14);
|
|
|
|
this.ctx.fillText(this.textInfo, top, height - 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.ctx.closePath();
|
|
|
|
this.ctx.closePath();
|
|
|
@ -543,11 +617,12 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//绘制告警区域
|
|
|
|
//绘制告警区域
|
|
|
|
drawline2(data) {
|
|
|
|
drawline2(data) {
|
|
|
|
this.canvas = this.$refs.myCanvas2;
|
|
|
|
this.canvas = this.$refs.myCanvasbig;
|
|
|
|
this.imgpic = this.$refs.picJpg;
|
|
|
|
this.imgpic = this.$refs.picJpg;
|
|
|
|
this.textInfo = data.enname;
|
|
|
|
this.textInfo = data.enname;
|
|
|
|
this.canvas.width = this.imgpic.offsetWidth; //设置画布大小
|
|
|
|
this.canvas.width = this.imgpic.offsetWidth; //设置画布大小
|
|
|
|
this.canvas.height = this.imgpic.offsetHeight; //设置画布大小
|
|
|
|
this.canvas.height = this.imgpic.offsetHeight; //设置画布大小
|
|
|
|
|
|
|
|
console.log(this.canvas.width, this.canvas.height);
|
|
|
|
this.ctx = this.canvas.getContext("2d");
|
|
|
|
this.ctx = this.canvas.getContext("2d");
|
|
|
|
this.ctx.beginPath();
|
|
|
|
this.ctx.beginPath();
|
|
|
|
//设置线条颜色,必须放在绘制之前
|
|
|
|
//设置线条颜色,必须放在绘制之前
|
|
|
@ -567,9 +642,15 @@ export default {
|
|
|
|
// this.ctx.strokeStyle = "red"; //线的颜色
|
|
|
|
// this.ctx.strokeStyle = "red"; //线的颜色
|
|
|
|
this.ctx.strokeRect(top, left, width, height); //绘制路径矩形
|
|
|
|
this.ctx.strokeRect(top, left, width, height); //绘制路径矩形
|
|
|
|
//this.ctx.strokeRect(data.x, data.y, data.width, data.height);
|
|
|
|
//this.ctx.strokeRect(data.x, data.y, data.width, data.height);
|
|
|
|
this.ctx.font = "24px normal";
|
|
|
|
this.ctx.font = "16px normal";
|
|
|
|
this.ctx.fillStyle = "#ff0000";
|
|
|
|
this.ctx.fillStyle = "#ff0000";
|
|
|
|
this.ctx.fillText(this.textInfo, top, left + 24);
|
|
|
|
//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.closePath();
|
|
|
|
this.ctx.stroke();
|
|
|
|
this.ctx.stroke();
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -676,6 +757,18 @@ export default {
|
|
|
|
this.selectRow = val;
|
|
|
|
this.selectRow = val;
|
|
|
|
this.handleHistory();
|
|
|
|
this.handleHistory();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
handlePicAlarm(val) {
|
|
|
|
|
|
|
|
console.log(val);
|
|
|
|
|
|
|
|
this.canvasloading = true;
|
|
|
|
|
|
|
|
if (val.path !== "" && this.tableData.length !== 0) {
|
|
|
|
|
|
|
|
console.log(val);
|
|
|
|
|
|
|
|
this.bigPhotoPic = val.path;
|
|
|
|
|
|
|
|
this.showBigpic = true;
|
|
|
|
|
|
|
|
// this.$nextTick(() => {
|
|
|
|
|
|
|
|
// this.drawline2(val);
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
dateFormat(row, column) {
|
|
|
|
dateFormat(row, column) {
|
|
|
|
var date = row[column.property];
|
|
|
|
var date = row[column.property];
|
|
|
|
if (date == undefined) {
|
|
|
|
if (date == undefined) {
|
|
|
@ -710,8 +803,8 @@ export default {
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
.picboxI {
|
|
|
|
.picboxI {
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
max-width: 1366px;
|
|
|
|
width: 1366px;
|
|
|
|
max-height: 768px;
|
|
|
|
height: 768px;
|
|
|
|
margin: auto;
|
|
|
|
margin: auto;
|
|
|
|
animation-name: scaleDraw;
|
|
|
|
animation-name: scaleDraw;
|
|
|
|
/*关键帧名称*/
|
|
|
|
/*关键帧名称*/
|
|
|
@ -720,11 +813,15 @@ export default {
|
|
|
|
animation-iteration-count: 1;
|
|
|
|
animation-iteration-count: 1;
|
|
|
|
/*动画播放的次数*/
|
|
|
|
/*动画播放的次数*/
|
|
|
|
animation-duration: 0.65s;
|
|
|
|
animation-duration: 0.65s;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
justify-content: center;
|
|
|
|
img {
|
|
|
|
img {
|
|
|
|
max-width: 1366px;
|
|
|
|
max-width: 1366px;
|
|
|
|
max-height: 768px;
|
|
|
|
max-height: 768px;
|
|
|
|
margin: auto;
|
|
|
|
margin: auto;
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
cursor: grab;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.myCanvas {
|
|
|
|
.myCanvas {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
@ -890,7 +987,7 @@ export default {
|
|
|
|
border-radius: 3px;
|
|
|
|
border-radius: 3px;
|
|
|
|
background: #fff;
|
|
|
|
background: #fff;
|
|
|
|
height: fit-content;
|
|
|
|
height: fit-content;
|
|
|
|
height: 320px;
|
|
|
|
height: auto;
|
|
|
|
.el-card__body {
|
|
|
|
.el-card__body {
|
|
|
|
padding: 0px;
|
|
|
|
padding: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -924,7 +1021,7 @@ export default {
|
|
|
|
color: #e49e61;
|
|
|
|
color: #e49e61;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.infoTop {
|
|
|
|
.infoTop {
|
|
|
|
font-size: 16px;
|
|
|
|
font-size: 14px;
|
|
|
|
color: #000;
|
|
|
|
color: #000;
|
|
|
|
font-weight: normal;
|
|
|
|
font-weight: normal;
|
|
|
|
margin-top: 2px;
|
|
|
|
margin-top: 2px;
|
|
|
|