Browse Source

fix

pull/3/MERGE
break60 4 years ago
parent
commit
394c5f29d2
  1. 16
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue

16
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue

@ -38,7 +38,7 @@
<m-list-box-f> <m-list-box-f>
<template slot="name"><strong>*</strong>{{$t('Alarm plugin instance')}}</template> <template slot="name"><strong>*</strong>{{$t('Alarm plugin instance')}}</template>
<template slot="content"> <template slot="content">
<el-select v-model="alertInstanceIds" size="small" style="width: 100%"> <el-select v-model="alertInstanceIds" size="small" style="width: 100%" multiple>
<el-option <el-option
v-for="items in allAlertPluginInstance" v-for="items in allAlertPluginInstance"
:key="items.id" :key="items.id"
@ -64,6 +64,7 @@
</m-popup> </m-popup>
</template> </template>
<script> <script>
import _ from 'lodash'
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import store from '@/conf/home/store' import store from '@/conf/home/store'
import mPopup from '@/module/components/popup/popup' import mPopup from '@/module/components/popup/popup'
@ -75,7 +76,7 @@
return { return {
store, store,
groupName: '', groupName: '',
alertInstanceIds: null, alertInstanceIds: [],
description: '' description: ''
} }
}, },
@ -114,7 +115,7 @@
_submit () { _submit () {
let param = { let param = {
groupName: this.groupName, groupName: this.groupName,
alertInstanceIds: this.alertInstanceIds, alertInstanceIds: this.alertInstanceIds.join(','),
description: this.description description: this.description
} }
if (this.item) { if (this.item) {
@ -124,9 +125,7 @@
this.store.dispatch(`security/${this.item ? 'updateAlertgrou' : 'createAlertgrou'}`, param).then(res => { this.store.dispatch(`security/${this.item ? 'updateAlertgrou' : 'createAlertgrou'}`, param).then(res => {
this.$emit('onUpdate') this.$emit('onUpdate')
this.$message.success(res.msg) this.$message.success(res.msg)
setTimeout(() => { this.$refs.popup.spinnerLoading = false
this.$refs.popup.spinnerLoading = false
}, 800)
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
this.$refs.popup.spinnerLoading = false this.$refs.popup.spinnerLoading = false
@ -140,7 +139,10 @@
created () { created () {
if (this.item) { if (this.item) {
this.groupName = this.item.groupName this.groupName = this.item.groupName
this.alertInstanceIds = Number(this.item.alertInstanceIds) let dataStrArr = this.item.alertInstanceIds.split(',')
this.alertInstanceIds = _.map(dataStrArr, v => {
return +v
})
this.description = this.item.description this.description = this.item.description
} }
}, },

Loading…
Cancel
Save