From 2903640d8d17424feedeeeee219ed1fe85bcafcd Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Tue, 26 May 2026 17:42:12 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B8=85=E9=99=A4=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot --- src/views/systemList/role/role.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/views/systemList/role/role.vue b/src/views/systemList/role/role.vue index 79e4e5c..0cc8dfe 100644 --- a/src/views/systemList/role/role.vue +++ b/src/views/systemList/role/role.vue @@ -85,7 +85,7 @@ - + @@ -137,9 +137,9 @@ - + @@ -431,6 +431,11 @@ const getMenuAllCheckedKeys = (): any => { const submitForm = () => { roleFormRef.value?.validate(async (valid: boolean) => { if (valid) { + // 如果 rolekey 为空,自动生成唯一标识 + if (!form.value.roleKey) { + form.value.roleKey = `role_${Date.now()}_${Math.random().toString(36)}`; + } + form.value.menuIds = getMenuAllCheckedKeys(); form.value.roleId ? await updateRole(form.value) : await addRole(form.value); proxy?.$modal.msgSuccess('操作成功');