|
|
@ -1,6 +1,6 @@ |
|
|
<script setup> |
|
|
<script setup> |
|
|
import { computed, onMounted, ref } from 'vue' |
|
|
|
|
|
import { dayjs, ElMessage } from 'element-plus' |
|
|
|
|
|
|
|
|
import {computed, onMounted, ref} from 'vue' |
|
|
|
|
|
import {dayjs, ElMessage} from 'element-plus' |
|
|
import request from '@/util/http.js' |
|
|
import request from '@/util/http.js' |
|
|
import API from '@/util/http.js' |
|
|
import API from '@/util/http.js' |
|
|
import moment from 'moment' |
|
|
import moment from 'moment' |
|
|
@ -49,7 +49,7 @@ const getGift = async function () { |
|
|
try { |
|
|
try { |
|
|
const result = await request({ |
|
|
const result = await request({ |
|
|
url: '/beanConsume/getLiveGift', // todo 换成实际接口地址 |
|
|
url: '/beanConsume/getLiveGift', // todo 换成实际接口地址 |
|
|
data: { account: adminData.value.account } |
|
|
|
|
|
|
|
|
data: {account: adminData.value.account} |
|
|
}) |
|
|
}) |
|
|
console.log('请求礼物列表成功', result) |
|
|
console.log('请求礼物列表成功', result) |
|
|
// 存储礼物数据 |
|
|
// 存储礼物数据 |
|
|
@ -71,7 +71,7 @@ const getChannel = async function () { |
|
|
try { |
|
|
try { |
|
|
const result = await request({ |
|
|
const result = await request({ |
|
|
url: '/beanConsume/getLiveChannel', // todo 换成实际接口地址 |
|
|
url: '/beanConsume/getLiveChannel', // todo 换成实际接口地址 |
|
|
data: { account: adminData.value.account } |
|
|
|
|
|
|
|
|
data: {account: adminData.value.account} |
|
|
}) |
|
|
}) |
|
|
console.log('请求频道列表成功', result) |
|
|
console.log('请求频道列表成功', result) |
|
|
// 存储频道数据 |
|
|
// 存储频道数据 |
|
|
@ -88,12 +88,12 @@ const getChannel = async function () { |
|
|
|
|
|
|
|
|
// 抽离类型选项到响应式数组 |
|
|
// 抽离类型选项到响应式数组 |
|
|
const consumeTypes = ref([ |
|
|
const consumeTypes = ref([ |
|
|
{ label: '发礼物', value: 1 }, |
|
|
|
|
|
{ label: '发红包', value: 2 }, |
|
|
|
|
|
{ label: '发福袋', value: 3 }, |
|
|
|
|
|
{ label: '付费直播', value: 4 }, |
|
|
|
|
|
{ label: '加入粉丝团', value: 5 }, |
|
|
|
|
|
{ label: '发弹幕', value: 6 } |
|
|
|
|
|
|
|
|
{label: '发礼物', value: 1}, |
|
|
|
|
|
{label: '发红包', value: 2}, |
|
|
|
|
|
{label: '发福袋', value: 3}, |
|
|
|
|
|
{label: '付费直播', value: 4}, |
|
|
|
|
|
{label: '加入粉丝团', value: 5}, |
|
|
|
|
|
{label: '发弹幕', value: 6} |
|
|
]) |
|
|
]) |
|
|
// 处理类型选择变化 |
|
|
// 处理类型选择变化 |
|
|
const handleTypeChange = (value) => { |
|
|
const handleTypeChange = (value) => { |
|
|
@ -136,7 +136,7 @@ const getDept = async function () { |
|
|
// url: '/general/dept', |
|
|
// url: '/general/dept', |
|
|
|
|
|
|
|
|
url: '/beanConsume/getDept', // todo 换成实际接口地址 |
|
|
url: '/beanConsume/getDept', // todo 换成实际接口地址 |
|
|
data: { account: adminData.value.account } |
|
|
|
|
|
|
|
|
data: {account: adminData.value.account} |
|
|
}) |
|
|
}) |
|
|
console.log('请求地区列表成功', result) |
|
|
console.log('请求地区列表成功', result) |
|
|
// 存储地区数据 |
|
|
// 存储地区数据 |
|
|
@ -260,7 +260,6 @@ const selectLiveBy = async function (val) { |
|
|
totalNum.value = Number(data.totalNum) || 0; |
|
|
totalNum.value = Number(data.totalNum) || 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 存储分页总数 |
|
|
// 存储分页总数 |
|
|
total.value = result.data.total |
|
|
total.value = result.data.total |
|
|
console.log('total', total.value) |
|
|
console.log('total', total.value) |
|
|
@ -337,8 +336,6 @@ const get7Days = function () { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理排序事件 |
|
|
// 处理排序事件 |
|
|
const handleSortChange = (column) => { |
|
|
const handleSortChange = (column) => { |
|
|
console.log('排序字段:', column.prop) |
|
|
console.log('排序字段:', column.prop) |
|
|
@ -413,7 +410,7 @@ const exportExcel = async function () { |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
console.log('2') |
|
|
console.log('2') |
|
|
const res = await API({ url: '/export/exportLive', data: params }); |
|
|
|
|
|
|
|
|
const res = await API({url: '/export/exportLive', data: params}); |
|
|
console.log('导出请求响应:', res); |
|
|
console.log('导出请求响应:', res); |
|
|
if (res.code === 200) { |
|
|
if (res.code === 200) { |
|
|
ElMessage.success('导出成功'); |
|
|
ElMessage.success('导出成功'); |
|
|
@ -442,7 +439,7 @@ const exportListLoading = ref(false) |
|
|
const getExportList = async () => { |
|
|
const getExportList = async () => { |
|
|
exportListLoading.value = true |
|
|
exportListLoading.value = true |
|
|
try { |
|
|
try { |
|
|
const result = await API({ url: '/export/export' }) |
|
|
|
|
|
|
|
|
const result = await API({url: '/export/export'}) |
|
|
if (result.code === 200) { |
|
|
if (result.code === 200) { |
|
|
const filteredData = result.data.filter(item => { |
|
|
const filteredData = result.data.filter(item => { |
|
|
return item.type === 6; //4表示金币消耗列表 // todo 修改对应type 6是直播 |
|
|
return item.type === 6; //4表示金币消耗列表 // todo 修改对应type 6是直播 |
|
|
@ -502,53 +499,64 @@ const getTagText = (state) => { |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<el-card class="card1" style="margin-bottom: 1vh;"> |
|
|
|
|
|
<div style="margin-bottom: 1vh;display: flex;"> |
|
|
|
|
|
<div style="width: 18vw;margin-right: 1vw;display: flex;align-items: center;"> |
|
|
|
|
|
<el-text>精网号:</el-text> |
|
|
|
|
|
<el-input v-model="beanConsumeLive.jwcode" style="width:10vw;" placeholder="请输入精网号" clearable /> |
|
|
|
|
|
|
|
|
<el-card class="card1" style="margin-bottom: 0.5vh;"> |
|
|
|
|
|
<el-col style="margin-bottom: 1vh"> |
|
|
|
|
|
<div class="select"> |
|
|
|
|
|
<div class="selectRow"> |
|
|
|
|
|
<el-text class="text">精网号:</el-text> |
|
|
|
|
|
<el-input class="selectContent" v-model="beanConsumeLive.jwcode" placeholder="请输入精网号" clearable/> |
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-bottom: 1vh;width:18vw;display: flex;align-items: center;"> |
|
|
|
|
|
<el-text>地区:</el-text> |
|
|
|
|
|
<el-select v-model="beanConsumeLive.dept" placeholder="请选择地区" style="width:10vw" clearable> |
|
|
|
|
|
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item" /> |
|
|
|
|
|
|
|
|
<div class="selectRow"> |
|
|
|
|
|
<el-text class="text">地区:</el-text> |
|
|
|
|
|
<el-select class="selectContent" v-model="beanConsumeLive.dept" placeholder="请选择地区" clearable> |
|
|
|
|
|
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item"/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-bottom: 1vh;width:18vw;display: flex;align-items: center;"> |
|
|
|
|
|
<el-text>礼物名称:</el-text> |
|
|
|
|
|
<el-select v-model="beanConsumeLive.gift" placeholder="请选择礼物名称" style="width:10vw" |
|
|
|
|
|
|
|
|
<div class="selectRow"> |
|
|
|
|
|
<el-text class="text">礼物名称:</el-text> |
|
|
|
|
|
<el-select class="selectContent" v-model="beanConsumeLive.gift" placeholder="请选择礼物名称" |
|
|
clearable filterable allow-create default-first-option> |
|
|
clearable filterable allow-create default-first-option> |
|
|
<el-option v-for="(item, index) in gifts" :key="index" :label="item" :value="item" /> |
|
|
|
|
|
|
|
|
<el-option v-for="(item, index) in gifts" :key="index" :label="item" :value="item"/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-bottom: 1vh;width:18vw;display: flex;align-items: center;"> |
|
|
|
|
|
<el-text>频道:</el-text> |
|
|
|
|
|
<el-select v-model="beanConsumeLive.liveChannel" placeholder="请选择频道" style="width:10vw" |
|
|
|
|
|
|
|
|
<div class="selectRow"> |
|
|
|
|
|
<el-text class="text">频道:</el-text> |
|
|
|
|
|
<el-select class="selectContent" v-model="beanConsumeLive.liveChannel" placeholder="请选择频道" |
|
|
clearable filterable allow-create default-first-option> |
|
|
clearable filterable allow-create default-first-option> |
|
|
<el-option v-for="(item, index) in channels" :key="index" :label="item" :value="item" /> |
|
|
|
|
|
|
|
|
<el-option v-for="(item, index) in channels" :key="index" :label="item" :value="item"/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-bottom: 1vh;width:18vw;display: flex;align-items: center;"> |
|
|
|
|
|
<el-text>直播间:</el-text> |
|
|
|
|
|
<el-input v-model="beanConsumeLive.liveName" placeholder="请输入直播间" style="width:10vw" |
|
|
|
|
|
clearable /> |
|
|
|
|
|
|
|
|
<div class="selectRow"> |
|
|
|
|
|
<el-text class="text">直播间:</el-text> |
|
|
|
|
|
<el-input class="selectContent" v-model="beanConsumeLive.liveName" placeholder="请输入直播间" |
|
|
|
|
|
clearable/> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div> |
|
|
|
|
|
<el-text>消费时间:</el-text> |
|
|
|
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" start-placeholder="起始时间" |
|
|
|
|
|
end-placeholder="结束时间" style="width: 20vw;margin-right: 1vw;" @change="handleDatePickerChange" |
|
|
|
|
|
:default-time="defaultTime" /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col> |
|
|
|
|
|
<div class="select"> |
|
|
|
|
|
<div class="selectRow" style="width: 31.5vw;"> |
|
|
|
|
|
<el-text class="text">消费时间:</el-text> |
|
|
|
|
|
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator="至" |
|
|
|
|
|
start-placeholder="起始时间" |
|
|
|
|
|
end-placeholder="结束时间" style="margin-right:1vw;width:480px" |
|
|
|
|
|
@change="handleDatePickerChange" |
|
|
|
|
|
:default-time="defaultTime"/> |
|
|
|
|
|
<div v-if="false"> |
|
|
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"> 今</el-button> |
|
|
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"> 今</el-button> |
|
|
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"> 昨</el-button> |
|
|
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"> 昨</el-button> |
|
|
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''"> 近7天</el-button> |
|
|
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''"> 近7天</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="selectRow" style="justify-content: flex-start;"> |
|
|
|
|
|
|
|
|
<el-button type="success" @click="reset()">重置</el-button> |
|
|
<el-button type="success" @click="reset()">重置</el-button> |
|
|
<el-button type="primary" @click="search()">查询</el-button> |
|
|
<el-button type="primary" @click="search()">查询</el-button> |
|
|
<el-button type="primary" @click="exportExcel()">导出excel</el-button> |
|
|
<el-button type="primary" @click="exportExcel()">导出excel</el-button> |
|
|
<el-button type="primary" @click="openExportList">查看导出列表</el-button> |
|
|
<el-button type="primary" @click="openExportList">查看导出列表</el-button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-col> |
|
|
</el-card> |
|
|
</el-card> |
|
|
<el-card class="card2"> |
|
|
<el-card class="card2"> |
|
|
<div class="goldStatistics"> |
|
|
<div class="goldStatistics"> |
|
|
@ -566,23 +574,23 @@ const getTagText = (state) => { |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<!-- 固定姓名列 --> |
|
|
<!-- 固定姓名列 --> |
|
|
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip /> |
|
|
|
|
|
|
|
|
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip/> |
|
|
<!-- 固定精网号列 --> |
|
|
<!-- 固定精网号列 --> |
|
|
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left" /> |
|
|
|
|
|
<el-table-column prop="dept" label="地区" width="110px" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left"/> |
|
|
|
|
|
<el-table-column prop="dept" label="地区" width="110px"/> |
|
|
<el-table-column prop="gift" label="礼物" width="140px"> |
|
|
<el-table-column prop="gift" label="礼物" width="140px"> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="beanNum" label="金豆数量" sortable="custom" width="120px" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="beanNum" label="金豆数量" sortable="custom" width="120px"/> |
|
|
<el-table-column prop="isBackpack" label="背包礼物" width="120px"> |
|
|
<el-table-column prop="isBackpack" label="背包礼物" width="120px"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
{{ scope.row.isBackpack == 1 ? '是' : '否' }} |
|
|
{{ scope.row.isBackpack == 1 ? '是' : '否' }} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="buyBean" label="付费金豆数" sortable="custom" width="120px" /> |
|
|
|
|
|
<el-table-column prop="freeBean" label="免费金豆数" sortable="custom" width="120px" /> |
|
|
|
|
|
<el-table-column prop="liveChannel" label="频道" width="120px" show-overflow-tooltip /> |
|
|
|
|
|
<el-table-column prop="liveName" label="直播间名称" width="160px" show-overflow-tooltip /> |
|
|
|
|
|
<el-table-column prop="consumeTime" label="消费时间" sortable="custom" width="180px" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="buyBean" label="付费金豆数" sortable="custom" width="120px"/> |
|
|
|
|
|
<el-table-column prop="freeBean" label="免费金豆数" sortable="custom" width="120px"/> |
|
|
|
|
|
<el-table-column prop="liveChannel" label="频道" width="120px" show-overflow-tooltip/> |
|
|
|
|
|
<el-table-column prop="liveName" label="直播间名称" width="160px" show-overflow-tooltip/> |
|
|
|
|
|
<el-table-column prop="consumeTime" label="消费时间" sortable="custom" width="180px"/> |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]" style="margin-top: 20px;" |
|
|
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]" style="margin-top: 20px;" |
|
|
@ -593,7 +601,7 @@ const getTagText = (state) => { |
|
|
<!-- 导出弹窗 --> |
|
|
<!-- 导出弹窗 --> |
|
|
<el-dialog v-model="exportListVisible" title="导出列表" width="80%"> |
|
|
<el-dialog v-model="exportListVisible" title="导出列表" width="80%"> |
|
|
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading"> |
|
|
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading"> |
|
|
<el-table-column prop="fileName" label="文件名" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="fileName" label="文件名"/> |
|
|
<el-table-column prop="state" label="状态"> |
|
|
<el-table-column prop="state" label="状态"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'"> |
|
|
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'"> |
|
|
@ -652,7 +660,7 @@ const getTagText = (state) => { |
|
|
:deep(.el-table__header-wrapper), |
|
|
:deep(.el-table__header-wrapper), |
|
|
:deep(.el-table__body-wrapper), |
|
|
:deep(.el-table__body-wrapper), |
|
|
:deep(.el-table__cell), |
|
|
:deep(.el-table__cell), |
|
|
/* 表格 */ |
|
|
|
|
|
|
|
|
/* 表格 */ |
|
|
:deep(.el-table__body td) { |
|
|
:deep(.el-table__body td) { |
|
|
background-color: #F3FAFE !important; |
|
|
background-color: #F3FAFE !important; |
|
|
} |
|
|
} |
|
|
@ -671,4 +679,26 @@ const getTagText = (state) => { |
|
|
display: flex; |
|
|
display: flex; |
|
|
margin-top: 20px; |
|
|
margin-top: 20px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 搜索的样式 */ |
|
|
|
|
|
.select { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
|
|
|
|
.selectRow { |
|
|
|
|
|
width: 17vw; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
padding: 0 0.5vw; |
|
|
|
|
|
|
|
|
|
|
|
.text { |
|
|
|
|
|
width: 5vw; |
|
|
|
|
|
font-size: 15px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.selectContent { |
|
|
|
|
|
flex: 1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |