Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
safe-campus-bbs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
万成波
safe-campus-bbs
Commits
036cecd4
Commit
036cecd4
authored
Nov 07, 2025
by
yuwenwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改积分管理模块
parent
a659c077
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
73 deletions
+96
-73
safe-campus-bbs-ui/src/views/pointsExchange/BatchExchange.vue
...-campus-bbs-ui/src/views/pointsExchange/BatchExchange.vue
+25
-36
safe-campus-bbs-ui/src/views/pointsManage/BatchAddPoints.vue
safe-campus-bbs-ui/src/views/pointsManage/BatchAddPoints.vue
+29
-34
safe-campus-bbs-ui/src/views/pointsManage/ErrorDialog.vue
safe-campus-bbs-ui/src/views/pointsManage/ErrorDialog.vue
+41
-0
safe-campus-bbs-ui/src/views/pointsManage/index.vue
safe-campus-bbs-ui/src/views/pointsManage/index.vue
+1
-3
No files found.
safe-campus-bbs-ui/src/views/pointsExchange/BatchExchange.vue
View file @
036cecd4
<
template
>
<
template
>
<div>
<el-dialog
:visible.sync=
"visible"
v-if=
"visible"
title=
"批量兑换"
:close-on-click-modal=
"false"
width=
"36%"
<el-dialog
:visible.sync=
"visible"
v-if=
"visible"
title=
"批量兑换"
:close-on-click-modal=
"false"
width=
"36%"
class=
"dialog"
@
close=
"handleClose"
>
class=
"dialog"
@
close=
"handleClose"
>
<el-form
:model=
"form"
ref=
"formRef"
label-position=
"top"
:rules=
"rules"
>
<el-form
:model=
"form"
ref=
"formRef"
label-position=
"top"
:rules=
"rules"
>
...
@@ -15,12 +16,15 @@
...
@@ -15,12 +16,15 @@
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
</
template
>
</
template
>
</el-dialog>
</el-dialog>
<!-- 操作失败结果 -->
<error-dialog
ref=
"errorDialogRef"
></error-dialog>
</div>
</template>
</template>
<
script
>
<
script
>
// import { pointsExchange, exchange } from '@/api/pointsExchange'
import
{
batchExchange
}
from
'
@/api/pointsExchange
'
;
import
{
batchExchange
}
from
'
@/api/pointsExchange
'
;
import
UserSelectInput
from
'
@/components/UserSelect/input
'
import
UserSelectInput
from
'
@/components/UserSelect/input
'
import
GoodsSelectInput
from
'
@/components/GoodsSelect/input
'
import
GoodsSelectInput
from
'
@/components/GoodsSelect/input
'
import
ErrorDialog
from
'
../pointsManage/ErrorDialog.vue
'
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -37,20 +41,9 @@ export default {
...
@@ -37,20 +41,9 @@ export default {
},
},
components
:
{
components
:
{
UserSelectInput
,
UserSelectInput
,
GoodsSelectInput
GoodsSelectInput
,
ErrorDialog
},
},
// watch: {
// "form.userName": {
// handler: function (val, oVal) {
// console.log(val, oVal)
// if (val) {
// this.formatData(val)
// }
// }
// },
// deep: true,
// immediate: true
// },
methods
:
{
methods
:
{
// 打开兑换窗口
// 打开兑换窗口
openModal
(
row
)
{
openModal
(
row
)
{
...
@@ -64,7 +57,7 @@ export default {
...
@@ -64,7 +57,7 @@ export default {
let
userNames
=
val
.
split
(
'
,
'
)
let
userNames
=
val
.
split
(
'
,
'
)
let
nickNames
=
name
.
split
(
'
,
'
)
let
nickNames
=
name
.
split
(
'
,
'
)
userNames
.
forEach
((
item
,
index
)
=>
{
userNames
.
forEach
((
item
,
index
)
=>
{
users
.
push
({
nickName
:
nickNames
[
index
],
userName
:
item
})
users
.
push
({
nickName
:
nickNames
[
index
],
userName
:
item
})
})
})
if
(
users
.
length
>
0
)
{
if
(
users
.
length
>
0
)
{
this
.
form
.
users
=
users
;
this
.
form
.
users
=
users
;
...
@@ -83,11 +76,7 @@ export default {
...
@@ -83,11 +76,7 @@ export default {
if
(
res
.
data
.
length
==
0
)
{
if
(
res
.
data
.
length
==
0
)
{
this
.
$modal
.
msgSuccess
(
'
批量兑换商品成功
'
)
this
.
$modal
.
msgSuccess
(
'
批量兑换商品成功
'
)
}
else
{
}
else
{
let
userName
=
res
.
data
.
map
((
item
)
=>
{
this
.
$refs
.
errorDialogRef
.
openModal
(
res
.
data
)
return
item
.
userName
;
}).
join
(
'
,
'
)
let
msg
=
`失败:
${
res
.
data
.
length
}
条,失败用户:
${
userName
}
`
this
.
$alert
(
"
<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>
"
+
msg
+
"
</div>
"
,
"
结果
"
,
{
dangerouslyUseHTMLString
:
true
});
}
}
this
.
handleClose
()
this
.
handleClose
()
this
.
$emit
(
'
handleOk
'
);
this
.
$emit
(
'
handleOk
'
);
...
...
safe-campus-bbs-ui/src/views/pointsManage/BatchAddPoints.vue
View file @
036cecd4
<
template
>
<
template
>
<el-dialog
:visible.sync=
"visible"
v-if=
"visible"
title=
"批量增加积分"
:close-on-click-modal=
"false"
width=
"36%"
<div>
class=
"dialog"
@
close=
"handleClose"
>
<el-dialog
:visible.sync=
"visible"
v-if=
"visible"
title=
"批量增加积分"
append-to-body
:close-on-click-modal=
"false"
width=
"36%"
class=
"dialog"
@
close=
"handleClose"
>
<el-form
:model=
"form"
ref=
"formRef"
label-position=
"top"
:rules=
"rules"
>
<el-form
:model=
"form"
ref=
"formRef"
label-position=
"top"
:rules=
"rules"
>
<el-form-item
label=
"用户名"
prop=
"userName"
>
<el-form-item
label=
"用户名"
prop=
"userName"
>
<UserSelectInput
v-model=
"form.userName"
:value.sync=
"form.userName"
:multiple=
"true"
<UserSelectInput
v-model=
"form.userName"
:value.sync=
"form.userName"
:multiple=
"true"
@
getValue=
"getNickName"
placeholder=
"请选择用户"
></UserSelectInput>
@
getValue=
"getNickName"
placeholder=
"请选择用户"
></UserSelectInput>
</el-form-item>
</el-form-item>
<el-form-item
label=
"积分"
prop=
"points"
>
<el-form-item
label=
"积分"
prop=
"points"
>
<el-input
v-model=
"form.points"
placeholder=
"请输入"
></el-input>
<el-input-number
v-model=
"form.points"
placeholder=
"请输入"
:min=
"0"
:step=
"1"
style=
"width: 100%;"
></el-input-number>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<template
#footer
>
<template
#footer
>
<el-button
@
click=
"handleClose"
>
取消
</el-button>
<el-button
@
click=
"handleClose"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
</
template
>
</
template
>
</el-dialog>
</el-dialog>
<!-- 操作失败结果 -->
<error-dialog
ref=
"errorDialogRef"
></error-dialog>
</div>
</template>
</template>
<
script
>
<
script
>
// import { pointsExchange, exchange } from '@/api/pointsExchange'
import
{
batchAddPoints
}
from
'
@/api/pointsManage
'
;
import
{
batchAddPoints
}
from
'
@/api/pointsManage
'
;
import
UserSelectInput
from
'
@/components/UserSelect/input
'
import
UserSelectInput
from
'
@/components/UserSelect/input
'
import
ErrorDialog
from
'
./ErrorDialog.vue
'
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -36,19 +45,8 @@ export default {
...
@@ -36,19 +45,8 @@ export default {
},
},
components
:
{
components
:
{
UserSelectInput
,
UserSelectInput
,
ErrorDialog
},
},
// watch: {
// "form.userName": {
// handler: function (val, oVal) {
// console.log(val, oVal)
// if (val) {
// this.formatData(val)
// }
// }
// },
// deep: true,
// immediate: true
// },
methods
:
{
methods
:
{
// 打开兑换窗口
// 打开兑换窗口
openModal
(
row
)
{
openModal
(
row
)
{
...
@@ -77,15 +75,12 @@ export default {
...
@@ -77,15 +75,12 @@ export default {
this
.
$refs
.
formRef
.
validate
((
valid
)
=>
{
this
.
$refs
.
formRef
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
batchAddPoints
(
data
).
then
(
res
=>
{
batchAddPoints
(
data
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
.
length
==
0
)
{
if
(
res
.
data
.
length
==
0
)
{
this
.
$modal
.
msgSuccess
(
'
批量添加积分成功
'
)
this
.
$modal
.
msgSuccess
(
'
批量添加积分成功
'
)
}
else
{
}
else
{
let
userName
=
res
.
data
.
map
((
item
)
=>
{
this
.
$refs
.
errorDialogRef
.
openModal
(
res
.
data
)
return
item
.
userName
;
}).
join
(
'
,
'
)
let
msg
=
`失败:
${
res
.
data
.
length
}
条,失败用户:
${
userName
}
`
this
.
$alert
(
"
<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>
"
+
msg
+
"
</div>
"
,
"
结果
"
,
{
dangerouslyUseHTMLString
:
true
});
}
}
this
.
handleClose
()
this
.
handleClose
()
this
.
$emit
(
'
handleOk
'
);
this
.
$emit
(
'
handleOk
'
);
...
...
safe-campus-bbs-ui/src/views/pointsManage/ErrorDialog.vue
0 → 100644
View file @
036cecd4
<
template
>
<el-dialog
:visible.sync=
"visible"
v-if=
"visible"
title=
"操作失败结果"
append-to-body
:close-on-click-modal=
"false"
width=
"40%"
class=
"dialog"
@
close=
"handleClose"
>
<el-table
:data=
"tableList"
>
<el-table-column
type=
"index"
width=
"55"
align=
"center"
></el-table-column>
<el-table-column
label=
"用户"
prop=
"userName"
align=
"center"
></el-table-column>
<el-table-column
label=
"失败原因"
prop=
"errorMessage"
align=
"center"
></el-table-column>
</el-table>
<template
#footer
>
<el-button
@
click=
"handleClose"
>
关闭
</el-button>
</
template
>
</el-dialog>
</template>
<
script
>
export
default
{
data
()
{
return
{
visible
:
false
,
tableList
:
[]
}
},
methods
:
{
// 打开兑换窗口
openModal
(
tableList
)
{
this
.
visible
=
true
;
this
.
tableList
=
tableList
},
handleClose
()
{
this
.
visible
=
false
}
}
}
</
script
>
<
style
lang=
"scss"
>
.dialog
{
.el-dialog__body
{
padding
:
0
20px
!
important
;
}
}
</
style
>
safe-campus-bbs-ui/src/views/pointsManage/index.vue
View file @
036cecd4
...
@@ -11,10 +11,8 @@
...
@@ -11,10 +11,8 @@
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-row
class=
"mb10"
>
<el-row
class=
"mb10"
>
<el-col
:span=
"2"
>
<el-col
:span=
"2
4
"
>
<el-button
type=
"primary"
@
click=
"handleAdd"
>
积分规则设置
</el-button>
<el-button
type=
"primary"
@
click=
"handleAdd"
>
积分规则设置
</el-button>
</el-col>
<el-col
:span=
"2"
>
<el-button
type=
"primary"
@
click=
"handleBatchAddPonits"
plain
>
批量增加积分
</el-button>
<el-button
type=
"primary"
@
click=
"handleBatchAddPonits"
plain
>
批量增加积分
</el-button>
</el-col>
</el-col>
</el-row>
</el-row>
...
...
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