diff --git a/src/store/modules/users.js b/src/store/modules/users.js index b24911aa2..6d2a66467 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -61,8 +61,10 @@ const mutations = { ADD_ORG: (state, org) => { state.consoleOrgs.push(org) }, + DELETE_ORG: (state, org) => { + state.consoleOrgs = state.consoleOrgs.filter(i => i.id !== org.id) + }, SET_CURRENT_ORG(state, org) { - console.log('set pre org: ', state.currentOrg) if (state.currentOrg?.name !== 'System') { state.preOrg = state.currentOrg } @@ -103,6 +105,9 @@ const actions = { addAdminOrg({ commit, state }, org) { commit('ADD_ORG', org) }, + deleteAdminOrg({ commit }, org) { + commit('DELETE_ORG', org) + }, modifyOrg({ commit, state }, org) { commit('MODIFY_ORG', org) }, diff --git a/src/views/settings/Org/OrganizationList.vue b/src/views/settings/Org/OrganizationList.vue index 7f819f957..877214921 100644 --- a/src/views/settings/Org/OrganizationList.vue +++ b/src/views/settings/Org/OrganizationList.vue @@ -76,6 +76,7 @@ export default { instance.confirmButtonLoading = true try { await performDelete.bind(this)({ row: row, col: col }) + this.$store.dispatch('users/deleteAdminOrg', { id: row.id, name: row.name }) done() reload() this.$message.success(this.$tc('common.deleteSuccessMsg'))