添加告警通知

master
fanluyan 5 months ago
parent 2775a73eba
commit 26c6063011

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

Loading…
Cancel
Save