feat: remove unnecessary edit permission checks from dropdown items
This commit is contained in:
parent
687fd6cb84
commit
f77dd47403
@ -236,7 +236,6 @@
|
|||||||
'OR',
|
'OR',
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
:disabled="!canEdit(item)"
|
|
||||||
@click.stop="openCreateDialog(item)"
|
@click.stop="openCreateDialog(item)"
|
||||||
>
|
>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
@ -245,7 +244,6 @@
|
|||||||
{{ $t('common.edit') }}
|
{{ $t('common.edit') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
:disabled="!canEdit(item)"
|
|
||||||
v-if="
|
v-if="
|
||||||
!item.template_id &&
|
!item.template_id &&
|
||||||
hasPermission(
|
hasPermission(
|
||||||
@ -264,7 +262,6 @@
|
|||||||
</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"
|
||||||
:disabled="!canEdit(item)"
|
|
||||||
@click.stop="configInitParams(item)"
|
@click.stop="configInitParams(item)"
|
||||||
>
|
>
|
||||||
<AppIcon iconName="app-operation" class="mr-4"></AppIcon>
|
<AppIcon iconName="app-operation" class="mr-4"></AppIcon>
|
||||||
@ -282,7 +279,6 @@
|
|||||||
'OR',
|
'OR',
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
:disabled="!canEdit(item)"
|
|
||||||
@click.stop="exportTool(item)"
|
@click.stop="exportTool(item)"
|
||||||
>
|
>
|
||||||
<AppIcon iconName="app-export"></AppIcon>
|
<AppIcon iconName="app-export"></AppIcon>
|
||||||
@ -299,7 +295,6 @@
|
|||||||
'OR',
|
'OR',
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
:disabled="!canEdit(item)"
|
|
||||||
divided
|
divided
|
||||||
@click.stop="deleteTool(item)"
|
@click.stop="deleteTool(item)"
|
||||||
>
|
>
|
||||||
@ -372,10 +367,6 @@ const currentFolder = ref<any>({})
|
|||||||
const search_type_change = () => {
|
const search_type_change = () => {
|
||||||
search_form.value = { name: '', create_user: '' }
|
search_form.value = { name: '', create_user: '' }
|
||||||
}
|
}
|
||||||
const canEdit = (row: any) => {
|
|
||||||
return user.userInfo?.id === row?.user_id
|
|
||||||
}
|
|
||||||
|
|
||||||
const ToolFormDrawerRef = ref()
|
const ToolFormDrawerRef = ref()
|
||||||
const ToolDrawertitle = ref('')
|
const ToolDrawertitle = ref('')
|
||||||
|
|
||||||
@ -386,11 +377,9 @@ function openCreateDialog(data?: any) {
|
|||||||
}
|
}
|
||||||
ToolDrawertitle.value = data ? t('views.tool.editTool') : t('views.tool.createTool')
|
ToolDrawertitle.value = data ? t('views.tool.editTool') : t('views.tool.createTool')
|
||||||
if (data) {
|
if (data) {
|
||||||
if (canEdit(data)) {
|
ToolApi.getToolById(data?.id, changeStateloading).then((res) => {
|
||||||
ToolApi.getToolById(data?.id, changeStateloading).then((res) => {
|
|
||||||
ToolFormDrawerRef.value.open(res.data)
|
ToolFormDrawerRef.value.open(res.data)
|
||||||
})
|
})
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
ToolFormDrawerRef.value.open(data)
|
ToolFormDrawerRef.value.open(data)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user