fix: Update visibility handling after user profile retrieval and enhance permission checks in dropdown items

This commit is contained in:
zhangzhanwei 2025-07-07 17:33:50 +08:00 committed by zhanweizhang7
parent 1bb2a1ae12
commit f6b36b7801
2 changed files with 6 additions and 4 deletions

View File

@ -431,8 +431,9 @@ const submit = async (formEl: FormInstance | undefined) => {
.then((res: any) => { .then((res: any) => {
MsgSuccess(t('common.editSuccess')) MsgSuccess(t('common.editSuccess'))
emit('refresh', res.data) emit('refresh', res.data)
visible.value = false return user.profile()
}) })
.then(() => {visible.value = false})
} else { } else {
const obj = { const obj = {
folder_id: folder.currentFolder?.id, folder_id: folder.currentFolder?.id,
@ -443,8 +444,9 @@ const submit = async (formEl: FormInstance | undefined) => {
.then((res: any) => { .then((res: any) => {
MsgSuccess(t('common.createSuccess')) MsgSuccess(t('common.createSuccess'))
emit('refresh') emit('refresh')
visible.value = false return user.profile()
}) })
.then(() => {visible.value = false})
} }
} }
}) })

View File

@ -213,7 +213,7 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item <el-dropdown-item
v-if="item.template_id" v-if="item.template_id && permissionPrecise.edit(item.id)"
@click.stop="addInternalTool(item, true)" @click.stop="addInternalTool(item, true)"
> >
<el-icon> <el-icon>
@ -238,7 +238,7 @@
{{ $t('common.copy') }} {{ $t('common.copy') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item <el-dropdown-item
v-if="item.init_field_list?.length > 0" v-if="item.init_field_list?.length > 0 && permissionPrecise.edit(item.id)"
@click.stop="configInitParams(item)" @click.stop="configInitParams(item)"
> >
<AppIcon iconName="app-operation" class="mr-4"></AppIcon> <AppIcon iconName="app-operation" class="mr-4"></AppIcon>