Browse Source

[fix-#3843][api]When update workflow definition,if name already exists, the prompt is not friendly.

pull/3/MERGE
zhuangchong 4 years ago
parent
commit
07ced8b591
  1. 16
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue

16
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue

@ -82,7 +82,7 @@
</div> </div>
</template> </template>
<x-button type="text" @click="close()"> {{$t('Cancel')}} </x-button> <x-button type="text" @click="close()"> {{$t('Cancel')}} </x-button>
<x-button type="primary" shape="circle" @click="ok()">{{$t('Add')}}</x-button> <x-button type="primary" shape="circle" :disabled="isDetails" @click="ok()">{{$t('Add')}}</x-button>
</div> </div>
</div> </div>
</div> </div>
@ -99,6 +99,7 @@
name: 'udp', name: 'udp',
data () { data () {
return { return {
originalName: '',
// dag name // dag name
name: '', name: '',
// dag description // dag description
@ -169,22 +170,14 @@
this.$emit('onUdp') this.$emit('onUdp')
} }
// Edit => direct storage if (this.originalName !== this.name) {
if (this.store.state.dag.name && this.store.state.dag.name===this.name) {
_verif()
} else if (this.store.state.dag.name && this.store.state.dag.name!==this.name) {
this.store.dispatch('dag/verifDAGName', this.name).then(res => { this.store.dispatch('dag/verifDAGName', this.name).then(res => {
_verif() _verif()
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
}) })
} else { } else {
// New First verify that the name exists _verif()
this.store.dispatch('dag/verifDAGName', this.name).then(res => {
_verif()
}).catch(e => {
this.$message.error(e.msg || '')
})
} }
}, },
/** /**
@ -207,6 +200,7 @@
this.udpList = dag.globalParams this.udpList = dag.globalParams
this.udpListCache = dag.globalParams this.udpListCache = dag.globalParams
this.name = dag.name this.name = dag.name
this.originalName = dag.name
this.description = dag.description this.description = dag.description
this.syncDefine = dag.syncDefine this.syncDefine = dag.syncDefine
this.timeout = dag.timeout || 0 this.timeout = dag.timeout || 0

Loading…
Cancel
Save