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
Unverified
Commit
fdfb028d
authored
Jan 13, 2024
by
芋道源码
Committed by
Gitee
Jan 13, 2024
Browse files
Options
Browse Files
Download
Plain Diff
!360 Review代码修改
Merge pull request !360 from 疯狂的世界/dev
parents
a77658b3
2b8eb49f
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
42 additions
and
60 deletions
+42
-60
src/api/mall/promotion/diy/page.ts
+1
-1
src/api/mall/promotion/diy/template.ts
+1
-1
src/components/DiyEditor/components/ComponentContainerProperty.vue
+2
-2
src/components/DiyEditor/components/mobile/CouponCard/component.tsx
+4
-10
src/components/DiyEditor/components/mobile/CouponCard/config.ts
+0
-1
src/components/DiyEditor/components/mobile/MagicCube/config.ts
+0
-1
src/components/DiyEditor/components/mobile/ProductCard/config.ts
+0
-1
src/components/DiyEditor/components/mobile/ProductList/config.ts
+0
-1
src/components/DiyEditor/components/mobile/PromotionArticle/index.vue
+2
-3
src/components/DiyEditor/components/mobile/PromotionCombination/config.ts
+0
-2
src/components/DiyEditor/components/mobile/SearchBar/config.ts
+0
-1
src/components/DiyEditor/components/mobile/VideoPlayer/config.ts
+1
-2
src/components/DiyEditor/components/mobile/VideoPlayer/property.vue
+2
-2
src/components/DiyEditor/util.ts
+3
-4
src/router/modules/remaining.ts
+2
-4
src/views/mall/promotion/diy/page/DiyPageForm.vue
+8
-8
src/views/mall/promotion/diy/page/decorate.vue
+1
-1
src/views/mall/promotion/diy/page/index.vue
+3
-3
src/views/mall/promotion/diy/template/DiyTemplateForm.vue
+8
-8
src/views/mall/promotion/diy/template/decorate.vue
+1
-1
src/views/mall/promotion/diy/template/index.vue
+3
-3
No files found.
src/api/mall/promotion/diy/page.ts
View file @
fdfb028d
...
@@ -5,7 +5,7 @@ export interface DiyPageVO {
...
@@ -5,7 +5,7 @@ export interface DiyPageVO {
templateId
?:
number
templateId
?:
number
name
:
string
name
:
string
remark
:
string
remark
:
string
preview
Image
Urls
:
string
[]
preview
Pic
Urls
:
string
[]
property
:
string
property
:
string
}
}
...
...
src/api/mall/promotion/diy/template.ts
View file @
fdfb028d
...
@@ -7,7 +7,7 @@ export interface DiyTemplateVO {
...
@@ -7,7 +7,7 @@ export interface DiyTemplateVO {
used
:
boolean
used
:
boolean
usedTime
?:
Date
usedTime
?:
Date
remark
:
string
remark
:
string
preview
Image
Urls
:
string
[]
preview
Pic
Urls
:
string
[]
property
:
string
property
:
string
}
}
...
...
src/components/DiyEditor/components/ComponentContainerProperty.vue
View file @
fdfb028d
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<template
#
tip
>
建议宽度 750px
</
template
>
<template
#
tip
>
建议宽度 750px
</
template
>
</UploadImg>
</UploadImg>
</el-form-item>
</el-form-item>
<el-tree
:data=
"treeData"
:expand-on-click-node=
"false"
>
<el-tree
:data=
"treeData"
:expand-on-click-node=
"false"
default-expand-all
>
<
template
#
default=
"{ node, data }"
>
<
template
#
default=
"{ node, data }"
>
<el-form-item
<el-form-item
:label=
"data.label"
:label=
"data.label"
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
</el-form-item>
</el-form-item>
</
template
>
</
template
>
</el-tree>
</el-tree>
<slot
name=
"style"
:
formData
=
"formData"
></slot>
<slot
name=
"style"
:
style
=
"formData"
></slot>
</el-form>
</el-form>
</el-card>
</el-card>
</el-tab-pane>
</el-tab-pane>
...
...
src/components/DiyEditor/components/mobile/CouponCard/component.tsx
View file @
fdfb028d
...
@@ -2,15 +2,13 @@ import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate'
...
@@ -2,15 +2,13 @@ import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate'
import
{
CouponTemplateValidityTypeEnum
,
PromotionDiscountTypeEnum
}
from
'@/utils/constants'
import
{
CouponTemplateValidityTypeEnum
,
PromotionDiscountTypeEnum
}
from
'@/utils/constants'
import
{
floatToFixed2
}
from
'@/utils'
import
{
floatToFixed2
}
from
'@/utils'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
object
}
from
'vue-types'
// 优惠值
// 优惠值
// TODO @疯狂:idea 有告警
export
const
CouponDiscount
=
defineComponent
({
export
const
CouponDiscount
=
defineComponent
({
name
:
'CouponDiscount'
,
name
:
'CouponDiscount'
,
props
:
{
props
:
{
coupon
:
{
coupon
:
object
<
CouponTemplateApi
.
CouponTemplateVO
>
()
type
:
CouponTemplateApi
.
CouponTemplateVO
}
},
},
setup
(
props
)
{
setup
(
props
)
{
const
coupon
=
props
.
coupon
as
CouponTemplateApi
.
CouponTemplateVO
const
coupon
=
props
.
coupon
as
CouponTemplateApi
.
CouponTemplateVO
...
@@ -35,9 +33,7 @@ export const CouponDiscount = defineComponent({
...
@@ -35,9 +33,7 @@ export const CouponDiscount = defineComponent({
export
const
CouponDiscountDesc
=
defineComponent
({
export
const
CouponDiscountDesc
=
defineComponent
({
name
:
'CouponDiscountDesc'
,
name
:
'CouponDiscountDesc'
,
props
:
{
props
:
{
coupon
:
{
coupon
:
object
<
CouponTemplateApi
.
CouponTemplateVO
>
()
type
:
CouponTemplateApi
.
CouponTemplateVO
}
},
},
setup
(
props
)
{
setup
(
props
)
{
const
coupon
=
props
.
coupon
as
CouponTemplateApi
.
CouponTemplateVO
const
coupon
=
props
.
coupon
as
CouponTemplateApi
.
CouponTemplateVO
...
@@ -61,9 +57,7 @@ export const CouponDiscountDesc = defineComponent({
...
@@ -61,9 +57,7 @@ export const CouponDiscountDesc = defineComponent({
export
const
CouponValidTerm
=
defineComponent
({
export
const
CouponValidTerm
=
defineComponent
({
name
:
'CouponValidTerm'
,
name
:
'CouponValidTerm'
,
props
:
{
props
:
{
coupon
:
{
coupon
:
object
<
CouponTemplateApi
.
CouponTemplateVO
>
()
type
:
CouponTemplateApi
.
CouponTemplateVO
}
},
},
setup
(
props
)
{
setup
(
props
)
{
const
coupon
=
props
.
coupon
as
CouponTemplateApi
.
CouponTemplateVO
const
coupon
=
props
.
coupon
as
CouponTemplateApi
.
CouponTemplateVO
...
...
src/components/DiyEditor/components/mobile/CouponCard/config.ts
View file @
fdfb028d
...
@@ -24,7 +24,6 @@ export interface CouponCardProperty {
...
@@ -24,7 +24,6 @@ export interface CouponCardProperty {
}
}
// 定义组件
// 定义组件
// TODO @疯狂:idea 有告警
export
const
component
=
{
export
const
component
=
{
id
:
'CouponCard'
,
id
:
'CouponCard'
,
name
:
'优惠券'
,
name
:
'优惠券'
,
...
...
src/components/DiyEditor/components/mobile/MagicCube/config.ts
View file @
fdfb028d
...
@@ -31,7 +31,6 @@ export interface MagicCubeItemProperty {
...
@@ -31,7 +31,6 @@ export interface MagicCubeItemProperty {
}
}
// 定义组件
// 定义组件
// TODO @疯狂:有 idea 爆红告警
export
const
component
=
{
export
const
component
=
{
id
:
'MagicCube'
,
id
:
'MagicCube'
,
name
:
'广告魔方'
,
name
:
'广告魔方'
,
...
...
src/components/DiyEditor/components/mobile/ProductCard/config.ts
View file @
fdfb028d
...
@@ -59,7 +59,6 @@ export interface ProductCardFieldProperty {
...
@@ -59,7 +59,6 @@ export interface ProductCardFieldProperty {
}
}
// 定义组件
// 定义组件
// TODO @疯狂:idea 有告警
export
const
component
=
{
export
const
component
=
{
id
:
'ProductCard'
,
id
:
'ProductCard'
,
name
:
'商品卡片'
,
name
:
'商品卡片'
,
...
...
src/components/DiyEditor/components/mobile/ProductList/config.ts
View file @
fdfb028d
...
@@ -38,7 +38,6 @@ export interface ProductListFieldProperty {
...
@@ -38,7 +38,6 @@ export interface ProductListFieldProperty {
}
}
// 定义组件
// 定义组件
// TODO @疯狂:idea 有告警
export
const
component
=
{
export
const
component
=
{
id
:
'ProductList'
,
id
:
'ProductList'
,
name
:
'商品栏'
,
name
:
'商品栏'
,
...
...
src/components/DiyEditor/components/mobile/PromotionArticle/index.vue
View file @
fdfb028d
<
template
>
<
template
>
<div
class=
"min-h-30px"
v-html=
"article.content"
></div>
<div
class=
"min-h-30px"
v-html=
"article
?
.content"
></div>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
PromotionArticleProperty
}
from
'./config'
import
{
PromotionArticleProperty
}
from
'./config'
import
*
as
ArticleApi
from
'@/api/mall/promotion/article/index'
import
*
as
ArticleApi
from
'@/api/mall/promotion/article/index'
/** 营销文章 */
/** 营销文章 */
// TODO @疯狂:idea 有告警
defineOptions
({
name
:
'PromotionArticle'
})
defineOptions
({
name
:
'PromotionArticle'
})
// 定义属性
// 定义属性
const
props
=
defineProps
<
{
property
:
PromotionArticleProperty
}
>
()
const
props
=
defineProps
<
{
property
:
PromotionArticleProperty
}
>
()
// 商品列表
// 商品列表
const
article
=
ref
<
ArticleApi
.
ArticleVO
[]
>
({}
)
const
article
=
ref
<
ArticleApi
.
ArticleVO
>
(
)
watch
(
watch
(
()
=>
props
.
property
.
id
,
()
=>
props
.
property
.
id
,
async
()
=>
{
async
()
=>
{
...
...
src/components/DiyEditor/components/mobile/PromotionCombination/config.ts
View file @
fdfb028d
...
@@ -39,13 +39,11 @@ export interface PromotionCombinationFieldProperty {
...
@@ -39,13 +39,11 @@ export interface PromotionCombinationFieldProperty {
}
}
// 定义组件
// 定义组件
// TODO @疯狂:idea 有告警
export
const
component
=
{
export
const
component
=
{
id
:
'PromotionCombination'
,
id
:
'PromotionCombination'
,
name
:
'拼团'
,
name
:
'拼团'
,
icon
:
'mdi:account-group'
,
icon
:
'mdi:account-group'
,
property
:
{
property
:
{
activityId
:
undefined
,
layoutType
:
'oneCol'
,
layoutType
:
'oneCol'
,
fields
:
{
fields
:
{
name
:
{
show
:
true
,
color
:
'#000'
},
name
:
{
show
:
true
,
color
:
'#000'
},
...
...
src/components/DiyEditor/components/mobile/SearchBar/config.ts
View file @
fdfb028d
...
@@ -17,7 +17,6 @@ export interface SearchProperty {
...
@@ -17,7 +17,6 @@ export interface SearchProperty {
export
type
PlaceholderPosition
=
'left'
|
'center'
export
type
PlaceholderPosition
=
'left'
|
'center'
// 定义组件
// 定义组件
// TODO @疯狂:idea 这里爆红,可以卡看咋优化下哇:is missing the following properties from type DiyComponent<SearchProperty>: uid, position
export
const
component
=
{
export
const
component
=
{
id
:
'SearchBar'
,
id
:
'SearchBar'
,
name
:
'搜索框'
,
name
:
'搜索框'
,
...
...
src/components/DiyEditor/components/mobile/VideoPlayer/config.ts
View file @
fdfb028d
...
@@ -19,7 +19,6 @@ export interface VideoPlayerStyle extends ComponentStyle {
...
@@ -19,7 +19,6 @@ export interface VideoPlayerStyle extends ComponentStyle {
}
}
// 定义组件
// 定义组件
// TODO @疯狂:idea 有告警
export
const
component
=
{
export
const
component
=
{
id
:
'VideoPlayer'
,
id
:
'VideoPlayer'
,
name
:
'视频播放'
,
name
:
'视频播放'
,
...
@@ -33,6 +32,6 @@ export const component = {
...
@@ -33,6 +32,6 @@ export const component = {
bgColor
:
'#fff'
,
bgColor
:
'#fff'
,
marginBottom
:
8
,
marginBottom
:
8
,
height
:
300
height
:
300
}
as
Component
Style
}
as
VideoPlayer
Style
}
}
}
as
DiyComponent
<
VideoPlayerProperty
>
}
as
DiyComponent
<
VideoPlayerProperty
>
src/components/DiyEditor/components/mobile/VideoPlayer/property.vue
View file @
fdfb028d
<
template
>
<
template
>
<ComponentContainerProperty
v-model=
"formData.style"
>
<ComponentContainerProperty
v-model=
"formData.style"
>
<template
#
style
=
"
{ formData }"
>
<template
#
style
>
<el-form-item
label=
"高度"
prop=
"height"
>
<el-form-item
label=
"高度"
prop=
"height"
>
<el-slider
<el-slider
v-model=
"formData.height"
v-model=
"formData.
style.
height"
:max=
"500"
:max=
"500"
:min=
"100"
:min=
"100"
show-input
show-input
...
...
src/components/DiyEditor/util.ts
View file @
fdfb028d
...
@@ -6,7 +6,7 @@ import { TabBarProperty } from '@/components/DiyEditor/components/mobile/TabBar/
...
@@ -6,7 +6,7 @@ import { TabBarProperty } from '@/components/DiyEditor/components/mobile/TabBar/
// 页面装修组件
// 页面装修组件
export
interface
DiyComponent
<
T
>
{
export
interface
DiyComponent
<
T
>
{
// 用于区分同一种组件的不同实例
// 用于区分同一种组件的不同实例
uid
:
number
uid
?
:
number
// 组件唯一标识
// 组件唯一标识
id
:
string
id
:
string
// 组件名称
// 组件名称
...
@@ -21,7 +21,7 @@ export interface DiyComponent<T> {
...
@@ -21,7 +21,7 @@ export interface DiyComponent<T> {
空:同center
空:同center
fixed: 由组件自己决定位置,如弹窗位于手机中心、浮动按钮一般位于手机右下角
fixed: 由组件自己决定位置,如弹窗位于手机中心、浮动按钮一般位于手机右下角
*/
*/
position
:
'top'
|
'bottom'
|
'center'
|
''
|
'fixed'
position
?
:
'top'
|
'bottom'
|
'center'
|
''
|
'fixed'
// 组件属性
// 组件属性
property
:
T
property
:
T
}
}
...
@@ -103,8 +103,7 @@ export function usePropertyForm<T>(modelValue: T, emit: Function): { formData: R
...
@@ -103,8 +103,7 @@ export function usePropertyForm<T>(modelValue: T, emit: Function): { formData: R
}
}
)
)
// TODO @疯狂:这个 idea 爆红,看看怎么可以解决哈
return
{
formData
}
as
{
formData
:
Ref
<
T
>
}
return
{
formData
}
}
}
// 页面组件库
// 页面组件库
...
...
src/router/modules/remaining.ts
View file @
fdfb028d
...
@@ -473,8 +473,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -473,8 +473,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
title
:
'模板装修'
,
title
:
'模板装修'
,
noCache
:
true
,
noCache
:
true
,
hidden
:
true
,
hidden
:
true
,
// TODO @疯狂:建议 menu 那的 /mall/promotion/diy-template/diy-template 改成 /mall/promotion/diy/template
activeMenu
:
'/mall/promotion/diy/template'
activeMenu
:
'/mall/promotion/diy-template/diy-template'
},
},
component
:
()
=>
import
(
'@/views/mall/promotion/diy/template/decorate.vue'
)
component
:
()
=>
import
(
'@/views/mall/promotion/diy/template/decorate.vue'
)
},
},
...
@@ -485,8 +484,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -485,8 +484,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
title
:
'页面装修'
,
title
:
'页面装修'
,
noCache
:
true
,
noCache
:
true
,
hidden
:
true
,
hidden
:
true
,
// TODO @疯狂:建议 menu 那的 /mall/promotion/diy-template/diy-page 改成 /mall/promotion/diy/page
activeMenu
:
'/mall/promotion/diy/page'
activeMenu
:
'/mall/promotion/diy-template/diy-page'
},
},
component
:
()
=>
import
(
'@/views/mall/promotion/diy/page/decorate.vue'
)
component
:
()
=>
import
(
'@/views/mall/promotion/diy/page/decorate.vue'
)
}
}
...
...
src/views/mall/promotion/diy/page/DiyPageForm.vue
View file @
fdfb028d
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"formData.remark"
placeholder=
"请输入备注"
/>
<el-input
v-model=
"formData.remark"
placeholder=
"请输入备注"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"预览图"
prop=
"preview
Image
Urls"
>
<el-form-item
label=
"预览图"
prop=
"preview
Pic
Urls"
>
<UploadImgs
v-model=
"formData.preview
Image
Urls"
/>
<UploadImgs
v-model=
"formData.preview
Pic
Urls"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<template
#
footer
>
<template
#
footer
>
...
@@ -40,7 +40,7 @@ const formData = ref({
...
@@ -40,7 +40,7 @@ const formData = ref({
id
:
undefined
,
id
:
undefined
,
name
:
undefined
,
name
:
undefined
,
remark
:
undefined
,
remark
:
undefined
,
preview
Image
Urls
:
[]
preview
Pic
Urls
:
[]
})
})
const
formRules
=
reactive
({
const
formRules
=
reactive
({
name
:
[{
required
:
true
,
message
:
'页面名称不能为空'
,
trigger
:
'blur'
}]
name
:
[{
required
:
true
,
message
:
'页面名称不能为空'
,
trigger
:
'blur'
}]
...
@@ -58,8 +58,8 @@ const open = async (type: string, id?: number) => {
...
@@ -58,8 +58,8 @@ const open = async (type: string, id?: number) => {
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
const
diyPage
=
await
DiyPageApi
.
getDiyPage
(
id
)
// 处理预览图
const
diyPage
=
await
DiyPageApi
.
getDiyPage
(
id
)
// 处理预览图
if
(
diyPage
?.
preview
Image
Urls
?.
length
>
0
)
{
if
(
diyPage
?.
preview
Pic
Urls
?.
length
>
0
)
{
diyPage
.
preview
ImageUrls
=
diyPage
.
previewImage
Urls
.
map
((
url
:
string
)
=>
{
diyPage
.
preview
PicUrls
=
diyPage
.
previewPic
Urls
.
map
((
url
:
string
)
=>
{
return
{
url
}
return
{
url
}
})
})
}
}
...
@@ -82,10 +82,10 @@ const submitForm = async () => {
...
@@ -82,10 +82,10 @@ const submitForm = async () => {
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
// 处理预览图
// 处理预览图
const
preview
ImageUrls
=
formData
.
value
.
previewImage
Urls
.
map
((
item
)
=>
{
const
preview
PicUrls
=
formData
.
value
.
previewPic
Urls
.
map
((
item
)
=>
{
return
item
[
'url'
]
?
item
[
'url'
]
:
item
return
item
[
'url'
]
?
item
[
'url'
]
:
item
})
})
const
data
=
{
...
formData
.
value
,
preview
Image
Urls
}
as
unknown
as
DiyPageApi
.
DiyPageVO
const
data
=
{
...
formData
.
value
,
preview
Pic
Urls
}
as
unknown
as
DiyPageApi
.
DiyPageVO
if
(
formType
.
value
===
'create'
)
{
if
(
formType
.
value
===
'create'
)
{
await
DiyPageApi
.
createDiyPage
(
data
)
await
DiyPageApi
.
createDiyPage
(
data
)
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
...
@@ -107,7 +107,7 @@ const resetForm = () => {
...
@@ -107,7 +107,7 @@ const resetForm = () => {
id
:
undefined
,
id
:
undefined
,
name
:
undefined
,
name
:
undefined
,
remark
:
undefined
,
remark
:
undefined
,
preview
Image
Urls
:
[]
preview
Pic
Urls
:
[]
}
}
formRef
.
value
?.
resetFields
()
formRef
.
value
?.
resetFields
()
}
}
...
...
src/views/mall/promotion/diy/page/decorate.vue
View file @
fdfb028d
...
@@ -52,7 +52,7 @@ const resetForm = () => {
...
@@ -52,7 +52,7 @@ const resetForm = () => {
templateId
:
undefined
,
templateId
:
undefined
,
name
:
''
,
name
:
''
,
remark
:
''
,
remark
:
''
,
preview
Image
Urls
:
[],
preview
Pic
Urls
:
[],
property
:
''
property
:
''
}
as
DiyPageApi
.
DiyPageVO
}
as
DiyPageApi
.
DiyPageVO
formRef
.
value
?.
resetFields
()
formRef
.
value
?.
resetFields
()
...
...
src/views/mall/promotion/diy/page/index.vue
View file @
fdfb028d
...
@@ -47,14 +47,14 @@
...
@@ -47,14 +47,14 @@
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"预览图"
align=
"center"
prop=
"preview
Image
Urls"
>
<el-table-column
label=
"预览图"
align=
"center"
prop=
"preview
Pic
Urls"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<el-image
<el-image
class=
"h-40px max-w-40px"
class=
"h-40px max-w-40px"
v-for=
"(url, index) in scope.row.preview
Image
Urls"
v-for=
"(url, index) in scope.row.preview
Pic
Urls"
:key=
"index"
:key=
"index"
:src=
"url"
:src=
"url"
:preview-src-list=
"scope.row.preview
Image
Urls"
:preview-src-list=
"scope.row.preview
Pic
Urls"
:initial-index=
"index"
:initial-index=
"index"
preview-teleported
preview-teleported
/>
/>
...
...
src/views/mall/promotion/diy/template/DiyTemplateForm.vue
View file @
fdfb028d
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"formData.remark"
placeholder=
"请输入备注"
type=
"textarea"
/>
<el-input
v-model=
"formData.remark"
placeholder=
"请输入备注"
type=
"textarea"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"预览图"
prop=
"preview
Image
Urls"
>
<el-form-item
label=
"预览图"
prop=
"preview
Pic
Urls"
>
<UploadImgs
v-model=
"formData.preview
Image
Urls"
/>
<UploadImgs
v-model=
"formData.preview
Pic
Urls"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<template
#
footer
>
<template
#
footer
>
...
@@ -40,7 +40,7 @@ const formData = ref({
...
@@ -40,7 +40,7 @@ const formData = ref({
id
:
undefined
,
id
:
undefined
,
name
:
undefined
,
name
:
undefined
,
remark
:
undefined
,
remark
:
undefined
,
preview
Image
Urls
:
[]
preview
Pic
Urls
:
[]
})
})
const
formRules
=
reactive
({
const
formRules
=
reactive
({
name
:
[{
required
:
true
,
message
:
'模板名称不能为空'
,
trigger
:
'blur'
}]
name
:
[{
required
:
true
,
message
:
'模板名称不能为空'
,
trigger
:
'blur'
}]
...
@@ -59,8 +59,8 @@ const open = async (type: string, id?: number) => {
...
@@ -59,8 +59,8 @@ const open = async (type: string, id?: number) => {
try
{
try
{
const
diyTemplate
=
await
DiyTemplateApi
.
getDiyTemplate
(
id
)
const
diyTemplate
=
await
DiyTemplateApi
.
getDiyTemplate
(
id
)
// 处理预览图
// 处理预览图
if
(
diyTemplate
?.
preview
Image
Urls
?.
length
>
0
)
{
if
(
diyTemplate
?.
preview
Pic
Urls
?.
length
>
0
)
{
diyTemplate
.
preview
ImageUrls
=
diyTemplate
.
previewImage
Urls
.
map
((
url
:
string
)
=>
{
diyTemplate
.
preview
PicUrls
=
diyTemplate
.
previewPic
Urls
.
map
((
url
:
string
)
=>
{
return
{
url
}
return
{
url
}
})
})
}
}
...
@@ -83,10 +83,10 @@ const submitForm = async () => {
...
@@ -83,10 +83,10 @@ const submitForm = async () => {
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
// 处理预览图
// 处理预览图
const
preview
ImageUrls
=
formData
.
value
.
previewImage
Urls
.
map
((
item
)
=>
{
const
preview
PicUrls
=
formData
.
value
.
previewPic
Urls
.
map
((
item
)
=>
{
return
item
[
'url'
]
?
item
[
'url'
]
:
item
return
item
[
'url'
]
?
item
[
'url'
]
:
item
})
})
const
data
=
{
...
formData
.
value
,
preview
Image
Urls
}
as
unknown
as
DiyTemplateApi
.
DiyTemplateVO
const
data
=
{
...
formData
.
value
,
preview
Pic
Urls
}
as
unknown
as
DiyTemplateApi
.
DiyTemplateVO
if
(
formType
.
value
===
'create'
)
{
if
(
formType
.
value
===
'create'
)
{
await
DiyTemplateApi
.
createDiyTemplate
(
data
)
await
DiyTemplateApi
.
createDiyTemplate
(
data
)
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
...
@@ -108,7 +108,7 @@ const resetForm = () => {
...
@@ -108,7 +108,7 @@ const resetForm = () => {
id
:
undefined
,
id
:
undefined
,
name
:
undefined
,
name
:
undefined
,
remark
:
undefined
,
remark
:
undefined
,
preview
Image
Urls
:
[]
preview
Pic
Urls
:
[]
}
}
formRef
.
value
?.
resetFields
()
formRef
.
value
?.
resetFields
()
}
}
...
...
src/views/mall/promotion/diy/template/decorate.vue
View file @
fdfb028d
...
@@ -118,7 +118,7 @@ const resetForm = () => {
...
@@ -118,7 +118,7 @@ const resetForm = () => {
used
:
false
,
used
:
false
,
usedTime
:
undefined
,
usedTime
:
undefined
,
remark
:
''
,
remark
:
''
,
preview
Image
Urls
:
[],
preview
Pic
Urls
:
[],
property
:
''
,
property
:
''
,
pages
:
[]
pages
:
[]
}
as
DiyTemplateApi
.
DiyTemplatePropertyVO
}
as
DiyTemplateApi
.
DiyTemplatePropertyVO
...
...
src/views/mall/promotion/diy/template/index.vue
View file @
fdfb028d
...
@@ -47,14 +47,14 @@
...
@@ -47,14 +47,14 @@
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"预览图"
align=
"center"
prop=
"preview
Image
Urls"
>
<el-table-column
label=
"预览图"
align=
"center"
prop=
"preview
Pic
Urls"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<el-image
<el-image
class=
"h-40px max-w-40px"
class=
"h-40px max-w-40px"
v-for=
"(url, index) in scope.row.preview
Image
Urls"
v-for=
"(url, index) in scope.row.preview
Pic
Urls"
:key=
"index"
:key=
"index"
:src=
"url"
:src=
"url"
:preview-src-list=
"scope.row.preview
Image
Urls"
:preview-src-list=
"scope.row.preview
Pic
Urls"
:initial-index=
"index"
:initial-index=
"index"
preview-teleported
preview-teleported
/>
/>
...
...
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