fix: Fixed the issue that the data was not refrefied when jumping back to the page after clicking delete on the cloud synchronization detail page

This commit is contained in:
zhaojisen
2024-06-12 13:42:09 +08:00
parent 982f9e5635
commit a561a62ef5
4 changed files with 15 additions and 4 deletions

View File

@@ -195,6 +195,7 @@ export default {
this.$log.debug('Start perform delete: ', url)
return this.$axios.delete(url)
}
this.$alert(msg, title, {
type: 'warning',
confirmButtonClass: 'el-button--danger',

View File

@@ -122,6 +122,9 @@ export default {
}
}
},
activated() {
this.$refs.accountTable.reloadTable()
},
methods: {
valid(status) {
if (status !== 200) {

View File

@@ -106,11 +106,12 @@ export default {
el: {
provider: this.provider,
regions: this.object.task?.regions || [],
getAuthInfo: () => {
getAuthInfo: async() => {
if (this.object?.id) {
return this.object.id
}
const form = this.$refs.form.$refs.form.dataForm
await form.submitForm('form', true)
return form.getFormValue()['attrs']
}
}

View File

@@ -91,21 +91,27 @@ export default {
this.content = `${this.$t('Modify')} [${count}]`
},
handlerLinkClick() {
this.content = this.$t('Loading')
const authInfo = this.getAuthInfo()
let method = 'get'
let data = {}
let url = `/api/v1/xpack/cloud/regions/?account_id=${authInfo}`
if (typeof authInfo === 'object') {
const attrs = JSON.parse(JSON.stringify(authInfo))
method = 'post'
url = `/api/v1/xpack/cloud/regions/?provider=${this.provider}`
data = { 'attrs': encryptAttrsField(attrs) }
}
this.content = this.$t('Loading')
this.$axios[method](url, data).then(resp => {
this.allRegions = resp?.regions
this.regionVisible = true
this.updateCheckedStatus()
console.log(Object.getOwnPropertyNames(data.attrs).length)
if (this.allRegions.length && Object.getOwnPropertyNames(data.attrs).length > 0) {
this.regionVisible = true
this.updateCheckedStatus()
}
}).catch(error => {
this.$message.error(this.$tc('CloudRegionTip' + ' ' + error))
}).finally(() => {