Commit f19b0480 authored by yuwenwen's avatar yuwenwen

修改BUG

parent 4eda70c0
...@@ -61,3 +61,12 @@ export function pointsSetting(params){ ...@@ -61,3 +61,12 @@ export function pointsSetting(params){
}) })
} }
// 修改积分配置
export function updatePointsSetting(data){
return request({
url:'/bbs/points/setting/batch',
method:'put',
data
})
}
...@@ -6,17 +6,17 @@ ...@@ -6,17 +6,17 @@
<el-table :data="addList"> <el-table :data="addList">
<el-table-column label="加分行为" prop="operateName" align="center"></el-table-column> <el-table-column label="加分行为" prop="operateName" align="center"></el-table-column>
<el-table-column label="分值" prop="operatePoints" align="center"> <el-table-column label="分值" prop="operatePoints" align="center">
<template #default="{row}"> <template #default="{ row }">
<el-input v-model="row.operatePoints"></el-input> <el-input v-model="row.operatePoints"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="每周上限次数" prop="limitCount" align="center"> <el-table-column label="每周上限次数" prop="limitCount" align="center">
<template #default="{row}"> <template #default="{ row }">
<el-input v-model="row.limitCount"></el-input> <el-input v-model="row.limitCount"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="启用" prop="enableStatus" align="center"> <el-table-column label="启用" prop="enableStatus" align="center">
<template #default="{row}"> <template #default="{ row }">
<el-switch v-model="row.enableStatus" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="row.enableStatus" :active-value="1" :inactive-value="0"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
...@@ -27,17 +27,17 @@ ...@@ -27,17 +27,17 @@
<el-table :data="decreaseList"> <el-table :data="decreaseList">
<el-table-column label="减分行为" prop="operateName" align="center"></el-table-column> <el-table-column label="减分行为" prop="operateName" align="center"></el-table-column>
<el-table-column label="分值" prop="operatePoints" align="center"> <el-table-column label="分值" prop="operatePoints" align="center">
<template #default="{row}"> <template #default="{ row }">
<el-input v-model="row.operatePoints"></el-input> <el-input v-model="row.operatePoints"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="每周上限次数" prop="limitCount" align="center"> <el-table-column label="每周上限次数" prop="limitCount" align="center">
<template #default="{row}"> <template #default="{ row }">
<el-input v-model="row.limitCount"></el-input> <el-input v-model="row.limitCount"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="启用" prop="enableStatus" align="center"> <el-table-column label="启用" prop="enableStatus" align="center">
<template #default="{row}"> <template #default="{ row }">
<el-switch v-model="row.enableStatus" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="row.enableStatus" :active-value="1" :inactive-value="0"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
...@@ -45,59 +45,76 @@ ...@@ -45,59 +45,76 @@
</div> </div>
</div> </div>
<template #footer> <template #footer>
<el-button @click="visible=false">取消</el-button> <el-button @click="visible = false">取消</el-button>
<el-button type="primary">确定</el-button> <el-button type="primary" @click="handleSubmit">确定</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {pointsSetting} from '@/api/pointsManage' import { pointsSetting, updatePointsSetting } from '@/api/pointsManage'
export default { export default {
data(){ data() {
return { return {
visible:false, visible: false,
addList:[], addList: [],
decreaseList:[] decreaseList: []
} }
}, },
methods:{ methods: {
openModal(){ openModal() {
this.visible = true; this.visible = true;
this.getSettings() this.getSettings()
}, },
getSettings(){ // 获取配置详情
pointsSetting().then(res=>{ getSettings() {
pointsSetting().then(res => {
console.log(res) console.log(res)
this.addList = res.data['ADD']; this.addList = res.data['ADD'];
this.decreaseList = res.data['DEC'] 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.rules-setting-container{ .rules-setting-container {
display: flex; display: flex;
min-height: 400px; min-height: 400px;
.add-box{
.add-box {
flex: 1; flex: 1;
padding: 0 20px; padding: 0 20px;
box-sizing: border-box; box-sizing: border-box;
border-right: 1px solid #eee; border-right: 1px solid #eee;
} }
.decrease-box{
.decrease-box {
flex: 1; flex: 1;
padding: 0 20px; padding: 0 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.label-box{ .label-box {
height: 68px; height: 68px;
line-height: 68px; line-height: 68px;
color: rgba(16, 16, 16, 1); color: rgba(16, 16, 16, 1);
font-size: 20px; font-size: 20px;
} }
} }
</style> </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