diff --git a/ui/src/pages/conversion-configuration.vue b/ui/src/pages/conversion-configuration.vue index fc2e4e1..7e48272 100644 --- a/ui/src/pages/conversion-configuration.vue +++ b/ui/src/pages/conversion-configuration.vue @@ -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: () => {} }) diff --git a/ui/src/pages/plugin-definition.vue b/ui/src/pages/plugin-definition.vue index 8da828a..7b54f71 100644 --- a/ui/src/pages/plugin-definition.vue +++ b/ui/src/pages/plugin-definition.vue @@ -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') }} @@ -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') }} @@ -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: () => {} })