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 {
cursor: pointer; cursor: pointer;
} }
.notAllowed {
cursor: not-allowed;
}
/* /*
超出省略号 超出省略号

View File

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