根据状态返回显示提示

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" />
</div>
<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
: item.channnelname

@ -114,11 +114,7 @@
<h3>操作项</h3>
<div class="buttonGroup">
<el-dropdown trigger="click" @command="handleCommandpic">
<el-button
type="primary"
:loading="btnpicloading"
:disabled="zzstatus == 0"
>
<el-button type="primary" :loading="btnpicloading">
主动拍照<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="picdropStyle">
@ -135,11 +131,7 @@
</el-dropdown-menu>
</el-dropdown>
<el-dropdown trigger="click" @command="handleCommandvideo">
<el-button
type="primary"
:loading="btnvideoloading"
:disabled="zzstatus == 0"
>
<el-button type="primary" :loading="btnvideoloading">
主动录像<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="videodropStyle">
@ -156,17 +148,10 @@
</el-dropdown-menu>
</el-dropdown>
<el-button
type="primary"
@click="handleShowInfo"
:disabled="zzstatus == 0"
>
<el-button type="primary" @click="handleShowInfo">
装置信息</el-button
>
<el-button
type="primary"
@click.native.stop="handleSetSchedule()"
:disabled="zzstatus == 0"
<el-button type="primary" @click.native.stop="handleSetSchedule()"
>拍照时间表</el-button
>
<!-- <el-dropdown
@ -187,7 +172,7 @@
trigger="click"
@command="handleCommandWarn"
>
<el-button type="primary" :disabled="zzstatus == 0">
<el-button type="primary">
声光报警<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
@ -231,6 +216,7 @@ import {
getLatestPhotoJoggle,
getReturnedPhotoJoggle,
alarmMarkJoggle,
getTermStatus,
} from "@/utils/api/index";
import { mapState } from "vuex";
import carouselChart from "../components/carouselChart.vue";
@ -537,7 +523,14 @@ export default {
handleWarn(val) {
console.log("声光报警");
console.log(this.cmdid);
alarmMarkJoggle({ cmdId: this.cmdid, ctrl: val })
getTermStatus({ termId: this.newTermId }).then((res) => {
console.log(res);
if (res.data.isonline) {
alarmMarkJoggle({
cmdId: this.cmdid,
ctrl: val,
termId: this.newTermId,
})
.then((res) => {
console.log(res);
if (res.code == 200) {
@ -566,6 +559,15 @@ export default {
type: "error",
});
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
//线
handleCommandLine(command) {
@ -590,8 +592,11 @@ export default {
//
handleCommandpic(command) {
this.btnpicloading = true;
console.log(command);
getTermStatus({ termId: this.newTermId }).then((res) => {
console.log(res);
if (res.data.isonline) {
this.btnpicloading = true;
getLatestPhotoJoggle({
captureType: 0,
channel: command,
@ -619,10 +624,24 @@ export default {
.catch((err) => {
console.log(err); //
});
} else {
this.btnpicloading = false;
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
//
handleCommandvideo(command) {
console.log(command);
getTermStatus({ termId: this.newTermId }).then((res) => {
console.log(res);
if (res.data.isonline) {
this.btnvideoloading = true;
getLatestPhotoJoggle({
captureType: 1,
@ -650,6 +669,15 @@ export default {
.catch((err) => {
console.log(err); //
});
} else {
this.$message({
duration: 1500,
showClose: true,
message: "装置下线,发送指令失败",
type: "error",
});
}
});
},
//
// handleShowPic() {
@ -725,8 +753,20 @@ export default {
//handleShowInfo
handleShowInfo() {
getTermStatus({ termId: this.newTermId }).then((res) => {
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() {

@ -29,7 +29,7 @@ module.exports = defineConfig({
"/api": {
//表示拦截以/api开头的请求路径
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, //是否开启跨域
pathRewrite: {
"^/api": "", //重写api把api变成空字符因为我们真正请求的路径是没有api的

Loading…
Cancel
Save