fix: 公用函数禁止编辑

This commit is contained in:
wangdan-fit2cloud 2024-09-24 10:38:20 +08:00
parent acc43df3a3
commit ce464c5ddf
2 changed files with 14 additions and 3 deletions

View File

@ -311,6 +311,9 @@ h5 {
.cursor {
cursor: pointer;
}
.notAllowed {
cursor: not-allowed;
}
/*
超出省略号

View File

@ -41,8 +41,9 @@
<CardBox
:title="item.name"
:description="item.desc"
class="function-lib-card cursor"
class="function-lib-card"
@click="openCreateDialog(item)"
:class="item.permission_type === 'PUBLIC' ? 'notAllowed' : 'cursor'"
>
<template #icon>
<AppAvatar class="mr-12 avatar-green" shape="square" :size="32">
@ -65,13 +66,18 @@
</el-tooltip>
<el-divider direction="vertical" />
<el-tooltip effect="dark" content="删除" placement="top">
<el-button text @click.stop="deleteFunctionLib(item)">
<el-button
:disabled="item.permission_type === 'PUBLIC'"
text
@click.stop="deleteFunctionLib(item)"
>
<el-icon><Delete /></el-icon>
</el-button>
</el-tooltip>
</div>
<div @click.stop>
<el-switch
:disabled="item.permission_type === 'PUBLIC'"
v-model="item.is_active"
@change="changeState($event, item)"
size="small"
@ -111,7 +117,9 @@ const changeStateloading = ref(false)
function openCreateDialog(data?: any) {
title.value = data ? '编辑函数' : '创建函数'
FunctionFormDrawerRef.value.open(data)
if (data?.permission_type !== 'PUBLIC') {
FunctionFormDrawerRef.value.open(data)
}
}
function searchHandle() {