From d759596679af29525e272a65c0d348fd2b0ad438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Wed, 11 Oct 2023 15:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=BB=84=E4=BB=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/XButton/src/ButtonBase.vue | 3 ++- src/utils/disposition/defaultButtons.ts | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/XButton/src/ButtonBase.vue b/src/components/XButton/src/ButtonBase.vue index 8158b8319..679340802 100644 --- a/src/components/XButton/src/ButtonBase.vue +++ b/src/components/XButton/src/ButtonBase.vue @@ -5,9 +5,10 @@ :type="item.type" :color="item.color" :link = "item.link ? item.link : false" + v-hasPermi="[item.hasPermi]" @click="buttonBaseClick(item.name,item,$event)" > - + {{ item.label }} diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index f49a80b7d..5bfaac741 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -13,7 +13,8 @@ export function defaultAddBtn(option:any) { hide: false, type: 'primary', icon: 'ep:plus', - color: '' + color: '', + hasPermi: '' }) } @@ -25,7 +26,8 @@ export function defaultImportBtn(option:any) { hide: false, type: 'warning', icon: 'ep:upload', - color: '' + color: '', + hasPermi: '' }) } @@ -37,7 +39,8 @@ export function defaultExportBtn(option:any) { hide: false, type: 'success', icon: 'ep:download', - color: '' + color: '', + hasPermi: '' }) } @@ -166,9 +169,10 @@ export function mainListEditBtn(option:any) { label: '编辑', name: 'edit', hide: false, - type: 'warning', + type: 'primary', color: '', link: true, // 文本展现按钮 + hasPermi: '' }) } @@ -181,6 +185,7 @@ export function mainListDeleteBtn(option:any) { type: 'danger', color: '', link: true, // 文本展现按钮 + hasPermi: '' }) } @@ -200,6 +205,7 @@ function __defaultBtnOption(option:any,specific:any){ color:option && option.color ? option.color : specific.color, hide:option && option.hide ? option.hide : specific.hide, link:option && option.link ? option.link : specific.link, + hasPermi:option && option.hasPermi ? option.hasPermi : specific.hasPermi, ...option } }