幸运礼物-平台汇总-数组类型

This commit is contained in:
khalil
2025-06-18 19:55:24 +08:00
parent 7eed754f42
commit ea39538887
2 changed files with 110 additions and 41 deletions

View File

@@ -16,12 +16,24 @@
</div>
<!-- 送出时间 -->
<div class="inquire">
<span>送出时间</span>
<span>时间</span>
<el-date-picker v-model="inquire.time"
type="date"
placeholder="请选择">
</el-date-picker>
</div>
<!-- 送出时间 -->
<div class="inquire">
<span>数组类型</span>
<el-select v-model="inquire.poolType"
placeholder="请选择">
<el-option v-for="item in poolTypes"
:key="item.type"
:label="item.name"
:value="item.type">
</el-option>
</el-select>
</div>
</div>
<el-button type="text">总进入{{ totalInput }}</el-button>
<el-button type="text">总退出{{ totalOutput }}</el-button>
@@ -227,14 +239,12 @@
</div>
</template>
<script>
import { personal, updateUserMulti, pageRecord, exportRecord } from "@/api/luckGift/luckGift";
import { personal, updateUserMulti, pageRecord, exportRecord, listType } from "@/api/luckGift/luckGift";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
import { ElMessage } from "element-plus";
import moment from "moment-timezone";
import PartitionSelect from "@/views/common/partitionSelect.vue";
import { genQueryParam } from "@/utils/maintainer";
export default {
name: "luckGiftData",
components: {
@@ -251,7 +261,9 @@ export default {
userId: "",
time: "",
value: undefined,
poolType: undefined,
},
poolTypes: [],
// 表格
tableData: [],
// 分页
@@ -271,6 +283,7 @@ export default {
pageRecord: {
uid: undefined,
date: undefined,
poolType: undefined,
loading: false,
data: [],
total: 0,
@@ -282,6 +295,20 @@ export default {
};
},
methods: {
loadPoolTypes () {
listType({ needAll: true }).then((res) => {
if (res.code != 200) {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
return
}
this.poolTypes = res.data;
this.inquire.poolType = this.poolTypes[0].type
})
},
// 查询接口
getData () {
if (!this.inquire.time && this.inquire.userId === '') {
@@ -301,6 +328,7 @@ export default {
? dateFormat(this.inquire.time, "yyyy-MM-dd")
: null,
partitionId: this.inquire.value,
poolType: this.inquire.poolType ? this.inquire.poolType : undefined,
}).then((res) => {
this.total = res.data.dataPage.total;
this.tableData = res.data.dataPage.rows;
@@ -347,6 +375,7 @@ export default {
this.recordDialog.title = '[' + row.erbanNo + ']' + row.date + '明细';
this.pageRecord.uid = row.uid;
this.pageRecord.date = row.date;
this.pageRecord.poolType = row.poolType ? row.poolType : undefined;
this.pageRecordData();
},
closeRecordDialog () {
@@ -354,6 +383,7 @@ export default {
this.recordDialog.title = undefined;
this.pageRecord.uid = undefined;
this.pageRecord.date = undefined;
this.pageRecord.poolType = undefined;
},
// 分页导航
handleRecordPageChange () {
@@ -372,6 +402,7 @@ export default {
pageRecord({
uid: this.pageRecord.uid,
date: this.pageRecord.date,
poolType: this.pageRecord.poolType,
pageNo: this.pageRecord.pageNo,
pageSize: this.pageRecord.pageSize,
}).then((res) => {
@@ -396,6 +427,9 @@ export default {
this.exportLoading = false;
},
},
mounted () {
this.loadPoolTypes()
},
};
</script>
<style lang="less" scoped>

View File

@@ -5,59 +5,74 @@
<div class="inquire">
<span>分区</span>
<partition-select v-model:partition-id="inquire.value"
v-model:partition-infos="inquire.options"
/>
v-model:partition-infos="inquire.options" />
</div>
<div class="inquire">
<span>数组类型</span>
<el-select v-model="inquire.poolType"
placeholder="请选择">
<el-option v-for="item in poolTypes"
:key="item.type"
:label="item.name"
:value="item.type">
</el-option>
</el-select>
</div>
<!-- 时间 -->
<!-- <div class="inquire">
<span>时间</span>
<el-date-picker v-model="inquire.time" type="date" placeholder="请选择">
</el-date-picker>
</div> -->
</div>
<!-- 按钮 -->
<div class="but">
<el-button class="primary" type="primary" @click="getData()"
>查询
<el-button class="primary"
type="primary"
@click="getData()">查询
</el-button>
</div>
<el-button type="text">数组出金币总额{{ totalInput }}</el-button>
<el-button type="text">数组出返币总额{{ totalOutput }}</el-button>
<el-button type="text">投产比{{ totalProductionRatio }}</el-button>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="totalInput" align="center" label="进入" />
<el-table-column prop="totalOutput" align="center" label="退出" />
<el-table-column
prop="productionRatio"
align="center"
label="退出/进入比例"
/>
<el-table-column prop="num" align="center" label="参与次数" />
<el-table-column prop="count" align="center" label="参与人数" />
<el-table-column prop="winCount" align="center" label="得到人数" />
<el-table-column prop="winNum" align="center" label="得到次数" />
<el-table-column prop="winRate" align="center" label="得到率" />
<el-table v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px">
<el-table-column prop="date"
align="center"
label="日期" />
<el-table-column prop="totalInput"
align="center"
label="进入" />
<el-table-column prop="totalOutput"
align="center"
label="退出" />
<el-table-column prop="productionRatio"
align="center"
label="退出/进入比例" />
<el-table-column prop="num"
align="center"
label="参与次数" />
<el-table-column prop="count"
align="center"
label="参与人数" />
<el-table-column prop="winCount"
align="center"
label="得到人数" />
<el-table-column prop="winNum"
align="center"
label="得到次数" />
<el-table-column prop="winRate"
align="center"
label="得到率" />
</el-table>
</div>
</template>
<script>
import { platform } from "@/api/luckGift/luckGift";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
import { platform, listType } from "@/api/luckGift/luckGift";
// @ts-ignore
import { ElMessage } from "element-plus";
import PartitionSelect from "@/views/common/partitionSelect.vue";
export default {
name: "luckGiftDataAll",
components: {PartitionSelect},
data() {
components: { PartitionSelect },
data () {
return {
loading: false,
totalInput: "0",
@@ -68,7 +83,9 @@ export default {
value: undefined,
options: [],
time: "",
poolType: undefined,
},
poolTypes: [],
// 表格
tableData: [],
// 分页
@@ -78,11 +95,26 @@ export default {
};
},
methods: {
loadPoolTypes () {
listType({ needAll: true }).then((res) => {
if (res.code != 200) {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
return
}
this.poolTypes = res.data;
this.inquire.poolType = this.poolTypes[0].type
})
},
// 查询接口
getData() {
getData () {
this.loading = true;
platform({
partitionId: this.inquire.value,
poolType: this.inquire.poolType ? this.inquire.poolType : undefined,
}).then((res) => {
this.totalInput = res.data.totalInput;
this.totalOutput = res.data.totalOutput;
@@ -92,13 +124,16 @@ export default {
});
},
// 分页导航
handleSizeChange() {
handleSizeChange () {
this.getData();
},
handleCurrentChange() {
handleCurrentChange () {
this.getData();
},
},
mounted () {
this.loadPoolTypes()
},
};
</script>
<style lang="less" scoped>