会员签到针对代码格式、功能优化

1.优化todo建议
 2.删除无用代码
This commit is contained in:
xiaqing
2023-08-09 16:14:00 +08:00
parent ac0f387322
commit f310f65842
6 changed files with 54 additions and 251 deletions

View File

@ -58,7 +58,7 @@
<el-table v-loading="loading" :data="list">
<el-table-column label="编号" align="center" prop="id" />
<!-- TODO @xiaqing展示用户昵称 -->
<el-table-column label="签到用户" align="center" prop="userId" />
<el-table-column label="签到用户" align="center" prop="nickName" />
<el-table-column label="签到天数" align="center" prop="day" />
<el-table-column label="获得积分" align="center" prop="point" />
<el-table-column
@ -67,18 +67,6 @@
prop="createTime"
:formatter="dateFormatter"
/>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['point:sign-in-record:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
@ -97,12 +85,10 @@
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as SignInRecordApi from '@/api/point/signInRecord'
import SignInRecordForm from './SignInRecordForm.vue'
defineOptions({ name: 'SignInRecord' })
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
const loading = ref(true) // 列表的加载中
const total = ref(0) // 列表的总页数
@ -141,25 +127,6 @@ const resetQuery = () => {
handleQuery()
}
/** 添加/修改操作 */
// const formRef = ref()
// const openForm = (type: string, id?: number) => {
// formRef.value.open(type, id)
// }
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
// 删除的二次确认
await message.delConfirm()
// 发起删除
await SignInRecordApi.deleteSignInRecord(id)
message.success(t('common.delSuccess'))
// 刷新列表
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {