Commit eb362cd1 authored by 万成波's avatar 万成波

Merge remote-tracking branch 'origin/master'

parents 00126d0e f19b0480
......@@ -61,3 +61,12 @@ export function pointsSetting(params){
})
}
// 修改积分配置
export function updatePointsSetting(data){
return request({
url:'/bbs/points/setting/batch',
method:'put',
data
})
}
......@@ -6,18 +6,18 @@
<el-table :data="addList">
<el-table-column label="加分行为" prop="operateName" align="center"></el-table-column>
<el-table-column label="分值" prop="operatePoints" align="center">
<template #default="{row}">
<template #default="{ row }">
<el-input v-model="row.operatePoints"></el-input>
</template>
</el-table-column>
<el-table-column label="每周上限次数" prop="limitCount" align="center">
<template #default="{row}">
<template #default="{ row }">
<el-input v-model="row.limitCount"></el-input>
</template>
</el-table-column>
<el-table-column label="启用" prop="enableStatus" align="center">
<template #default="{row}">
<el-switch v-model="row.enableStatus" :active-value="1" :inactive-value="0"></el-switch>
<template #default="{ row }">
<el-switch v-model="row.enableStatus" :active-value="1" :inactive-value="0"></el-switch>
</template>
</el-table-column>
</el-table>
......@@ -27,77 +27,94 @@
<el-table :data="decreaseList">
<el-table-column label="减分行为" prop="operateName" align="center"></el-table-column>
<el-table-column label="分值" prop="operatePoints" align="center">
<template #default="{row}">
<template #default="{ row }">
<el-input v-model="row.operatePoints"></el-input>
</template>
</el-table-column>
<el-table-column label="每周上限次数" prop="limitCount" align="center">
<template #default="{row}">
<template #default="{ row }">
<el-input v-model="row.limitCount"></el-input>
</template>
</el-table-column>
<el-table-column label="启用" prop="enableStatus" align="center">
<template #default="{row}">
<el-switch v-model="row.enableStatus" :active-value="1" :inactive-value="0"></el-switch>
<template #default="{ row }">
<el-switch v-model="row.enableStatus" :active-value="1" :inactive-value="0"></el-switch>
</template>
</el-table-column>
</el-table>
</div>
</div>
<template #footer>
<el-button @click="visible=false">取消</el-button>
<el-button type="primary">确定</el-button>
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button>
</template>
</el-dialog>
</template>
<script>
import {pointsSetting} from '@/api/pointsManage'
import { pointsSetting, updatePointsSetting } from '@/api/pointsManage'
export default {
data(){
data() {
return {
visible:false,
addList:[],
decreaseList:[]
visible: false,
addList: [],
decreaseList: []
}
},
methods:{
openModal(){
methods: {
openModal() {
this.visible = true;
this.getSettings()
},
getSettings(){
pointsSetting().then(res=>{
// 获取配置详情
getSettings() {
pointsSetting().then(res => {
console.log(res)
this.addList = res.data['ADD'];
this.decreaseList = res.data['DEC']
})
},
// 修改配置
handleSubmit() {
let data = {
'ADD': this.addList,
'DEC': this.decreaseList
}
updatePointsSetting(data).then(res => {
if (res.code == 200) {
this.$modal.msgSuccess("修改配置成功");
this.visible = false;
}else{
this.$modal.msgError(res.msg || "修改配置失败");
}
})
}
}
}
</script>
<style lang="scss" scoped>
.rules-setting-container{
.rules-setting-container {
display: flex;
min-height: 400px;
.add-box{
.add-box {
flex: 1;
padding: 0 20px;
box-sizing: border-box;
border-right: 1px solid #eee;
}
.decrease-box{
.decrease-box {
flex: 1;
padding: 0 20px;
box-sizing: border-box;
}
.label-box{
.label-box {
height: 68px;
line-height: 68px;
color: rgba(16, 16, 16, 1);
font-size: 20px;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment