65
65
</ContentWrap >
66
66
</el-col >
67
67
</el-row >
68
+
69
+ <!-- 搜索工作栏 -->
68
70
<ContentWrap >
69
- <!-- 搜索工作栏 -->
70
71
<el-form
71
72
ref =" queryFormRef"
72
73
:inline =" true"
109
110
</el-form-item >
110
111
</el-form >
111
112
</ContentWrap >
113
+
114
+ <!-- 分页列表数据展示 -->
112
115
<ContentWrap >
113
- <!-- 分页列表数据展示 -->
114
116
<el-table v-loading =" loading" :data =" pageList" >
115
117
<el-table-column align =" center" label =" 编号" prop =" id" />
116
- <!-- TODO 是否需要做一个点击用户头像跳转或查看用户信息的功能 -->
117
118
<el-table-column align =" center" label =" 头像" prop =" avatar" />
119
+ <el-table-column align =" center" label =" 昵称" prop =" nickname" />
118
120
<el-table-column align =" center" label =" 开团团长" prop =" headId" >
119
121
<template #default =" { row }: { row: CombinationRecordApi .CombinationRecordVO } " >
120
122
{{
147
149
</el-table-column >
148
150
<el-table-column align =" center" label =" 几人团" prop =" userSize" />
149
151
<el-table-column align =" center" label =" 参与人数" prop =" userCount" />
152
+ <el-table-column
153
+ :formatter =" dateFormatter"
154
+ align =" center"
155
+ label =" 参团时间"
156
+ prop =" createTime"
157
+ width =" 180"
158
+ />
150
159
<el-table-column
151
160
:formatter =" dateFormatter"
152
161
align =" center"
162
171
/>
163
172
</template >
164
173
</el-table-column >
174
+ <!-- TODO puhui999:这里加个查看拼团?点击后,查看完整的拼团列表? -->
165
175
<el-table-column align =" center" fixed =" right" label =" 操作" >
166
176
<template #default ></template >
167
177
</el-table-column >
175
185
/>
176
186
</ContentWrap >
177
187
</template >
178
-
179
188
<script lang="ts" setup>
180
189
import { DICT_TYPE , getIntDictOptions } from ' @/utils/dict'
181
190
import { dateFormatter } from ' @/utils/formatTime'
182
191
import { createImageViewer } from ' @/components/ImageViewer'
183
192
import * as CombinationRecordApi from ' @/api/mall/promotion/combination/combinationRecord'
184
193
185
194
defineOptions ({ name: ' CombinationRecord' })
195
+
186
196
const queryParams = ref ({
187
197
dateType: 0 , // 日期类型
188
198
status: undefined , // 拼团状态
@@ -216,6 +226,7 @@ const getSummary = async () => {
216
226
recordSummary .value = await CombinationRecordApi .getCombinationRecordSummary ()
217
227
}
218
228
// 日期快捷选项
229
+ // TODO @puhui999:不用 dateType,而是 shortcuts 选择后,设置到对应的 date 就 ok 啦。直接通过它查询。然后,看看怎么把 shortcuts 变成一个公共变量,类似 defaultProps 一样
219
230
const shortcuts = ref ([
220
231
{
221
232
text: ' 今天' ,
@@ -246,7 +257,7 @@ const shortcuts = ref([
246
257
}
247
258
},
248
259
{
249
- text: ' 最近30天 ' ,
260
+ text: ' 最近 30 天 ' ,
250
261
type: ' last30Days' ,
251
262
value : () => {
252
263
const date = new Date ()
@@ -276,14 +287,6 @@ const shortcuts = ref([
276
287
}
277
288
])
278
289
279
- /** 获得每个 Tab 的数量 */
280
- const getTabsCount = async () => {
281
- const res = await CombinationRecordApi .getCombinationRecordCount ()
282
- shortcuts .value .forEach ((tab ) => {
283
- tab .text += ` (${res [tab .type ]}) `
284
- })
285
- }
286
-
287
290
/** 搜索按钮操作 */
288
291
const handleQuery = () => {
289
292
queryParams .value .pageNo = 1
@@ -306,7 +309,6 @@ const imagePreview = (imgUrl: string) => {
306
309
/** 初始化 **/
307
310
onMounted (async () => {
308
311
await getSummary ()
309
- await getTabsCount ()
310
312
await getList ()
311
313
})
312
314
</script >
0 commit comments