Skip to content

Commit 341303b

Browse files
author
puhui999
committed
fix: 完善 mall seckillActivity add
1 parent 51e79f2 commit 341303b

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<!-- 先选择 -->
1111
<template #spuIds>
1212
<el-button @click="spuSelectRef.open()">选择商品</el-button>
13-
<!-- TODO @puhui999:默认展开 SKU 哈,毕竟 SKU 是主角,SPU 是配角 -->
1413
<SpuAndSkuList
1514
ref="spuAndSkuListRef"
1615
:rule-config="ruleConfig"
@@ -24,7 +23,7 @@
2423
<el-button @click="dialogVisible = false">取 消</el-button>
2524
</template>
2625
</Dialog>
27-
<SpuSelect ref="spuSelectRef" :is-select-sku="true" @confirm="selectSpu" />
26+
<SpuSelect ref="spuSelectRef" @confirm="selectSpu" />
2827
</template>
2928
<script lang="ts" setup>
3029
import { SpuAndSkuList, SpuProperty, SpuSelect } from '../../components'
@@ -132,7 +131,7 @@ const submitForm = async () => {
132131
try {
133132
const data = formRef.value.formModel as SeckillActivityApi.SeckillActivityVO
134133
data.spuIds = spuList.value.map((spu) => spu.id!)
135-
data.products = spuAndSkuListRef.value.getSkuConfigs()
134+
data.products = spuAndSkuListRef.value.getSkuConfigs('productConfig')
136135
if (formType.value === 'create') {
137136
await SeckillActivityApi.createSeckillActivity(data)
138137
message.success(t('common.createSuccess'))

src/views/mall/promotion/seckill/activity/index.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@
2424
v-model:pageSize="tableObject.pageSize"
2525
:columns="allSchemas.tableColumns"
2626
:data="tableObject.tableList"
27+
:expand="true"
2728
:loading="tableObject.loading"
2829
:pagination="{
2930
total: tableObject.total
3031
}"
32+
@expand-change="expandChange"
3133
>
34+
<template #expand> 展示活动商品和商品相关属性活动配置</template>
3235
<template #configIds="{ row }">
3336
<el-tag v-for="(name, index) in convertSeckillConfigNames(row)" :key="index" class="mr-5px">
3437
{{ name }}
@@ -93,6 +96,11 @@ const convertSeckillConfigNames = computed(
9396
?.filter((item) => row.configIds.includes(item.id))
9497
?.map((config) => config.name)
9598
)
99+
const expandChange = (row, expandedRows) => {
100+
// TODO puhui:等 CRUD 完事后弄
101+
console.log(row, expandedRows)
102+
}
103+
96104
/** 初始化 **/
97105
onMounted(async () => {
98106
await getList()

src/views/mall/promotion/seckill/activity/seckillActivity.data.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const rules = reactive({
1616
})
1717

1818
// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
19-
// TODO @puhui999:table 宽度调整下,有点太长啦;部分字段可以隐藏哈,根据需求;
2019
const crudSchemas = reactive<CrudSchema[]>([
2120
{
2221
label: '秒杀活动名称',
@@ -177,8 +176,10 @@ const crudSchemas = reactive<CrudSchema[]>([
177176
}
178177
},
179178
{
180-
label: '秒杀活动商品', // TODO @puhui999:格式化的商品不对;
179+
label: '秒杀活动商品',
181180
field: 'spuIds',
181+
isTable: false,
182+
isSearch: false,
182183
form: {
183184
colProps: {
184185
span: 24
@@ -218,7 +219,7 @@ const crudSchemas = reactive<CrudSchema[]>([
218219
},
219220
{
220221
label: '状态',
221-
field: 'status', // TODO @puhui999:状态在 table 格式化不对;
222+
field: 'status', // TODO @puhui999:状态在 table 格式化不对;建表插入的数据状态值不对,改为 0 或 1 就好了
222223
dictType: DICT_TYPE.COMMON_STATUS,
223224
dictClass: 'number',
224225
isForm: false,
@@ -233,6 +234,7 @@ const crudSchemas = reactive<CrudSchema[]>([
233234
{
234235
label: '备注',
235236
field: 'remark',
237+
isSearch: false,
236238
form: {
237239
component: 'Input',
238240
componentProps: {

0 commit comments

Comments
 (0)