新增 幸运数字提交记录 / 幸运数字基础配置

This commit is contained in:
chenruiye
2025-06-18 17:16:25 +08:00
parent 47ace88c31
commit 4b78298651
3 changed files with 482 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import request from '@/utils/request';
// 配置获取
export const getConfig = query => {
return request({
url: '/admin/luckyNumber/getConfig',
method: 'get',
params: query
});
};
// 修改配置
export const updateConfig = query => {
return request({
url: '/admin/luckyNumber/update',
method: 'post',
data: query
});
};
// 提交记录
export const getluckyNumberList = query => {
return request({
url: '/admin/luckyNumber/list',
method: 'get',
params: query
});
};

View File

@@ -0,0 +1,223 @@
<template>
<div class="box">
<div class="condition">
<div class="inquire">
<span>分区</span>
<partition-select
v-model:partition-id="formData.partitionId"
@update:partitionId="changePartitionId"
/>
<el-button
class="primary"
type="primary"
@click="
editDialog = true;
butClick = false;
"
style="margin-left: 20px;"
>
编辑</el-button
>
</div>
<div class="inquire">
<span>当天奖池金币</span>
<!-- @input="handleInput" -->
<el-input
v-model="editData.configAddJackpot"
placeholder=""
class="input"
disabled
></el-input>
</div>
<div class="inquire">
<span>平台抽成</span>
<!-- @input="handleInput" -->
<el-input
v-model="editData.jackpotRatio"
placeholder=""
class="input"
disabled
></el-input>
</div>
<div class="inquire">
<span>今日开奖数字</span>
<!-- @input="handleInput" -->
<el-input
v-model="editData.luckyNumber"
:placeholder="editData.luckyNumber || '随机'"
class="input"
disabled
></el-input>
</div>
<!-- 编辑弹窗 -->
<el-dialog v-model="editDialog" title="编辑" width="36%" center>
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>当天奖池金币</span
>
<el-input
v-model="editData.configAddJackpot"
style="width: 75%"
class="input"
placeholder="请输入"
></el-input>
</div>
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>平台抽成</span
>
<el-input
v-model="editData.jackpotRatio"
style="width: 75%"
class="input"
placeholder="请输入"
></el-input>
</div>
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>今日开奖数字</span
>
<el-input
v-model="editData.luckyNumber"
style="width: 75%"
class="input"
placeholder="请输入"
></el-input>
</div>
<template #footer>
<span class="dialog-footer">
<el-button
@click="
editDialog = false;
butClick = false;
"
>取消</el-button
>
<el-button
type="primary"
:disabled="butClick"
@click="editDialogClick()"
>
保存
</el-button>
</span>
</template>
</el-dialog>
</div>
</div>
</template>
<script>
import { ref, onMounted, reactive, computed } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import PartitionSelect from "@/views/common/partitionSelect.vue";
import { getConfig, updateConfig } from "@/api/SsGuild/LuckyNumber";
export default {
name: "LuckyNumberBasicConfiguration",
components: {
PartitionSelect,
},
setup() {
const formData = reactive({
partitionId: undefined,
});
const editData = reactive({
configAddJackpot: 0,
jackpotRatio: 0,
partitionId: undefined,
luckyNumber:0
});
const editDialog = ref(false);
const butClick = ref(false);
const editDialogTitle = ref("");
const editDialogValue = ref("");
const getData = () => {
getConfig(formData).then((res) => {
if (res.code == 200) {
editData.configAddJackpot = res.data.configAddJackpot;
editData.luckyNumber = res.data.luckyNumber;
editData.jackpotRatio = Number(1 - res.data.jackpotRatio).toFixed(2);
} else {
ElMessage.error(res.message);
}
});
};
const changePartitionId = (e) => {
formData.partitionId = e;
getData();
};
const editDialogClick = () => {
// editData.partitionId = formData.partitionId;
// editData.jackpotRatio = Number(1 - editData.jackpotRatio).toFixed(2);
let obj = {
partitionId : formData.partitionId,
jackpotRatio : Number(1 - editData.jackpotRatio).toFixed(2),
configAddJackpot: editData.configAddJackpot,
luckyNumber: editData.luckyNumber,
};
updateConfig(obj).then((res) => {
if (res.code == 200) {
ElMessage({
showClose: true,
message: "修改成功",
type: "success",
});
editDialog.value = false;
getData();
} else {
ElMessage.error(res.message);
}
});
};
onMounted(() => {
// getData();
});
return {
formData,
editDialog,
butClick,
editDialogTitle,
getData,
changePartitionId,
editData,
editDialogValue,
editDialogClick,
};
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.condition {
margin-bottom: 20px;
.inquire {
margin-right: 20px;
margin-bottom: 20px;
span {
display: inline-block;
width: 110px;
margin-right: 10px;
// text-align: right;
}
.input {
width: 180px;
margin-right: 10px;
}
}
}
.but {
margin-bottom: 20px;
}
}
</style>

View File

@@ -0,0 +1,234 @@
<template>
<div class="box">
<div class="inquire">
<span>分区</span>
<partition-select
v-model:partition-id="formData.partitionId"
@update:partitionId="changeLevel"
/>
</div>
<div class="inquire">
<div class="block">
<span class="demonstration">日期</span>
<el-date-picker
v-model="dateTime"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div>
</div>
<el-button class="primary" type="primary" @click="getData()"
>查询</el-button
>
<!-- 表格数据 -->
<el-table
v-loading="tableData.loadingOuter"
:data="tableData.dataOuter"
ref="multipleTable"
@selection-change="handleSelectionChange"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="partitionDesc" align="center" label="分区" />
<el-table-column prop="erbanNo" align="center" label="平台号" />
<el-table-column prop="nick" align="center" label="用户昵称" />
<el-table-column prop="input" align="center" label="提交记录">
<template v-slot="scope">
{{ scope.row.numberList }}
</template>
</el-table-column>
<el-table-column prop="input" align="center" label="花费金币" />
<el-table-column prop="luckyNumber" align="center" label="Moli当期数字" />
<el-table-column prop="jackpot" align="center" label="奖池累计金币" />
<el-table-column prop="luckyPlayerNumber" align="center" label="瓜分记录">
<template v-slot="scope">
<el-button @click="editFun(scope.row)" type="text" size="small">
{{ scope.row.luckyPlayerNumber }}
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
:current-page="formData.pageNo"
:page-size="formData.pageSize"
:page-sizes="[10, 20, 50, 100, 200]"
layout="sizes, prev, pager, next"
:total="tableData.totalOuter"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 详情 -->
<el-dialog v-model="detailsDialog" title="幸运数字瓜分记录" width="70%">
<!-- 内表格 -->
<el-table v-loading="tableData.loadingInner" :data="tableData.dataInner" border
style="width: 100%; margin-top: 25px">
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="partitionDesc" align="center" label="分区" />
<el-table-column prop="erbanNo" align="center" label="平台号" />
<el-table-column prop="nick" align="center" label="用户昵称" />
<el-table-column prop="input" align="center" label="提交记录">
<template v-slot="scope">
{{ scope.row.numberList }}
</template>
</el-table-column>
<el-table-column prop="input" align="center" label="花费金币" />
<el-table-column prop="luckyNumber" align="center" label="Moli当期数字" />
<el-table-column prop="jackpot" align="center" label="奖池累计金币" />
<el-table-column prop="output" align="center" label="瓜分金币" />
</el-table>
<el-pagination style="margin-top: 10px" class="paginationClass" :current-page="dialogPagination.pageNo"
:page-size="dialogPagination.pageSize" :page-sizes="[10, 20, 50, 100, 200]"
layout="sizes, prev, pager, next" :total="tableData.totalInner" @size-change="detailhandleSizeChange"
@current-change="detailhandleCurrentChange" />
<!-- 操作 -->
<template #footer>
<span class="dialog-footer">
<el-button type="primary" class="primary" @click="detailsDialog = false;detailPageType = 0">关闭</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
import { ref, onMounted, reactive } from "vue";
import PartitionSelect from "@/views/common/partitionSelect.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { dateFormat } from "@/utils/system-helper";
import { getluckyNumberList } from "@/api/SsGuild/LuckyNumber";
export default {
name: "LuckyNumberSubmissionRecord",
components: {
PartitionSelect,
},
setup() {
const formData = reactive({
partitionId: undefined,
pageNo: 1,
pageSize: 10,
startTime: "",
endTime: "",
});
const dateTime = ref([]);
const tableData = reactive({
dataOuter: [],
dataInner: [],
loadingOuter: false,
loadingInner: false,
totalOuter: 0,
totalInner: 0,
});
const dialogPagination = reactive({
pageNo: 1,
pageSize: 10,
date:'',
partitionId: undefined,
})
const detailsDialog = ref(false);
const getData = () => {
tableData.loadingOuter = true;
let time = dateTime.value;
if (time && time.length > 0) {
formData.startTime = dateFormat(time[0], "yyyy-MM-dd");
formData.endTime = dateFormat(time[1], "yyyy-MM-dd");
} else {
formData.startTime = "";
formData.endTime = "";
}
getluckyNumberList(formData).then((res) => {
if (res.code == 200) {
tableData.dataOuter = res.data.rows;
tableData.totalOuter = res.data.total;
tableData.loadingOuter = false;
} else {
tableData.loadingOuter = false;
ElMessage.error(res.message);
}
});
};
const editFun = (row) => {
tableData.loadingInner = true;
dialogPagination.date = row.date;
dialogPagination.partitionId = formData.partitionId;
getluckyNumberList(dialogPagination).then((res) => {
if (res.code == 200) {
tableData.dataInner = res.data.rows;
tableData.totalInner = res.data.total;
tableData.loadingInner = false;
detailsDialog.value = true;
} else {
tableData.loadingInner = false;
ElMessage.error(res.message);
}
});
};
const handleSizeChange = (val) => {
formData.pageSize = val;
getData();
};
const handleCurrentChange = (val) => {
formData.pageNo = val;
getData();
};
const detailhandleSizeChange = (val) => {
dialogPagination.pageSize = val;
editFun();
};
const detailhandleCurrentChange = (val) => {
dialogPagination.pageNo = val;
editFun();
};
return {
formData,
dateTime,
tableData,
getData,
handleSizeChange,
handleCurrentChange,
editFun,
dialogPagination,
detailsDialog
};
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.dialogTableVisibleBut {
display: block;
margin: 30px 0 0 830px;
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
</style>