houzhongjian
2024-08-08 820397e43a0b64d35c6d31d2a55475061438593b
提交 | 用户 | 时间
820397 1 <template>
H 2   <ComponentContainerProperty v-model="formData.style">
3     <!-- 表单 -->
4     <el-form label-width="80px" :model="formData" class="m-t-8px">
5       <el-form-item label="上传图片" prop="imgUrl">
6         <UploadImg v-model="formData.imgUrl" height="50px" width="auto" class="min-w-80px">
7           <template #tip>
8             <el-text type="info" size="small"> 推荐宽度 750</el-text>
9           </template>
10         </UploadImg>
11       </el-form-item>
12     </el-form>
13
14     <el-button type="primary" plain class="w-full" @click="handleOpenEditDialog">
15       设置热区
16     </el-button>
17   </ComponentContainerProperty>
18   <!-- 热区编辑对话框 -->
19   <HotZoneEditDialog ref="editDialogRef" v-model="formData.list" :img-url="formData.imgUrl" />
20 </template>
21
22 <script setup lang="ts">
23 import { usePropertyForm } from '@/components/DiyEditor/util'
24 import { HotZoneProperty } from '@/components/DiyEditor/components/mobile/HotZone/config'
25 import HotZoneEditDialog from './components/HotZoneEditDialog/index.vue'
26
27 /** 热区属性面板 */
28 defineOptions({ name: 'HotZoneProperty' })
29
30 const props = defineProps<{ modelValue: HotZoneProperty }>()
31 const emit = defineEmits(['update:modelValue'])
32 const { formData } = usePropertyForm(props.modelValue, emit)
33
34 // 热区编辑对话框
35 const editDialogRef = ref()
36 // 打开热区编辑对话框
37 const handleOpenEditDialog = () => {
38   editDialogRef.value.open()
39 }
40 </script>
41
42 <style scoped lang="scss">
43 .hot-zone {
44   position: absolute;
45   background: #409effbf;
46   border: 1px solid var(--el-color-primary);
47   color: #fff;
48   font-size: 12px;
49   display: flex;
50   align-items: center;
51   justify-content: center;
52   cursor: move;
53
54   /* 控制点 */
55   .ctrl-dot {
56     position: absolute;
57     width: 4px;
58     height: 4px;
59     border-radius: 50%;
60     background-color: #fff;
61   }
62 }
63 </style>