parent
664a86e71c
commit
a7f0c8d3a2
@ -10,10 +10,10 @@ export interface ConfigVO {
|
||||
|
||||
// 查询积分设置详情
|
||||
export const getConfig = async () => {
|
||||
return await request.get({ url: `/point/config/get` })
|
||||
return await request.get({ url: `/member/point/config/get` })
|
||||
}
|
||||
|
||||
// 新增修改积分设置
|
||||
export const saveConfig = async (data: ConfigVO) => {
|
||||
return await request.put({ url: `/point/config/save`, data })
|
||||
return await request.put({ url: `/member/point/config/save`, data })
|
||||
}
|
||||
|
@ -17,5 +17,5 @@ export interface RecordVO {
|
||||
|
||||
// 查询用户积分记录列表
|
||||
export const getRecordPage = async (params) => {
|
||||
return await request.get({ url: `/point/record/page`, params })
|
||||
return await request.get({ url: `/member/point/record/page`, params })
|
||||
}
|
||||
|
@ -4,30 +4,30 @@ export interface SignInConfigVO {
|
||||
id: number
|
||||
day: number | null
|
||||
point: number | null
|
||||
isEnable: boolean | null
|
||||
enable: boolean | null
|
||||
}
|
||||
|
||||
// 查询积分签到规则列表
|
||||
export const getSignInConfigPage = async () => {
|
||||
return await request.get({ url: `/point/sign-in-config/list` })
|
||||
return await request.get({ url: `/member/point/sign-in-config/list` })
|
||||
}
|
||||
|
||||
// 查询积分签到规则详情
|
||||
export const getSignInConfig = async (id: number) => {
|
||||
return await request.get({ url: `/point/sign-in-config/get?id=` + id })
|
||||
return await request.get({ url: `/member/point/sign-in-config/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增积分签到规则
|
||||
export const createSignInConfig = async (data: SignInConfigVO) => {
|
||||
return await request.post({ url: `/point/sign-in-config/create`, data })
|
||||
return await request.post({ url: `/member/point/sign-in-config/create`, data })
|
||||
}
|
||||
|
||||
// 修改积分签到规则
|
||||
export const updateSignInConfig = async (data: SignInConfigVO) => {
|
||||
return await request.put({ url: `/point/sign-in-config/update`, data })
|
||||
return await request.put({ url: `/member/point/sign-in-config/update`, data })
|
||||
}
|
||||
|
||||
// 删除积分签到规则
|
||||
export const deleteSignInConfig = async (id: number) => {
|
||||
return await request.delete({ url: `/point/sign-in-config/delete?id=` + id })
|
||||
return await request.delete({ url: `/member/point/sign-in-config/delete?id=` + id })
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ export interface SignInRecordVO {
|
||||
|
||||
// 查询用户签到积分列表
|
||||
export const getSignInRecordPage = async (params) => {
|
||||
return await request.get({ url: `/point/sign-in-record/page`, params })
|
||||
return await request.get({ url: `/member/point/sign-in-record/page`, params })
|
||||
}
|
||||
|
||||
// 导出用户签到积分 Excel
|
||||
export const exportSignInRecord = async (params) => {
|
||||
return await request.download({ url: `/point/sign-in-record/export-excel`, params })
|
||||
return await request.download({ url: `/member/point/sign-in-record/export-excel`, params })
|
||||
}
|
||||
|
@ -8,9 +8,9 @@
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="用户" prop="nickName">
|
||||
<el-form-item label="用户" prop="nickname">
|
||||
<el-input
|
||||
v-model="queryParams.nickName"
|
||||
v-model="queryParams.nickname"
|
||||
placeholder="请输入用户昵称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
@ -79,13 +79,13 @@
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="编号" align="center" prop="id" />
|
||||
<el-table-column label="用户" align="center" prop="nickName" />
|
||||
<el-table-column label="用户" align="center" prop="nickname" />
|
||||
<el-table-column label="积分标题" align="center" prop="title" />
|
||||
<el-table-column label="积分描述" align="center" prop="description" />
|
||||
<el-table-column
|
||||
label="获得时间"
|
||||
align="center"
|
||||
prop="createDate"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column label="积分" align="center" prop="point">
|
||||
@ -147,7 +147,7 @@ const list = ref([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
nickName: null,
|
||||
nickname: null,
|
||||
bizType: null,
|
||||
type: null,
|
||||
title: null,
|
||||
|
@ -71,6 +71,8 @@ const submitForm = async () => {
|
||||
try {
|
||||
const data = formData.value as unknown as SignInConfigApi.SignInConfigVO
|
||||
if (formType.value === 'create') {
|
||||
//默认新创建的自动启动
|
||||
data.enable = true
|
||||
await SignInConfigApi.createSignInConfig(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
|
@ -25,8 +25,8 @@
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-switch
|
||||
v-model="scope.row.isEnable"
|
||||
@change="handleSwitchChange(scope.row.id, $event)"
|
||||
v-model="scope.row.enable"
|
||||
@change="handleSwitchChange(scope.row, $event)"
|
||||
inline-prompt
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
@ -105,15 +105,11 @@ const handleDelete = async (id: number) => {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
const handleSwitchChange = async (id, e) => {
|
||||
console.log('开关状态变更,id:', id, '新状态:', e)
|
||||
const handleSwitchChange = async (row, e) => {
|
||||
console.log('开关状态变更,id:', row, '新状态:', e)
|
||||
// 创建对象
|
||||
const signInConfig: SignInConfigVO = {
|
||||
id: id,
|
||||
day: null,
|
||||
point: null,
|
||||
isEnable: e
|
||||
}
|
||||
const signInConfig: SignInConfigVO = { enable: e }
|
||||
;({ id: signInConfig.id, day: signInConfig.day, point: signInConfig.point, enable: e } = row)
|
||||
await SignInConfigApi.updateSignInConfig(signInConfig)
|
||||
}
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="签到用户" prop="nickName">
|
||||
<el-form-item label="签到用户" prop="nickname">
|
||||
<el-input
|
||||
v-model="queryParams.nickName"
|
||||
v-model="queryParams.nickname"
|
||||
placeholder="请输入签到用户"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
@ -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="nickName" />
|
||||
<el-table-column label="签到用户" align="center" prop="nickname" />
|
||||
<el-table-column
|
||||
label="签到天数"
|
||||
align="center"
|
||||
@ -101,7 +101,7 @@ const list = ref([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
nickName: null,
|
||||
nickname: null,
|
||||
day: null,
|
||||
createTime: []
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user