From f306e1628df7d988ca84f2a3db97decb4d817158 Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Wed, 25 Oct 2023 20:03:29 +0800 Subject: [PATCH] =?UTF-8?q?style(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../userGroup/projectUserGroup.vue | 4 ++-- .../userGroup/userDrawer.vue | 13 +++++++--- .../project/components/addProjectModal.vue | 16 ++++++++++--- .../project/components/addUserModal.vue | 1 + .../project/components/userDrawer.vue | 4 ++++ .../components/addOrganizationModal.vue | 22 +++++++---------- .../components/addProjectModal.vue | 24 ++++++++++++------- .../components/addUserModal.vue | 1 + .../components/projectDrawer.vue | 5 ++++ .../components/systemOrganization.vue | 12 ++++++---- .../components/systemProject.vue | 5 +++- .../components/userDrawer.vue | 7 +++++- .../system/organizationAndProject/index.vue | 10 ++++++-- .../organizationAndProject/locale/en-US.ts | 1 + .../organizationAndProject/locale/zh-CN.ts | 1 + 15 files changed, 87 insertions(+), 39 deletions(-) diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue b/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue index 2c0c482d8f..2354a69c59 100644 --- a/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue @@ -175,9 +175,9 @@ try { await updateOrAddProjectUserGroup(record); Message.success(t('common.updateSuccess')); + return true; } catch (error) { - // eslint-disable-next-line no-console - console.log(error); + return false; } }; diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/userDrawer.vue b/frontend/src/views/project-management/projectAndPermission/userGroup/userDrawer.vue index 332010e856..93013d4428 100644 --- a/frontend/src/views/project-management/projectAndPermission/userGroup/userDrawer.vue +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/userDrawer.vue @@ -116,6 +116,7 @@ } const handleCancel = () => { + keyword.value = ''; emit('cancel'); }; @@ -149,9 +150,15 @@ console.error(error); } }; - watchEffect(() => { - currentVisible.value = props.visible; - }); + watch( + () => props.visible, + (visible) => { + currentVisible.value = visible; + if (visible) { + fetchData(); + } + } + ); watchEffect(() => { const { projectId, userRoleId } = props; if (projectId && userRoleId) { diff --git a/frontend/src/views/setting/organization/project/components/addProjectModal.vue b/frontend/src/views/setting/organization/project/components/addProjectModal.vue index a5c6513511..b08e5399f3 100644 --- a/frontend/src/views/setting/organization/project/components/addProjectModal.vue +++ b/frontend/src/views/setting/organization/project/components/addProjectModal.vue @@ -21,11 +21,12 @@ field="name" required :label="t('system.project.name')" + asterisk-position="end" :rules="[{ required: true, message: t('system.project.projectNameRequired') }]" > - + { - formReset(); emit('cancel', shouldSearch); }; @@ -200,7 +200,6 @@ } }; watchEffect(() => { - initAffiliatedOrgOption(); if (isEdit.value && props.currentProject) { form.id = props.currentProject.id; form.name = props.currentProject.name; @@ -212,4 +211,15 @@ form.resourcePoolIds = props.currentProject.resourcePoolIds; } }); + watch( + () => props.visible, + (val) => { + currentVisible.value = val; + if (!val) { + formReset(); + } else { + initAffiliatedOrgOption(); + } + } + ); diff --git a/frontend/src/views/setting/organization/project/components/addUserModal.vue b/frontend/src/views/setting/organization/project/components/addUserModal.vue index 76bf8f263f..7b6090e594 100644 --- a/frontend/src/views/setting/organization/project/components/addUserModal.vue +++ b/frontend/src/views/setting/organization/project/components/addUserModal.vue @@ -13,6 +13,7 @@ { + keyword.value = ''; emit('cancel'); }; @@ -157,6 +158,9 @@ () => props.visible, (visible) => { currentVisible.value = visible; + if (visible) { + fetchData(); + } } ); diff --git a/frontend/src/views/setting/system/organizationAndProject/components/addOrganizationModal.vue b/frontend/src/views/setting/system/organizationAndProject/components/addOrganizationModal.vue index e7ce34cacb..2282ee79a6 100644 --- a/frontend/src/views/setting/system/organizationAndProject/components/addOrganizationModal.vue +++ b/frontend/src/views/setting/system/organizationAndProject/components/addOrganizationModal.vue @@ -5,7 +5,7 @@ :ok-text="t('system.organization.create')" unmount-on-close title-align="start" - @cancel="handleCancel" + @cancel="handleCancel(false)" >