控制通道

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 ///api/getTermStatus
export function getTermStatus(data) { export function getTermStatus(data) {
return request({ return request({

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

@ -16,6 +16,21 @@
</el-switch> </el-switch>
</div> </div>
</el-card> </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"> <el-card class="box-card globalprob">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>设置告警可信度</span> <span>设置告警可信度</span>
@ -43,6 +58,7 @@ import {
updateAlarmTypeList, updateAlarmTypeList,
getMarkEnableStatus, getMarkEnableStatus,
updateMarkEnableStatus, updateMarkEnableStatus,
updateAlarmChannel,
} from "@/utils/api/index"; } from "@/utils/api/index";
export default { export default {
@ -52,6 +68,8 @@ export default {
lineValue: false, lineValue: false,
lineNum: 0, lineNum: 0,
probList: [], probList: [],
tdOptions: [{ id: -1, name: "全部", alias: null }], //
channel: "",
}; };
}, },
created() { created() {
@ -64,11 +82,15 @@ export default {
getMarkEnableStatus() getMarkEnableStatus()
.then((res) => { .then((res) => {
console.log(res); console.log(res);
if (res.data === 1) { if (res.data.imgMark === 1) {
this.lineValue = true; this.lineValue = true;
console.log("绘制开启");
} else { } else {
this.lineValue = false; this.lineValue = false;
console.log("绘制关闭");
} }
this.channel = res.data.alarmChannel;
console.log(this.channel);
}) })
.catch((err) => {}); .catch((err) => {});
}, },
@ -93,6 +115,8 @@ export default {
getAlarmTypeList().then((res) => { getAlarmTypeList().then((res) => {
console.log(res); console.log(res);
this.probList = res.data.list; this.probList = res.data.list;
this.tdOptions = [{ id: -1, name: "全部", alias: null }];
this.tdOptions = this.tdOptions.concat(res.data.channellist);
}); });
}, },
setProb() { setProb() {
@ -113,6 +137,25 @@ export default {
console.log(err); 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> </script>

Loading…
Cancel
Save