File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
src/views/mall/promotion/seckill/activity Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 10
10
<!-- 先选择 -->
11
11
<template #spuIds >
12
12
<el-button @click =" spuSelectRef.open()" >选择商品</el-button >
13
- <!-- TODO @puhui999:默认展开 SKU 哈,毕竟 SKU 是主角,SPU 是配角 -->
14
13
<SpuAndSkuList
15
14
ref =" spuAndSkuListRef"
16
15
:rule-config =" ruleConfig"
24
23
<el-button @click =" dialogVisible = false" >取 消</el-button >
25
24
</template >
26
25
</Dialog >
27
- <SpuSelect ref =" spuSelectRef" :is-select-sku = " true " @confirm =" selectSpu" />
26
+ <SpuSelect ref =" spuSelectRef" @confirm =" selectSpu" />
28
27
</template >
29
28
<script lang="ts" setup>
30
29
import { SpuAndSkuList , SpuProperty , SpuSelect } from ' ../../components'
@@ -132,7 +131,7 @@ const submitForm = async () => {
132
131
try {
133
132
const data = formRef .value .formModel as SeckillActivityApi .SeckillActivityVO
134
133
data .spuIds = spuList .value .map ((spu ) => spu .id ! )
135
- data .products = spuAndSkuListRef .value .getSkuConfigs ()
134
+ data .products = spuAndSkuListRef .value .getSkuConfigs (' productConfig ' )
136
135
if (formType .value === ' create' ) {
137
136
await SeckillActivityApi .createSeckillActivity (data )
138
137
message .success (t (' common.createSuccess' ))
Original file line number Diff line number Diff line change 24
24
v-model:pageSize =" tableObject.pageSize"
25
25
:columns =" allSchemas.tableColumns"
26
26
:data =" tableObject.tableList"
27
+ :expand =" true"
27
28
:loading =" tableObject.loading"
28
29
:pagination =" {
29
30
total: tableObject.total
30
31
}"
32
+ @expand-change =" expandChange"
31
33
>
34
+ <template #expand > 展示活动商品和商品相关属性活动配置</template >
32
35
<template #configIds =" { row } " >
33
36
<el-tag v-for =" (name, index) in convertSeckillConfigNames(row)" :key =" index" class =" mr-5px" >
34
37
{{ name }}
@@ -93,6 +96,11 @@ const convertSeckillConfigNames = computed(
93
96
?.filter ((item ) => row .configIds .includes (item .id ))
94
97
?.map ((config ) => config .name )
95
98
)
99
+ const expandChange = (row , expandedRows ) => {
100
+ // TODO puhui:等 CRUD 完事后弄
101
+ console .log (row , expandedRows )
102
+ }
103
+
96
104
/** 初始化 **/
97
105
onMounted (async () => {
98
106
await getList ()
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ export const rules = reactive({
16
16
} )
17
17
18
18
// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
19
- // TODO @puhui 999:table 宽度调整下,有点太长啦;部分字段可以隐藏哈,根据需求;
20
19
const crudSchemas = reactive < CrudSchema [ ] > ( [
21
20
{
22
21
label : '秒杀活动名称' ,
@@ -177,8 +176,10 @@ const crudSchemas = reactive<CrudSchema[]>([
177
176
}
178
177
} ,
179
178
{
180
- label : '秒杀活动商品' , // TODO @puhui 999:格式化的商品不对;
179
+ label : '秒杀活动商品' ,
181
180
field : 'spuIds' ,
181
+ isTable : false ,
182
+ isSearch : false ,
182
183
form : {
183
184
colProps : {
184
185
span : 24
@@ -218,7 +219,7 @@ const crudSchemas = reactive<CrudSchema[]>([
218
219
} ,
219
220
{
220
221
label : '状态' ,
221
- field : 'status' , // TODO @puhui 999:状态在 table 格式化不对;
222
+ field : 'status' , // TODO @puhui 999:状态在 table 格式化不对;建表插入的数据状态值不对,改为 0 或 1 就好了
222
223
dictType : DICT_TYPE . COMMON_STATUS ,
223
224
dictClass : 'number' ,
224
225
isForm : false ,
@@ -233,6 +234,7 @@ const crudSchemas = reactive<CrudSchema[]>([
233
234
{
234
235
label : '备注' ,
235
236
field : 'remark' ,
237
+ isSearch : false ,
236
238
form : {
237
239
component : 'Input' ,
238
240
componentProps : {
You can’t perform that action at this time.
0 commit comments