code review:签到记录

This commit is contained in:
YunaiV 2023-08-20 19:34:39 +08:00
parent 82628ce780
commit be485cc4ab
3 changed files with 10 additions and 37 deletions

View File

@ -11,8 +11,3 @@ export interface SignInRecordVO {
export const getSignInRecordPage = async (params) => {
return await request.get({ url: `/member/point/sign-in-record/page`, params })
}
// 导出用户签到积分 Excel
export const exportSignInRecord = async (params) => {
return await request.download({ url: `/member/point/sign-in-record/export-excel`, params })
}

View File

@ -77,7 +77,7 @@
width="180"
/>
<el-table-column label="用户" align="center" prop="nickname" width="200" />
<el-table-column label="变动积分" align="center" prop="point" width="100">
<el-table-column label="获得积分" align="center" prop="point" width="100">
<template #default="scope">
<el-tag v-if="scope.row.point > 0" class="ml-2" type="success" effect="dark">
+{{ scope.row.point }}

View File

@ -40,15 +40,6 @@
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['point:sign-in-record:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
@ -57,7 +48,6 @@
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table-column label="编号" align="center" prop="id" />
<!-- TODO @xiaqing展示用户昵称 -->
<el-table-column label="签到用户" align="center" prop="nickname" />
<el-table-column
label="签到天数"
@ -65,7 +55,14 @@
prop="day"
:formatter="(_, __, cellValue) => ['第', cellValue, '天'].join(' ')"
/>
<el-table-column label="获得积分" align="center" prop="point" />
<el-table-column label="获得积分" align="center" prop="point" width="100">
<template #default="scope">
<el-tag v-if="scope.row.point > 0" class="ml-2" type="success" effect="dark">
+{{ scope.row.point }}
</el-tag>
<el-tag v-else class="ml-2" type="danger" effect="dark"> {{ scope.row.point }} </el-tag>
</template>
</el-table-column>
<el-table-column
label="签到时间"
align="center"
@ -81,15 +78,11 @@
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<SignInRecordForm ref="formRef" @success="getList" />
</template>
<script lang="ts" setup>
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as SignInRecordApi from '@/api/point/signInRecord'
import * as SignInRecordApi from '@/api/member/signin/record'
defineOptions({ name: 'SignInRecord' })
@ -132,21 +125,6 @@ const resetQuery = () => {
handleQuery()
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SignInRecordApi.exportSignInRecord(queryParams)
download.excel(data, '用户签到积分.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()