Files
peko-admin-web/src/views/luckGift/luckGiftData.vue

281 lines
7.1 KiB
Vue
Raw Normal View History

2024-09-14 16:05:29 +08:00
<template>
<div class="box">
<!-- ID -->
<div class="condition">
2024-09-14 19:03:04 +08:00
<!-- 分区 -->
<div class="inquire">
<span>分区</span>
<el-select
v-model="inquire.value"
placeholder="请选择"
@change="handleChange"
>
<el-option
v-for="item in inquire.options"
:key="item.type"
:label="item.name"
:value="item.type"
>
</el-option>
</el-select>
</div>
2024-09-14 16:05:29 +08:00
<div class="inquire">
<span>MoliStar ID</span>
<el-input v-model="inquire.userId" placeholder="" class="input">
</el-input>
</div>
<!-- 送出时间 -->
<div class="inquire">
<span>送出时间</span>
<el-date-picker v-model="inquire.time" type="date" placeholder="请选择">
</el-date-picker>
</div>
</div>
2024-11-15 11:15:03 +08:00
<el-button type="text">总进入{{ alwaysEnter }}</el-button>
<el-button type="text">总退出{{ totalWithdrawal }}</el-button>
<el-button type="text"
>总比例{{ totalWithdrawal / alwaysEnter }}</el-button
>
2024-09-14 16:05:29 +08:00
<!-- 按钮 -->
<div class="but">
<el-button class="primary" type="primary" @click="getData()"
>查询
</el-button>
<el-button
@click="
inquire.userId = '';
inquire.time = '';
"
2024-09-14 19:03:04 +08:00
>重置筛选
2024-09-14 16:05:29 +08:00
</el-button>
<el-button
class="primary"
type="primary"
style="margin-left=20px;"
:disabled="butClick"
@click="
editDialog = true;
type = 12;
editDialogTitle = '赠送1000倍奖励';
value = inquire.x;
"
>
2024-10-12 18:05:09 +08:00
赠送</el-button
>
2024-09-14 16:05:29 +08:00
</div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
2024-09-14 20:12:04 +08:00
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="uid" align="center" label="uid" />
<el-table-column prop="erbanNo" align="center" label="平台id" />
2024-09-14 23:46:27 +08:00
<el-table-column prop="totalInput" align="center" label="进入" />
<el-table-column prop="totalOutput" align="center" label="退出" />
<el-table-column prop="production" align="center" label="剩余" />
<el-table-column
prop="productionRatio"
align="center"
label="退出/进入"
/>
2024-09-14 23:46:27 +08:00
<el-table-column prop="avgInput" align="center" label="每次进入" />
<el-table-column prop="num" align="center" label="总次数" />
<el-table-column prop="winNum" align="center" label="得到次数" />
<el-table-column prop="winRate" align="center" label="得到率" />
2024-09-14 16:05:29 +08:00
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 编辑弹窗 -->
<el-dialog v-model="editDialog" :title="editDialogTitle" 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"
>{{ editDialogTitle }}</span
>
<el-input
v-model="value"
style="width: 75%"
class="input"
placeholder="请输入用户ID"
></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>
2024-09-14 16:05:29 +08:00
</div>
</template>
<script>
import { personal, updateUserMulti } from "@/api/luckGift/luckGift";
2024-09-14 16:05:29 +08:00
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
import { ElMessage } from "element-plus";
import moment from "moment-timezone";
export default {
name: "luckGiftData",
data() {
return {
loading: false,
2024-11-15 11:15:03 +08:00
alwaysEnter: "",
totalWithdrawal: "",
2024-09-14 16:05:29 +08:00
//查询所需条件对象
inquire: {
userId: "",
time: "",
2024-09-14 19:03:04 +08:00
value: 2,
options: [
{
name: "阿拉伯区",
type: 2,
},
{
name: "英语区",
type: 1,
},
{
name: "华语区",
type: 4,
},
{
value: 8,
label: "土耳其区",
},
2024-09-14 19:03:04 +08:00
],
2024-09-14 16:05:29 +08:00
},
// 表格
tableData: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
editDialog: false,
editDialogTitle: "",
value: "",
2024-09-14 16:05:29 +08:00
};
},
created() {
// this.getData();
},
methods: {
// 查询接口
getData() {
console.log(dateFormat(this.inquire.time, "yyyy-MM-dd"));
2024-11-15 11:15:03 +08:00
// if (!this.inquire.time) {
// ElMessage({
// showClose: true,
// message: "请选择时间",
// type: "error",
// });
// return;
// }
2024-09-14 16:05:29 +08:00
this.loading = true;
2024-09-14 19:03:04 +08:00
personal({
erbanNo: this.inquire.userId,
pageNo: this.currentPage,
pageSize: this.pageSize,
2024-11-15 11:15:03 +08:00
startDate: this.inquire.time
? dateFormat(this.inquire.time, "yyyy-MM-dd")
: null,
endDate: this.inquire.time
? dateFormat(this.inquire.time, "yyyy-MM-dd")
: null,
2024-09-14 19:03:04 +08:00
partitionId: this.inquire.value,
}).then((res) => {
this.total = res.data.total;
this.tableData = res.data.rows;
this.loading = false;
});
2024-09-14 16:05:29 +08:00
},
// 确认保存
editDialogClick() {
this.butClick = true;
updateUserMulti({ erbanNo: this.value }).then((res) => {
if (res.code == 200) {
ElMessage({
showClose: true,
message: "赠送成功",
type: "success",
});
setTimeout(() => {
this.butClick = false;
}, 3000);
this.editDialog = false;
this.getData();
} else {
this.butClick = false;
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
2024-09-14 16:05:29 +08:00
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.condition {
margin-bottom: 20px;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
}
.but {
margin-bottom: 20px;
}
}
</style>