From 7dd5e8d0fbb5b9a6b154178c8c0b376d2aad2d30 Mon Sep 17 00:00:00 2001 From: zhaojinfeng <121016171@qq.com> Date: Thu, 14 Dec 2023 16:11:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A0=E6=B3=95=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=BC=B9=E6=A1=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/select-transfer-modal/index.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/select-transfer-modal/index.vue b/packages/select-transfer-modal/index.vue index 2eec6db..6f47d61 100644 --- a/packages/select-transfer-modal/index.vue +++ b/packages/select-transfer-modal/index.vue @@ -2,7 +2,7 @@ * @Author: zhaojinfeng 121016171@qq.com * @Date: 2023-08-14 11:07:15 * @LastEditors: zhaojinfeng 121016171@qq.com - * @LastEditTime: 2023-09-06 20:03:04 + * @LastEditTime: 2023-12-14 16:08:04 * @FilePath: \vue3\packages\select-transfer-modal\index.vue * @Description: * @@ -99,6 +99,8 @@ const properties = withDefaults( request: (args: any) => Promise pageSizes?: number[] pagerCount?: number + /** 禁用按钮 */ + disabledButton?: boolean hideButton?: boolean hidePagination?: boolean title?: string @@ -191,26 +193,34 @@ async function getList() { } } function openDialog() { + if (properties.disabledButton) + return + if (properties.hideButton) emit('update:show', true) else showDialog.value = true } -function confirm() { - const selections = transferValue.map(key => properties.formattter(temp[key])) - emit('update:value', selections) - emit('confirm', selections, [...transferValue]) +function closeDialog() { if (properties.hideButton) emit('update:show', false) else showDialog.value = false } +function confirm() { + const selections = transferValue.map(key => properties.formattter(temp[key])) + emit('update:value', selections) + emit('confirm', selections, [...transferValue]) + closeDialog() +} + function closed() { queryRef?.resetFields() queryParams.pageNum = 1 currentKeyList = [] + closeDialog() } /** 重置按钮操作 */