告警--主动拍照

master
13703816893 2 years ago
parent 6ffd743b39
commit b48ca6d47c

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

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

Loading…
Cancel
Save