You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by so...@apache.org on 2022/03/22 03:27:28 UTC

[dolphinscheduler] branch dev updated: [Fix][UI Next][V1.0.0-Alpha] fix queue display bug in tenant modal (#9064)

This is an automated email from the ASF dual-hosted git repository.

songjian pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new f5ef410  [Fix][UI Next][V1.0.0-Alpha] fix queue display bug in tenant modal (#9064)
f5ef410 is described below

commit f5ef410d06e0ef7717dd0065320edbd631aef8c3
Author: Devosend <de...@gmail.com>
AuthorDate: Tue Mar 22 11:27:22 2022 +0800

    [Fix][UI Next][V1.0.0-Alpha] fix queue display bug in tenant modal (#9064)
    
    * fix queue always display first queue bug in tenant modal
    
    * modify queueId init
---
 .../views/security/tenant-manage/components/tenant-modal.tsx  |  3 ++-
 .../views/security/tenant-manage/components/use-modalData.ts  | 11 +++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dolphinscheduler-ui-next/src/views/security/tenant-manage/components/tenant-modal.tsx b/dolphinscheduler-ui-next/src/views/security/tenant-manage/components/tenant-modal.tsx
index 9636f57..f6e14f9 100644
--- a/dolphinscheduler-ui-next/src/views/security/tenant-manage/components/tenant-modal.tsx
+++ b/dolphinscheduler-ui-next/src/views/security/tenant-manage/components/tenant-modal.tsx
@@ -57,7 +57,7 @@ const TenantModal = defineComponent({
     watch(
       () => props.showModalRef,
       () => {
-        props.showModalRef && getListData()
+        props.showModalRef && getListData(props.statusRef)
       }
     )
 
@@ -67,6 +67,7 @@ const TenantModal = defineComponent({
         if (props.statusRef === 0) {
           variables.model.tenantCode = ''
           variables.model.description = ''
+          variables.model.queueId = null
         } else {
           variables.model.id = props.row.id
           variables.model.tenantCode = props.row.tenantCode
diff --git a/dolphinscheduler-ui-next/src/views/security/tenant-manage/components/use-modalData.ts b/dolphinscheduler-ui-next/src/views/security/tenant-manage/components/use-modalData.ts
index 3084721..331573c 100644
--- a/dolphinscheduler-ui-next/src/views/security/tenant-manage/components/use-modalData.ts
+++ b/dolphinscheduler-ui-next/src/views/security/tenant-manage/components/use-modalData.ts
@@ -34,7 +34,7 @@ export function useModalData(
       id: ref<number>(-1),
       tenantCode: ref(''),
       description: ref(''),
-      queueId: ref<number>(-1),
+      queueId: ref<number | null>(null),
       generalOptions: []
     },
     saving: false,
@@ -48,7 +48,7 @@ export function useModalData(
     }
   })
 
-  const getListData = () => {
+  const getListData = (status: number) => {
     const { state } = useAsyncState(
       queryList().then((res: any) => {
         variables.model.generalOptions = res.map((item: any) => {
@@ -57,7 +57,9 @@ export function useModalData(
             value: item.id
           }
         })
-        variables.model.queueId = res[0].id
+        if (status === 0) {
+          variables.model.queueId = res[0].id
+        }
       }),
       {}
     )
@@ -84,13 +86,14 @@ export function useModalData(
       (unused: any) => {
         const data = {
           tenantCode: variables.model.tenantCode,
-          queueId: variables.model.queueId,
+          queueId: variables.model.queueId as number,
           description: variables.model.description
         }
         createTenant(data).then(
           (unused: any) => {
             variables.model.tenantCode = ''
             variables.model.description = ''
+            variables.model.queueId = null
             ctx.emit('confirmModal', props.showModalRef)
           },
           (unused: any) => {