Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ae0cc94d
authored
Jan 18, 2025
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】MALL: usePropertyForm 替换为 useVModel 实现 modelValue 代理
parent
48e7e7e5
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
71 additions
and
92 deletions
+71
-92
src/components/DiyEditor/components/ComponentContainerProperty.vue
+3
-2
src/components/DiyEditor/components/mobile/Carousel/property.vue
+2
-2
src/components/DiyEditor/components/mobile/CouponCard/property.vue
+2
-2
src/components/DiyEditor/components/mobile/Divider/property.vue
+2
-2
src/components/DiyEditor/components/mobile/FloatingActionButton/property.vue
+2
-2
src/components/DiyEditor/components/mobile/HotZone/property.vue
+2
-2
src/components/DiyEditor/components/mobile/ImageBar/property.vue
+2
-2
src/components/DiyEditor/components/mobile/MagicCube/property.vue
+2
-2
src/components/DiyEditor/components/mobile/MenuGrid/property.vue
+2
-2
src/components/DiyEditor/components/mobile/MenuList/property.vue
+2
-2
src/components/DiyEditor/components/mobile/MenuSwiper/property.vue
+2
-2
src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue
+1
-1
src/components/DiyEditor/components/mobile/NavigationBar/property.vue
+2
-2
src/components/DiyEditor/components/mobile/NoticeBar/property.vue
+2
-2
src/components/DiyEditor/components/mobile/PageConfig/property.vue
+2
-2
src/components/DiyEditor/components/mobile/Popover/property.vue
+2
-2
src/components/DiyEditor/components/mobile/ProductCard/property.vue
+2
-2
src/components/DiyEditor/components/mobile/ProductList/property.vue
+2
-2
src/components/DiyEditor/components/mobile/PromotionArticle/property.vue
+2
-2
src/components/DiyEditor/components/mobile/PromotionCombination/property.vue
+2
-2
src/components/DiyEditor/components/mobile/PromotionPoint/property.vue
+2
-2
src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue
+2
-2
src/components/DiyEditor/components/mobile/SearchBar/property.vue
+2
-2
src/components/DiyEditor/components/mobile/TabBar/property.vue
+2
-2
src/components/DiyEditor/components/mobile/TitleBar/property.vue
+2
-2
src/components/DiyEditor/components/mobile/UserCard/property.vue
+2
-2
src/components/DiyEditor/components/mobile/UserCoupon/property.vue
+2
-2
src/components/DiyEditor/components/mobile/UserOrder/property.vue
+2
-2
src/components/DiyEditor/components/mobile/UserWallet/property.vue
+2
-2
src/components/DiyEditor/components/mobile/VideoPlayer/property.vue
+2
-2
src/components/DiyEditor/util.ts
+0
-29
src/components/Draggable/index.vue
+11
-4
No files found.
src/components/DiyEditor/components/ComponentContainerProperty.vue
View file @
ae0cc94d
...
@@ -51,7 +51,8 @@
...
@@ -51,7 +51,8 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ComponentStyle
,
usePropertyForm
}
from
'@/components/DiyEditor/util'
import
{
ComponentStyle
}
from
'@/components/DiyEditor/util'
import
{
useVModel
}
from
'@vueuse/core'
/**
/**
* 组件容器属性:目前右边部分
* 组件容器属性:目前右边部分
...
@@ -61,7 +62,7 @@ defineOptions({ name: 'ComponentContainer' })
...
@@ -61,7 +62,7 @@ defineOptions({ name: 'ComponentContainer' })
const
props
=
defineProps
<
{
modelValue
:
ComponentStyle
}
>
()
const
props
=
defineProps
<
{
modelValue
:
ComponentStyle
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
const
treeData
=
[
const
treeData
=
[
{
{
...
...
src/components/DiyEditor/components/mobile/Carousel/property.vue
View file @
ae0cc94d
...
@@ -93,14 +93,14 @@
...
@@ -93,14 +93,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
CarouselProperty
}
from
'./config'
import
{
CarouselProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 轮播图属性面板
// 轮播图属性面板
defineOptions
({
name
:
'CarouselProperty'
})
defineOptions
({
name
:
'CarouselProperty'
})
const
props
=
defineProps
<
{
modelValue
:
CarouselProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
CarouselProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/CouponCard/property.vue
View file @
ae0cc94d
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
CouponCardProperty
}
from
'./config'
import
{
CouponCardProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
*
as
CouponTemplateApi
from
'@/api/mall/promotion/coupon/couponTemplate'
import
*
as
CouponTemplateApi
from
'@/api/mall/promotion/coupon/couponTemplate'
import
{
floatToFixed2
}
from
'@/utils'
import
{
floatToFixed2
}
from
'@/utils'
import
{
PromotionDiscountTypeEnum
}
from
'@/utils/constants'
import
{
PromotionDiscountTypeEnum
}
from
'@/utils/constants'
...
@@ -84,7 +84,7 @@ defineOptions({ name: 'CouponCardProperty' })
...
@@ -84,7 +84,7 @@ defineOptions({ name: 'CouponCardProperty' })
const
props
=
defineProps
<
{
modelValue
:
CouponCardProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
CouponCardProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 优惠券列表
// 优惠券列表
const
couponList
=
ref
<
CouponTemplateApi
.
CouponTemplateVO
[]
>
([])
const
couponList
=
ref
<
CouponTemplateApi
.
CouponTemplateVO
[]
>
([])
...
...
src/components/DiyEditor/components/mobile/Divider/property.vue
View file @
ae0cc94d
...
@@ -45,12 +45,12 @@
...
@@ -45,12 +45,12 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
DividerProperty
}
from
'./config'
import
{
DividerProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 导航栏属性面板
// 导航栏属性面板
defineOptions
({
name
:
'DividerProperty'
})
defineOptions
({
name
:
'DividerProperty'
})
const
props
=
defineProps
<
{
modelValue
:
DividerProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
DividerProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
//线类型
//线类型
const
BORDER_TYPES
=
[
const
BORDER_TYPES
=
[
...
...
src/components/DiyEditor/components/mobile/FloatingActionButton/property.vue
View file @
ae0cc94d
...
@@ -31,14 +31,14 @@
...
@@ -31,14 +31,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
FloatingActionButtonProperty
}
from
'./config'
import
{
FloatingActionButtonProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 悬浮按钮属性面板
// 悬浮按钮属性面板
defineOptions
({
name
:
'FloatingActionButtonProperty'
})
defineOptions
({
name
:
'FloatingActionButtonProperty'
})
const
props
=
defineProps
<
{
modelValue
:
FloatingActionButtonProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
FloatingActionButtonProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/HotZone/property.vue
View file @
ae0cc94d
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
{
HotZoneProperty
}
from
'@/components/DiyEditor/components/mobile/HotZone/config'
import
{
HotZoneProperty
}
from
'@/components/DiyEditor/components/mobile/HotZone/config'
import
HotZoneEditDialog
from
'./components/HotZoneEditDialog/index.vue'
import
HotZoneEditDialog
from
'./components/HotZoneEditDialog/index.vue'
...
@@ -29,7 +29,7 @@ defineOptions({ name: 'HotZoneProperty' })
...
@@ -29,7 +29,7 @@ defineOptions({ name: 'HotZoneProperty' })
const
props
=
defineProps
<
{
modelValue
:
HotZoneProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
HotZoneProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 热区编辑对话框
// 热区编辑对话框
const
editDialogRef
=
ref
()
const
editDialogRef
=
ref
()
...
...
src/components/DiyEditor/components/mobile/ImageBar/property.vue
View file @
ae0cc94d
...
@@ -21,14 +21,14 @@
...
@@ -21,14 +21,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ImageBarProperty
}
from
'./config'
import
{
ImageBarProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 图片展示属性面板
// 图片展示属性面板
defineOptions
({
name
:
'ImageBarProperty'
})
defineOptions
({
name
:
'ImageBarProperty'
})
const
props
=
defineProps
<
{
modelValue
:
ImageBarProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
ImageBarProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/MagicCube/property.vue
View file @
ae0cc94d
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
{
MagicCubeProperty
}
from
'@/components/DiyEditor/components/mobile/MagicCube/config'
import
{
MagicCubeProperty
}
from
'@/components/DiyEditor/components/mobile/MagicCube/config'
/** 广告魔方属性面板 */
/** 广告魔方属性面板 */
...
@@ -64,7 +64,7 @@ defineOptions({ name: 'MagicCubeProperty' })
...
@@ -64,7 +64,7 @@ defineOptions({ name: 'MagicCubeProperty' })
const
props
=
defineProps
<
{
modelValue
:
MagicCubeProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
MagicCubeProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 选中的热区
// 选中的热区
const
selectedHotAreaIndex
=
ref
(
-
1
)
const
selectedHotAreaIndex
=
ref
(
-
1
)
...
...
src/components/DiyEditor/components/mobile/MenuGrid/property.vue
View file @
ae0cc94d
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
{
import
{
EMPTY_MENU_GRID_ITEM_PROPERTY
,
EMPTY_MENU_GRID_ITEM_PROPERTY
,
MenuGridProperty
MenuGridProperty
...
@@ -59,7 +59,7 @@ defineOptions({ name: 'MenuGridProperty' })
...
@@ -59,7 +59,7 @@ defineOptions({ name: 'MenuGridProperty' })
const
props
=
defineProps
<
{
modelValue
:
MenuGridProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
MenuGridProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/MenuList/property.vue
View file @
ae0cc94d
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
{
import
{
EMPTY_MENU_LIST_ITEM_PROPERTY
,
EMPTY_MENU_LIST_ITEM_PROPERTY
,
MenuListProperty
MenuListProperty
...
@@ -39,7 +39,7 @@ defineOptions({ name: 'MenuListProperty' })
...
@@ -39,7 +39,7 @@ defineOptions({ name: 'MenuListProperty' })
const
props
=
defineProps
<
{
modelValue
:
MenuListProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
MenuListProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/MenuSwiper/property.vue
View file @
ae0cc94d
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
{
import
{
EMPTY_MENU_SWIPER_ITEM_PROPERTY
,
EMPTY_MENU_SWIPER_ITEM_PROPERTY
,
MenuSwiperProperty
MenuSwiperProperty
...
@@ -70,7 +70,7 @@ defineOptions({ name: 'MenuSwiperProperty' })
...
@@ -70,7 +70,7 @@ defineOptions({ name: 'MenuSwiperProperty' })
const
props
=
defineProps
<
{
modelValue
:
MenuSwiperProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
MenuSwiperProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue
View file @
ae0cc94d
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
NavigationBarCellProperty
}
from
'../config'
import
{
NavigationBarCellProperty
}
from
'../config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 导航栏属性面板
// 导航栏属性面板
defineOptions
({
name
:
'NavigationBarCellProperty'
})
defineOptions
({
name
:
'NavigationBarCellProperty'
})
...
...
src/components/DiyEditor/components/mobile/NavigationBar/property.vue
View file @
ae0cc94d
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
NavigationBarProperty
}
from
'./config'
import
{
NavigationBarProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
NavigationBarCellProperty
from
'@/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue'
import
NavigationBarCellProperty
from
'@/components/DiyEditor/components/mobile/NavigationBar/components/CellProperty.vue'
// 导航栏属性面板
// 导航栏属性面板
defineOptions
({
name
:
'NavigationBarProperty'
})
defineOptions
({
name
:
'NavigationBarProperty'
})
...
@@ -77,7 +77,7 @@ const rules = {
...
@@ -77,7 +77,7 @@ const rules = {
const
props
=
defineProps
<
{
modelValue
:
NavigationBarProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
NavigationBarProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
if
(
!
formData
.
value
.
_local
)
{
if
(
!
formData
.
value
.
_local
)
{
formData
.
value
.
_local
=
{
previewMp
:
true
,
previewOther
:
false
}
formData
.
value
.
_local
=
{
previewMp
:
true
,
previewOther
:
false
}
}
}
...
...
src/components/DiyEditor/components/mobile/NoticeBar/property.vue
View file @
ae0cc94d
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
NoticeBarProperty
}
from
'./config'
import
{
NoticeBarProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 通知栏属性面板
// 通知栏属性面板
defineOptions
({
name
:
'NoticeBarProperty'
})
defineOptions
({
name
:
'NoticeBarProperty'
})
// 表单校验
// 表单校验
...
@@ -40,7 +40,7 @@ const rules = {
...
@@ -40,7 +40,7 @@ const rules = {
const
props
=
defineProps
<
{
modelValue
:
NoticeBarProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
NoticeBarProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/PageConfig/property.vue
View file @
ae0cc94d
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
PageConfigProperty
}
from
'./config'
import
{
PageConfigProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 导航栏属性面板
// 导航栏属性面板
defineOptions
({
name
:
'PageConfigProperty'
})
defineOptions
({
name
:
'PageConfigProperty'
})
// 表单校验
// 表单校验
...
@@ -28,7 +28,7 @@ const rules = {}
...
@@ -28,7 +28,7 @@ const rules = {}
const
props
=
defineProps
<
{
modelValue
:
PageConfigProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
PageConfigProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/Popover/property.vue
View file @
ae0cc94d
...
@@ -25,14 +25,14 @@
...
@@ -25,14 +25,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
PopoverProperty
}
from
'./config'
import
{
PopoverProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 弹窗广告属性面板
// 弹窗广告属性面板
defineOptions
({
name
:
'PopoverProperty'
})
defineOptions
({
name
:
'PopoverProperty'
})
const
props
=
defineProps
<
{
modelValue
:
PopoverProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
PopoverProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/ProductCard/property.vue
View file @
ae0cc94d
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ProductCardProperty
}
from
'./config'
import
{
ProductCardProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
SpuShowcase
from
'@/views/mall/product/spu/components/SpuShowcase.vue'
import
SpuShowcase
from
'@/views/mall/product/spu/components/SpuShowcase.vue'
// 商品卡片属性面板
// 商品卡片属性面板
...
@@ -143,7 +143,7 @@ defineOptions({ name: 'ProductCardProperty' })
...
@@ -143,7 +143,7 @@ defineOptions({ name: 'ProductCardProperty' })
const
props
=
defineProps
<
{
modelValue
:
ProductCardProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
ProductCardProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/ProductList/property.vue
View file @
ae0cc94d
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ProductListProperty
}
from
'./config'
import
{
ProductListProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
SpuShowcase
from
'@/views/mall/product/spu/components/SpuShowcase.vue'
import
SpuShowcase
from
'@/views/mall/product/spu/components/SpuShowcase.vue'
// 商品栏属性面板
// 商品栏属性面板
...
@@ -93,7 +93,7 @@ defineOptions({ name: 'ProductListProperty' })
...
@@ -93,7 +93,7 @@ defineOptions({ name: 'ProductListProperty' })
const
props
=
defineProps
<
{
modelValue
:
ProductListProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
ProductListProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/PromotionArticle/property.vue
View file @
ae0cc94d
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
PromotionArticleProperty
}
from
'./config'
import
{
PromotionArticleProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
*
as
ArticleApi
from
'@/api/mall/promotion/article/index'
import
*
as
ArticleApi
from
'@/api/mall/promotion/article/index'
// 营销文章属性面板
// 营销文章属性面板
...
@@ -33,7 +33,7 @@ defineOptions({ name: 'PromotionArticleProperty' })
...
@@ -33,7 +33,7 @@ defineOptions({ name: 'PromotionArticleProperty' })
const
props
=
defineProps
<
{
modelValue
:
PromotionArticleProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
PromotionArticleProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 文章列表
// 文章列表
const
articles
=
ref
<
ArticleApi
.
ArticleVO
>
([])
const
articles
=
ref
<
ArticleApi
.
ArticleVO
>
([])
...
...
src/components/DiyEditor/components/mobile/PromotionCombination/property.vue
View file @
ae0cc94d
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
PromotionCombinationProperty
}
from
'./config'
import
{
PromotionCombinationProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
*
as
CombinationActivityApi
from
'@/api/mall/promotion/combination/combinationActivity'
import
*
as
CombinationActivityApi
from
'@/api/mall/promotion/combination/combinationActivity'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
CombinationShowcase
from
'@/views/mall/promotion/combination/components/CombinationShowcase.vue'
import
CombinationShowcase
from
'@/views/mall/promotion/combination/components/CombinationShowcase.vue'
...
@@ -150,7 +150,7 @@ defineOptions({ name: 'PromotionCombinationProperty' })
...
@@ -150,7 +150,7 @@ defineOptions({ name: 'PromotionCombinationProperty' })
const
props
=
defineProps
<
{
modelValue
:
PromotionCombinationProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
PromotionCombinationProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 活动列表
// 活动列表
const
activityList
=
ref
<
CombinationActivityApi
.
CombinationActivityVO
[]
>
([])
const
activityList
=
ref
<
CombinationActivityApi
.
CombinationActivityVO
[]
>
([])
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
...
...
src/components/DiyEditor/components/mobile/PromotionPoint/property.vue
View file @
ae0cc94d
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
PromotionPointProperty
}
from
'./config'
import
{
PromotionPointProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
PointShowcase
from
'@/views/mall/promotion/point/components/PointShowcase.vue'
import
PointShowcase
from
'@/views/mall/promotion/point/components/PointShowcase.vue'
// 秒杀属性面板
// 秒杀属性面板
...
@@ -148,7 +148,7 @@ defineOptions({ name: 'PromotionPointProperty' })
...
@@ -148,7 +148,7 @@ defineOptions({ name: 'PromotionPointProperty' })
const
props
=
defineProps
<
{
modelValue
:
PromotionPointProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
PromotionPointProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
<
style
lang=
"scss"
scoped
></
style
>
src/components/DiyEditor/components/mobile/PromotionSeckill/property.vue
View file @
ae0cc94d
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
PromotionSeckillProperty
}
from
'./config'
import
{
PromotionSeckillProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
*
as
SeckillActivityApi
from
'@/api/mall/promotion/seckill/seckillActivity'
import
*
as
SeckillActivityApi
from
'@/api/mall/promotion/seckill/seckillActivity'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
{
CommonStatusEnum
}
from
'@/utils/constants'
import
SeckillShowcase
from
'@/views/mall/promotion/seckill/components/SeckillShowcase.vue'
import
SeckillShowcase
from
'@/views/mall/promotion/seckill/components/SeckillShowcase.vue'
...
@@ -150,7 +150,7 @@ defineOptions({ name: 'PromotionSeckillProperty' })
...
@@ -150,7 +150,7 @@ defineOptions({ name: 'PromotionSeckillProperty' })
const
props
=
defineProps
<
{
modelValue
:
PromotionSeckillProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
PromotionSeckillProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 活动列表
// 活动列表
const
activityList
=
ref
<
SeckillActivityApi
.
SeckillActivityVO
[]
>
([])
const
activityList
=
ref
<
SeckillActivityApi
.
SeckillActivityVO
[]
>
([])
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
...
...
src/components/DiyEditor/components/mobile/SearchBar/property.vue
View file @
ae0cc94d
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
{
SearchProperty
}
from
'@/components/DiyEditor/components/mobile/SearchBar/config'
import
{
SearchProperty
}
from
'@/components/DiyEditor/components/mobile/SearchBar/config'
/** 搜索框属性面板 */
/** 搜索框属性面板 */
...
@@ -67,7 +67,7 @@ defineOptions({ name: 'SearchProperty' })
...
@@ -67,7 +67,7 @@ defineOptions({ name: 'SearchProperty' })
const
props
=
defineProps
<
{
modelValue
:
SearchProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
SearchProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/TabBar/property.vue
View file @
ae0cc94d
...
@@ -80,13 +80,13 @@
...
@@ -80,13 +80,13 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
TabBarProperty
,
component
,
THEME_LIST
}
from
'./config'
import
{
TabBarProperty
,
component
,
THEME_LIST
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 底部导航栏
// 底部导航栏
defineOptions
({
name
:
'TabBarProperty'
})
defineOptions
({
name
:
'TabBarProperty'
})
const
props
=
defineProps
<
{
modelValue
:
TabBarProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
TabBarProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 将数据库的值更新到右侧属性栏
// 将数据库的值更新到右侧属性栏
component
.
property
.
items
=
formData
.
value
.
items
component
.
property
.
items
=
formData
.
value
.
items
...
...
src/components/DiyEditor/components/mobile/TitleBar/property.vue
View file @
ae0cc94d
...
@@ -101,13 +101,13 @@
...
@@ -101,13 +101,13 @@
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
TitleBarProperty
}
from
'./config'
import
{
TitleBarProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 导航栏属性面板
// 导航栏属性面板
defineOptions
({
name
:
'TitleBarProperty'
})
defineOptions
({
name
:
'TitleBarProperty'
})
const
props
=
defineProps
<
{
modelValue
:
TitleBarProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
TitleBarProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 表单校验
// 表单校验
const
rules
=
{}
const
rules
=
{}
...
...
src/components/DiyEditor/components/mobile/UserCard/property.vue
View file @
ae0cc94d
...
@@ -4,14 +4,14 @@
...
@@ -4,14 +4,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
UserCardProperty
}
from
'./config'
import
{
UserCardProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 用户卡片属性面板
// 用户卡片属性面板
defineOptions
({
name
:
'UserCardProperty'
})
defineOptions
({
name
:
'UserCardProperty'
})
const
props
=
defineProps
<
{
modelValue
:
UserCardProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
UserCardProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/UserCoupon/property.vue
View file @
ae0cc94d
...
@@ -4,14 +4,14 @@
...
@@ -4,14 +4,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
UserCouponProperty
}
from
'./config'
import
{
UserCouponProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 用户卡券属性面板
// 用户卡券属性面板
defineOptions
({
name
:
'UserCouponProperty'
})
defineOptions
({
name
:
'UserCouponProperty'
})
const
props
=
defineProps
<
{
modelValue
:
UserCouponProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
UserCouponProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/UserOrder/property.vue
View file @
ae0cc94d
...
@@ -4,14 +4,14 @@
...
@@ -4,14 +4,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
UserOrderProperty
}
from
'./config'
import
{
UserOrderProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 用户订单属性面板
// 用户订单属性面板
defineOptions
({
name
:
'UserOrderProperty'
})
defineOptions
({
name
:
'UserOrderProperty'
})
const
props
=
defineProps
<
{
modelValue
:
UserOrderProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
UserOrderProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/UserWallet/property.vue
View file @
ae0cc94d
...
@@ -4,14 +4,14 @@
...
@@ -4,14 +4,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
UserWalletProperty
}
from
'./config'
import
{
UserWalletProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 用户资产属性面板
// 用户资产属性面板
defineOptions
({
name
:
'UserWalletProperty'
})
defineOptions
({
name
:
'UserWalletProperty'
})
const
props
=
defineProps
<
{
modelValue
:
UserWalletProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
UserWalletProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/components/mobile/VideoPlayer/property.vue
View file @
ae0cc94d
...
@@ -42,14 +42,14 @@
...
@@ -42,14 +42,14 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
VideoPlayerProperty
}
from
'./config'
import
{
VideoPlayerProperty
}
from
'./config'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
// 视频播放属性面板
// 视频播放属性面板
defineOptions
({
name
:
'VideoPlayerProperty'
})
defineOptions
({
name
:
'VideoPlayerProperty'
})
const
props
=
defineProps
<
{
modelValue
:
VideoPlayerProperty
}
>
()
const
props
=
defineProps
<
{
modelValue
:
VideoPlayerProperty
}
>
()
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
<
style
scoped
lang=
"scss"
></
style
>
src/components/DiyEditor/util.ts
View file @
ae0cc94d
import
{
ref
,
Ref
}
from
'vue'
import
{
PageConfigProperty
}
from
'@/components/DiyEditor/components/mobile/PageConfig/config'
import
{
PageConfigProperty
}
from
'@/components/DiyEditor/components/mobile/PageConfig/config'
import
{
NavigationBarProperty
}
from
'@/components/DiyEditor/components/mobile/NavigationBar/config'
import
{
NavigationBarProperty
}
from
'@/components/DiyEditor/components/mobile/NavigationBar/config'
import
{
TabBarProperty
}
from
'@/components/DiyEditor/components/mobile/TabBar/config'
import
{
TabBarProperty
}
from
'@/components/DiyEditor/components/mobile/TabBar/config'
...
@@ -78,34 +77,6 @@ export interface PageConfig {
...
@@ -78,34 +77,6 @@ export interface PageConfig {
// 页面组件,只保留组件ID,组件属性
// 页面组件,只保留组件ID,组件属性
export
interface
PageComponent
extends
Pick
<
DiyComponent
<
any
>
,
'id'
|
'property'
>
{}
export
interface
PageComponent
extends
Pick
<
DiyComponent
<
any
>
,
'id'
|
'property'
>
{}
// 属性表单监听
export
function
usePropertyForm
<
T
>
(
modelValue
:
T
,
emit
:
Function
):
{
formData
:
Ref
<
T
>
}
{
const
formData
=
ref
<
T
>
()
// 监听属性数据变动
watch
(
()
=>
modelValue
,
()
=>
{
formData
.
value
=
modelValue
},
{
deep
:
true
,
immediate
:
true
}
)
// 监听表单数据变动
watch
(
()
=>
formData
.
value
,
()
=>
{
emit
(
'update:modelValue'
,
formData
.
value
)
},
{
deep
:
true
}
)
return
{
formData
}
as
{
formData
:
Ref
<
T
>
}
}
// 页面组件库
// 页面组件库
export
const
PAGE_LIBS
=
[
export
const
PAGE_LIBS
=
[
{
{
...
...
src/components/Draggable/index.vue
View file @
ae0cc94d
...
@@ -13,9 +13,16 @@
...
@@ -13,9 +13,16 @@
class=
"mb-4px flex flex-col gap-4px border border-gray-2 border-rounded rounded border-solid p-8px"
class=
"mb-4px flex flex-col gap-4px border border-gray-2 border-rounded rounded border-solid p-8px"
>
>
<!-- 操作按钮区 -->
<!-- 操作按钮区 -->
<div
class=
"m--8px m-b-4px flex flex-row items-center justify-between p-8px"
style=
"background-color: var(--app-content-bg-color);"
>
<div
class=
"m--8px m-b-4px flex flex-row items-center justify-between p-8px"
style=
"background-color: var(--app-content-bg-color)"
>
<el-tooltip
content=
"拖动排序"
>
<el-tooltip
content=
"拖动排序"
>
<Icon
icon=
"ic:round-drag-indicator"
class=
"drag-icon cursor-move"
style=
"color: #8a909c;"
/>
<Icon
icon=
"ic:round-drag-indicator"
class=
"drag-icon cursor-move"
style=
"color: #8a909c"
/>
</el-tooltip>
</el-tooltip>
<el-tooltip
content=
"删除"
>
<el-tooltip
content=
"删除"
>
<Icon
<Icon
...
@@ -47,7 +54,7 @@
...
@@ -47,7 +54,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
// 拖拽组件
// 拖拽组件
import
VueDraggable
from
'vuedraggable'
import
VueDraggable
from
'vuedraggable'
import
{
use
PropertyForm
}
from
'@/components/DiyEditor/util
'
import
{
use
VModel
}
from
'@vueuse/core
'
import
{
any
,
array
}
from
'vue-types'
import
{
any
,
array
}
from
'vue-types'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
cloneDeep
}
from
'lodash-es'
import
{
cloneDeep
}
from
'lodash-es'
...
@@ -66,7 +73,7 @@ const props = defineProps({
...
@@ -66,7 +73,7 @@ const props = defineProps({
})
})
// 定义事件
// 定义事件
const
emit
=
defineEmits
([
'update:modelValue'
])
const
emit
=
defineEmits
([
'update:modelValue'
])
const
{
formData
}
=
usePropertyForm
(
props
.
modelValue
,
emit
)
const
formData
=
useVModel
(
props
,
'modelValue'
,
emit
)
// 处理添加
// 处理添加
const
handleAdd
=
()
=>
formData
.
value
.
push
(
cloneDeep
(
props
.
emptyItem
||
{}))
const
handleAdd
=
()
=>
formData
.
value
.
push
(
cloneDeep
(
props
.
emptyItem
||
{}))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment