fix: 修复创建报警规则中存在的问题

This commit is contained in:
Xu Zhimeng 2024-01-04 12:00:48 +08:00
parent b17d6ffac8
commit 5d2dbf2aa2
2 changed files with 33 additions and 1 deletions

View File

@ -524,6 +524,7 @@ export default {
label: item.name,
value: item.itemId,
units: item.units,
valueType: item.valueType,
}
})
} else {
@ -556,6 +557,8 @@ export default {
onSave() {
this.$refs.al_ruleForm.validate((valid) => {
if (valid) {
const find = this.itemOptions.find((item) => item.value == this.form.itemId.key)
let params = {
silenceCycle: this.form.silenceCycle,
contactId: this.form.contactId,
@ -570,6 +573,7 @@ export default {
},
name: this.form.name,
id: this.isAdd ? '' : this.currId,
itemType: find.valueType,
}
if (this.isAdd) {
postAction('/alarmRule/create', params).then((res) => {
@ -644,6 +648,7 @@ export default {
label: item.name,
value: item.itemId,
units: item.units,
valueType: item.valueType,
}
})
} else {
@ -783,6 +788,7 @@ export default {
.ant-spin-nested-loading {
width: 100%;
height: calc(100% - 40px);
overflow: auto;
}
.monitor-list {
height: 100%;

View File

@ -215,6 +215,9 @@ export default {
},
}
},
created() {
this.getAlarmGroup()
},
mounted() {
this.sourceOptions = this.serverList
},
@ -227,6 +230,25 @@ export default {
},
},
methods: {
getAlarmGroup() {
let params = {
pageNo: 1,
pageSize: 9999,
}
getAction('/alarmContactGroup/findPage', params).then((res) => {
if (res.success) {
this.contactGroupOptions = res.result.records.map((item) => {
return {
label: item.name,
value: item.id,
}
})
} else {
this.$message.warning('This operation fails. Contact your system administrator')
}
})
},
onCancel() {
this.$emit('onCancel')
this.resetForm()
@ -238,6 +260,8 @@ export default {
onSave() {
this.$refs.al_ruleForm.validate((valid) => {
if (valid) {
const find = this.itemOptions.find((item) => item.value == this.form.itemId.key)
let params = {
silenceCycle: this.form.silenceCycle,
contactId: this.form.contactId,
@ -251,8 +275,9 @@ export default {
units: this.units,
},
name: this.form.name,
itemType: find.valueType,
}
this.$emit('onCanonSavecel', params)
this.$emit('onOk', params)
this.resetForm()
}
})
@ -270,6 +295,7 @@ export default {
label: item.name,
value: item.itemId,
units: item.units,
valueType: item.valueType,
}
})
} else {