From a7860ed94a013e66004295d914994387bcd8f9d0 Mon Sep 17 00:00:00 2001 From: xue jiahao Date: Tue, 3 Dec 2024 15:23:03 +0800 Subject: [PATCH] UI bugfix --- .../ShareDomain/ShareDomainDialog.vue | 4 ++-- frontend/src/pages/TenantDomain.vue | 8 +++++-- frontend/src/pages/UserDomain.vue | 22 +++++++++++-------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/ShareDomain/ShareDomainDialog.vue b/frontend/src/components/ShareDomain/ShareDomainDialog.vue index 09e2eff..72427fe 100644 --- a/frontend/src/components/ShareDomain/ShareDomainDialog.vue +++ b/frontend/src/components/ShareDomain/ShareDomainDialog.vue @@ -9,7 +9,7 @@ diff --git a/frontend/src/pages/TenantDomain.vue b/frontend/src/pages/TenantDomain.vue index a0ac958..1266db2 100644 --- a/frontend/src/pages/TenantDomain.vue +++ b/frontend/src/pages/TenantDomain.vue @@ -32,7 +32,7 @@ - + @@ -294,7 +294,11 @@ const onSubmit = () => { 'ownerid': authStore.userId || '' } // for search: api.put(`api/domain`)、api.post(`api/domain`) - api[method].apply(api, [`api/domain`, param]).then(() => { + api[method].apply(api, [`api/domain`, param]).then(async (resp: any) => { + const res = resp.data; + if (res.data.id === currentDomainId.value && !res.data.is_active) { + await authStore.setCurrentDomain(); + } getDomain(); domainStore.loadUserDomains(); closeDg(); diff --git a/frontend/src/pages/UserDomain.vue b/frontend/src/pages/UserDomain.vue index a56fbea..f1fdccc 100644 --- a/frontend/src/pages/UserDomain.vue +++ b/frontend/src/pages/UserDomain.vue @@ -171,17 +171,21 @@ const getDomain = async (userId? : string) => { activeDomainId.value = resp?.data?.data?.id; const domainResult = userId ? await api.get(`api/domain?userId=${userId}`) : await api.get(`api/domain`); const domains = domainResult.data as any[]; - rows.value = domains.map((item) => { + rows.value = domains.reduce((acc, item) => { rowIds.add(item.id); - return { - id: item.id, - name: item.name, - url: item.url, - kintoneuser: item.kintoneuser, - ownerEmail: item.owner.email, - owner: item.owner.first_name + ' ' + item.owner.last_name, + if (item.is_active) { + acc.push({ + id: item.id, + name: item.name, + url: item.url, + kintoneuser: item.kintoneuser, + ownerEmail: item.owner.email, + owner: item.owner.first_name + ' ' + item.owner.last_name, + }) } - }); + return acc; + }, []); + } onMounted(async () => {