diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue index b46e477803..07c9faa8ae 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue @@ -129,28 +129,36 @@ }) }, _submit () { - this.$f.rule.forEach(item => { - item.title = item.name - }) - let param = { - instanceName: this.instanceName, - pluginDefineId: this.pluginDefineId, - pluginInstanceParams: JSON.stringify(this.$f.rule) - } - if (this.item) { - param.alertPluginInstanceId = this.item.id - param.pluginDefineId = null - } - this.$refs.popover.spinnerLoading = true - this.store.dispatch(`security/${this.item ? 'updateAlertPluginInstance' : 'createAlertPluginInstance'}`, param).then(res => { - this.$refs.popover.spinnerLoading = false - this.$emit('onUpdate') - this.$message.success(res.msg) - }).catch(e => { - this.$message.error(e.msg || '') - this.$refs.popover.spinnerLoading = false + this.$f.validate((valid) => { + if (valid) { + this.$f.rule.forEach(item => { + item.title = item.name + }) + let param = { + instanceName: this.instanceName, + pluginDefineId: this.pluginDefineId, + pluginInstanceParams: JSON.stringify(this.$f.rule) + } + if (this.item) { + param.alertPluginInstanceId = this.item.id + param.pluginDefineId = null + } + this.$refs.popover.spinnerLoading = true + this.store.dispatch(`security/${this.item ? 'updateAlertPluginInstance' : 'createAlertPluginInstance'}`, param).then(res => { + this.$refs.popover.spinnerLoading = false + this.$emit('onUpdate') + this.$message.success(res.msg) + }).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 () { this.$emit('close') } diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js index c7c2b7299c..17d96ccf44 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -222,6 +222,7 @@ export default { 'Alarm instance name': 'Alarm instance name', 'Select plugin': 'Select plugin', 'Please enter group name': 'Please enter group name', + 'Instance parameter exception': 'Instance parameter exception', 'Group Type': 'Group Type', 'Alarm plugin instance': 'Alarm plugin instance', Remarks: 'Remarks', diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js index aa7792094d..746517fb21 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -222,6 +222,7 @@ export default { 'Alarm instance name': '告警实例名称', 'Select plugin': '选择插件', 'Please enter group name': '请输入组名称', + 'Instance parameter exception': '实例参数异常', 'Group Type': '组类型', 'Alarm plugin instance': '告警插件实例', Remarks: '备注',