From e54faab91e7d06e09232e5a560a35a952d90ea5d Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Mon, 27 Jun 2022 17:03:08 +0800 Subject: [PATCH] feat: support update a user Signed-off-by: Ryan Wang --- src/modules/system/users/UserList.vue | 36 +++++++++++-------- .../users/components/UserCreationModal.vue | 18 ++++++++-- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/modules/system/users/UserList.vue b/src/modules/system/users/UserList.vue index bec7cd33..12aad833 100644 --- a/src/modules/system/users/UserList.vue +++ b/src/modules/system/users/UserList.vue @@ -13,13 +13,14 @@ import { VTag, } from "@halo-dev/components"; import UserCreationModal from "./components/UserCreationModal.vue"; -import { ref } from "vue"; +import { onMounted, ref } from "vue"; import { axiosInstance } from "@halo-dev/admin-shared"; import type { User } from "@/types/extension"; const checkAll = ref(false); const creationModal = ref(false); const users = ref([]); +const selectedUser = ref(null); const handleFetchUsers = async () => { try { @@ -30,11 +31,19 @@ const handleFetchUsers = async () => { } }; -handleFetchUsers(); +const handleOpenCreateModal = (user: User) => { + selectedUser.value = user; + creationModal.value = true; +}; + +onMounted(() => { + handleFetchUsers(); +});
    -
  • +
  • - + {{ user.spec.displayName }} {{ user.metadata.name }} @@ -246,7 +254,7 @@ handleFetchUsers(); {{ user.metadata.creationTimestamp }} - +
    diff --git a/src/modules/system/users/components/UserCreationModal.vue b/src/modules/system/users/components/UserCreationModal.vue index 4832c8c8..784dba3f 100644 --- a/src/modules/system/users/components/UserCreationModal.vue +++ b/src/modules/system/users/components/UserCreationModal.vue @@ -1,6 +1,6 @@