Merge branch 'fly' into xy-ly

hn2.0
fanluyan 2 years ago
commit 460c7c41ea

@ -182,12 +182,34 @@
</div>
</div>
<div class="alarmPic">
<div class="imgshow" @click="handleBigPicbox(selectRow)">
<div
class="imgshow"
v-loading="alarmLoading"
@click="handleBigPicbox(selectRow)"
>
<!-- @click="handleBigPicbox(selectRow)" -->
<div
class="picshow"
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>
</div>
<img
@ -215,11 +237,18 @@
</div>
</div>
<!-- 点击出现大图 -->
<div v-if="showBigpic" class="showPic" @click="closePic">
<div
v-if="showBigpic"
class="showPic"
@click="closePic"
v-loading="canvasloading"
>
<div class="picboxI">
<img class="maskPic" :src="bigPhotoPic" />
<!-- <canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> -->
<i @click="closePic" class="el-icon-circle-close"></i>
<img @load="imgOnload" class="maskPic" :src="bigPhotoPic" />
<canvas id="myCanvas" class="myCanvas" ref="myCanvas2"></canvas>
</div>
<div class="viewClose">
<i @click="closePic" class="el-icon-close"></i>
</div>
</div>
<historyimg ref="historyimg_ref"></historyimg>
@ -243,6 +272,16 @@ export default {
},
data() {
return {
OptionssalseImg: {
inline: false,
button: true,
navbar: false,
title: false,
toolbar: false,
tooltip: false,
zoomable: true,
url: "src",
},
dyOptions: [{ id: 0, name: "全部" }], //
xlOptions: [{ id: 0, name: "全部" }], //线
gtOptions: [{ id: 0, name: "全部" }], //
@ -269,6 +308,8 @@ export default {
textInfo: "",
bigPhotoPic: "", //
selectRow: {},
alarmLoading: false,
canvasloading: false,
};
},
mounted() {
@ -286,13 +327,19 @@ export default {
this.getTableList();
},
methods: {
imgOnload() {
console.log("加载完成");
//this.alarmLoading = false;
this.canvasloading = false;
},
handleBigPicbox(val) {
if (val.path !== "" && tableData.length !== 0) {
this.canvasloading = true;
if (val.path !== "" && this.tableData.length !== 0) {
console.log(val);
this.bigPhotoPic = val.path;
this.showBigpic = true;
this.$nextTick(() => {
this.drawline(val);
this.drawline2(val);
});
}
},
@ -358,7 +405,6 @@ export default {
this.photoPic = res.data.list[0].path;
this.selectRow = res.data.list[0];
console.log(this.selectRow);
// ref myTableref
this.$refs.multipleTable.setCurrentRow(this.selectRow);
this.handleRowClick(this.selectRow);
@ -405,6 +451,37 @@ export default {
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();
},
//
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
@ -427,8 +504,10 @@ export default {
//
handleRowClick(row) {
//this.$refs.multipleTable.toggleRowSelection(row);
//this.alarmLoading = true;
console.log(row);
this.photoPic = row.path;
console.log(this.photoPic);
this.selectRow = row;
//
if (row.isread == 0) {
@ -446,6 +525,11 @@ export default {
});
}, 300);
}
setTimeout(function () {
console.log("关闭遮罩");
this.alarmLoading = false;
}, 1000);
this.$nextTick(() => {
this.drawline(row);
});
@ -560,13 +644,25 @@ export default {
height: 100%;
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;
right: -24px;
font-size: 48px;
color: #fff;
cursor: pointer;
top: -24px;
font-size: 18px;
}
}
}
@ -639,6 +735,20 @@ export default {
height: 100%;
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 {
width: 100%;
height: 100%;
@ -650,6 +760,7 @@ export default {
width: 100%;
height: 100%;
cursor: pointer;
z-index: 2;
}
}
.editorBtn {

@ -1,39 +1,34 @@
<template>
<div class="thumb-example">
<div class="picTop">
<!-- 判断是否是图片并且不为空 -->
<div
class="bigimg"
v-if="
bigPicPath.indexOf('nopic') == -1 &&
bigPicPath.indexOf('videos') == -1
"
:style="
bigPicPath ? 'backgroundImage:url(' + bigPicPath + '!128x72)' : ''
"
@click="handleBigPicbox(bigPicPath)"
:style="bigPicPath ? 'backgroundImage:url(' + bigPicPath + ')' : ''"
>
<img ref="picJpg" class="animImg" :src="bigPicPath" />
<!-- @click="handleBigPicbox(bigPicPath)" -->
<div
class="nosee"
:style="'backgroundImage:url(' + bigPicPath + ')'"
></div>
<viewer :options="OptionssalseImg" class="bigimgView">
<img ref="picJpg" class="animImg" :src="bigPicPath + ''" />
</viewer>
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
<!-- <p class="mark">
{{ bigPicPath }}
<span>{{ this.activeSmall }}</span>
</p> -->
</div>
<div
v-if="
showBigpic &&
bigPicPath.indexOf('nopic') == -1 &&
bigPicPath.indexOf('videos') == -1
"
class="showPic"
@click="closePic"
>
<div class="picboxI">
<img class="maskPic" :src="bigPicPath" />
<i @click="closePic" class="el-icon-circle-close"></i>
<!-- <img ref="picJpg" class="animImg" :src="bigPicPath + '!1280x720'" /> -->
</div>
<div class="bigimg nopic" v-if="bigPicPath.indexOf('nopic') !== -1">
<img
class="animImg"
:src="bigPicPath.substring(0, bigPicPath.length - 9)"
/>
</div>
<div class="bigimg" v-else-if="bigPicPath.indexOf('videos') !== -1">
<video
width="100%"
@ -44,9 +39,21 @@
autoplay
></video>
</div>
<div class="bigimg" v-else>
<img class="animImg" :src="bigPicPath" />
<!-- <div
v-if="
showBigpic &&
bigPicPath.indexOf('nopic') == -1 &&
bigPicPath.indexOf('videos') == -1
"
class="showPic"
@click="closePic"
>
<div class="picboxI">
<img class="maskPic" :src="bigPicPath" />
<i @click="closePic" class="el-icon-circle-close"></i>
</div>
</div> -->
<div class="arrow leftArrow" v-if="this.bigNum != 0" @click="leftClick">
<i class="el-icon-arrow-left"></i>
</div>
@ -211,7 +218,7 @@ export default {
},
mounted() {
console.log(this.terminalPhoto);
this.bigPicPath = this.terminalPhoto[0].path;
this.bigPicPath = this.terminalPhoto[0].path + "!1280x720";
this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize);
this.total = this.terminalPhoto.length / this.pagesize;
console.log(this.fiveList);
@ -236,7 +243,7 @@ export default {
},
watch: {
terminalPhoto: function (newVal, oldVal) {
this.bigPicPath = this.terminalPhoto[0].path;
this.bigPicPath = this.terminalPhoto[0].path + "!1280x720";
this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize);
this.total = this.terminalPhoto.length / this.pagesize;
},
@ -308,13 +315,13 @@ export default {
(this.page - 1) * this.pagesize,
this.page * this.pagesize
);
this.bigPicPath = this.fiveList[this.activeSmall].path;
this.bigPicPath = this.fiveList[this.activeSmall].path + "!1280x720";
this.videopath = this.fiveList[this.activeSmall].thumb;
},
//
leftClick() {
this.bigNum--; //
this.bigPicPath = this.terminalPhoto[this.bigNum].path;
this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1280x720";
this.activeSmall--;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
console.log(this.page);
@ -340,7 +347,7 @@ export default {
//
rightClick() {
this.bigNum++; //
this.bigPicPath = this.terminalPhoto[this.bigNum].path;
this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1280x720";
this.activeSmall++;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
if (this.activeSmall > 4) {
@ -367,7 +374,7 @@ export default {
console.log(row);
console.log();
this.activeSmall = index;
this.bigPicPath = row.path;
this.bigPicPath = row.path + "!1280x720";
getCoordinate({
channelId: row.channelId,
needPic: "1",
@ -505,6 +512,20 @@ export default {
justify-content: center;
position: relative;
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 {
position: absolute;
bottom: 12px;
@ -523,6 +544,7 @@ export default {
width: 100%;
height: 100%;
cursor: pointer;
z-index: 2;
}
}
img {

@ -7,7 +7,7 @@
>新增</el-button
>
</div>
<!-- <div class="searchBox">
<div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压等级" class="dybox">
<el-select v-model="formdata.dyId" @change="getSearchxl">
@ -44,13 +44,16 @@
</el-select>
</el-form-item>
<el-form-item>
<el-input v-model="formdata.searchnr" placeholder="请输入线路/杆塔/设备编号"></el-input>
<el-input
v-model="formdata.searchnr"
placeholder="请输入线路/杆塔/设备编号"
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div> -->
</div>
<div class="photoGraphicTable">
<el-table
ref="multipleTable"
@ -715,11 +718,13 @@ export default {
justify-content: space-between;
align-items: center;
}
.searchBox {
margin-top: 8px;
}
.photoGraphicTable {
// margin-top: 16px;
margin-top: 36px;
height: calc(100% - 70px);
//margin-top: 36px;
height: calc(100% - 94px);
}
.dropgps {
color: @color-primary;

@ -0,0 +1,128 @@
<template>
<el-dialog
class="gpsPoisitiondialog"
title="GPS位置"
:visible.sync="isShow"
:close-on-click-modal="false"
width="662px"
@close="handleclose"
>
<div class="gpsbox" v-loading="loading">
<p>
<span>经度</span><span>{{ infornr.longitude }}</span>
</p>
<p>
<span>纬度</span><span>{{ infornr.latitude }}</span>
</p>
<p>
<span>半径</span><span>{{ infornr.radius }}</span>
</p>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getTermGPSJoggle, getTermGPSPosition } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: true,
isShow: false,
timer: null,
infornr: {},
i: 0,
queryTime: "", //ID
zzcmdid: "",
zztermid: "",
};
},
mounted() {},
methods: {
//
getgpsData(zzcmdidval, zztermidval) {
this.zzcmdid = zzcmdidval;
this.zztermid = zztermidval;
console.log(this.zzcmdid);
console.log(this.zztermid);
this.loading = true;
getTermGPSPosition({
cmdId: zzcmdidval,
})
.then((res) => {
this.queryTime = res.data;
console.log(this.zztermid);
this.getNewgpsData(this.zztermid);
this.timer = window.setInterval(() => {
this.getNewgpsData(this.zztermid);
this.i++;
}, 5000);
})
.catch((err) => {});
},
//
getNewgpsData(val) {
getTermGPSJoggle({
queryTime: this.queryTime,
termid: val,
})
.then((res) => {
this.loading = true;
if (res.code == 200) {
this.infornr = res.data;
if (res.data.hasNew == true) {
this.loading = false;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "gps信息已更新",
type: "success",
});
clearInterval(this.timer);
} else if (this.i > 9) {
this.loading = false;
this.i = 0;
this.$message({
duration: 1500,
showClose: true,
message: "暂未获取到GPS信息请稍后再试",
type: "warning",
});
clearInterval(this.timer);
}
} else {
this.$message.error(res.code.msg);
}
})
.catch((err) => {});
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
handleclose() {
this.i = 0;
clearInterval(this.timer);
this.timer = null;
},
},
};
</script>
<style lang="less">
.gpsPoisitiondialog {
.gpsbox {
p {
line-height: 32px;
height: 32px;
font-size: 16px;
}
}
}
</style>

@ -61,9 +61,6 @@
:terminalPhoto="terminalPhoto"
v-if="terminalPhoto.length > 0"
></carouselChart>
<!-- <div class="totalPic" v-if="totalPic !== 0">
图片总数{{ totalPic }}
</div> -->
</div>
<div class="parameterArea">
<div class="zzbox">
@ -182,12 +179,31 @@
<el-dropdown-item command="close">关闭</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- 获取gps位置 -->
<el-button type="primary" @click.native.stop="handleShowGPS()"
>获取GPS位置</el-button
>
<!-- gps开关 -->
<el-dropdown
class="dropgps"
trigger="click"
@command="handleCommandGps"
>
<el-button type="primary">
GPS开关<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
<el-dropdown-item command="open">开启GPS</el-dropdown-item>
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</div>
</div>
<setschedule ref="setschedule_ref"></setschedule>
<info-dialog ref="infodialog_ref"></info-dialog>
<gps-position ref="gpsdialog_ref"></gps-position>
</div>
</div>
</template>
@ -201,18 +217,21 @@ import {
getReturnedPhotoJoggle,
alarmMarkJoggle,
getTermStatus,
setTermGPSJoggle,
} from "@/utils/api/index";
import { mapState } from "vuex";
import carouselChart from "../components/carouselChart.vue";
import setschedule from "./components/setschedule.vue";
import deviceUpgrade from "./components/deviceUpgrade.vue";
import infoDialog from "./components/infoDialog.vue";
import gpsPosition from "./components/gpsPosition.vue";
export default {
components: {
carouselChart,
setschedule,
deviceUpgrade,
infoDialog,
gpsPosition,
},
data() {
return {
@ -493,6 +512,7 @@ export default {
this.$refs.setschedule_ref.getSingleAccess(this.channelId, this.cmdid);
this.$refs.setschedule_ref.deviceList();
},
//
handleCommandWarn(command) {
switch (command) {
case "open": //
@ -731,6 +751,51 @@ export default {
}
});
},
//GPS
handleShowGPS() {
this.$refs.gpsdialog_ref.display();
this.$refs.gpsdialog_ref.getgpsData(this.cmdid, this.newTermId);
console.log(this.cmdid, this.newTermId);
},
//gps
handleCommandGps(command) {
switch (command) {
case "open": //
this.changeGPS(1, this.cmdid);
break;
case "close": //
this.changeGPS(0, this.cmdid);
break;
}
},
changeGPS(val, cmdid) {
console.log(val, cmdid);
setTermGPSJoggle({ gpsstatus: val, cmdId: cmdid })
.then((res) => {
console.log(res);
if (val == 0) {
this.$message({
duration: 1500,
message: "关闭GPS",
type: "success",
showClose: true,
});
} else {
this.$message({
duration: 1500,
message: "成功开启GPS",
type: "success",
showClose: true,
});
}
})
.catch((err) => {
console.log(err); //
});
},
//
// handlehistoryPic() {
// this.$router.push({ path: "/realTimeSearch" });

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

Loading…
Cancel
Save