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

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({ return request({
url: "/api/getLatestPhoto", url: "/api/takePic",
method: "post", method: "get",
data,
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) { export function getAllChannelListJoggle(data) {
@ -536,11 +548,11 @@ export function getAllTowerJoggle(data) {
} }
//手动拍照获取最新图片 //手动拍照获取最新图片
export function getReturnedPhotoJoggle(data) { export function getTakePicPhotoStatusJoggle(data) {
return request({ return request({
url: "/api/getReturnedPhoto", url: "/api/getTakePicPhotoStatus",
method: "post", method: "get",
data, params: data,
}); });
} }

@ -14,7 +14,16 @@
indicator-position="none" indicator-position="none"
> >
<el-carousel-item v-for="(item, index) in imglist" :key="index"> <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-item>
</el-carousel> </el-carousel>
</div> </div>

@ -343,8 +343,12 @@ import {
getSearchInfo, getSearchInfo,
getAlarmList, getAlarmList,
getAlarmTypeList, getAlarmTypeList,
getLatestPhotoJoggle, // getLatestPhotoJoggle,
getReturnedPhotoJoggle, // getReturnedPhotoJoggle,
getTermStatus,
takePicJoggle,
getTakePicPhotoStatusJoggle,
getTakePicStatusJoggle,
readAlarm, readAlarm,
} from "@/utils/api/index"; } from "@/utils/api/index";
import historyimg from "./components/historyimg.vue"; import historyimg from "./components/historyimg.vue";
@ -398,6 +402,8 @@ export default {
zoomD: 1, zoomD: 1,
canvansdata: "", canvansdata: "",
current: 0, current: 0,
requestId: "", //requestid
picTime: "", //
}; };
}, },
created() { created() {
@ -794,33 +800,100 @@ export default {
this.imgOnload(); this.imgOnload();
}); });
}, },
//
//
handleCommandpic() { handleCommandpic() {
this.btnpicloading = true; getTermStatus({ termId: this.selectRow.termId }).then((res) => {
getLatestPhotoJoggle({ console.log(res);
if (res.data.isonline) {
takePicJoggle({
captureType: 0, captureType: 0,
channel: this.selectRow.channelId, channel: this.selectRow.channelId,
termId: this.selectRow.termId, termId: this.selectRow.termId,
preset: 255, preset: 255,
}).then((res) => { })
.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({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
message: "手动拍照请求成功!", 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", type: "success",
}); });
this.timer = window.setInterval(() => { this.timer = window.setInterval(() => {
this.newPicApi(res.data); this.newPicApi();
this.i++; this.i++;
}, 5000); }, 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) { newPicApi() {
getReturnedPhotoJoggle({ getTakePicPhotoStatusJoggle({
photoTime: val, photoTime: new Date(this.picTime).getTime(),
termId: this.selectRow.termId, termId: this.selectRow.termId,
}).then((res) => { }).then((res) => {
console.log(res.data);
if (res.data == true && this.i < 10) { if (res.data == true && this.i < 10) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
@ -846,6 +919,7 @@ export default {
} }
}); });
}, },
// //
handleHistory() { handleHistory() {
this.$refs.historyimg_ref.display(); this.$refs.historyimg_ref.display();

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

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

File diff suppressed because it is too large Load Diff

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

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