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) this.$log.debug('Start perform delete: ', url)
return this.$axios.delete(url) return this.$axios.delete(url)
} }
this.$alert(msg, title, { this.$alert(msg, title, {
type: 'warning', type: 'warning',
confirmButtonClass: 'el-button--danger', confirmButtonClass: 'el-button--danger',

View File

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

View File

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

View File

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