hookehuyr

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

添加表单类型属性并根据类型控制点击遮罩是否关闭弹窗
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 v-model:show="visible" 3 v-model:show="visible"
4 position="bottom" 4 position="bottom"
5 :style="{ width: '100%', height: '90%' }" 5 :style="{ width: '100%', height: '90%' }"
6 - :close-on-click-overlay="false" 6 + :close-on-click-overlay="type === 'add' ? false : true"
7 :lock-scroll="true" 7 :lock-scroll="true"
8 :close-on-popstate="true" 8 :close-on-popstate="true"
9 @close="handleClose" 9 @close="handleClose"
...@@ -49,6 +49,10 @@ const props = defineProps({ ...@@ -49,6 +49,10 @@ const props = defineProps({
49 title: { 49 title: {
50 type: String, 50 type: String,
51 default: '个人信息录入' 51 default: '个人信息录入'
52 + },
53 + type: {
54 + type: String,
55 + default: 'add'
52 } 56 }
53 }) 57 })
54 58
......
...@@ -249,6 +249,7 @@ ...@@ -249,6 +249,7 @@
249 v-model:show="showInfoEntry" 249 v-model:show="showInfoEntry"
250 :iframe-src="iframeSrc" 250 :iframe-src="iframeSrc"
251 :title="iframeTitle" 251 :title="iframeTitle"
252 + :type="iframeType"
252 @data-received="handleInfoEntryComplete" 253 @data-received="handleInfoEntryComplete"
253 @close="handleInfoEntryClose" 254 @close="handleInfoEntryClose"
254 /> 255 />
...@@ -339,6 +340,7 @@ onMounted(async () => { ...@@ -339,6 +340,7 @@ onMounted(async () => {
339 // 设置弹窗标题 340 // 设置弹窗标题
340 iframeTitle.value = '个人信息录入' 341 iframeTitle.value = '个人信息录入'
341 iframeSrc.value = itemWithForm.form_url 342 iframeSrc.value = itemWithForm.form_url
343 + iframeType.value = 'add'
342 console.log('首次录入,显示个人信息录入弹窗') 344 console.log('首次录入,显示个人信息录入弹窗')
343 } else { 345 } else {
344 // 已录入过信息,从缓存中恢复数据并显示预览 346 // 已录入过信息,从缓存中恢复数据并显示预览
...@@ -357,6 +359,7 @@ onMounted(async () => { ...@@ -357,6 +359,7 @@ onMounted(async () => {
357 // 如果解析失败,重新录入 359 // 如果解析失败,重新录入
358 showInfoEntry.value = true 360 showInfoEntry.value = true
359 iframeSrc.value = itemWithForm.form_url 361 iframeSrc.value = itemWithForm.form_url
362 + iframeType.value = 'add'
360 } 363 }
361 } 364 }
362 } 365 }
...@@ -382,6 +385,8 @@ const orderComplete = ref(false) ...@@ -382,6 +385,8 @@ const orderComplete = ref(false)
382 const showInfoEntry = ref(false) 385 const showInfoEntry = ref(false)
383 // 个人信息录入弹窗的iframe地址 386 // 个人信息录入弹窗的iframe地址
384 const iframeSrc = ref(null) 387 const iframeSrc = ref(null)
388 +// 个人信息录入弹窗的类型
389 +const iframeType = ref('add')
385 // 个人信息录入弹窗的标题 390 // 个人信息录入弹窗的标题
386 const iframeTitle = ref('个人信息录入') 391 const iframeTitle = ref('个人信息录入')
387 // 个人信息录入弹窗的iframe地址 392 // 个人信息录入弹窗的iframe地址
...@@ -495,6 +500,8 @@ const handleEditInfo = () => { ...@@ -495,6 +500,8 @@ const handleEditInfo = () => {
495 500
496 // 设置iframe地址并显示弹窗 501 // 设置iframe地址并显示弹窗
497 iframeSrc.value = editUrl 502 iframeSrc.value = editUrl
503 + // 设置弹窗类型为编辑
504 + iframeType.value = 'edit'
498 // 设置弹窗标题 505 // 设置弹窗标题
499 iframeTitle.value = '编辑个人信息' 506 iframeTitle.value = '编辑个人信息'
500 showInfoEntry.value = true 507 showInfoEntry.value = true
......