fix(管理端): 修复单图组件热区弹窗无法打开,无图时提示先上传图片

This commit is contained in:
From-wh 2026-10-23 11:28:25 +08:00 committed by 吴昊天
parent 4bec49c6c2
commit 53bdad2339
2 changed files with 8 additions and 1 deletions

View File

@ -285,6 +285,8 @@ function linkUrl(e) {
// 将链接地址存储到对应的数据项中
areaData.value[itemIndex.value].link = e;
}
// script setup 默认封闭,父组件通过模板 ref 驱动 dialogVisible,必须显式暴露
defineExpose({ dialogVisible });
</script>
<style lang="scss" scoped>

View File

@ -42,6 +42,7 @@
<script setup>
import { ref, watch, onMounted, nextTick } from 'vue';
import { ElMessage } from 'element-plus';
import uploadPictures from '@/components/uploadPictures';
import OperationFloorModal from '@diy/components/hotpotModal';
@ -111,7 +112,11 @@ function getPic(pc) {
}
function openFloorModal() {
// 如果配置数据中有url,则显示热点图对话框
if (configData.value.url) hotpot.value.dialogVisible = true;
if (!configData.value.url) {
ElMessage.warning('请先上传图片');
return;
}
hotpot.value.dialogVisible = true;
}
/**
* 处理区域数据