fix: crud组件列表操作栏和列表顶部操作栏增加hidden隐藏字段
This commit is contained in:
parent
fdc1933bbe
commit
53fdd79a2e
|
|
@ -55,6 +55,7 @@
|
||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<template v-else-if="typeof item === 'object'">
|
<template v-else-if="typeof item === 'object'">
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="item.hidden === undefined || item.hidden === false"
|
||||||
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
||||||
:icon="item.icon"
|
:icon="item.icon"
|
||||||
:type="item.type ?? 'default'"
|
:type="item.type ?? 'default'"
|
||||||
|
|
@ -284,31 +285,10 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<template v-else-if="typeof item === 'object'">
|
<template v-else-if="typeof item === 'object'">
|
||||||
<el-button
|
<template v-if="item.hidden === undefined || item.hidden === false">
|
||||||
v-if="item.isBtn"
|
|
||||||
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
|
||||||
:icon="item.icon"
|
|
||||||
:type="item.type ?? 'primary'"
|
|
||||||
size="small"
|
|
||||||
link
|
|
||||||
@click="
|
|
||||||
handleOperat({
|
|
||||||
name: item.name,
|
|
||||||
row: scope.row,
|
|
||||||
column: scope.column,
|
|
||||||
$index: scope.$index,
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ item.text }}
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<el-dropdown style="margin-top: 4px" v-else>
|
|
||||||
<el-button
|
<el-button
|
||||||
v-if="item.render === undefined || item.render(scope.row)"
|
v-if="item.isBtn"
|
||||||
v-bind="
|
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
||||||
item.auth ? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] } : {}
|
|
||||||
"
|
|
||||||
:icon="item.icon"
|
:icon="item.icon"
|
||||||
:type="item.type ?? 'primary'"
|
:type="item.type ?? 'primary'"
|
||||||
size="small"
|
size="small"
|
||||||
|
|
@ -324,26 +304,51 @@
|
||||||
>
|
>
|
||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<template #dropdown v-if="item.options && item.options.length > 0">
|
|
||||||
<el-dropdown-menu>
|
<el-dropdown style="margin-top: 4px" v-else>
|
||||||
<el-dropdown-item
|
<el-button
|
||||||
@click="
|
v-if="item.render === undefined || item.render(scope.row)"
|
||||||
handleOperat({
|
v-bind="
|
||||||
name: item.name,
|
item.auth
|
||||||
row: scope.row,
|
? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] }
|
||||||
column: scope.column,
|
: {}
|
||||||
$index: scope.$index,
|
"
|
||||||
command: opt.command ? opt.command : '',
|
:icon="item.icon"
|
||||||
})
|
:type="item.type ?? 'primary'"
|
||||||
"
|
size="small"
|
||||||
v-for="opt in item.options"
|
link
|
||||||
:key="opt.value"
|
@click="
|
||||||
>
|
handleOperat({
|
||||||
{{ opt.label }}
|
name: item.name,
|
||||||
</el-dropdown-item>
|
row: scope.row,
|
||||||
</el-dropdown-menu>
|
column: scope.column,
|
||||||
</template>
|
$index: scope.$index,
|
||||||
</el-dropdown>
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ item.text }}
|
||||||
|
</el-button>
|
||||||
|
<template #dropdown v-if="item.options && item.options.length > 0">
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item
|
||||||
|
@click="
|
||||||
|
handleOperat({
|
||||||
|
name: item.name,
|
||||||
|
row: scope.row,
|
||||||
|
column: scope.column,
|
||||||
|
$index: scope.$index,
|
||||||
|
command: opt.command ? opt.command : '',
|
||||||
|
})
|
||||||
|
"
|
||||||
|
v-for="opt in item.options"
|
||||||
|
:key="opt.value"
|
||||||
|
>
|
||||||
|
{{ opt.label }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,7 @@ export interface IContentConfig<T = any> {
|
||||||
icon?: string;
|
icon?: string;
|
||||||
name: string;
|
name: string;
|
||||||
text: string;
|
text: string;
|
||||||
|
hidden?: boolean;
|
||||||
type?: "primary" | "success" | "warning" | "danger" | "info";
|
type?: "primary" | "success" | "warning" | "danger" | "info";
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
@ -215,6 +216,7 @@ export interface IContentConfig<T = any> {
|
||||||
name: string;
|
name: string;
|
||||||
text: string;
|
text: string;
|
||||||
isBtn?: boolean;
|
isBtn?: boolean;
|
||||||
|
hidden?: boolean;
|
||||||
type?: "primary" | "success" | "warning" | "danger" | "info";
|
type?: "primary" | "success" | "warning" | "danger" | "info";
|
||||||
render?: (row: IObject) => boolean;
|
render?: (row: IObject) => boolean;
|
||||||
options?: {
|
options?: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue