fix: 修复删除组织后切换组织下拉列表还会显示问题

This commit is contained in:
“huailei000” 2023-02-20 14:47:40 +08:00 committed by huailei
parent 5a0d0f98d3
commit b6258dd32c
2 changed files with 7 additions and 1 deletions

View File

@ -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)
},

View File

@ -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'))