实时监控添加图片列表展示

hn2.0
fanluyan 2 years ago
parent e409df201c
commit e737c6fa7e

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@ -507,14 +507,26 @@ export function setTermGPSJoggle(data) {
}
//手动拍照
export function getLatestPhotoJoggle(data) {
export function takePicJoggle(data) {
return request({
url: "/api/getLatestPhoto",
method: "post",
data,
url: "/api/takePic",
method: "get",
params: data,
// data,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
// },
});
}
//手动拍 获取装置状态
export function getTakePicStatusJoggle(data) {
return request({
url: "/api/getTakePicStatus",
method: "get",
params: data,
});
}
//获取所有通道列表
export function getAllChannelListJoggle(data) {
@ -536,11 +548,11 @@ export function getAllTowerJoggle(data) {
}
//手动拍照获取最新图片
export function getReturnedPhotoJoggle(data) {
export function getTakePicPhotoStatusJoggle(data) {
return request({
url: "/api/getReturnedPhoto",
method: "post",
data,
url: "/api/getTakePicPhotoStatus",
method: "get",
params: data,
});
}

@ -14,7 +14,16 @@
indicator-position="none"
>
<el-carousel-item v-for="(item, index) in imglist" :key="index">
<el-image :src="item.path" fit="contain"></el-image>
<el-image
:src="item.path"
fit="contain"
v-if="item.mediaType == 0"
></el-image>
<el-image
:src="item.thumb"
fit="contain"
v-if="item.mediaType == 1"
></el-image>
</el-carousel-item>
</el-carousel>
</div>

@ -343,8 +343,12 @@ import {
getSearchInfo,
getAlarmList,
getAlarmTypeList,
getLatestPhotoJoggle,
getReturnedPhotoJoggle,
// getLatestPhotoJoggle,
// getReturnedPhotoJoggle,
getTermStatus,
takePicJoggle,
getTakePicPhotoStatusJoggle,
getTakePicStatusJoggle,
readAlarm,
} from "@/utils/api/index";
import historyimg from "./components/historyimg.vue";
@ -398,6 +402,8 @@ export default {
zoomD: 1,
canvansdata: "",
current: 0,
requestId: "", //requestid
picTime: "", //
};
},
created() {
@ -794,33 +800,100 @@ export default {
this.imgOnload();
});
},
//
//
handleCommandpic() {
this.btnpicloading = true;
getLatestPhotoJoggle({
captureType: 0,
channel: this.selectRow.channelId,
termId: this.selectRow.termId,
preset: 255,
}).then((res) => {
this.$message({
duration: 1500,
showClose: true,
message: "手动拍照请求成功!",
type: "success",
});
this.timer = window.setInterval(() => {
this.newPicApi(res.data);
this.i++;
}, 5000);
getTermStatus({ termId: this.selectRow.termId }).then((res) => {
console.log(res);
if (res.data.isonline) {
takePicJoggle({
captureType: 0,
channel: this.selectRow.channelId,
termId: this.selectRow.termId,
preset: 255,
})
.then((res) => {
console.log(res);
this.requestId = res.data.requestId; //requestid
this.picTime = res.data.taketime; //
console.log(this.requestId);
this.btnpicloading = true;
this.statusTimer = window.setInterval(() => {
this.getTakePicStatus(this.requestId);
this.statusNum++;
}, 2000);
})
.catch((err) => {
console.log(err); //
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
//
getTakePicStatus(data) {
console.log(data);
getTakePicStatusJoggle({
requestid: data,
})
.then((res) => {
console.log(res);
//res.data 0 1 2
if (res.data == 0 && this.statusNum >= 5) {
this.statusNum = 0;
clearInterval(this.statusTimer);
this.statusTimer = null;
this.btnpicloading = false;
this.btnvideoloading = false;
this.$message({
duration: 1500,
showClose: true,
message: "下发指令超时,请重试!",
type: "warning",
});
} else if (res.data == 1) {
this.statusNum = 0;
clearInterval(this.statusTimer);
this.statusTimer = null;
this.$message({
duration: 1500,
showClose: true,
message: "下发指令成功!",
type: "success",
});
this.timer = window.setInterval(() => {
this.newPicApi();
this.i++;
}, 8000);
} else if (res.data == 2) {
this.statusNum = 0;
clearInterval(this.statusTimer);
this.statusTimer = null;
this.$message({
duration: 1500,
showClose: true,
message: "下发指令失败!",
type: "error",
});
}
})
.catch((err) => {
console.log(err); //
});
},
//
newPicApi(val) {
getReturnedPhotoJoggle({
photoTime: val,
newPicApi() {
getTakePicPhotoStatusJoggle({
photoTime: new Date(this.picTime).getTime(),
termId: this.selectRow.termId,
}).then((res) => {
console.log(res.data);
if (res.data == true && this.i < 10) {
clearInterval(this.timer);
this.timer = null;
@ -846,6 +919,7 @@ export default {
}
});
},
//
handleHistory() {
this.$refs.historyimg_ref.display();

@ -22,13 +22,6 @@
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
<!-- <img ref="picJpg" class="animImg" :src="bigPicPath + '!1366x768'" /> -->
</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%"
@ -39,6 +32,12 @@
autoplay
></video>
</div>
<div class="bigimg nopic" v-if="bigPicPath.indexOf('nopic') !== -1">
<img
class="animImg"
:src="bigPicPath.substring(0, bigPicPath.length - 9)"
/>
</div>
<div
v-if="
@ -203,6 +202,7 @@ export default {
url: "src",
},
isshowArrow: true, //
mediaType: "", //
bigPicPath: "", //
videopath: "",
smallPicPath: "", //
@ -226,6 +226,7 @@ export default {
},
mounted() {
console.log(this.terminalPhoto);
this.mediaType = this.terminalPhoto[0].mediaType;
this.bigPicPath = this.terminalPhoto[0].path + "!1366x768";
// this.bigPicPath = this.terminalPhoto[0].path + "!1366x768";
this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize);
@ -324,12 +325,14 @@ export default {
(this.page - 1) * this.pagesize,
this.page * this.pagesize
);
this.bigPicPath = this.fiveList[this.activeSmall].path + "!1366x768";
this.videopath = this.fiveList[this.activeSmall].thumb;
},
//
leftClick() {
this.bigNum--; //
this.mediaType = this.terminalPhoto[this.bigNum].mediaType;
this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1366x768";
this.activeSmall--;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
@ -356,6 +359,7 @@ export default {
//
rightClick() {
this.bigNum++; //
this.mediaType = this.terminalPhoto[this.bigNum].mediaType;
this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1366x768";
this.activeSmall++;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
@ -383,6 +387,7 @@ export default {
console.log(row);
console.log();
this.activeSmall = index;
this.mediaType = row.mediaType;
this.bigPicPath = row.path + "!1366x768";
getCoordinate({
channelId: row.channelId,
@ -460,7 +465,7 @@ export default {
width: 100%;
display: flex;
flex-direction: column;
height: calc(100% - 0px);
height: calc(100% - 32px);
box-sizing: border-box;
.showPic {

@ -52,7 +52,7 @@
</div>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click="isShow = false"> </el-button> -->
<el-button type="primary" @click="isShow = false"> </el-button>
<el-button type="primary" @click="handleclose"> </el-button>
</div>
</el-dialog>
</template>
@ -147,6 +147,7 @@ export default {
this.isShow = false;
},
handleclose() {
this.isShow = false;
this.i = 0;
clearInterval(this.timer);
this.timer = null;

File diff suppressed because it is too large Load Diff

@ -375,7 +375,7 @@ export default {
console.log(this.zzstatus);
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey); //
this.channelId = this.currentNodekey;
this.getChannelList(this.channelId); //id
});
}

@ -1,5 +1,5 @@
<template>
<div class="previewContain">
<div class="previewContain" v-loading="previewLoading">
<!-- {{ previewData }} -->
<!-- {{ previewData.name }}______{{ previewData.id }} -->
<div class="pictureBox">
@ -14,24 +14,41 @@
:key="'col-' + index"
v-if="index < colNum * i && index >= colNum * (i - 1)"
>
<div class="imgcloum">
<!-- <img
src="http://180.166.218.222:40080/photos/2023/07/17/03/XYIGQ10C221000003_1_FF_20230717134007.jpg!1366x768"
/> -->
<img :src="item.path + '!1366x768'" />
<div class="imgcloum" @click="handleTowerPic(item)">
<!-- 首先判断是否是图片mediatype=0,并且path不为空 展示图片 -->
<img
:src="item.path + '!1366x768'"
v-if="item.mediatype == 0 && item.path !== null"
/>
<!-- 判断是否是视频mediatype=1,并且path不为空 展示图片 -->
<img
v-else-if="item.mediatype == 1 && item.thumb !== null"
:src="item.thumb + '!1366x768'"
/>
<!-- 判断是否是视频mediatype=bull,并且path为空 展示暂无图片 -->
<img
v-else-if="item.mediatype == null"
src="../../assets/img/nodatapic2.jpg"
/>
<div class="picInfo">
<p>
{{ item.linename }}-{{ item.towername }}-{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channnelname
}}
</p>
<p class="timeinfo" v-if="item.mediatype !== null">
{{ $moment(item.photoTime).format("YYYY-MM-DD HH:mm:ss") }}
</p>
<p class="timeinfo" v-else></p>
</div>
</div>
</el-col>
</el-row>
</div>
<div class="pageNation">
<!-- <el-pagination
@current-change="handleCurrentChange"
:current-page="page"
layout=" prev, pager, next, jumper,total"
:total="total"
>
</el-pagination> -->
<div class="pageNation" v-if="picList.length !== 0">
<el-pagination
@current-change="handleCurrentChange"
:current-page="page"
@ -45,6 +62,7 @@
</template>
<script>
import { getTowerAndPhotoList } from "@/utils/api/index";
export default {
props: ["previewData"],
data() {
@ -58,22 +76,26 @@ export default {
picList: [], //
id: "",
type: "",
previewLoading: false,
};
},
mounted: function () {},
methods: {
//
getPicList(id, type) {
getPicList(id, type, page) {
this.id = id;
this.type = type;
this.page = page;
console.log(id, type);
this.previewLoading = true;
getTowerAndPhotoList({
id: id,
type: type,
pageindex: this.page,
pageindex: page,
pagesize: this.rowNum * this.colNum,
})
.then((res) => {
this.previewLoading = false;
console.log(res);
this.picList = res.data.list;
this.totalPage = res.data.totalpage;
@ -83,11 +105,16 @@ export default {
console.log(err); //
});
},
handleTowerPic(val) {
console.log(val);
this.$parent.jumpTowerPic(val);
console.log("调用父组件方法");
},
//
handleCurrentChange(val) {
this.page = val;
this.picList = [];
this.getPicList(this.id, this.type);
this.getPicList(this.id, this.type, this.page);
},
},
};
@ -104,19 +131,44 @@ export default {
//background-color: aquamarine;
.el-col {
height: 100%;
padding-right: 0.1%;
padding-left: 0.1%;
padding-top: 0.1%;
padding-bottom: 0.1%;
padding-right: 0.3%;
padding-left: 0.3%;
padding-top: 0.3%;
padding-bottom: 0.3%;
border-radius: 4px;
overflow: hidden;
}
.imgcloum {
width: 100%;
height: 100%;
// background: #f00;
cursor: pointer;
position: relative;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
&:hover {
border: 1px solid #169e8c;
}
img {
width: 100%;
height: 100%;
}
.picInfo {
position: absolute;
background: #169e8ca1;
color: #fff;
height: auto;
font-size: 14px;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
.timeinfo {
margin-top: 4px;
margin-bottom: 4px;
}
}
}
}
}

Loading…
Cancel
Save