根据状态返回显示提示

master
fanluyan 2 years ago
parent 685dce7b1c
commit f41ad2f5ca

@ -684,3 +684,15 @@ export function updateMarkEnableStatus(data) {
}, },
}); });
} }
///api/getTermStatus
export function getTermStatus(data) {
return request({
url: "/api/getTermStatus",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}

@ -48,7 +48,11 @@
<img src="../../assets/img/nopic.jpg" /> <img src="../../assets/img/nopic.jpg" />
</div> </div>
<p class="infoTop"> <p class="infoTop">
{{ item.linename }}-{{ item.displayname }}-{{ {{ item.linename }}-{{
item.displayname !== null && item.displayname !== ""
? item.displayname
: item.cmdid
}}-{{
item.alias !== null && item.alias !== "" item.alias !== null && item.alias !== ""
? item.alias ? item.alias
: item.channnelname : item.channnelname

@ -114,11 +114,7 @@
<h3>操作项</h3> <h3>操作项</h3>
<div class="buttonGroup"> <div class="buttonGroup">
<el-dropdown trigger="click" @command="handleCommandpic"> <el-dropdown trigger="click" @command="handleCommandpic">
<el-button <el-button type="primary" :loading="btnpicloading">
type="primary"
:loading="btnpicloading"
:disabled="zzstatus == 0"
>
主动拍照<i class="el-icon-arrow-down el-icon--right"></i> 主动拍照<i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown" class="picdropStyle"> <el-dropdown-menu slot="dropdown" class="picdropStyle">
@ -135,11 +131,7 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-dropdown trigger="click" @command="handleCommandvideo"> <el-dropdown trigger="click" @command="handleCommandvideo">
<el-button <el-button type="primary" :loading="btnvideoloading">
type="primary"
:loading="btnvideoloading"
:disabled="zzstatus == 0"
>
主动录像<i class="el-icon-arrow-down el-icon--right"></i> 主动录像<i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown" class="videodropStyle"> <el-dropdown-menu slot="dropdown" class="videodropStyle">
@ -156,17 +148,10 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-button <el-button type="primary" @click="handleShowInfo">
type="primary"
@click="handleShowInfo"
:disabled="zzstatus == 0"
>
装置信息</el-button 装置信息</el-button
> >
<el-button <el-button type="primary" @click.native.stop="handleSetSchedule()"
type="primary"
@click.native.stop="handleSetSchedule()"
:disabled="zzstatus == 0"
>拍照时间表</el-button >拍照时间表</el-button
> >
<!-- <el-dropdown <!-- <el-dropdown
@ -187,7 +172,7 @@
trigger="click" trigger="click"
@command="handleCommandWarn" @command="handleCommandWarn"
> >
<el-button type="primary" :disabled="zzstatus == 0"> <el-button type="primary">
声光报警<i class="el-icon-arrow-down el-icon--right"></i> 声光报警<i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle"> <el-dropdown-menu slot="dropdown" class="gpsdropStyle">
@ -231,6 +216,7 @@ import {
getLatestPhotoJoggle, getLatestPhotoJoggle,
getReturnedPhotoJoggle, getReturnedPhotoJoggle,
alarmMarkJoggle, alarmMarkJoggle,
getTermStatus,
} from "@/utils/api/index"; } from "@/utils/api/index";
import { mapState } from "vuex"; import { mapState } from "vuex";
import carouselChart from "../components/carouselChart.vue"; import carouselChart from "../components/carouselChart.vue";
@ -537,35 +523,51 @@ export default {
handleWarn(val) { handleWarn(val) {
console.log("声光报警"); console.log("声光报警");
console.log(this.cmdid); console.log(this.cmdid);
alarmMarkJoggle({ cmdId: this.cmdid, ctrl: val }) getTermStatus({ termId: this.newTermId }).then((res) => {
.then((res) => { console.log(res);
console.log(res); if (res.data.isonline) {
if (res.code == 200) { alarmMarkJoggle({
if (val == 1) { cmdId: this.cmdid,
this.$message({ ctrl: val,
duration: 1500, termId: this.newTermId,
showClose: true, })
message: "声光报警开启成功", .then((res) => {
type: "success", console.log(res);
}); if (res.code == 200) {
} else { if (val == 1) {
this.$message({
duration: 1500,
showClose: true,
message: "声光报警开启成功",
type: "success",
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: "声光报警关闭成功",
type: "success",
});
}
}
})
.catch((err) => {
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
message: "声光报警关闭成功", message: "声光报警操作失败",
type: "success", type: "error",
}); });
} });
} } else {
})
.catch((err) => {
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
message: "声光报警操作失败", message: "装置下线,发送指令失败",
type: "error", type: "error",
}); });
}); }
});
}, },
//线 //线
handleCommandLine(command) { handleCommandLine(command) {
@ -590,66 +592,92 @@ export default {
// //
handleCommandpic(command) { handleCommandpic(command) {
this.btnpicloading = true;
console.log(command); console.log(command);
getLatestPhotoJoggle({ getTermStatus({ termId: this.newTermId }).then((res) => {
captureType: 0, console.log(res);
channel: command, if (res.data.isonline) {
// cmdid: this.cmdid, this.btnpicloading = true;
termId: this.newTermId, getLatestPhotoJoggle({
preset: 255, captureType: 0,
}) channel: command,
.then((res) => { // cmdid: this.cmdid,
termId: this.newTermId,
preset: 255,
})
.then((res) => {
this.$message({
duration: 1500,
showClose: true,
message: "手动拍照请求成功!",
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++;
}, 5000);
})
.catch((err) => {
console.log(err); //
});
} else {
this.btnpicloading = false;
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
message: "手动拍照请求成功!", message: "装置下线,发送指令失败",
type: "success", type: "error",
}); });
console.log(res); }
this.newPicData = res.data; });
console.log(this.newPicData);
console.log(this.newTermId);
this.timer = window.setInterval(() => {
this.newPicApi();
this.i++;
}, 5000);
})
.catch((err) => {
console.log(err); //
});
}, },
// //
handleCommandvideo(command) { handleCommandvideo(command) {
console.log(command); console.log(command);
this.btnvideoloading = true;
getLatestPhotoJoggle({ getTermStatus({ termId: this.newTermId }).then((res) => {
captureType: 1, console.log(res);
channel: command, if (res.data.isonline) {
//cmdid: this.cmdid, this.btnvideoloading = true;
termId: this.newTermId, getLatestPhotoJoggle({
preset: 255, captureType: 1,
}) channel: command,
.then((res) => { //cmdid: this.cmdid,
termId: this.newTermId,
preset: 255,
})
.then((res) => {
this.$message({
duration: 1500,
showClose: true,
message: "手动拍视频请求成功!",
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); //
});
} else {
this.$message({ this.$message({
duration: 1500, duration: 1500,
showClose: true, showClose: true,
message: "手动拍视频请求成功!", message: "装置下线,发送指令失败",
type: "success", type: "error",
}); });
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); //
});
}, },
// //
// handleShowPic() { // handleShowPic() {
@ -725,8 +753,20 @@ export default {
//handleShowInfo //handleShowInfo
handleShowInfo() { handleShowInfo() {
this.$refs.infodialog_ref.display(); getTermStatus({ termId: this.newTermId }).then((res) => {
this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid); console.log(res);
if (res.data.isonline) {
this.$refs.infodialog_ref.display();
this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid);
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
}, },
// //
// handlehistoryPic() { // handlehistoryPic() {

@ -29,7 +29,7 @@ module.exports = defineConfig({
"/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的

Loading…
Cancel
Save