fix: 无法重新打开弹框的问题

This commit is contained in:
2023-12-14 16:11:28 +08:00
parent 463682522e
commit 7dd5e8d0fb

View File

@ -2,7 +2,7 @@
* @Author: zhaojinfeng 121016171@qq.com * @Author: zhaojinfeng 121016171@qq.com
* @Date: 2023-08-14 11:07:15 * @Date: 2023-08-14 11:07:15
* @LastEditors: zhaojinfeng 121016171@qq.com * @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 * @FilePath: \vue3\packages\select-transfer-modal\index.vue
* @Description: * @Description:
* *
@ -99,6 +99,8 @@ const properties = withDefaults(
request: (args: any) => Promise<Page> request: (args: any) => Promise<Page>
pageSizes?: number[] pageSizes?: number[]
pagerCount?: number pagerCount?: number
/** 禁用按钮 */
disabledButton?: boolean
hideButton?: boolean hideButton?: boolean
hidePagination?: boolean hidePagination?: boolean
title?: string title?: string
@ -191,26 +193,34 @@ async function getList() {
} }
} }
function openDialog() { function openDialog() {
if (properties.disabledButton)
return
if (properties.hideButton) if (properties.hideButton)
emit('update:show', true) emit('update:show', true)
else else
showDialog.value = true showDialog.value = true
} }
function confirm() { function closeDialog() {
const selections = transferValue.map(key => properties.formattter(temp[key]))
emit('update:value', selections)
emit('confirm', selections, [...transferValue])
if (properties.hideButton) if (properties.hideButton)
emit('update:show', false) emit('update:show', false)
else else
showDialog.value = false 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() { function closed() {
queryRef?.resetFields() queryRef?.resetFields()
queryParams.pageNum = 1 queryParams.pageNum = 1
currentKeyList = [] currentKeyList = []
closeDialog()
} }
/** 重置按钮操作 */ /** 重置按钮操作 */