feat:【mall】diy editor 的 hot-zone 代码优化(80%)进一步使用 Modal
This commit is contained in:
@@ -48,8 +48,6 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({ open });
|
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
async function open(link: string) {
|
async function open(link: string) {
|
||||||
activeAppLink.value.path = link;
|
activeAppLink.value.path = link;
|
||||||
@@ -71,6 +69,8 @@ async function open(link: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({ open });
|
||||||
|
|
||||||
/** 处理 APP 链接选中 */
|
/** 处理 APP 链接选中 */
|
||||||
function handleAppLinkSelected(appLink: AppLink) {
|
function handleAppLinkSelected(appLink: AppLink) {
|
||||||
if (!isSameLink(appLink.path, activeAppLink.value.path)) {
|
if (!isSameLink(appLink.path, activeAppLink.value.path)) {
|
||||||
@@ -139,7 +139,7 @@ function scrollToGroupBtn(group: string) {
|
|||||||
|
|
||||||
/** 是否为相同的链接(不比较参数,只比较链接) */
|
/** 是否为相同的链接(不比较参数,只比较链接) */
|
||||||
function isSameLink(link1: string, link2: string) {
|
function isSameLink(link1: string, link2: string) {
|
||||||
return link2 ? link1.split('?')[0] === link2.split('?')[0] : false;
|
return link2 ? link1?.split('?')[0] === link2.split('?')[0] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理详情选择 */
|
/** 处理详情选择 */
|
||||||
@@ -166,7 +166,6 @@ function handleProductCategorySelected(id: number) {
|
|||||||
view-class="flex flex-col"
|
view-class="flex flex-col"
|
||||||
class="border-r border-gray-200 pr-2"
|
class="border-r border-gray-200 pr-2"
|
||||||
>
|
>
|
||||||
<!-- TODO @AI:文字左对齐 -->
|
|
||||||
<ElButton
|
<ElButton
|
||||||
v-for="(group, groupIndex) in APP_LINK_GROUP_LIST"
|
v-for="(group, groupIndex) in APP_LINK_GROUP_LIST"
|
||||||
:key="groupIndex"
|
:key="groupIndex"
|
||||||
@@ -220,7 +219,6 @@ function handleProductCategorySelected(id: number) {
|
|||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<!-- TODO @AI:这里要处理下; -->
|
|
||||||
<el-dialog v-model="detailSelectDialog.visible" title="" width="50%">
|
<el-dialog v-model="detailSelectDialog.visible" title="" width="50%">
|
||||||
<el-form class="min-h-[200px]">
|
<el-form class="min-h-[200px]">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
|||||||
@@ -42,9 +42,11 @@ const emit = defineEmits(['update:modelValue']);
|
|||||||
const formData = ref<HotZoneItemProperty[]>([]);
|
const formData = ref<HotZoneItemProperty[]>([]);
|
||||||
|
|
||||||
const [Modal, modalApi] = useVbenModal({
|
const [Modal, modalApi] = useVbenModal({
|
||||||
onClosed() {
|
showCancelButton: false,
|
||||||
|
onConfirm() {
|
||||||
const list = zoomOut(formData.value);
|
const list = zoomOut(formData.value);
|
||||||
emit('update:modelValue', list);
|
emit('update:modelValue', list);
|
||||||
|
modalApi.close();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -162,11 +164,6 @@ const setHeight = (item: HotZoneItemProperty, height: number) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 处理对话框确定 */
|
|
||||||
const handleSubmit = () => {
|
|
||||||
modalApi.close();
|
|
||||||
};
|
|
||||||
|
|
||||||
const activeHotZone = ref<HotZoneItemProperty>();
|
const activeHotZone = ref<HotZoneItemProperty>();
|
||||||
const appLinkDialogRef = ref();
|
const appLinkDialogRef = ref();
|
||||||
|
|
||||||
@@ -224,15 +221,11 @@ const handleAppLinkChange = (appLink: AppLink) => {
|
|||||||
></span>
|
></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #prepend-footer>
|
||||||
<ElButton @click="handleAdd" type="primary" plain>
|
<ElButton @click="handleAdd" type="primary" plain>
|
||||||
<IconifyIcon icon="ep:plus" class="mr-5px" />
|
<IconifyIcon icon="ep:plus" class="mr-5px" />
|
||||||
添加热区
|
添加热区
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton @click="handleSubmit" type="primary" plain>
|
|
||||||
<IconifyIcon icon="ep:check" class="mr-5px" />
|
|
||||||
确定
|
|
||||||
</ElButton>
|
|
||||||
</template>
|
</template>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user