Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pobu168 committed Aug 11, 2021
1 parent 871d364 commit b363b9e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
18 changes: 11 additions & 7 deletions ui/src/pages/conversion-configuration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1325,15 +1325,19 @@ export default {
'z-index': 1000000,
loading: true,
onOk: async () => {
let res = await deleteAttrs(item.id)
this.$Modal.remove()
if (res.statusCode === 'OK') {
this.$Notice.success({
title: 'Successful',
desc: 'Successful'
})
if (item.id) {
let res = await deleteAttrs(item.id)
if (res.statusCode === 'OK') {
this.$Notice.success({
title: 'Successful',
desc: 'Successful'
})
attrs.splice(index, 1)
}
} else {
attrs.splice(index, 1)
}
this.$Modal.remove()
},
onCancel: () => {}
})
Expand Down
26 changes: 15 additions & 11 deletions ui/src/pages/plugin-definition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
type="error"
ghost
size="small"
@click="deleteParams(param)"
@click="deleteParams(param, interfaceParamter['input'], index)"
:disabled="param.source === 'system'"
>{{ $t('t_delete') }}</Button
>
Expand Down Expand Up @@ -335,7 +335,7 @@
type="error"
ghost
size="small"
@click="deleteParams(param)"
@click="deleteParams(param, interfaceParamter['output'], index)"
:disabled="param.source === 'system'"
>{{ $t('t_delete') }}
</Button>
Expand Down Expand Up @@ -623,21 +623,25 @@ export default {
this.getInterfaceParamter(param.interface)
}
},
deleteParams (param) {
deleteParams (param, allParams, index) {
this.$Modal.confirm({
title: this.$t('t_confirm_delete'),
'z-index': 1000000,
loading: true,
onOk: async () => {
let res = await deleteParameter(param.id)
this.$Modal.remove()
if (res.statusCode === 'OK') {
this.$Notice.success({
title: 'Successful',
desc: 'Successful'
})
this.getInterfaceParamter(param.interface)
if (param.id) {
let res = await deleteParameter(param.id)
if (res.statusCode === 'OK') {
this.$Notice.success({
title: 'Successful',
desc: 'Successful'
})
this.getInterfaceParamter(param.interface)
}
} else {
allParams.splice(index, 1)
}
this.$Modal.remove()
},
onCancel: () => {}
})
Expand Down

0 comments on commit b363b9e

Please sign in to comment.