Merge pull request #136 from cshaptx4869/patch-92
refactor(PageContent): ♻️ 默认工具栏支持自定义
This commit is contained in:
@@ -57,6 +57,7 @@
|
|||||||
<!-- 右侧工具栏 -->
|
<!-- 右侧工具栏 -->
|
||||||
<div>
|
<div>
|
||||||
<template v-for="item in defaultToolbar" :key="item">
|
<template v-for="item in defaultToolbar" :key="item">
|
||||||
|
<template v-if="typeof item === 'string'">
|
||||||
<!-- 刷新 -->
|
<!-- 刷新 -->
|
||||||
<template v-if="item === 'refresh'">
|
<template v-if="item === 'refresh'">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -104,6 +105,27 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 其他 -->
|
||||||
|
<template v-else-if="typeof item === 'object'">
|
||||||
|
<template v-if="item.auth">
|
||||||
|
<el-button
|
||||||
|
:icon="item.icon"
|
||||||
|
circle
|
||||||
|
:title="item.text"
|
||||||
|
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
|
||||||
|
@click="handleToolbar(item.name)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-button
|
||||||
|
:icon="item.icon"
|
||||||
|
circle
|
||||||
|
:title="item.title"
|
||||||
|
@click="handleToolbar(item.name)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
@@ -447,7 +469,18 @@ export interface IContentConfig<T = any> {
|
|||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
// 表格工具栏右侧图标
|
// 表格工具栏右侧图标
|
||||||
defaultToolbar?: ("refresh" | "filter" | "exports" | "search")[];
|
defaultToolbar?: Array<
|
||||||
|
| "refresh"
|
||||||
|
| "filter"
|
||||||
|
| "exports"
|
||||||
|
| "search"
|
||||||
|
| {
|
||||||
|
name: string;
|
||||||
|
icon: string;
|
||||||
|
title?: string;
|
||||||
|
auth?: string;
|
||||||
|
}
|
||||||
|
>;
|
||||||
// table组件列属性(额外的属性templet,operat,slotName)
|
// table组件列属性(额外的属性templet,operat,slotName)
|
||||||
cols: Array<{
|
cols: Array<{
|
||||||
type?: "default" | "selection" | "index" | "expand";
|
type?: "default" | "selection" | "index" | "expand";
|
||||||
|
|||||||
Reference in New Issue
Block a user