diff --git a/apps/web-ele/src/views/mall/promotion/components/app-link-input/select-dialog.vue b/apps/web-ele/src/views/mall/promotion/components/app-link-input/select-dialog.vue
index 7962dc165..818f8764b 100644
--- a/apps/web-ele/src/views/mall/promotion/components/app-link-input/select-dialog.vue
+++ b/apps/web-ele/src/views/mall/promotion/components/app-link-input/select-dialog.vue
@@ -5,9 +5,10 @@ import type { AppLink } from './data';
import { nextTick, ref } from 'vue';
+import { useVbenModal } from '@vben/common-ui';
import { getUrlNumberValue } from '@vben/utils';
-import { ElScrollbar } from 'element-plus';
+import { ElButton, ElScrollbar, ElTooltip } from 'element-plus';
import ProductCategorySelect from '#/views/mall/product/category/components/product-category-select.vue';
@@ -39,12 +40,20 @@ const detailSelectDialog = ref<{
type: undefined,
}); // 详情选择对话框
-const dialogVisible = ref(false);
+const [Modal, modalApi] = useVbenModal({
+ onConfirm() {
+ emit('change', activeAppLink.value.path);
+ emit('appLinkChange', activeAppLink.value);
+ modalApi.close();
+ },
+});
+
+defineExpose({ open });
/** 打开弹窗 */
-function open(link: string) {
+async function open(link: string) {
activeAppLink.value.path = link;
- dialogVisible.value = true;
+ modalApi.open();
// 滚动到当前的链接
const group = APP_LINK_GROUP_LIST.find((group) =>
group.links.some((linkItem) => {
@@ -56,14 +65,12 @@ function open(link: string) {
}),
);
if (group) {
- // TODO @AI:await 方式;
// 使用 nextTick 的原因:可能 Dom 还没生成,导致滚动失败
- nextTick(() => handleGroupSelected(group.name));
+ await nextTick();
+ handleGroupSelected(group.name);
}
}
-defineExpose({ open });
-
/** 处理 APP 链接选中 */
function handleAppLinkSelected(appLink: AppLink) {
if (!isSameLink(appLink.path, activeAppLink.value.path)) {
@@ -87,12 +94,6 @@ function handleAppLinkSelected(appLink: AppLink) {
}
}
-function handleSubmit() {
- dialogVisible.value = false;
- emit('change', activeAppLink.value.path);
- emit('appLinkChange', activeAppLink.value);
-}
-
/**
* 处理右侧链接列表滚动
*
@@ -156,15 +157,17 @@ function handleProductCategorySelected(id: number) {
}
-
+
-
+
{{ group.name }}
-
+
-
{{ group.name }}
+
+ {{ group.name }}
+
-
-
{{ appLink.name }}
-
-
+
+
-
-
- 确 定
- 取 消
-
-
+
+
-