告警--主动拍照

master
13703816893 2 years ago
parent 6ffd743b39
commit b48ca6d47c

@ -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'
});
}
});

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

Loading…
Cancel
Save