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
341303b0
authored
Jun 25, 2023
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 完善 mall seckillActivity add
parent
51e79f29
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue
+2
-3
src/views/mall/promotion/seckill/activity/index.vue
+8
-0
src/views/mall/promotion/seckill/activity/seckillActivity.data.ts
+5
-3
No files found.
src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue
View file @
341303b0
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
<!-- 先选择 -->
<!-- 先选择 -->
<template
#
spuIds
>
<template
#
spuIds
>
<el-button
@
click=
"spuSelectRef.open()"
>
选择商品
</el-button>
<el-button
@
click=
"spuSelectRef.open()"
>
选择商品
</el-button>
<!-- TODO @puhui999:默认展开 SKU 哈,毕竟 SKU 是主角,SPU 是配角 -->
<SpuAndSkuList
<SpuAndSkuList
ref=
"spuAndSkuListRef"
ref=
"spuAndSkuListRef"
:rule-config=
"ruleConfig"
:rule-config=
"ruleConfig"
...
@@ -24,7 +23,7 @@
...
@@ -24,7 +23,7 @@
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
</
template
>
</
template
>
</Dialog>
</Dialog>
<SpuSelect
ref=
"spuSelectRef"
:is-select-sku=
"true"
@
confirm=
"selectSpu"
/>
<SpuSelect
ref=
"spuSelectRef"
@
confirm=
"selectSpu"
/>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
SpuAndSkuList
,
SpuProperty
,
SpuSelect
}
from
'../../components'
import
{
SpuAndSkuList
,
SpuProperty
,
SpuSelect
}
from
'../../components'
...
@@ -132,7 +131,7 @@ const submitForm = async () => {
...
@@ -132,7 +131,7 @@ const submitForm = async () => {
try
{
try
{
const
data
=
formRef
.
value
.
formModel
as
SeckillActivityApi
.
SeckillActivityVO
const
data
=
formRef
.
value
.
formModel
as
SeckillActivityApi
.
SeckillActivityVO
data
.
spuIds
=
spuList
.
value
.
map
((
spu
)
=>
spu
.
id
!
)
data
.
spuIds
=
spuList
.
value
.
map
((
spu
)
=>
spu
.
id
!
)
data
.
products
=
spuAndSkuListRef
.
value
.
getSkuConfigs
()
data
.
products
=
spuAndSkuListRef
.
value
.
getSkuConfigs
(
'productConfig'
)
if
(
formType
.
value
===
'create'
)
{
if
(
formType
.
value
===
'create'
)
{
await
SeckillActivityApi
.
createSeckillActivity
(
data
)
await
SeckillActivityApi
.
createSeckillActivity
(
data
)
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
...
...
src/views/mall/promotion/seckill/activity/index.vue
View file @
341303b0
...
@@ -24,11 +24,14 @@
...
@@ -24,11 +24,14 @@
v-model:pageSize=
"tableObject.pageSize"
v-model:pageSize=
"tableObject.pageSize"
:columns=
"allSchemas.tableColumns"
:columns=
"allSchemas.tableColumns"
:data=
"tableObject.tableList"
:data=
"tableObject.tableList"
:expand=
"true"
:loading=
"tableObject.loading"
:loading=
"tableObject.loading"
:pagination=
"{
:pagination=
"{
total: tableObject.total
total: tableObject.total
}"
}"
@
expand-change=
"expandChange"
>
>
<
template
#
expand
>
展示活动商品和商品相关属性活动配置
</
template
>
<
template
#
configIds=
"{ row }"
>
<
template
#
configIds=
"{ row }"
>
<el-tag
v-for=
"(name, index) in convertSeckillConfigNames(row)"
:key=
"index"
class=
"mr-5px"
>
<el-tag
v-for=
"(name, index) in convertSeckillConfigNames(row)"
:key=
"index"
class=
"mr-5px"
>
{{
name
}}
{{
name
}}
...
@@ -93,6 +96,11 @@ const convertSeckillConfigNames = computed(
...
@@ -93,6 +96,11 @@ const convertSeckillConfigNames = computed(
?.
filter
((
item
)
=>
row
.
configIds
.
includes
(
item
.
id
))
?.
filter
((
item
)
=>
row
.
configIds
.
includes
(
item
.
id
))
?.
map
((
config
)
=>
config
.
name
)
?.
map
((
config
)
=>
config
.
name
)
)
)
const
expandChange
=
(
row
,
expandedRows
)
=>
{
// TODO puhui:等 CRUD 完事后弄
console
.
log
(
row
,
expandedRows
)
}
/** 初始化 **/
/** 初始化 **/
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
await
getList
()
await
getList
()
...
...
src/views/mall/promotion/seckill/activity/seckillActivity.data.ts
View file @
341303b0
...
@@ -16,7 +16,6 @@ export const rules = reactive({
...
@@ -16,7 +16,6 @@ export const rules = reactive({
})
})
// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
// TODO @puhui999:table 宽度调整下,有点太长啦;部分字段可以隐藏哈,根据需求;
const
crudSchemas
=
reactive
<
CrudSchema
[]
>
([
const
crudSchemas
=
reactive
<
CrudSchema
[]
>
([
{
{
label
:
'秒杀活动名称'
,
label
:
'秒杀活动名称'
,
...
@@ -177,8 +176,10 @@ const crudSchemas = reactive<CrudSchema[]>([
...
@@ -177,8 +176,10 @@ const crudSchemas = reactive<CrudSchema[]>([
}
}
},
},
{
{
label
:
'秒杀活动商品'
,
// TODO @puhui999:格式化的商品不对;
label
:
'秒杀活动商品'
,
field
:
'spuIds'
,
field
:
'spuIds'
,
isTable
:
false
,
isSearch
:
false
,
form
:
{
form
:
{
colProps
:
{
colProps
:
{
span
:
24
span
:
24
...
@@ -218,7 +219,7 @@ const crudSchemas = reactive<CrudSchema[]>([
...
@@ -218,7 +219,7 @@ const crudSchemas = reactive<CrudSchema[]>([
},
},
{
{
label
:
'状态'
,
label
:
'状态'
,
field
:
'status'
,
// TODO @puhui999:状态在 table 格式化不对;
field
:
'status'
,
// TODO @puhui999:状态在 table 格式化不对;
建表插入的数据状态值不对,改为 0 或 1 就好了
dictType
:
DICT_TYPE
.
COMMON_STATUS
,
dictType
:
DICT_TYPE
.
COMMON_STATUS
,
dictClass
:
'number'
,
dictClass
:
'number'
,
isForm
:
false
,
isForm
:
false
,
...
@@ -233,6 +234,7 @@ const crudSchemas = reactive<CrudSchema[]>([
...
@@ -233,6 +234,7 @@ const crudSchemas = reactive<CrudSchema[]>([
{
{
label
:
'备注'
,
label
:
'备注'
,
field
:
'remark'
,
field
:
'remark'
,
isSearch
:
false
,
form
:
{
form
:
{
component
:
'Input'
,
component
:
'Input'
,
componentProps
:
{
componentProps
:
{
...
...
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