Files
peko-admin-web/src/views/BD/BDmanagement.vue

325 lines
9.9 KiB
Vue

<template>
<div class="box">
<div class="inquire">
<span>用户ID:</span>
<el-input v-model="formData.erbanNo"
placeholder=""
class="input" />
</div>
<div class="inquire">
<span>分区</span>
<partition-select v-model:partition-id="formData.partitionId"
@update:partitionId="getlistByPartition" />
</div>
<div class="inquire">
<span>国家</span>
<el-select v-model="formData.regionId"
placeholder="请选择">
<el-option v-for="item in adminCountryArr"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="inquire">
<span class="demonstration">日期</span>
<el-date-picker v-model="dataTime"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD">
</el-date-picker>
</div>
<el-button style=""
type="primary"
@click="getData()">查询</el-button>
<el-table v-loading="tableData.loading"
:data="tableData.data"
ref="multipleTable"
@selection-change="handleSelectionChange"
border
style="width: 100%; margin-top: 25px">
<el-table-column prop="erbanNo"
align="center"
label="用户ID" />
<el-table-column prop="nick"
align="center"
label="用户昵称" />
<el-table-column prop="partitionDesc"
align="center"
label="分区" />
<el-table-column prop="regionName"
align="center"
label="国家" />
<el-table-column prop="createTime"
align="center"
label="创建时间">
<template v-slot="scope">
{{ dateFormat(scope.row.createTime) }}
</template>
</el-table-column>
<el-table-column prop="guildNum"
align="center"
label="旗下公会数量">
<template v-slot="scope">
<el-button type="text"
size="small"
@click="editFen(scope.row)">
{{ scope.row.guildNum }}
</el-button>
</template>
</el-table-column>
<el-table-column prop="diamondNum"
align="center"
label="公会钻石流水" />
<el-table-column prop="goldNum"
align="center"
label="公会金币流水" />
<el-table-column prop="owner"
align="center"
label="负责人" />
</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.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange" />
<!-- 详情表格 -->
<el-dialog v-model="detailsDialog"
title="公会钻石流水详情"
width="70%"
center>
<!-- 内表格 -->
<el-table v-loading="tableDetailData.loading"
:data="tableDetailData.data"
border
style="width: 100%; margin-top: 25px">
<el-table-column prop="guildId"
align="center"
label="公会ID" />
<el-table-column prop="guildName"
align="center"
label="公会昵称" />
<el-table-column prop="ownerErbanNo"
align="center"
label="公会长ID" />
<el-table-column prop="nick"
align="center"
label="公会长昵称" />
<el-table-column prop="regionName"
align="center"
label="所属国家" />
<el-table-column prop="createTime"
align="center"
label="公会成立时间">
<template v-slot="scope">
{{ dateFormat(scope.row.createTime) }}
</template>
</el-table-column>
<el-table-column prop="memberNum"
align="center"
label="公会成员数(不包括公会长)" />
<el-table-column prop="diamondNum"
align="center"
label="公会钻石流水" />
<el-table-column prop="goldNum"
align="center"
label="公会金币流水" />
<el-table-column prop="status"
align="center"
label="绑定状态">
<template v-slot="scope">
{{ scope.row.status == 1 ? '有效' : '无效' }}
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination style="margin-top: 10px"
class="paginationClass"
:current-page="formDetailData.pageNo"
:page-size="formDetailData.pageSize"
:page-sizes="[10, 20, 50, 100, 200]"
layout="sizes, prev, pager, next"
:total="tableDetailData.total"
@size-change="handleSizeChangeDetail"
@current-change="handleCurrentChangeDetail" />
</el-dialog>
</div>
</template>
<script>
import { ref, onMounted, reactive, computed } from 'vue'
import PartitionSelect from "@/views/common/partitionSelect.vue";
import { getBdDetailGuildsList, getBdDataList, getlistByPartitionId } from "@/api/BD/IdentitySettings.js"
import { ElMessage, ElMessageBox } from "element-plus";
import { dateFormat } from "@/utils/system-helper";
export default {
name: 'BDmanagement',
components: {
PartitionSelect
},
setup () {
const formData = reactive({
partitionId: undefined,
pageNo: 1,
pageSize: 10,
erbanNo: '',
regionId: '',
startTime: '',
endTime: ''
})
const tableData = reactive({
data: [],
total: 0,
loading: false,
})
const formDetailData = reactive({
bdId: '',
pageNo: 1,
pageSize: 10,
startTime: '',
endTime: '',
partitionId: '',
})
const tableDetailData = reactive({
data: [],
total: 0,
loading: false,
})
const detailsDialog = ref(false)
const dataTime = ref('');
const adminCountryArr = ref([])
const getlistByPartition = (e) => {
if (e) {
formData.partitionId = e;
}
getlistByPartitionId({ partitionId: formData.partitionId, containAll: true }).then((res) => {
if (res.code == 200) {
adminCountryArr.value = res.data;
}
});
}
const getData = () => {
tableData.loading = true;
if (dataTime.value && dataTime.value.length > 0) {
formData.startTime = dataTime.value[0];
formData.endTime = dataTime.value[1];
console.log(dataTime.value)
} else {
formData.startTime = dataTime.value
formData.endTime = dataTime.value
}
getBdDataList(formData).then(res => {
if (res.code == 200) {
tableData.data = res.data.rows
tableData.total = res.data.total
tableData.loading = false
} else {
tableData.loading = false;
ElMessage.error(res.message)
}
})
}
// 详情
const editFen = (row) => {
if (row) {
formDetailData.bdId = row.id;
formDetailData.partitionId = formData.partitionId;
formDetailData.endTime = formData.endTime;
formDetailData.startTime = formData.startTime;
}
tableDetailData.loading = true;
getBdDetailGuildsList(formDetailData).then(res => {
if (res.code == 200) {
tableDetailData.data = res.data.rows
tableDetailData.total = res.data.total
tableDetailData.loading = false
detailsDialog.value = true
} else {
tableDetailData.loading = false
ElMessage.error(res.message)
}
})
}
const dateFormat = (row) => {
const date = new Date(row);
return date.format("yyyy-MM-dd hh:mm:ss");
}
const handleSizeChange = (val) => {
formData.pageSize = val;
getData();
};
const handleCurrentChange = (val) => {
formData.pageNo = val;
getData();
};
const handleSizeChangeDetail = (val) => {
formDetailData.pageSize = val;
editFen();
};
const handleCurrentChangeDetail = (val) => {
formDetailData.pageNo = val;
editFen();
};
return {
formData,
adminCountryArr,
getlistByPartition,
dataTime,
getData,
tableData,
dateFormat,
editFen,
formDetailData,
detailsDialog,
tableDetailData,
handleSizeChange,
handleCurrentChange,
handleSizeChangeDetail,
handleCurrentChangeDetail
}
}
}
</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>