|
|
|
@ -165,7 +165,7 @@
|
|
|
|
|
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="editorBtn">
|
|
|
|
|
<!-- <el-button type="primary" :loading="btnpicloading" @click="handleCommandpic">主动拍照</el-button> -->
|
|
|
|
|
<el-button type="primary" :loading="btnpicloading" @click="handleCommandpic">主动拍照</el-button>
|
|
|
|
|
<el-button type="primary">历史图片</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -387,36 +387,50 @@ export default {
|
|
|
|
|
//手动拍照
|
|
|
|
|
handleCommandpic() {
|
|
|
|
|
this.btnpicloading = true;
|
|
|
|
|
getLatestPhotoJoggle({}).then((res) => {
|
|
|
|
|
getLatestPhotoJoggle({
|
|
|
|
|
captureType: 0,
|
|
|
|
|
channel: this.selectRow.channelId,
|
|
|
|
|
termId: this.selectRow.termId,
|
|
|
|
|
preset: 255,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.$message({
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: "手动拍照请求成功!",
|
|
|
|
|
type: "success",
|
|
|
|
|
});
|
|
|
|
|
this.timer = window.setInterval(() => {
|
|
|
|
|
this.newPicApi();
|
|
|
|
|
this.newPicApi(res.data);
|
|
|
|
|
this.i++;
|
|
|
|
|
}, 5000);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取最新图片
|
|
|
|
|
newPicApi() {
|
|
|
|
|
getReturnedPhotoJoggle({}).then((res) => {
|
|
|
|
|
newPicApi(val) {
|
|
|
|
|
getReturnedPhotoJoggle({
|
|
|
|
|
photoTime: val,
|
|
|
|
|
termId: this.selectRow.termId,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (res.data == true && this.i < 10) {
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
this.timer = null;
|
|
|
|
|
this.i = 0;
|
|
|
|
|
this.btnpicloading = false;
|
|
|
|
|
console.log("返回最新图片");
|
|
|
|
|
this.$notify({
|
|
|
|
|
title: '通知信息',
|
|
|
|
|
message: '已返回最新图片',
|
|
|
|
|
type: 'success',
|
|
|
|
|
position: 'bottom-right'
|
|
|
|
|
});
|
|
|
|
|
} else if (res.data == false && this.i > 10) {
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
this.timer = null;
|
|
|
|
|
this.i = 0;
|
|
|
|
|
this.btnpicloading = false;
|
|
|
|
|
this.$message({
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: "装置暂无响应,请稍后再试!",
|
|
|
|
|
type: "warning",
|
|
|
|
|
this.$notify({
|
|
|
|
|
title: '通知信息',
|
|
|
|
|
message: '装置暂无响应,请稍后再试!',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
position: 'bottom-right'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|