diff --git a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/index.vue b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/index.vue index ee2b85a08..175f36866 100644 --- a/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/index.vue +++ b/apps/web-ele/src/views/mall/promotion/components/diy-editor/components/mobile/hot-zone/components/hot-zone-edit-dialog/index.vue @@ -6,9 +6,10 @@ import type { AppLink } from '#/views/mall/promotion/components/app-link-input/d import { ref } from 'vue'; +import { useVbenModal } from '@vben/common-ui'; import { IconifyIcon } from '@vben/icons'; -import { ElButton, ElDialog, ElImage } from 'element-plus'; +import { ElButton, ElImage } from 'element-plus'; import { AppLinkSelectDialog } from '#/views/mall/promotion/components'; @@ -40,14 +41,19 @@ const emit = defineEmits(['update:modelValue']); const formData = ref([]); -const dialogVisible = ref(false); // 弹窗的是否显示 +const [Modal, modalApi] = useVbenModal({ + onClosed() { + const list = zoomOut(formData.value); + emit('update:modelValue', list); + }, +}); /** 打开弹窗 */ -const open = () => { +function open() { // 放大 formData.value = zoomIn(props.modelValue); - dialogVisible.value = true; -}; + modalApi.open(); +} defineExpose({ open }); // 提供 open 方法,用于打开弹窗 @@ -156,16 +162,9 @@ const setHeight = (item: HotZoneItemProperty, height: number) => { } }; -/** 处理对话框关闭 */ +/** 处理对话框确定 */ const handleSubmit = () => { - dialogVisible.value = false; -}; - -/** 处理对话框关闭 */ -const handleClose = () => { - // 缩小 - const list = zoomOut(formData.value); - emit('update:modelValue', list); + modalApi.close(); }; const activeHotZone = ref(); @@ -186,12 +185,7 @@ const handleAppLinkChange = (appLink: AppLink) => { - +