From a15b683b1da1845afcd7a3b34318551642d4a508 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Wed, 6 Aug 2025 09:12:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=96=B0=E5=A2=9E=E6=97=B6=E8=A7=92=E8=89=B2=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=8C=85=E5=90=AB=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/custom/post-select.vue | 14 +++++++------- src/typings/api/system.api.d.ts | 2 ++ .../system/user/modules/user-operate-drawer.vue | 17 +++++++++++++++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/components/custom/post-select.vue b/src/components/custom/post-select.vue index 49dd8741..57cfee9e 100644 --- a/src/components/custom/post-select.vue +++ b/src/components/custom/post-select.vue @@ -21,27 +21,27 @@ const attrs: SelectProps = useAttrs(); const { loading: postLoading, startLoading: startPostLoading, endLoading: endPostLoading } = useLoading(); -/** the enabled role options */ -const roleOptions = ref[]>([]); +/** the enabled post options */ +const postOptions = ref[]>([]); watch( () => props.deptId, () => { if (!props.deptId) { - roleOptions.value = []; + postOptions.value = []; return; } - getRoleOptions(); + getPostOptions(); }, { immediate: true } ); -async function getRoleOptions() { +async function getPostOptions() { startPostLoading(); const { error, data } = await fetchGetPostSelect(props.deptId!); if (!error) { - roleOptions.value = data.map(item => ({ + postOptions.value = data.map(item => ({ label: item.postName, value: item.postId })); @@ -54,7 +54,7 @@ async function getRoleOptions() { diff --git a/src/typings/api/system.api.d.ts b/src/typings/api/system.api.d.ts index 8e779f31..64825d10 100644 --- a/src/typings/api/system.api.d.ts +++ b/src/typings/api/system.api.d.ts @@ -163,6 +163,8 @@ declare namespace Api { postIds: string[]; /** user role ids */ roleIds: string[]; + /** roles */ + roles: Role[]; }; /** user list */ diff --git a/src/views/system/user/modules/user-operate-drawer.vue b/src/views/system/user/modules/user-operate-drawer.vue index 68ecfa2c..f48c0b17 100644 --- a/src/views/system/user/modules/user-operate-drawer.vue +++ b/src/views/system/user/modules/user-operate-drawer.vue @@ -1,5 +1,5 @@