From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目
---
src/views/mall/promotion/combination/record/index.vue | 276 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 276 insertions(+), 0 deletions(-)
diff --git a/src/views/mall/promotion/combination/record/index.vue b/src/views/mall/promotion/combination/record/index.vue
new file mode 100644
index 0000000..b9b5ff7
--- /dev/null
+++ b/src/views/mall/promotion/combination/record/index.vue
@@ -0,0 +1,276 @@
+<template>
+ <doc-alert title="銆愯惀閿�銆戞嫾鍥㈡椿鍔�" url="https://doc.iocoder.cn/mall/promotion-combination/" />
+
+ <!-- 缁熻淇℃伅灞曠ず -->
+ <el-row :gutter="12">
+ <el-col :span="6">
+ <ContentWrap class="h-[110px] pb-0!">
+ <div class="flex items-center">
+ <div
+ class="h-[50px] w-[50px] flex items-center justify-center"
+ style="color: rgb(24 144 255); background-color: rgb(24 144 255 / 10%)"
+ >
+ <Icon :size="23" icon="fa:user-times" />
+ </div>
+ <div class="ml-[20px]">
+ <div class="mb-8px text-14px text-gray-400">鍙備笌浜烘暟(涓�)</div>
+ <CountTo
+ :duration="2600"
+ :end-val="recordSummary.userCount"
+ :start-val="0"
+ class="text-20px"
+ />
+ </div>
+ </div>
+ </ContentWrap>
+ </el-col>
+ <el-col :span="6">
+ <ContentWrap class="h-[110px]">
+ <div class="flex items-center">
+ <div
+ class="h-[50px] w-[50px] flex items-center justify-center"
+ style="color: rgb(162 119 255); background-color: rgb(162 119 255 / 10%)"
+ >
+ <Icon :size="23" icon="fa:user-plus" />
+ </div>
+ <div class="ml-[20px]">
+ <div class="mb-8px text-14px text-gray-400">鎴愬洟鏁伴噺(涓�)</div>
+ <CountTo
+ :duration="2600"
+ :end-val="recordSummary.successCount"
+ :start-val="0"
+ class="text-20px"
+ />
+ </div>
+ </div>
+ </ContentWrap>
+ </el-col>
+ <el-col :span="6">
+ <ContentWrap class="h-[110px]">
+ <div class="flex items-center">
+ <div
+ class="h-[50px] w-[50px] flex items-center justify-center"
+ style="color: rgb(162 119 255); background-color: rgb(162 119 255 / 10%)"
+ >
+ <Icon :size="23" icon="fa:user-plus" />
+ </div>
+ <div class="ml-[20px]">
+ <div class="mb-8px text-14px text-gray-400">铏氭嫙鎴愬洟(涓�)</div>
+ <CountTo
+ :duration="2600"
+ :end-val="recordSummary.virtualGroupCount"
+ :start-val="0"
+ class="text-20px"
+ />
+ </div>
+ </div>
+ </ContentWrap>
+ </el-col>
+ </el-row>
+
+ <!-- 鎼滅储宸ヤ綔鏍� -->
+ <ContentWrap>
+ <el-form
+ ref="queryFormRef"
+ :inline="true"
+ :model="queryParams"
+ class="-mb-15px"
+ label-width="68px"
+ >
+ <el-form-item label="鍒涘缓鏃堕棿" prop="createTime">
+ <el-date-picker
+ v-model="queryParams.createTime"
+ :shortcuts="defaultShortcuts"
+ class="!w-240px"
+ end-placeholder="缁撴潫鏃ユ湡"
+ start-placeholder="寮�濮嬫棩鏈�"
+ type="daterange"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ />
+ </el-form-item>
+ <el-form-item label="鎷煎洟鐘舵��" prop="status">
+ <el-select v-model="queryParams.status" class="!w-240px" clearable placeholder="鍏ㄩ儴">
+ <el-option
+ v-for="(dict, index) in getIntDictOptions(
+ DICT_TYPE.PROMOTION_COMBINATION_RECORD_STATUS
+ )"
+ :key="index"
+ :label="dict.label"
+ :value="dict.value"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button @click="handleQuery">
+ <Icon class="mr-5px" icon="ep:search" />
+ 鎼滅储
+ </el-button>
+ <el-button @click="resetQuery">
+ <Icon class="mr-5px" icon="ep:refresh" />
+ 閲嶇疆
+ </el-button>
+ </el-form-item>
+ </el-form>
+ </ContentWrap>
+
+ <!-- 鍒嗛〉鍒楄〃鏁版嵁灞曠ず -->
+ <ContentWrap>
+ <el-table v-loading="loading" :data="pageList">
+ <el-table-column align="center" label="缂栧彿" prop="id" min-width="50" />
+ <el-table-column align="center" label="澶村儚" prop="avatar" min-width="80">
+ <template #default="scope">
+ <el-avatar :src="scope.row.avatar" />
+ </template>
+ </el-table-column>
+ <el-table-column align="center" label="鏄电О" prop="nickname" min-width="100" />
+ <el-table-column align="center" label="寮�鍥㈠洟闀�" prop="headId" min-width="100">
+ <template #default="{ row }: { row: CombinationRecordApi.CombinationRecordVO }">
+ {{
+ row.headId ? pageList.find((item) => item.id === row.headId)?.nickname : row.nickname
+ }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ :formatter="dateFormatter"
+ align="center"
+ label="寮�鍥㈡椂闂�"
+ prop="startTime"
+ width="180"
+ />
+ <el-table-column
+ align="center"
+ label="鎷煎洟鍟嗗搧"
+ prop="type"
+ show-overflow-tooltip
+ min-width="300"
+ >
+ <template #default="{ row }">
+ <el-image
+ :src="row.picUrl"
+ class="mr-5px h-30px w-30px align-middle"
+ @click="imagePreview(row.picUrl)"
+ />
+ <span class="align-middle">{{ row.spuName }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column align="center" label="鍑犱汉鍥�" prop="userSize" min-width="100" />
+ <el-table-column align="center" label="鍙備笌浜烘暟" prop="userCount" min-width="100" />
+ <el-table-column
+ :formatter="dateFormatter"
+ align="center"
+ label="鍙傚洟鏃堕棿"
+ prop="createTime"
+ width="180"
+ />
+ <el-table-column
+ :formatter="dateFormatter"
+ align="center"
+ label="缁撴潫鏃堕棿"
+ prop="endTime"
+ width="180"
+ />
+ <el-table-column align="center" label="鎷煎洟鐘舵��" prop="status" min-width="150">
+ <template #default="scope">
+ <dict-tag
+ :type="DICT_TYPE.PROMOTION_COMBINATION_RECORD_STATUS"
+ :value="scope.row.status"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column align="center" fixed="right" label="鎿嶄綔">
+ <template #default="scope">
+ <el-button
+ v-hasPermi="['promotion:combination-record:query']"
+ link
+ type="primary"
+ @click="openRecordListDialog(scope.row)"
+ >
+ 鏌ョ湅鎷煎洟
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <!-- 鍒嗛〉 -->
+ <Pagination
+ v-model:limit="queryParams.pageSize"
+ v-model:page="queryParams.pageNo"
+ :total="total"
+ @pagination="getList"
+ />
+ </ContentWrap>
+
+ <!-- 琛ㄥ崟寮圭獥 -->
+ <CombinationRecordListDialog ref="combinationRecordListRef" />
+</template>
+<script lang="ts" setup>
+import CombinationRecordListDialog from './CombinationRecordListDialog.vue'
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { dateFormatter, defaultShortcuts } from '@/utils/formatTime'
+import { createImageViewer } from '@/components/ImageViewer'
+import * as CombinationRecordApi from '@/api/mall/promotion/combination/combinationRecord'
+
+defineOptions({ name: 'PromotionCombinationRecord' })
+
+const queryParams = ref({
+ status: undefined, // 鎷煎洟鐘舵��
+ createTime: undefined, // 鍒涘缓鏃堕棿
+ pageSize: 10,
+ pageNo: 1
+})
+const queryFormRef = ref() // 鎼滅储鐨勮〃鍗�
+const combinationRecordListRef = ref() // 鏌ヨ琛ㄥ崟 Ref
+const loading = ref(true) // 鍒楄〃鐨勫姞杞戒腑
+const total = ref(0) // 鎬昏褰曟暟
+const pageList = ref<CombinationRecordApi.CombinationRecordVO[]>([]) // 鍒嗛〉鏁版嵁
+/** 鏌ヨ鍒楄〃 */
+const getList = async () => {
+ loading.value = true
+ try {
+ const data = await CombinationRecordApi.getCombinationRecordPage(queryParams.value)
+ pageList.value = data.list as CombinationRecordApi.CombinationRecordVO[]
+ total.value = data.total
+ } finally {
+ loading.value = false
+ }
+}
+// 鎷煎洟缁熻鏁版嵁
+const recordSummary = ref({
+ successCount: 0,
+ userCount: 0,
+ virtualGroupCount: 0
+})
+/** 鑾峰緱鎷煎洟璁板綍缁熻淇℃伅 */
+const getSummary = async () => {
+ recordSummary.value = await CombinationRecordApi.getCombinationRecordSummary()
+}
+
+/** 鏌ョ湅鎷煎洟璇︽儏 */
+const openRecordListDialog = (row: CombinationRecordApi.CombinationRecordVO) => {
+ combinationRecordListRef.value?.open(row.headId || row.id) // 澶氳〃杈惧紡鐨勫師鍥狅紝鍥㈤暱鐨� headId 涓虹┖锛屽氨鏄嚜韬殑鎯呭喌
+}
+
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+ queryParams.value.pageNo = 1
+ getList()
+}
+
+/** 閲嶇疆鎸夐挳鎿嶄綔 */
+const resetQuery = () => {
+ queryFormRef.value.resetFields()
+ handleQuery()
+}
+
+/** 鍟嗗搧鍥鹃瑙� */
+const imagePreview = (imgUrl: string) => {
+ createImageViewer({
+ urlList: [imgUrl]
+ })
+}
+
+/** 鍒濆鍖� **/
+onMounted(async () => {
+ await getSummary()
+ await getList()
+})
+</script>
--
Gitblit v1.8.0