This commit is contained in:
777
2025-12-09 11:27:12 +08:00
parent e137e573d2
commit 85cf804aaf
7 changed files with 464 additions and 111 deletions

View File

@@ -25,3 +25,11 @@ export function updateAccountCoin(data) {
data: data data: data
}) })
} }
export function changePointsAccount(data) {
return request({
url: '/cai/account/changePoints',
method: 'post',
data: data
})
}

View File

@@ -7,6 +7,17 @@ export function listBusinessConfigList() {
}) })
} }
export function listBusinessConfigV2List(businessType) {
return request({
url: '/cai/systemConfig/business/v2/all',
method: 'get',
params: {
businessType: businessType
}
})
}
export function updateBusinessConfig(data) { export function updateBusinessConfig(data) {
return request({ return request({
url: '/cai/systemConfig/business/update', url: '/cai/systemConfig/business/update',

View File

@@ -0,0 +1,124 @@
<template>
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="是否执行分销" prop="distribution">
<el-radio-group v-model="form.distribution">
<el-radio :label="false">不执行</el-radio>
<el-radio :label="true">执行</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="调整积分" prop="changePoints">
<el-input v-model="form.changePoints" placeholder="请输入调整积分" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入" />
</el-form-item>
<el-form-item :label="systemName+'号'" prop="usercode">
<el-autocomplete
class="inline-input"
v-model="form.usercode"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
></el-autocomplete>
</el-form-item>
<el-form-item label="昵称" v-if="info.nickname">
{{ info.nickname }} {{ info.usercode }}
</el-form-item>
<el-form-item label="头像" v-if="info.avatar">
<image-avatar :src="info.avatar"/>
</el-form-item>
<el-form-item>
注意调整积分为负减余额正则加积分 请保证积分不能减为负数
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="open = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {getUserByUsercode, listUserByUserCode} from "@/api/cai/user";
import {changePointsAccount} from "@/api/cai/account";
export default {
components: {
},
data () {
return {
systemName: process.env.VUE_APP_SYSTEM_HOME,
open: false,
title: '',
form:{
usercode: undefined,
changePoints: undefined,
remark: undefined,
distribution: false
},
info:{
},
// 表单校验
rules: {
distribution: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
usercode: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
changePoints: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
remark: [
{ required: true, message: "数据不能为空", trigger: "blur" }
],
},
buttonLoading: false,
}
},
created() {
},
methods: {
init () {
this.open = true;
this.title = "调整用户积分"
this.info = {};
this.form.usercode = undefined
this.form.rechargeCoin = undefined
this.form.remark = undefined
},
querySearch(querySearch,cb){
listUserByUserCode(querySearch).then(res => {
cb(res.data.map((terminal) => {
return {
value: terminal,
name: terminal,
};
}))
})
},
handleSelect(item){
getUserByUsercode(item.value).then(res => {
this.info = res.data
})
},
// 表单提交
submitForm () {
this.$refs['form'].validate((valid) => {
if (valid) {
this.buttonLoading = true;
changePointsAccount(this.form).then(data => {
this.$modal.msgSuccess("操作成功");
this.buttonLoading = false;
this.open = false
this.$emit('refreshDataList')
}).finally(() => {
this.buttonLoading = false;
});
}
})
},
}
}
</script>

View File

@@ -34,6 +34,16 @@
v-hasPermi="['cai:account:add']" v-hasPermi="['cai:account:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-plus"
size="mini"
@click="handleAddPoints"
v-hasPermi="['cai:account:add']"
>新增积分</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@@ -60,7 +70,7 @@
<el-table-column label="余额" align="center" prop="coin" sortable="custom" :sort-orders="['descending', 'ascending']" /> <el-table-column label="余额" align="center" prop="coin" sortable="custom" :sort-orders="['descending', 'ascending']" />
<el-table-column label="收益" align="center" prop="incomeCoin" sortable="custom" :sort-orders="['descending', 'ascending']"/> <el-table-column label="收益" align="center" prop="incomeCoin" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="积分" align="center" prop="points" sortable="custom" :sort-orders="['descending', 'ascending']"/> <el-table-column label="积分" align="center" prop="points" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="非原生充值" align="center" prop="totalTrdMoney" sortable="custom" :sort-orders="['descending', 'ascending']"/> <!-- <el-table-column label="非原生充值" align="center" prop="totalTrdMoney" sortable="custom" :sort-orders="['descending', 'ascending']"/>-->
<el-table-column label="充值总额" align="center" prop="totalBuyMoney" sortable="custom" :sort-orders="['descending', 'ascending']"/> <el-table-column label="充值总额" align="center" prop="totalBuyMoney" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="充值总紫贝" align="center" prop="totalBuyCoin" sortable="custom" :sort-orders="['descending', 'ascending']"/> <el-table-column label="充值总紫贝" align="center" prop="totalBuyCoin" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="聊天总收入" align="center" prop="messageIncomeCoin" sortable="custom" :sort-orders="['descending', 'ascending']"/> <el-table-column label="聊天总收入" align="center" prop="messageIncomeCoin" sortable="custom" :sort-orders="['descending', 'ascending']"/>
@@ -92,8 +102,10 @@
@pagination="getList" @pagination="getList"
/> />
<add-account-dialog v-if="addAccountDialogVisible" ref="addAccountDialog" @refreshDataList="getList"/>
<add-account-dialog v-if="addAccountDialogVisible" ref="addAccountDialog" @refreshDataList="getList"/> <add-account-dialog v-if="addAccountDialogVisible" ref="addAccountDialog" @refreshDataList="getList"/>
<account-change-info v-if="accountChangeInfoVisible" ref="accountChangeInfo" /> <account-change-info v-if="accountChangeInfoVisible" ref="accountChangeInfo" />
<add-account-points-dialog v-if="addAccountPointsVisible" ref="addAccountPoints" />
</div> </div>
</template> </template>
@@ -102,11 +114,14 @@ import {listAccount} from "@/api/cai/account";
import {genderList, isAnchorList, userStatusList, yesOrNoList} from "@/constant/statusMap"; import {genderList, isAnchorList, userStatusList, yesOrNoList} from "@/constant/statusMap";
import AddAccountDialog from "@/views/cai/account/add-account-dialog"; import AddAccountDialog from "@/views/cai/account/add-account-dialog";
import AccountChangeInfo from "@/views/cai/account/account-change-info"; import AccountChangeInfo from "@/views/cai/account/account-change-info";
import AddAccountPointsDialog from "@/views/cai/account/add-account-points-dialog.vue";
export default { export default {
name: "Account", name: "Account",
components:{ components:{
AddAccountPointsDialog,
AccountChangeInfo, AccountChangeInfo,
AddAccountDialog AddAccountDialog
}, },
@@ -115,6 +130,7 @@ export default {
genderList, userStatusList, yesOrNoList, isAnchorList, genderList, userStatusList, yesOrNoList, isAnchorList,
addAccountDialogVisible: false, addAccountDialogVisible: false,
accountChangeInfoVisible: false, accountChangeInfoVisible: false,
addAccountPointsVisible: false,
systemName: process.env.VUE_APP_SYSTEM_HOME, systemName: process.env.VUE_APP_SYSTEM_HOME,
// 遮罩层 // 遮罩层
loading: true, loading: true,
@@ -187,6 +203,12 @@ export default {
this.$refs.addAccountDialog.init(row?.usercode) this.$refs.addAccountDialog.init(row?.usercode)
}) })
}, },
handleAddPoints(row) {
this.addAccountPointsVisible = true
this.$nextTick(() => {
this.$refs.addAccountPoints.init(row?.usercode)
})
},
} }
}; };
</script> </script>

