添加心跳标识,自动拍照

master
fanluyan 2 years ago
parent b91b061f23
commit 99eacd4746

@ -335,3 +335,12 @@ export function getAllTowerJoggle(data) {
data,
});
}
//手动拍照获取最新图片
export function getReturnedPhotoJoggle(data) {
return request({
url: "/api/getReturnedPhoto",
method: "post",
data,
});
}

@ -25,7 +25,9 @@
class="iconfont icon-video-camera"
style="margin-right: 6px"
></span>
<span>{{ node.label }}</span>
<span :class="data.onlinestatus == 0 ? 'disconnect' : ''">{{
node.label
}}</span>
</span>
</el-tree>
</div>
@ -80,6 +82,10 @@
<el-button type="primary" @click="handleShowPic"
>手动拍照</el-button
>
<!-- <el-button type="primary" @click="handleShowPic"
>手动拍视频</el-button
> -->
<el-button type="primary" @click="handleShowGPS"
>获取GPS位置</el-button
>
@ -99,9 +105,9 @@
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-button type="primary" @click="handleShowErr"
<el-button type="primary" @click="handleShowErr"
>声光报警</el-button
> -->
>
<!-- <el-button type="primary" @click="handlehistoryPic"
>历史图片</el-button
> -->
@ -123,6 +129,7 @@ import {
getTermGPSJoggle,
setTermGPSJoggle,
getLatestPhotoJoggle,
getReturnedPhotoJoggle,
} from "@/utils/api/index";
import carouselChart from "../components/carouselChart.vue";
import setschedule from "./components/setschedule.vue";
@ -139,6 +146,7 @@ export default {
},
data() {
return {
onlinestatus: "", //
showBigPic: true,
defaultKey: "",
lineTreeData: [],
@ -170,6 +178,10 @@ export default {
label: "关闭",
},
],
newPicData: "",
timer: null,
i: 0,
newTermId: "",
};
},
watch: {
@ -208,10 +220,16 @@ export default {
.then((res) => {
console.log(res);
this.lineTreeData = res.data.list;
console.log(this.lineTreeData);
console.log(this.lineTreeData[0].list[0].list);
if (this.lineTreeData[0].list[0].list.length > 0) {
this.currentNodekey = this.lineTreeData[0].list[0].list[0].id; //
this.newTermId = this.lineTreeData[0].list[0].list[0].id;
console.log(this.currentNodekey);
console.log("ssssssssssssssssss");
console.log(this.newTermId);
console.log("ssssssssssssssssss");
this.cmdid = this.lineTreeData[0].list[0].list[0].cmdid;
console.log(this.cmdid);
this.$nextTick(() => {
@ -236,6 +254,11 @@ export default {
}
this.channelId = data.id; //id
this.cmdid = data.cmdid;
this.newTermId = data.id; //id
console.log("1111");
console.log(this.newTermId, this.channelId);
console.log("1111");
this.channelValue = [];
this.channelOption = [];
this.getChannelList(this.channelId); //id
@ -394,11 +417,53 @@ export default {
type: "success",
});
console.log(res);
this.newPicData = res.data;
console.log(this.newPicData);
console.log(this.newTermId);
this.timer = window.setInterval(() => {
this.newPicApi();
this.i++;
}, 10000);
})
.catch((err) => {
console.log(err); //
});
},
//
newPicApi() {
getReturnedPhotoJoggle({
photoTime: this.newPicData,
termId: this.newTermId,
}).then((res) => {
console.log(res.data);
console.log(this.i);
//console.log(this.newPicData, this.currentNodekey);
if (res.data == true && this.i < 10) {
console.log(res.data);
clearInterval(this.timer);
this.timer = null;
this.getTerminalPhotoList(
this.channelValue,
this.dateValue,
this.channelList[0].termId
);
console.log("返回最新图片");
} else if (res.data == false && this.i > 10) {
clearInterval(this.timer);
this.timer = null;
this.$message({
message: "自动拍照暂无响应,请稍后再试!",
type: "warning",
});
}
console.log("2222222222222222");
});
},
stop() {
clearInterval(this.timer);
this.timer = null;
},
//handleShowInfo
handleShowInfo() {
this.$refs.infodialog_ref.display();
@ -409,6 +474,11 @@ export default {
// // sessionStorage.setItem("keyPath", " realTimeSearch");
// },
},
destroyed() {
//
clearInterval(this.timer);
this.timer = null;
},
};
</script>
@ -435,6 +505,9 @@ export default {
height: 40px;
font-size: 12px;
}
.custom-tree-node {
color: #333;
}
}
.el-tree--highlight-current
.el-tree-node.is-current
@ -442,6 +515,13 @@ export default {
//
color: #fff;
background: #2d8cf0;
.custom-tree-node {
color: #fff;
}
}
.disconnect {
color: #d3d3d3;
}
}
.picSetBox {

Loading…
Cancel
Save