fix: crud组件列表操作栏和列表顶部操作栏增加hidden隐藏字段

This commit is contained in:
YeMingfei666 2025-04-11 16:48:06 +08:00
parent fdc1933bbe
commit 53fdd79a2e
2 changed files with 51 additions and 44 deletions

View File

@ -55,6 +55,7 @@
<!-- 其他 -->
<template v-else-if="typeof item === 'object'">
<el-button
v-if="item.hidden === undefined || item.hidden === false"
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
:icon="item.icon"
:type="item.type ?? 'default'"
@ -284,6 +285,7 @@
</template>
<!-- 其他 -->
<template v-else-if="typeof item === 'object'">
<template v-if="item.hidden === undefined || item.hidden === false">
<el-button
v-if="item.isBtn"
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
@ -307,7 +309,9 @@
<el-button
v-if="item.render === undefined || item.render(scope.row)"
v-bind="
item.auth ? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] } : {}
item.auth
? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] }
: {}
"
:icon="item.icon"
:type="item.type ?? 'primary'"
@ -347,6 +351,7 @@
</template>
</template>
</template>
</template>
<!-- 自定义 -->
<template v-else-if="col.templet === 'custom'">
<slot :name="col.slotName ?? col.prop" :prop="col.prop" v-bind="scope" />

View File

@ -148,6 +148,7 @@ export interface IContentConfig<T = any> {
icon?: string;
name: string;
text: string;
hidden?: boolean;
type?: "primary" | "success" | "warning" | "danger" | "info";
}
>;
@ -215,6 +216,7 @@ export interface IContentConfig<T = any> {
name: string;
text: string;
isBtn?: boolean;
hidden?: boolean;
type?: "primary" | "success" | "warning" | "danger" | "info";
render?: (row: IObject) => boolean;
options?: {