Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a5330958
authored
Jul 03, 2023
by
puhui999
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'yudao/dev' into dev-to-dev
parents
2e96b1c9
4571f893
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
145 additions
and
475 deletions
+145
-475
src/api/point/config/index.ts
+5
-25
src/utils/dict.ts
+2
-3
src/views/mall/product/spu/components/index.ts
+4
-1
src/views/mall/product/spu/index.vue
+2
-0
src/views/mall/promotion/components/SpuSelect.vue
+0
-1
src/views/mall/promotion/components/index.ts
+1
-0
src/views/mall/promotion/seckill/activity/index.vue
+3
-0
src/views/mall/promotion/seckill/activity/seckillActivity.data.ts
+1
-1
src/views/member/point/config/index.vue
+93
-0
src/views/member/point/record/RecordForm.vue
+3
-2
src/views/member/point/record/index.vue
+22
-91
src/views/member/signin/config/SignInConfigForm.vue
+0
-0
src/views/member/signin/config/index.vue
+6
-9
src/views/member/signin/record/SignInRecordForm.vue
+0
-0
src/views/member/signin/record/index.vue
+3
-18
src/views/point/config/ConfigForm.vue
+0
-122
src/views/point/config/index.vue
+0
-202
No files found.
src/api/point/config/index.ts
View file @
a5330958
...
@@ -8,32 +8,12 @@ export interface ConfigVO {
...
@@ -8,32 +8,12 @@ export interface ConfigVO {
tradeGivePoint
:
number
tradeGivePoint
:
number
}
}
// 查询积分设置列表
export
const
getConfigPage
=
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
`/point/config/page`
,
params
})
}
// 查询积分设置详情
// 查询积分设置详情
export
const
getConfig
=
async
(
id
:
number
)
=>
{
export
const
getConfig
=
async
()
=>
{
return
await
request
.
get
({
url
:
`/point/config/get?id=`
+
id
})
return
await
request
.
get
({
url
:
`/point/config/get`
})
}
// 新增积分设置
export
const
createConfig
=
async
(
data
:
ConfigVO
)
=>
{
return
await
request
.
post
({
url
:
`/point/config/create`
,
data
})
}
// 修改积分设置
export
const
updateConfig
=
async
(
data
:
ConfigVO
)
=>
{
return
await
request
.
put
({
url
:
`/point/config/update`
,
data
})
}
// 删除积分设置
export
const
deleteConfig
=
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/point/config/delete?id=`
+
id
})
}
}
//
导出积分设置 Excel
//
新增修改积分设置
export
const
exportConfig
=
async
(
params
)
=>
{
export
const
saveConfig
=
async
(
data
:
ConfigVO
)
=>
{
return
await
request
.
download
({
url
:
`/point/config/export-excel`
,
params
})
return
await
request
.
put
({
url
:
`/point/config/save`
,
data
})
}
}
src/utils/dict.ts
View file @
a5330958
...
@@ -146,9 +146,8 @@ export enum DICT_TYPE {
...
@@ -146,9 +146,8 @@ export enum DICT_TYPE {
MP_MESSAGE_TYPE
=
'mp_message_type'
,
// 消息类型
MP_MESSAGE_TYPE
=
'mp_message_type'
,
// 消息类型
// ========== MALL - 会员模块 ==========
// ========== MALL - 会员模块 ==========
// 积分模块 TODO 芋艿:改成 member_ 前缀;包括枚举和值;
MEMBER_POINT_BIZ_TYPE
=
'member_point_biz_type'
,
// 积分的业务类型
POINT_BIZ_TYPE
=
'point_biz_type'
,
MEMBER_POINT_STATUS
=
'member_point_status'
,
// 积分的状态
POINT_STATUS
=
'point_status'
,
// ========== MALL - 商品模块 ==========
// ========== MALL - 商品模块 ==========
PRODUCT_UNIT
=
'product_unit'
,
// 商品单位
PRODUCT_UNIT
=
'product_unit'
,
// 商品单位
...
...
src/views/mall/product/spu/components/index.ts
View file @
a5330958
...
@@ -7,6 +7,7 @@ import SkuList from './SkuList.vue'
...
@@ -7,6 +7,7 @@ import SkuList from './SkuList.vue'
import
{
Spu
}
from
'@/api/mall/product/spu'
import
{
Spu
}
from
'@/api/mall/product/spu'
// TODO @puhui999:Properties 改成 Property 更合适?
interface
Properties
{
interface
Properties
{
id
:
number
id
:
number
name
:
string
name
:
string
...
@@ -30,8 +31,10 @@ interface RuleConfig {
...
@@ -30,8 +31,10 @@ interface RuleConfig {
}
}
/**
/**
* 商品通用函数
* 获得商品的规格列表
*
* @param spu
* @param spu
* @return Property 规格列表
*/
*/
const
getPropertyList
=
(
spu
:
Spu
):
Properties
[]
=>
{
const
getPropertyList
=
(
spu
:
Spu
):
Properties
[]
=>
{
// 直接拿返回的 skus 属性逆向生成出 propertyList
// 直接拿返回的 skus 属性逆向生成出 propertyList
...
...
src/views/mall/product/spu/index.vue
View file @
a5330958
...
@@ -437,6 +437,7 @@ const categoryList = ref() // 分类树
...
@@ -437,6 +437,7 @@ const categoryList = ref() // 分类树
const
categoryString
=
(
categoryId
)
=>
{
const
categoryString
=
(
categoryId
)
=>
{
return
treeToString
(
categoryList
.
value
,
categoryId
)
return
treeToString
(
categoryList
.
value
,
categoryId
)
}
}
/**
/**
* 校验所选是否为二级及以下节点
* 校验所选是否为二级及以下节点
*/
*/
...
@@ -446,6 +447,7 @@ const nodeClick = () => {
...
@@ -446,6 +447,7 @@ const nodeClick = () => {
message
.
warning
(
'必须选择二级及以下节点!!'
)
message
.
warning
(
'必须选择二级及以下节点!!'
)
}
}
}
}
/** 初始化 **/
/** 初始化 **/
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
await
getTabsCount
()
await
getTabsCount
()
...
...
src/views/mall/promotion/components/SpuSelect.vue
View file @
a5330958
...
@@ -256,7 +256,6 @@ const imagePreview = (imgUrl: string) => {
...
@@ -256,7 +256,6 @@ const imagePreview = (imgUrl: string) => {
const
categoryList
=
ref
()
// 分类树
const
categoryList
=
ref
()
// 分类树
// TODO @puhui999:商品搜索的时候,可以通过一级搜二级;所以这个校验可以去掉哈;也就是说,只允许挂在二级,但是一级可搜索到
/** 初始化 **/
/** 初始化 **/
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
await
getList
()
await
getList
()
...
...
src/views/mall/promotion/components/index.ts
View file @
a5330958
...
@@ -7,6 +7,7 @@ type SpuProperty<T> = {
...
@@ -7,6 +7,7 @@ type SpuProperty<T> = {
spuDetail
:
T
spuDetail
:
T
propertyList
:
Properties
[]
propertyList
:
Properties
[]
}
}
/**
/**
* 提供商品活动商品选择通用组件
* 提供商品活动商品选择通用组件
*/
*/
...
...
src/views/mall/promotion/seckill/activity/index.vue
View file @
a5330958
...
@@ -89,6 +89,8 @@ const openForm = (type: string, id?: number) => {
...
@@ -89,6 +89,8 @@ const openForm = (type: string, id?: number) => {
const
handleDelete
=
(
id
:
number
)
=>
{
const
handleDelete
=
(
id
:
number
)
=>
{
tableMethods
.
delList
(
id
,
false
)
tableMethods
.
delList
(
id
,
false
)
}
}
// TODO @puhui:是不是直接叫 configList 就好啦
const
seckillConfigAllSimple
=
ref
([])
// 时段配置精简列表
const
seckillConfigAllSimple
=
ref
([])
// 时段配置精简列表
const
convertSeckillConfigNames
=
computed
(
const
convertSeckillConfigNames
=
computed
(
()
=>
(
row
)
=>
()
=>
(
row
)
=>
...
@@ -96,6 +98,7 @@ const convertSeckillConfigNames = computed(
...
@@ -96,6 +98,7 @@ const convertSeckillConfigNames = computed(
?.
filter
((
item
)
=>
row
.
configIds
.
includes
(
item
.
id
))
?.
filter
((
item
)
=>
row
.
configIds
.
includes
(
item
.
id
))
?.
map
((
config
)
=>
config
.
name
)
?.
map
((
config
)
=>
config
.
name
)
)
)
const
expandChange
=
(
row
,
expandedRows
)
=>
{
const
expandChange
=
(
row
,
expandedRows
)
=>
{
// TODO puhui:等 CRUD 完事后弄
// TODO puhui:等 CRUD 完事后弄
console
.
log
(
row
,
expandedRows
)
console
.
log
(
row
,
expandedRows
)
...
...
src/views/mall/promotion/seckill/activity/seckillActivity.data.ts
View file @
a5330958
...
@@ -219,7 +219,7 @@ const crudSchemas = reactive<CrudSchema[]>([
...
@@ -219,7 +219,7 @@ const crudSchemas = reactive<CrudSchema[]>([
},
},
{
{
label
:
'状态'
,
label
:
'状态'
,
field
:
'status'
,
// TODO @puhui999:状态在 table 格式化不对;建表插入的数据状态值不对,改为 0 或 1 就好了
field
:
'status'
,
dictType
:
DICT_TYPE
.
COMMON_STATUS
,
dictType
:
DICT_TYPE
.
COMMON_STATUS
,
dictClass
:
'number'
,
dictClass
:
'number'
,
isForm
:
false
,
isForm
:
false
,
...
...
src/views/member/point/config/index.vue
0 → 100644
View file @
a5330958
<
template
>
<ContentWrap>
<el-form
ref=
"formRef"
:model=
"formData"
:rules=
"formRules"
label-width=
"120px"
v-loading=
"formLoading"
>
<el-form-item
label=
"hideId"
v-show=
"false"
>
<el-input
v-model=
"formData.id"
/>
</el-form-item>
<!-- TODO @xiaqing:展示给用户的字段名,可以和 crmeb 保持一直,然后每一个表单都有类似 crmeb 的 tip;例如说:积分抵用比例(1积分抵多少金额)单位:元 -->
<el-form-item
label=
"积分抵扣"
prop=
"tradeDeductEnable"
>
<el-switch
v-model=
"formData.tradeDeductEnable"
/>
</el-form-item>
<!-- TODO @xiaqing:用户看到的是元,最多 2 位;分是后端的存储哈 -->
<el-form-item
label=
"抵扣单位(分)"
prop=
"tradeDeductUnitPrice"
>
<el-input-number
v-model=
"formData.tradeDeductUnitPrice"
placeholder=
"请输入抵扣单位(分)"
style=
"width: 300px"
/>
</el-form-item>
<el-form-item
label=
"积分抵扣最大值"
prop=
"tradeDeductMaxPrice"
>
<el-input-number
v-model=
"formData.tradeDeductMaxPrice"
placeholder=
"请输入积分抵扣最大值"
style=
"width: 300px"
/>
</el-form-item>
<el-form-item
label=
"1 元赠送多少分"
prop=
"tradeGivePoint"
>
<el-input-number
v-model=
"formData.tradeGivePoint"
placeholder=
"请输入 1 元赠送多少积分"
style=
"width: 300px"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"onSubmit"
>
提交
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
</
template
>
<
script
lang=
"ts"
setup
>
import
*
as
ConfigApi
from
'@/api/point/config'
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
formLoading
=
ref
(
false
)
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const
formData
=
ref
({
id
:
undefined
,
tradeDeductEnable
:
undefined
,
tradeDeductUnitPrice
:
undefined
,
tradeDeductMaxPrice
:
undefined
,
tradeGivePoint
:
undefined
})
const
formRules
=
reactive
({})
const
formRef
=
ref
()
// 表单 Ref
/** 修改积分配置 */
const
onSubmit
=
async
()
=>
{
// 校验表单
if
(
!
formRef
)
return
const
valid
=
await
formRef
.
value
.
validate
()
if
(
!
valid
)
return
// 提交请求
formLoading
.
value
=
true
try
{
const
data
=
formData
.
value
as
unknown
as
ConfigApi
.
ConfigVO
await
ConfigApi
.
saveConfig
(
data
)
message
.
success
(
t
(
'common.updateSuccess'
))
dialogVisible
.
value
=
false
}
finally
{
formLoading
.
value
=
false
}
}
/** 获得积分配置 */
const
getConfig
=
async
()
=>
{
try
{
const
data
=
await
ConfigApi
.
getConfig
()
formData
.
value
=
data
}
finally
{
}
}
onMounted
(()
=>
{
getConfig
()
})
</
script
>
src/views/point/record/RecordForm.vue
→
src/views/
member/
point/record/RecordForm.vue
View file @
a5330958
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<el-form-item
label=
"业务类型"
prop=
"bizType"
>
<el-form-item
label=
"业务类型"
prop=
"bizType"
>
<el-select
v-model=
"formData.bizType"
placeholder=
"请选择业务类型"
>
<el-select
v-model=
"formData.bizType"
placeholder=
"请选择业务类型"
>
<el-option
<el-option
v-for=
"dict in getStrDictOptions(DICT_TYPE.POINT_BIZ_TYPE)"
v-for=
"dict in getStrDictOptions(DICT_TYPE.
MEMBER_
POINT_BIZ_TYPE)"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<el-form-item
label=
"积分状态"
prop=
"status"
>
<el-form-item
label=
"积分状态"
prop=
"status"
>
<el-select
v-model=
"formData.status"
placeholder=
"积分状态"
>
<el-select
v-model=
"formData.status"
placeholder=
"积分状态"
>
<el-option
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.POINT_STATUS)"
v-for=
"dict in getIntDictOptions(DICT_TYPE.
MEMBER_
POINT_STATUS)"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -157,6 +157,7 @@ const submitForm = async () => {
...
@@ -157,6 +157,7 @@ const submitForm = async () => {
}
}
}
}
// TODO @xiaqing:不需要更新操作哇?
/** 重置表单 */
/** 重置表单 */
const
resetForm
=
()
=>
{
const
resetForm
=
()
=>
{
formData
.
value
=
{
formData
.
value
=
{
...
...
src/views/point/record/index.vue
→
src/views/
member/
point/record/index.vue
View file @
a5330958
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
class=
"!w-240px"
class=
"!w-240px"
>
>
<el-option
<el-option
v-for=
"dict in getStrDictOptions(DICT_TYPE.POINT_BIZ_TYPE)"
v-for=
"dict in getStrDictOptions(DICT_TYPE.
MEMBER_
POINT_BIZ_TYPE)"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
...
@@ -50,14 +50,14 @@
...
@@ -50,14 +50,14 @@
<el-form-item
label=
"积分状态"
prop=
"status"
>
<el-form-item
label=
"积分状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
class=
"!w-240px"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
class=
"!w-240px"
>
<el-option
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.POINT_STATUS)"
v-for=
"dict in getIntDictOptions(DICT_TYPE.
MEMBER_
POINT_STATUS)"
:key=
"dict.value"
:key=
"dict.value"
:label=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
:value=
"dict.value"
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
发生
时间"
prop=
"createDate"
>
<el-form-item
label=
"
获得
时间"
prop=
"createDate"
>
<el-date-picker
<el-date-picker
v-model=
"queryParams.createDate"
v-model=
"queryParams.createDate"
value-format=
"YYYY-MM-DD HH:mm:ss"
value-format=
"YYYY-MM-DD HH:mm:ss"
...
@@ -71,18 +71,6 @@
...
@@ -71,18 +71,6 @@
<el-form-item>
<el-form-item>
<el-button
@
click=
"handleQuery"
><Icon
icon=
"ep:search"
class=
"mr-5px"
/>
搜索
</el-button>
<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
@
click=
"resetQuery"
><Icon
icon=
"ep:refresh"
class=
"mr-5px"
/>
重置
</el-button>
<el-button
type=
"primary"
@
click=
"openForm('create')"
v-hasPermi=
"['point:record:create']"
>
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
新增
</el-button>
<el-button
type=
"success"
plain
@
click=
"handleExport"
:loading=
"exportLoading"
v-hasPermi=
"['point:record:export']"
>
<Icon
icon=
"ep:download"
class=
"mr-5px"
/>
导出
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</ContentWrap>
</ContentWrap>
...
@@ -90,13 +78,18 @@
...
@@ -90,13 +78,18 @@
<!-- 列表 -->
<!-- 列表 -->
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"序号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"业务编码"
align=
"center"
prop=
"bizId"
/>
<!-- TODO @xiaqing:展示用户的昵称哈; -->
<el-table-column
label=
"业务类型"
align=
"center"
prop=
"bizType"
>
<el-table-column
label=
"用户"
align=
"center"
prop=
"userId"
/>
<template
#
default=
"scope"
>
<el-table-column
label=
"积分标题"
align=
"center"
prop=
"title"
/>
<dict-tag
:type=
"DICT_TYPE.POINT_BIZ_TYPE"
:value=
"scope.row.bizType"
/>
<el-table-column
label=
"积分描述"
align=
"center"
prop=
"description"
/>
</
template
>
<el-table-column
</el-table-column>
label=
"获得时间"
align=
"center"
prop=
"createDate"
:formatter=
"dateFormatter"
/>
<!-- todo @xiaqing:可以参考 crmeb 的展示,把积分和增加减少放一起,用红色和绿色展示 -->
<el-table-column
<el-table-column
label=
"操作类型"
label=
"操作类型"
align=
"center"
align=
"center"
...
@@ -107,16 +100,19 @@
...
@@ -107,16 +100,19 @@
}
}
"
"
/>
/>
<el-table-column
label=
"积分标题"
align=
"center"
prop=
"title"
/>
<el-table-column
label=
"积分描述"
align=
"center"
prop=
"description"
/>
<el-table-column
label=
"积分"
align=
"center"
prop=
"point"
/>
<el-table-column
label=
"积分"
align=
"center"
prop=
"point"
/>
<el-table-column
label=
"变动后的积分"
align=
"center"
prop=
"totalPoint"
/>
<el-table-column
label=
"变动后的积分"
align=
"center"
prop=
"totalPoint"
/>
<el-table-column
label=
"业务编码"
align=
"center"
prop=
"bizId"
/>
<el-table-column
label=
"业务类型"
align=
"center"
prop=
"bizType"
>
<template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.MEMBER_POINT_BIZ_TYPE"
:value=
"scope.row.bizType"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.POINT_STATUS"
:value=
"scope.row.status"
/>
<dict-tag
:type=
"DICT_TYPE.
MEMBER_
POINT_STATUS"
:value=
"scope.row.status"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"用户id"
align=
"center"
prop=
"userId"
/>
<el-table-column
<el-table-column
label=
"冻结时间"
label=
"冻结时间"
align=
"center"
align=
"center"
...
@@ -129,32 +125,6 @@
...
@@ -129,32 +125,6 @@
prop=
"thawingTime"
prop=
"thawingTime"
:formatter=
"dateFormatter"
:formatter=
"dateFormatter"
/>
/>
<el-table-column
label=
"发生时间"
align=
"center"
prop=
"createDate"
:formatter=
"dateFormatter"
/>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
#
default=
"scope"
>
<el-button
link
type=
"primary"
@
click=
"openForm('update', scope.row.id)"
v-hasPermi=
"['point:record:update']"
>
编辑
</el-button>
<el-button
link
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
v-hasPermi=
"['point:record:delete']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<!-- 分页 -->
<Pagination
<Pagination
...
@@ -172,15 +142,11 @@
...
@@ -172,15 +142,11 @@
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
,
getStrDictOptions
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getStrDictOptions
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
download
from
'@/utils/download'
import
*
as
RecordApi
from
'@/api/point/record'
import
*
as
RecordApi
from
'@/api/point/record'
import
RecordForm
from
'./RecordForm.vue'
import
RecordForm
from
'./RecordForm.vue'
defineOptions
({
name
:
'PointRecord'
})
defineOptions
({
name
:
'PointRecord'
})
const
message
=
useMessage
()
// 消息弹窗
const
{
t
}
=
useI18n
()
// 国际化
const
loading
=
ref
(
true
)
// 列表的加载中
const
loading
=
ref
(
true
)
// 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
const
list
=
ref
([])
// 列表的数据
...
@@ -195,7 +161,6 @@ const queryParams = reactive({
...
@@ -195,7 +161,6 @@ const queryParams = reactive({
createDate
:
[]
createDate
:
[]
})
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
const
exportLoading
=
ref
(
false
)
// 导出的加载中
/** 查询列表 */
/** 查询列表 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
...
@@ -221,40 +186,6 @@ const resetQuery = () => {
...
@@ -221,40 +186,6 @@ const resetQuery = () => {
handleQuery
()
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
RecordApi
.
deleteRecord
(
id
)
message
.
success
(
t
(
'common.delSuccess'
))
// 刷新列表
await
getList
()
}
catch
{}
}
/** 导出按钮操作 */
const
handleExport
=
async
()
=>
{
try
{
// 导出的二次确认
await
message
.
exportConfirm
()
// 发起导出
exportLoading
.
value
=
true
const
data
=
await
RecordApi
.
exportRecord
(
queryParams
)
download
.
excel
(
data
,
'用户积分记录.xls'
)
}
catch
{
}
finally
{
exportLoading
.
value
=
false
}
}
/** 初始化 **/
/** 初始化 **/
onMounted
(()
=>
{
onMounted
(()
=>
{
getList
()
getList
()
...
...
src/views/
point/signInC
onfig/SignInConfigForm.vue
→
src/views/
member/signin/c
onfig/SignInConfigForm.vue
View file @
a5330958
File moved
src/views/
point/signInC
onfig/index.vue
→
src/views/
member/signin/c
onfig/index.vue
View file @
a5330958
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
:inline=
"true"
:inline=
"true"
label-width=
"68px"
label-width=
"68px"
>
>
<!-- TODO @xiaqing:搜索可以去掉,因为一共就没几条配置哈 -->
<el-form-item
label=
"签到天数"
prop=
"day"
>
<el-form-item
label=
"签到天数"
prop=
"day"
>
<el-input
<el-input
v-model=
"queryParams.day"
v-model=
"queryParams.day"
...
@@ -35,6 +36,7 @@
...
@@ -35,6 +36,7 @@
:loading=
"exportLoading"
:loading=
"exportLoading"
v-hasPermi=
"['point:sign-in-config:export']"
v-hasPermi=
"['point:sign-in-config:export']"
>
>
<!-- TODO @xiaqing:四个功能的导出都可以去掉 -->
<Icon
icon=
"ep:download"
class=
"mr-5px"
/>
导出
<Icon
icon=
"ep:download"
class=
"mr-5px"
/>
导出
</el-button>
</el-button>
</el-form-item>
</el-form-item>
...
@@ -44,15 +46,10 @@
...
@@ -44,15 +46,10 @@
<!-- 列表 -->
<!-- 列表 -->
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<
el-table-column
label=
"序号"
align=
"center"
prop=
"id"
v-if=
"false"
/
>
<
!-- TODO @xiaqing:展示优化下,改成第 1 天、第 2 天这种 --
>
<el-table-column
label=
"签到天数"
align=
"center"
prop=
"day"
/>
<el-table-column
label=
"签到天数"
align=
"center"
prop=
"day"
/>
<el-table-column
label=
"签到分数"
align=
"center"
prop=
"point"
/>
<el-table-column
label=
"获得积分"
align=
"center"
prop=
"point"
/>
<el-table-column
<!-- TODO @xiaqing:展示一个是否开启 -->
label=
"创建时间"
align=
"center"
prop=
"createTime"
:formatter=
"dateFormatter"
/>
<el-table-column
label=
"操作"
align=
"center"
>
<el-table-column
label=
"操作"
align=
"center"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<el-button
<el-button
...
@@ -88,7 +85,6 @@
...
@@ -88,7 +85,6 @@
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
download
from
'@/utils/download'
import
download
from
'@/utils/download'
import
*
as
SignInConfigApi
from
'@/api/point/signInConfig'
import
*
as
SignInConfigApi
from
'@/api/point/signInConfig'
import
SignInConfigForm
from
'./SignInConfigForm.vue'
import
SignInConfigForm
from
'./SignInConfigForm.vue'
...
@@ -109,6 +105,7 @@ const queryParams = reactive({
...
@@ -109,6 +105,7 @@ const queryParams = reactive({
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
const
exportLoading
=
ref
(
false
)
// 导出的加载中
const
exportLoading
=
ref
(
false
)
// 导出的加载中
// TODO @xiaqing:可以不分页;
/** 查询列表 */
/** 查询列表 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
...
...
src/views/
point/signInR
ecord/SignInRecordForm.vue
→
src/views/
member/signin/r
ecord/SignInRecordForm.vue
View file @
a5330958
File moved
src/views/
point/signInR
ecord/index.vue
→
src/views/
member/signin/r
ecord/index.vue
View file @
a5330958
...
@@ -40,14 +40,6 @@
...
@@ -40,14 +40,6 @@
<el-form-item>
<el-form-item>
<el-button
@
click=
"handleQuery"
><Icon
icon=
"ep:search"
class=
"mr-5px"
/>
搜索
</el-button>
<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
@
click=
"resetQuery"
><Icon
icon=
"ep:refresh"
class=
"mr-5px"
/>
重置
</el-button>
<!--
<el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- @click="openForm('create')"-->
<!-- v-hasPermi="['point:sign-in-record:create']"-->
<!-- >-->
<!--
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
新增-->
<!--
</el-button>
-->
<el-button
<el-button
type=
"success"
type=
"success"
plain
plain
...
@@ -64,10 +56,11 @@
...
@@ -64,10 +56,11 @@
<!-- 列表 -->
<!-- 列表 -->
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"序号"
align=
"center"
prop=
"id"
/>
<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=
"userId"
/>
<el-table-column
label=
"签到天数"
align=
"center"
prop=
"day"
/>
<el-table-column
label=
"签到天数"
align=
"center"
prop=
"day"
/>
<el-table-column
label=
"
签到的分数
"
align=
"center"
prop=
"point"
/>
<el-table-column
label=
"
获得积分
"
align=
"center"
prop=
"point"
/>
<el-table-column
<el-table-column
label=
"签到时间"
label=
"签到时间"
align=
"center"
align=
"center"
...
@@ -76,14 +69,6 @@
...
@@ -76,14 +69,6 @@
/>
/>
<el-table-column
label=
"操作"
align=
"center"
>
<el-table-column
label=
"操作"
align=
"center"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<!--
<el-button-->
<!-- link-->
<!-- type="primary"-->
<!-- @click="openForm('update', scope.row.id)"-->
<!-- v-hasPermi="['point:sign-in-record:update']"-->
<!-- >-->
<!-- 编辑-->
<!--
</el-button>
-->
<el-button
<el-button
link
link
type=
"danger"
type=
"danger"
...
...
src/views/point/config/ConfigForm.vue
deleted
100644 → 0
View file @
2e96b1c9
<
template
>
<Dialog
:title=
"dialogTitle"
v-model=
"dialogVisible"
style=
"width: 600px"
>
<el-form
ref=
"formRef"
:model=
"formData"
:rules=
"formRules"
label-width=
"120px"
v-loading=
"formLoading"
>
<el-form-item
label=
"积分抵扣"
prop=
"tradeDeductEnable"
>
<el-select
v-model=
"formData.tradeDeductEnable"
placeholder=
"请选择是否开启"
>
<el-option
v-for=
"dict in options"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"抵扣单位(元)"
prop=
"tradeDeductUnitPrice"
>
<el-input
v-model=
"formData.tradeDeductUnitPrice"
placeholder=
"请输入抵扣单位(元)"
/>
</el-form-item>
<el-form-item
label=
"积分抵扣最大值"
prop=
"tradeDeductMaxPrice"
>
<el-input
v-model=
"formData.tradeDeductMaxPrice"
placeholder=
"请输入积分抵扣最大值"
/>
</el-form-item>
<el-form-item
label=
"1元赠送多少分"
prop=
"tradeGivePoint"
>
<el-input
v-model=
"formData.tradeGivePoint"
placeholder=
"请输入1元赠送多少分"
/>
</el-form-item>
</el-form>
<template
#
footer
>
<el-button
@
click=
"submitForm"
type=
"primary"
:disabled=
"formLoading"
>
确 定
</el-button>
<el-button
@
click=
"dialogVisible = false"
>
取 消
</el-button>
</
template
>
</Dialog>
</template>
<
script
lang=
"ts"
setup
>
import
*
as
ConfigApi
from
'@/api/point/config'
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
dialogTitle
=
ref
(
''
)
// 弹窗的标题
const
formLoading
=
ref
(
false
)
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const
formType
=
ref
(
''
)
// 表单的类型:create - 新增;update - 修改
const
formData
=
ref
({
id
:
undefined
,
tradeDeductEnable
:
undefined
,
tradeDeductUnitPrice
:
undefined
,
tradeDeductMaxPrice
:
undefined
,
tradeGivePoint
:
undefined
})
const
formRules
=
reactive
({})
const
formRef
=
ref
()
// 表单 Ref
const
options
=
[
{
value
:
'1'
,
label
:
'是'
},
{
value
:
'0'
,
label
:
'否'
}
]
/** 打开弹窗 */
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
dialogVisible
.
value
=
true
dialogTitle
.
value
=
t
(
'action.'
+
type
)
formType
.
value
=
type
resetForm
()
// 修改时,设置数据
if
(
id
)
{
formLoading
.
value
=
true
try
{
formData
.
value
=
await
ConfigApi
.
getConfig
(
id
)
}
finally
{
formLoading
.
value
=
false
}
}
}
defineExpose
({
open
})
// 提供 open 方法,用于打开弹窗
/** 提交表单 */
const
emit
=
defineEmits
([
'success'
])
// 定义 success 事件,用于操作成功后的回调
const
submitForm
=
async
()
=>
{
// 校验表单
if
(
!
formRef
)
return
const
valid
=
await
formRef
.
value
.
validate
()
if
(
!
valid
)
return
// 提交请求
formLoading
.
value
=
true
try
{
const
data
=
formData
.
value
as
unknown
as
ConfigApi
.
ConfigVO
if
(
formType
.
value
===
'create'
)
{
await
ConfigApi
.
createConfig
(
data
)
message
.
success
(
t
(
'common.createSuccess'
))
}
else
{
await
ConfigApi
.
updateConfig
(
data
)
message
.
success
(
t
(
'common.updateSuccess'
))
}
dialogVisible
.
value
=
false
// 发送操作成功的事件
emit
(
'success'
)
}
finally
{
formLoading
.
value
=
false
}
}
/** 重置表单 */
const
resetForm
=
()
=>
{
formData
.
value
=
{
id
:
undefined
,
tradeDeductEnable
:
undefined
,
tradeDeductUnitPrice
:
undefined
,
tradeDeductMaxPrice
:
undefined
,
tradeGivePoint
:
undefined
}
formRef
.
value
?.
resetFields
()
}
</
script
>
src/views/point/config/index.vue
deleted
100644 → 0
View file @
2e96b1c9
<
template
>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class=
"-mb-15px"
:model=
"queryParams"
ref=
"queryFormRef"
:inline=
"true"
label-width=
"68px"
>
<el-form-item
label=
"是否开启"
prop=
"tradeDeductEnable"
>
<el-select
v-model=
"queryParams.tradeDeductEnable"
placeholder=
"请选择是否开启"
clearable
class=
"!w-240px"
>
<el-option
v-for=
"dict in options"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<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=
"primary"
@
click=
"openForm('create')"
v-hasPermi=
"['point:config:create']"
>
<Icon
icon=
"ep:plus"
class=
"mr-5px"
/>
新增
</el-button>
<el-button
type=
"success"
plain
@
click=
"handleExport"
:loading=
"exportLoading"
v-hasPermi=
"['point:config:export']"
>
<Icon
icon=
"ep:download"
class=
"mr-5px"
/>
导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"序号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"积分抵扣(是否开启)"
align=
"center"
prop=
"tradeDeductEnable"
:formatter=
"tradeDeductFormat"
/>
<el-table-column
label=
"抵扣单位(元)"
align=
"center"
prop=
"tradeDeductUnitPrice"
/>
<el-table-column
label=
"积分抵扣最大值"
align=
"center"
prop=
"tradeDeductMaxPrice"
/>
<el-table-column
label=
"1元赠送多少分"
align=
"center"
prop=
"tradeGivePoint"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
:formatter=
"dateFormatter"
/>
<el-table-column
label=
"变更时间"
align=
"center"
prop=
"updateTime"
:formatter=
"dateFormatter"
/>
<el-table-column
label=
"操作"
align=
"center"
>
<template
#
default=
"scope"
>
<el-button
link
type=
"primary"
@
click=
"openForm('update', scope.row.id)"
v-hasPermi=
"['point:config:update']"
>
编辑
</el-button>
<el-button
link
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
v-hasPermi=
"['point:config:delete']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total=
"total"
v-model:page=
"queryParams.pageNo"
v-model:limit=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</ContentWrap>
<!-- 表单弹窗:添加/修改 -->
<ConfigForm
ref=
"formRef"
@
success=
"getList"
/>
</template>
<
script
lang=
"ts"
setup
>
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
download
from
'@/utils/download'
import
*
as
ConfigApi
from
'@/api/point/config'
import
ConfigForm
from
'./ConfigForm.vue'
defineOptions
({
name
:
'PointConfig'
})
const
message
=
useMessage
()
// 消息弹窗
const
{
t
}
=
useI18n
()
// 国际化
const
loading
=
ref
(
true
)
// 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
const
queryParams
=
reactive
({
pageNo
:
1
,
pageSize
:
10
,
tradeDeductEnable
:
null
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
exportLoading
=
ref
(
false
)
// 导出的加载中
const
options
=
[
{
value
:
'1'
,
label
:
'是'
},
{
value
:
'0'
,
label
:
'否'
}
]
const
tradeDeductFormat
=
(
row
,
column
,
cellValue
)
=>
{
return
cellValue
===
1
?
'是'
:
'否'
}
/** 查询列表 */
const
getList
=
async
()
=>
{
loading
.
value
=
true
try
{
const
data
=
await
ConfigApi
.
getConfigPage
(
queryParams
)
list
.
value
=
data
.
list
total
.
value
=
data
.
total
}
finally
{
loading
.
value
=
false
}
}
/** 搜索按钮操作 */
const
handleQuery
=
()
=>
{
queryParams
.
pageNo
=
1
getList
()
}
/** 重置按钮操作 */
const
resetQuery
=
()
=>
{
queryFormRef
.
value
.
resetFields
()
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
ConfigApi
.
deleteConfig
(
id
)
message
.
success
(
t
(
'common.delSuccess'
))
// 刷新列表
await
getList
()
}
catch
{}
}
/** 导出按钮操作 */
const
handleExport
=
async
()
=>
{
try
{
// 导出的二次确认
await
message
.
exportConfirm
()
// 发起导出
exportLoading
.
value
=
true
const
data
=
await
ConfigApi
.
exportConfig
(
queryParams
)
download
.
excel
(
data
,
'积分设置.xls'
)
}
catch
{
}
finally
{
exportLoading
.
value
=
false
}
}
/** 初始化 **/
onMounted
(()
=>
{
getList
()
})
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment