添加告警通知

master
fanluyan 5 months ago
parent 2775a73eba
commit 26c6063011

@ -11,6 +11,18 @@
></el-input>
<p class="redErr" v-if="titleFlag">*</p>
</div>
<div class="noteBox">
<h3 class="lableBox">是否告警</h3>
<el-select v-model="activityForm.warnVal">
<el-option
v-for="item in warnOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<div class="upgradeBox">
<h3 class="lableBox">装置列表</h3>
<el-input
@ -69,6 +81,12 @@
}}%
</template>
</el-table-column>
<el-table-column prop="status" label="告警通知">
<template slot-scope="scope">
<span v-if="scope.row.status == 1"></span>
<span v-if="scope.row.status == 2"></span>
</template>
</el-table-column>
<!-- <el-table-column prop="path" label="文件路径"> </el-table-column> -->
<el-table-column label="操作" width="300" class-name="editClass">
<template slot-scope="scope">
@ -161,9 +179,21 @@ export default {
data() {
return {
activityloading: true,
warnOptions: [
{
value: 1,
label: "不通知",
},
{
value: 2,
label: "通知",
},
],
activityData: [], //
activityForm: {
title: "",
warnVal: 1,
cmdidArr: "",
},
cmdObjects: [], //
@ -271,6 +301,7 @@ export default {
this.termsLoading = true;
this.termsData = row.terms;
this.activityNameTitle = row.title;
this.activityName = row.title + "(" + row.terms.length + ")";
this.termsData = row.terms;
},
@ -313,6 +344,7 @@ export default {
console.log(row);
this.ActibityId = row.id;
this.activityForm.title = row.title;
this.activityForm.warnVal = row.status;
const columnData = row.terms.map((item) => item.cmdid);
this.activityForm.cmdidArr = columnData.join("\n");
},
@ -333,6 +365,7 @@ export default {
actParams = {
id: this.ActibityId,
title: this.activityForm.title,
status: this.activityForm.warnVal,
terms: this.cmdObjects,
};
updActiveApi(actParams)
@ -341,6 +374,7 @@ export default {
this.getactivityList();
this.activityForm.title = "";
this.activityForm.cmdidArr = "";
this.activityForm.warnVal = 1;
this.ActibityId = "";
})
.catch((err) => {});
@ -350,6 +384,7 @@ export default {
actParams = {
title: this.activityForm.title,
terms: this.cmdObjects,
status: this.activityForm.warnVal,
};
addActiveApi(actParams)
.then((res) => {
@ -357,6 +392,7 @@ export default {
this.getactivityList();
this.activityForm.title = "";
this.activityForm.cmdidArr = "";
this.activityForm.warnVal = 1;
this.ActibityId = "";
})
.catch((err) => {});
@ -381,6 +417,9 @@ export default {
.noteClass {
width: 100%;
}
.el-select {
width: 100%;
}
.lableBox {
font-size: 14px;
font-weight: normal;

Loading…
Cancel
Save