Browse Source

导出

zhangrenyuan/feature-20250728113353-金币前端三期
ZhangYong 2 weeks ago
parent
commit
14b014c202
  1. 4
      .env.development
  2. 50
      src/views/recharge/beanOnlineRecharge.vue
  3. 50
      src/views/recharge/beanSystemRecharge.vue

4
.env.development

@ -1,6 +1,6 @@
# VITE_API_BASE='https://hwjb.homilychart.com/dev/admin'
# 测试环境
# VITE_API_BASE='http://18.143.76.3:10704/'
VITE_API_BASE='http://18.143.76.3:10704/'
# VITE_API_BASE='http://192.168.9.52:10705/'
VITE_UPLOAD_URL=http://39.101.133.168:8828/hljw/api/aws/upload
# VITE_API_BASE='http://192.168.9.28:8081/'
@ -10,4 +10,4 @@ VITE_UPLOAD_URL=http://39.101.133.168:8828/hljw/api/aws/upload
# zhangyong
# VITE_API_BASE='http://192.168.3.83:8081/'
# 李慧琳
VITE_API_BASE='http://localhost:8081/'
# VITE_API_BASE='http://localhost:8081/'

50
src/views/recharge/beanOnlineRecharge.vue

@ -81,6 +81,7 @@ const getToday = () => {
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'today'
search();
}
const getYesterday = () => {
@ -99,6 +100,7 @@ const getYesterday = () => {
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'yesterday'
search();
}
@ -117,6 +119,7 @@ const get7Days = function () {
)
getTime.value = [startTime, endTime]
activeTimeRange.value = '7days'
search();
}
@ -129,6 +132,7 @@ const reset = () => {
}
getTime.value = []
activeTimeRange.value = ''
search()
}
//
@ -150,10 +154,10 @@ const get = async () => {
const data = {
...getObj.value,
beanRechargeInfo: {
...selectData.value
},
...selectData.value,
sortField: sortField.value,
sortOrder: sortOrder.value,
},
}
console.log('请求参数:', data);
const result = await API({
@ -191,7 +195,7 @@ const handleSortChange = (column) => {
console.log('排序方式:', column.order)
// 使
const allowedFields = ['money', 'freeGold', 'payTime', 'createTime', 'permanentGold'];
const allowedFields = ['money', 'num'];
if (allowedFields.includes(column.prop)) {
sortField.value = column.prop;
}
@ -201,7 +205,7 @@ const handleSortChange = (column) => {
console.log('传递给后端的排序字段:', sortField.value)
console.log('传递给后端的排序方式:', sortOrder.value)
// get();
get();
}
//===================================================
//
@ -230,7 +234,7 @@ const exportExcel = async () => {
},
}
try {
const res = await API({ url: '/export', data: params })
const res = await API({ url: '/export/exportol', data: params })
if (res.code === 200) {
ElMessage.success('导出成功')
} else {
@ -259,11 +263,10 @@ const getExportList = async () => {
try {
const result = await API({ url: '/export/export' })
if (result.code === 200) {
// const filteredData = result.data.filter(item => {
// return item.type === 2; //2
// });
// exportList.value = filteredData
exportList.value = result.data
const filteredData = result.data.filter(item => {
return item.type === 10;
});
exportList.value = filteredData
} else {
ElMessage.error(result.msg || '获取导出列表失败')
}
@ -390,9 +393,7 @@ onMounted(async function () {
<el-col>
<el-card>
<div class="bean-info">
<!-- 汉字用 <strong> 加粗动态数据用 <span> 包一层单独改色 -->
<strong> 充值金豆数</strong><span class="data-text">{{ beanNum }}</span>
<strong>, 合计新币数</strong><span class="data-text">{{ money }}</span>
充值金豆数{{ beanNum }}, 合计新币数{{ money }}
</div>
<!-- 设置表格容器的高度和滚动样式 -->
<div style="height: 520px; overflow-y: auto;margin-top: 10px;">
@ -413,9 +414,9 @@ onMounted(async function () {
<span v-else>其他</span>
</template>
</el-table-column>
<el-table-column prop="rechargeTime" sortable label="充值时间" min-width="200px">
<el-table-column prop="rechargeTime" label="充值时间" min-width="200px">
<template #default="scope">
{{ moment(scope.row.payTime).format('YYYY-MM-DD HH:mm:ss') }}
{{ moment(scope.row.rechargeTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table>
@ -463,24 +464,5 @@ onMounted(async function () {
</el-dialog>
</template>
<style scoped>
:deep(.custom-height-dialog .el-dialog__body) {
height: 60vh;
overflow-y: auto;
padding: 15px;
}
.bean-info {
background-color: #eaf5ff;
padding: 12px 16px;
border-radius: 6px;
font-size: 16px;
color: #333;
}
.bean-info strong {
font-weight: 700;
}
.bean-info .data-text {
color: #007bff;
}
</style>

50
src/views/recharge/beanSystemRecharge.vue

@ -78,6 +78,7 @@ const getToday = () => {
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'today'
search()
}
const getYesterday = () => {
@ -96,6 +97,7 @@ const getYesterday = () => {
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'yesterday'
search()
}
@ -114,6 +116,7 @@ const get7Days = function () {
)
getTime.value = [startTime, endTime]
activeTimeRange.value = '7days'
search()
}
@ -126,6 +129,7 @@ const reset = () => {
}
getTime.value = []
activeTimeRange.value = ''
search()
}
//
@ -204,7 +208,7 @@ const handleCurrentChange = (value) => {
get()
}
//=============================================
//=================================================
const exportExcel = async () => {
const params = {
...getObj.value,
@ -215,7 +219,9 @@ const exportExcel = async () => {
},
}
try {
const res = await API({ url: '/export', data: params })
const res = await API({ url: '/export/exportBean', data: params })
console.log('系统充值导出的参数为:', params);
if (res.code === 200) {
ElMessage.success('导出成功')
} else {
@ -242,13 +248,12 @@ const exportListLoading = ref(false)
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({url: '/export/export'})
const result = await API({ url: '/export/export' })
if (result.code === 200) {
// const filteredData = result.data.filter(item => {
// return item.type === 2; //2
// });
// exportList.value = filteredData
exportList.value = result.data
const filteredData = result.data.filter(item => {
return item.type === 9;
});
exportList.value = filteredData
} else {
ElMessage.error(result.msg || '获取导出列表失败')
}
@ -358,9 +363,9 @@ onMounted(async function () {
<el-card>
<div class="bean-info">
<!-- 汉字用 <strong> 加粗动态数据用 <span> 包一层单独改色 -->
<strong>金豆总数</strong><span class="data-text">{{ beanNum }}</span>
<strong>, 充值金豆数</strong><span class="data-text">{{ permanentBeans }}</span>
<strong>, 合计新币数</strong><span class="data-text">{{ money }}</span>
金豆总数{{ beanNum }}
, 充值金豆数{{ permanentBeans }}
, 合计新币数{{ money }}
</div>
<!-- 设置表格容器的高度和滚动样式 -->
<div style="height: 520px; overflow-y: auto;margin-top: 10px;">
@ -392,11 +397,10 @@ onMounted(async function () {
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80%">
<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="状态">
<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'">
{{ getTagText(scope.row.state) }}
</el-tag>
</template>
@ -422,20 +426,4 @@ onMounted(async function () {
</template>
</el-dialog>
</template>
<style scoped>
.bean-info {
background-color: #eaf5ff;
padding: 12px 16px;
border-radius: 6px;
font-size: 16px;
color: #333;
}
.bean-info strong {
font-weight: 700;
}
.bean-info .data-text {
color: #007bff;
}
</style>
<style scoped></style>
Loading…
Cancel
Save