Skip to content

Commit b67fabc

Browse files
author
puhui999
committed
fix: mall SeckillActivity
1 parent 4057130 commit b67fabc

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
@expand-change="expandChange"
3333
>
3434
<template #expand> 展示活动商品和商品相关属性活动配置</template>
35+
<template #spuId="{ row }">
36+
<el-image
37+
:src="row.picUrl"
38+
class="w-30px h-30px align-middle mr-5px"
39+
@click="imagePreview(row.picUrl)"
40+
/>
41+
<span class="align-middle">{{ row.spuName }}</span>
42+
</template>
3543
<template #configIds="{ row }">
3644
<el-tag v-for="(name, index) in convertSeckillConfigNames(row)" :key="index" class="mr-5px">
3745
{{ name }}
@@ -67,6 +75,7 @@ import { getListAllSimple } from '@/api/mall/promotion/seckill/seckillConfig'
6775
import * as SeckillActivityApi from '@/api/mall/promotion/seckill/seckillActivity'
6876
import SeckillActivityForm from './SeckillActivityForm.vue'
6977
import { cloneDeep } from 'lodash-es'
78+
import { createImageViewer } from '@/components/ImageViewer'
7079
7180
defineOptions({ name: 'PromotionSeckillActivity' })
7281
@@ -90,7 +99,12 @@ const openForm = (type: string, id?: number) => {
9099
const handleDelete = (id: number) => {
91100
tableMethods.delList(id, false)
92101
}
93-
102+
/** 商品图预览 */
103+
const imagePreview = (imgUrl: string) => {
104+
createImageViewer({
105+
urlList: [imgUrl]
106+
})
107+
}
94108
const configList = ref([]) // 时段配置精简列表
95109
const convertSeckillConfigNames = computed(
96110
() => (row) =>
@@ -106,6 +120,11 @@ const expandChange = (row, expandedRows) => {
106120
107121
/** 初始化 **/
108122
onMounted(async () => {
123+
/*
124+
TODO
125+
后面准备封装成一个函数来操作 tableColumns 重新排列:比如说需求是表单上商品选择是在后面的而列表展示的时候需要调到位置。
126+
封装效果支持批量操作,给出 field 和需要插入的位置,例:[{field:'spuId',index: 1}] 效果为把 field 为 spuId 的 column 移动到第一个位置
127+
*/
109128
// 处理一下表格列让商品往前
110129
const index = allSchemas.tableColumns.findIndex((item) => item.field === 'spuId')
111130
const column = cloneDeep(allSchemas.tableColumns[index])

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const crudSchemas = reactive<CrudSchema[]>([
194194
}
195195
},
196196
table: {
197-
width: 200
197+
width: 300
198198
}
199199
},
200200
{

0 commit comments

Comments
 (0)