|
|
@ -129,28 +129,36 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
_submit () { |
|
|
|
_submit () { |
|
|
|
this.$f.rule.forEach(item => { |
|
|
|
this.$f.validate((valid) => { |
|
|
|
item.title = item.name |
|
|
|
if (valid) { |
|
|
|
}) |
|
|
|
this.$f.rule.forEach(item => { |
|
|
|
let param = { |
|
|
|
item.title = item.name |
|
|
|
instanceName: this.instanceName, |
|
|
|
}) |
|
|
|
pluginDefineId: this.pluginDefineId, |
|
|
|
let param = { |
|
|
|
pluginInstanceParams: JSON.stringify(this.$f.rule) |
|
|
|
instanceName: this.instanceName, |
|
|
|
} |
|
|
|
pluginDefineId: this.pluginDefineId, |
|
|
|
if (this.item) { |
|
|
|
pluginInstanceParams: JSON.stringify(this.$f.rule) |
|
|
|
param.alertPluginInstanceId = this.item.id |
|
|
|
} |
|
|
|
param.pluginDefineId = null |
|
|
|
if (this.item) { |
|
|
|
} |
|
|
|
param.alertPluginInstanceId = this.item.id |
|
|
|
this.$refs.popover.spinnerLoading = true |
|
|
|
param.pluginDefineId = null |
|
|
|
this.store.dispatch(`security/${this.item ? 'updateAlertPluginInstance' : 'createAlertPluginInstance'}`, param).then(res => { |
|
|
|
} |
|
|
|
this.$refs.popover.spinnerLoading = false |
|
|
|
this.$refs.popover.spinnerLoading = true |
|
|
|
this.$emit('onUpdate') |
|
|
|
this.store.dispatch(`security/${this.item ? 'updateAlertPluginInstance' : 'createAlertPluginInstance'}`, param).then(res => { |
|
|
|
this.$message.success(res.msg) |
|
|
|
this.$refs.popover.spinnerLoading = false |
|
|
|
}).catch(e => { |
|
|
|
this.$emit('onUpdate') |
|
|
|
this.$message.error(e.msg || '') |
|
|
|
this.$message.success(res.msg) |
|
|
|
this.$refs.popover.spinnerLoading = false |
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
this.$message.error(e.msg || '') |
|
|
|
|
|
|
|
this.$refs.popover.spinnerLoading = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning(`${i18n.$t('Instance parameter exception')}`) |
|
|
|
|
|
|
|
this.$refs.popover.spinnerLoading = false |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
close () { |
|
|
|
close () { |
|
|
|
this.$emit('close') |
|
|
|
this.$emit('close') |
|
|
|
} |
|
|
|
} |
|
|
|