32
32
@expand-change =" expandChange"
33
33
>
34
34
<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 >
35
43
<template #configIds =" { row } " >
36
44
<el-tag v-for =" (name, index) in convertSeckillConfigNames(row)" :key =" index" class =" mr-5px" >
37
45
{{ name }}
@@ -67,6 +75,7 @@ import { getListAllSimple } from '@/api/mall/promotion/seckill/seckillConfig'
67
75
import * as SeckillActivityApi from ' @/api/mall/promotion/seckill/seckillActivity'
68
76
import SeckillActivityForm from ' ./SeckillActivityForm.vue'
69
77
import { cloneDeep } from ' lodash-es'
78
+ import { createImageViewer } from ' @/components/ImageViewer'
70
79
71
80
defineOptions ({ name: ' PromotionSeckillActivity' })
72
81
@@ -90,7 +99,12 @@ const openForm = (type: string, id?: number) => {
90
99
const handleDelete = (id : number ) => {
91
100
tableMethods .delList (id , false )
92
101
}
93
-
102
+ /** 商品图预览 */
103
+ const imagePreview = (imgUrl : string ) => {
104
+ createImageViewer ({
105
+ urlList: [imgUrl ]
106
+ })
107
+ }
94
108
const configList = ref ([]) // 时段配置精简列表
95
109
const convertSeckillConfigNames = computed (
96
110
() => (row ) =>
@@ -106,6 +120,11 @@ const expandChange = (row, expandedRows) => {
106
120
107
121
/** 初始化 **/
108
122
onMounted (async () => {
123
+ /*
124
+ TODO
125
+ 后面准备封装成一个函数来操作 tableColumns 重新排列:比如说需求是表单上商品选择是在后面的而列表展示的时候需要调到位置。
126
+ 封装效果支持批量操作,给出 field 和需要插入的位置,例:[{field:'spuId',index: 1}] 效果为把 field 为 spuId 的 column 移动到第一个位置
127
+ */
109
128
// 处理一下表格列让商品往前
110
129
const index = allSchemas .tableColumns .findIndex ((item ) => item .field === ' spuId' )
111
130
const column = cloneDeep (allSchemas .tableColumns [index ])
0 commit comments