hookehuyr

feat(表单): 根据类型动态设置点击遮罩关闭行为

添加表单类型属性并根据类型控制点击遮罩是否关闭弹窗
......@@ -3,7 +3,7 @@
v-model:show="visible"
position="bottom"
:style="{ width: '100%', height: '90%' }"
:close-on-click-overlay="false"
:close-on-click-overlay="type === 'add' ? false : true"
:lock-scroll="true"
:close-on-popstate="true"
@close="handleClose"
......@@ -49,6 +49,10 @@ const props = defineProps({
title: {
type: String,
default: '个人信息录入'
},
type: {
type: String,
default: 'add'
}
})
......
......@@ -249,6 +249,7 @@
v-model:show="showInfoEntry"
:iframe-src="iframeSrc"
:title="iframeTitle"
:type="iframeType"
@data-received="handleInfoEntryComplete"
@close="handleInfoEntryClose"
/>
......@@ -339,6 +340,7 @@ onMounted(async () => {
// 设置弹窗标题
iframeTitle.value = '个人信息录入'
iframeSrc.value = itemWithForm.form_url
iframeType.value = 'add'
console.log('首次录入,显示个人信息录入弹窗')
} else {
// 已录入过信息,从缓存中恢复数据并显示预览
......@@ -357,6 +359,7 @@ onMounted(async () => {
// 如果解析失败,重新录入
showInfoEntry.value = true
iframeSrc.value = itemWithForm.form_url
iframeType.value = 'add'
}
}
}
......@@ -382,6 +385,8 @@ const orderComplete = ref(false)
const showInfoEntry = ref(false)
// 个人信息录入弹窗的iframe地址
const iframeSrc = ref(null)
// 个人信息录入弹窗的类型
const iframeType = ref('add')
// 个人信息录入弹窗的标题
const iframeTitle = ref('个人信息录入')
// 个人信息录入弹窗的iframe地址
......@@ -495,6 +500,8 @@ const handleEditInfo = () => {
// 设置iframe地址并显示弹窗
iframeSrc.value = editUrl
// 设置弹窗类型为编辑
iframeType.value = 'edit'
// 设置弹窗标题
iframeTitle.value = '编辑个人信息'
showInfoEntry.value = true
......