调整编辑rules弹窗的逻辑,前段增加错误提醒
This commit is contained in:
parent
6ac573eb7e
commit
cdc51f8de6
|
@ -607,29 +607,6 @@ export default {
|
||||||
editItem(id) {
|
editItem(id) {
|
||||||
getAction("/alarmRule/findInfo", {alarmRuleId:id}).then(async res => {
|
getAction("/alarmRule/findInfo", {alarmRuleId:id}).then(async res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let result_1 = await getAction("/alarmRule/getSources", { souceType: res.result.sourceType })
|
|
||||||
if (result_1.success) {
|
|
||||||
this.sourceOptions = result_1.result.map(item => {
|
|
||||||
return {
|
|
||||||
label: item.sourceName,
|
|
||||||
value: item.sourceId
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$message.warning("This operation fails. Contact your system administrator")
|
|
||||||
}
|
|
||||||
let result_2 = await getAction("/alarmRule/getItems", {sourceName:res.result.sourceName})
|
|
||||||
if (result_2.success) {
|
|
||||||
this.itemOptions = result_2.result.map(item => {
|
|
||||||
return {
|
|
||||||
label: item.name,
|
|
||||||
value: item.itemId,
|
|
||||||
units:item.units
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$message.warning("This operation fails. Contact your system administrator")
|
|
||||||
}
|
|
||||||
this.isAdd = false
|
this.isAdd = false
|
||||||
this.form.sourceType = res.result.sourceType
|
this.form.sourceType = res.result.sourceType
|
||||||
this.form.sourceId = {
|
this.form.sourceId = {
|
||||||
|
@ -648,6 +625,35 @@ export default {
|
||||||
this.form.contactId = res.result.contactId
|
this.form.contactId = res.result.contactId
|
||||||
this.currId = res.result.id
|
this.currId = res.result.id
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
getAction("/alarmRule/getSources", { souceType: res.result.sourceType }).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.sourceOptions = res.result.map(item => {
|
||||||
|
return {
|
||||||
|
label: item.sourceName,
|
||||||
|
value: item.sourceId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.warning("This operation fails. Contact your system administrator")
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
this.$message.warning("This operation fails. Contact your system administrator")
|
||||||
|
})
|
||||||
|
getAction("/alarmRule/getItems", { sourceName: res.result.sourceName }).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.itemOptions = res.result.map(item => {
|
||||||
|
return {
|
||||||
|
label: item.name,
|
||||||
|
value: item.itemId,
|
||||||
|
units:item.units
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.warning("This operation fails. Contact your system administrator")
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
this.$message.warning("This operation fails. Contact your system administrator")
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning("This operation fails. Contact your system administrator")
|
this.$message.warning("This operation fails. Contact your system administrator")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user