控制通道

hn2.0
fanluyan 2 years ago
parent 6fd01caea5
commit 9399138d37

@ -752,7 +752,18 @@ export function updateMarkEnableStatus(data) {
},
});
}
//全局设置通道
export function updateAlarmChannel(data) {
return request({
url: "/api/updateAlarmChannel",
method: "post",
data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
///api/getTermStatus
export function getTermStatus(data) {
return request({

@ -37,16 +37,7 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="通道">
<el-select v-model="formdata.channel">
<el-option
v-for="item in tdOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始日期">
<!-- <el-date-picker
v-model="formdata.timeVal"
@ -389,10 +380,9 @@ export default {
dyOptions: [{ id: -1, name: "全部" }], //
xlOptions: [{ id: -1, name: "全部" }], //线
gtOptions: [{ id: -1, name: "全部" }], //
tdOptions: [{ id: -1, name: "全部", alias: null }], //
gjOptions: [{ id: -1, label: -1, name: "全部" }], //
formdata: {
channel: 1,
dyId: -1,
lineId: -1,
towerId: -1,
@ -568,14 +558,9 @@ export default {
.then((res) => {
this.gjOptions = [{ id: -1, label: -1, name: "全部" }];
this.gjOptions = this.gjOptions.concat(res.data.list);
this.tdOptions = [{ id: -1, name: "全部", alias: null }];
this.tdOptions = this.tdOptions.concat(res.data.channellist);
console.log(this.tdOptions);
console.log(this.gjOptions);
this.formdata.label = this.gjOptions[0].label;
this.formdata.channel = this.tdOptions[1].id;
console.log(this.formdata.label);
console.log(this.formdata.channel);
})
.catch((err) => {});
},

@ -16,6 +16,21 @@
</el-switch>
</div>
</el-card>
<el-card class="box-card globalDrawLine">
<div slot="header" class="clearfix">
<span>设置告警通道</span>
</div>
<div>
<el-select v-model="channel" @change="handleChange">
<el-option
v-for="item in tdOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
</el-card>
<el-card class="box-card globalprob">
<div slot="header" class="clearfix">
<span>设置告警可信度</span>
@ -43,6 +58,7 @@ import {
updateAlarmTypeList,
getMarkEnableStatus,
updateMarkEnableStatus,
updateAlarmChannel,
} from "@/utils/api/index";
export default {
@ -52,6 +68,8 @@ export default {
lineValue: false,
lineNum: 0,
probList: [],
tdOptions: [{ id: -1, name: "全部", alias: null }], //
channel: "",
};
},
created() {
@ -64,11 +82,15 @@ export default {
getMarkEnableStatus()
.then((res) => {
console.log(res);
if (res.data === 1) {
if (res.data.imgMark === 1) {
this.lineValue = true;
console.log("绘制开启");
} else {
this.lineValue = false;
console.log("绘制关闭");
}
this.channel = res.data.alarmChannel;
console.log(this.channel);
})
.catch((err) => {});
},
@ -93,6 +115,8 @@ export default {
getAlarmTypeList().then((res) => {
console.log(res);
this.probList = res.data.list;
this.tdOptions = [{ id: -1, name: "全部", alias: null }];
this.tdOptions = this.tdOptions.concat(res.data.channellist);
});
},
setProb() {
@ -113,6 +137,25 @@ export default {
console.log(err);
});
},
//
handleChange(val) {
console.log(val);
updateAlarmChannel({ channel: this.channel })
.then((res) => {
console.log(res);
if (res.code === 200) {
this.$message({
duration: 1500,
showClose: true,
message: "告警通道设置成功",
type: "success",
});
}
})
.catch((err) => {
console.log(err);
});
},
},
};
</script>

Loading…
Cancel
Save