View File

@@ -0,0 +1,145 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-refresh"
size="mini"
@click="getList"
>重新查询</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="configList" >
<el-table-column label="名称" align="center" prop="desc" />
<el-table-column label="数值" align="center" prop="value" >
<template v-slot="scope">
<span v-if="scope.row.inputType !== 'textarea'">{{ scope.row.value }}</span>
<span v-if="scope.row.inputType === 'textarea'" v-html="scope.row.valueTextArea"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-hasPermi="['cai:businessConfig:edit']"
@click="handleUpdate(scope.row)"
>修改</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="desc">
<el-input v-model="form.desc" placeholder="请输入" disabled/>
</el-form-item>
<el-form-item label="数值" prop="value">
<el-input v-model="form.value" placeholder="请输入数值" v-if="form.inputType !== 'textarea'" />
<el-input v-model="form.value" placeholder="请输入数值" type="textarea" autosize v-if="form.inputType === 'textarea'" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listBusinessConfigV2List, updateBusinessConfig} from "@/api/cai/systemConfig";
export default {
props: {
businessType: {
type: String,
required: true, // 必填
default: "base" // 默认值
},
},
name: "BusinessConfig",
components: {
},
data() {
return {
// 遮罩层
buttonLoading: false,
loading: true,
// 显示搜索条件
showSearch: true,
queryParams:{},
form:{},
// 轮播表格数据
configList: [],
title: "",
open: false,
rules:[]
};
},
created() {
this.getList();
},
methods: {
/** 查询轮播列表 */
getList() {
this.loading = true;
listBusinessConfigV2List(this.businessType).then(response => {
response.data.forEach(i => {
if(i.inputType === 'textarea'){
i.valueTextArea = i.value.replace(/\n/g, "<br/>");
}
})
this.configList = response.data;
}).finally(()=>{
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
reset() {
this.form = {
key: undefined,
desc: undefined,
value: undefined,
inputType: undefined
};
this.resetForm("form");
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = {
key: row.key,
desc: row.desc,
value: row.value,
inputType: row.inputType
};
this.open = true;
this.title = "修改业务设置";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
updateBusinessConfig(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
});
},
}
};
</script>

View File

@@ -0,0 +1,129 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="configList" >
<el-table-column label="名称" align="center" prop="desc" />
<el-table-column label="数值" align="center" prop="value" >
<template v-slot="scope">
<span v-if="scope.row.inputType !== 'textarea'">{{ scope.row.value }}</span>
<span v-if="scope.row.inputType === 'textarea'" v-html="scope.row.valueTextArea"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-hasPermi="['cai:businessConfig:edit']"
@click="handleUpdate(scope.row)"
>修改</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="desc">
<el-input v-model="form.desc" placeholder="请输入" disabled/>
</el-form-item>
<el-form-item label="数值" prop="value">
<el-input v-model="form.value" placeholder="请输入数值" v-if="form.inputType !== 'textarea'" />
<el-input v-model="form.value" placeholder="请输入数值" type="textarea" autosize v-if="form.inputType === 'textarea'" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listBusinessConfigList, updateBusinessConfig} from "@/api/cai/systemConfig";
export default {
name: "BusinessConfig",
components: {
},
data() {
return {
// 遮罩层
buttonLoading: false,
loading: true,
// 显示搜索条件
showSearch: true,
queryParams:{},
form:{},
// 轮播表格数据
configList: [],
title: "",
open: false,
rules:[]
};
},
created() {
this.getList();
},
methods: {
/** 查询轮播列表 */
getList() {
this.loading = true;
listBusinessConfigList().then(response => {
response.data.forEach(i => {
if(i.inputType === 'textarea'){
i.valueTextArea = i.value.replace(/\n/g, "<br/>");
}
})
this.configList = response.data;
}).finally(()=>{
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
reset() {
this.form = {
key: undefined,
desc: undefined,
value: undefined,
inputType: undefined
};
this.resetForm("form");
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = {
key: row.key,
desc: row.desc,
value: row.value,
inputType: row.inputType
};
this.open = true;
this.title = "修改业务设置";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
updateBusinessConfig(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
});
},
}
};
</script>

View File

@@ -1,130 +1,44 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row :gutter="10" class="mb8"> <el-tabs v-model="activeTabs" @tab-click="handleClick">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <el-tab-pane label="业务配置" name="business">
</el-row> <config-table business-type="business" />
</el-tab-pane>
<el-table v-loading="loading" :data="configList" > <el-tab-pane label="安全配置" name="security">
<el-table-column label="名称" align="center" prop="desc" /> <config-table business-type="security" />
<el-table-column label="数值" align="center" prop="value" > </el-tab-pane>
<template v-slot="scope"> <el-tab-pane label="支付配置" name="pay">
<span v-if="scope.row.inputType !== 'textarea'">{{ scope.row.value }}</span> <config-table business-type="pay" />
<span v-if="scope.row.inputType === 'textarea'" v-html="scope.row.valueTextArea"></span> </el-tab-pane>
</template> <el-tab-pane label="域名配置" name="domain">
</el-table-column> <config-table business-type="domain" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right"> </el-tab-pane>
<template v-slot="scope"> <el-tab-pane label="系统配置" name="system">
<el-button <config-table business-type="system" />
size="mini" </el-tab-pane>
type="text" </el-tabs>
icon="el-icon-edit"
v-hasPermi="['cai:businessConfig:edit']"
@click="handleUpdate(scope.row)"
>修改</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="desc">
<el-input v-model="form.desc" placeholder="请输入" disabled/>
</el-form-item>
<el-form-item label="数值" prop="value">
<el-input v-model="form.value" placeholder="请输入数值" v-if="form.inputType !== 'textarea'" />
<el-input v-model="form.value" placeholder="请输入数值" type="textarea" autosize v-if="form.inputType === 'textarea'" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import BannerAddUpdateDialog from '@/views/cai/banner/banner-add-update-dialog.vue'
import {listBusinessConfigList, updateBusinessConfig, updateSystemConfig} from "@/api/cai/systemConfig"; import ConfigTable from "@/views/cai/businessConfig/config-table.vue";
export default { export default {
name: "Banner", name: "SystemConfig",
components: { components: {
BannerAddUpdateDialog ConfigTable
}, },
data() { data() {
return { return {
// 遮罩层 activeTabs: "business",
buttonLoading: false,
loading: true,
// 显示搜索条件
showSearch: true,
queryParams:{},
form:{},
// 轮播表格数据
configList: [],
title: "",
open: false,
rules:[]
}; };
}, },
created() { created() {
this.getList();
}, },
methods: { methods: {
/** 查询轮播列表 */ handleClick(tab, event){
getList() { console.log(tab, event);
this.loading = true;
listBusinessConfigList().then(response => {
response.data.forEach(i => {
if(i.inputType === 'textarea'){
i.valueTextArea = i.value.replace(/\n/g, "<br/>");
}
})
this.configList = response.data;
}).finally(()=>{
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
reset() {
this.form = {
key: undefined,
desc: undefined,
value: undefined,
inputType: undefined
};
this.resetForm("form");
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = {
key: row.key,
desc: row.desc,
value: row.value,
inputType: row.inputType
};
this.open = true;
this.title = "修改业务设置";
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
updateBusinessConfig(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
});
}, },
} }
}; };