|
@ -219,6 +219,102 @@ const handleCurrentChange = (value) => { |
|
|
get() |
|
|
get() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//======================导出======================= |
|
|
|
|
|
const exportExcel = async () => { |
|
|
|
|
|
const params = { |
|
|
|
|
|
...getObj.value, |
|
|
|
|
|
"beanRechargeInfo": { |
|
|
|
|
|
...selectData.value, |
|
|
|
|
|
sortField: sortField.value, |
|
|
|
|
|
sortOrder: sortOrder.value, |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
try { |
|
|
|
|
|
const res = await API({ url: '/export', data: params }) |
|
|
|
|
|
if (res.code === 200) { |
|
|
|
|
|
ElMessage.success('导出成功') |
|
|
|
|
|
} else { |
|
|
|
|
|
ElMessage.error(res.message || '导出失败,请稍后重试') |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log('请求失败', error) |
|
|
|
|
|
ElMessage.error('导出失败,请稍后重试') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
const exportListVisible = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
// 打开导出列表弹窗 |
|
|
|
|
|
const openExportList = () => { |
|
|
|
|
|
getExportList() |
|
|
|
|
|
exportListVisible.value = true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 导出列表数据 |
|
|
|
|
|
const exportList = ref([]) |
|
|
|
|
|
// 导出列表加载状态 |
|
|
|
|
|
const exportListLoading = ref(false) |
|
|
|
|
|
// 获取导出列表 |
|
|
|
|
|
const getExportList = async () => { |
|
|
|
|
|
exportListLoading.value = true |
|
|
|
|
|
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 |
|
|
|
|
|
} else { |
|
|
|
|
|
ElMessage.error(result.msg || '获取导出列表失败') |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('获取导出列表出错:', error) |
|
|
|
|
|
ElMessage.error('获取导出列表失败,请稍后重试') |
|
|
|
|
|
} finally { |
|
|
|
|
|
exportListLoading.value = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 下载导出文件 |
|
|
|
|
|
const downloadExportFile = (item) => { |
|
|
|
|
|
if (item.state === 2) { |
|
|
|
|
|
const link = document.createElement('a') |
|
|
|
|
|
link.href = item.url |
|
|
|
|
|
link.download = item.fileName |
|
|
|
|
|
link.click() |
|
|
|
|
|
} else { |
|
|
|
|
|
ElMessage.warning('文件还在导出中,请稍后再试') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//根据状态返回对应的标签类型 |
|
|
|
|
|
const getTagType = (state) => { |
|
|
|
|
|
switch (state) { |
|
|
|
|
|
case 0: |
|
|
|
|
|
return 'info'; |
|
|
|
|
|
case 1: |
|
|
|
|
|
return 'primary'; |
|
|
|
|
|
case 2: |
|
|
|
|
|
return 'success'; |
|
|
|
|
|
case 3: |
|
|
|
|
|
return 'danger'; |
|
|
|
|
|
default: |
|
|
|
|
|
return 'info'; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//根据状态返回对应的标签文案 |
|
|
|
|
|
const getTagText = (state) => { |
|
|
|
|
|
switch (state) { |
|
|
|
|
|
case 0: |
|
|
|
|
|
return '待执行'; |
|
|
|
|
|
case 1: |
|
|
|
|
|
return '执行中'; |
|
|
|
|
|
case 2: |
|
|
|
|
|
return '执行完成'; |
|
|
|
|
|
case 3: |
|
|
|
|
|
return '执行出错'; |
|
|
|
|
|
default: |
|
|
|
|
|
return '未知状态'; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
onMounted(async function () { |
|
|
onMounted(async function () { |
|
|
await get() |
|
|
await get() |
|
|
await getArea() |
|
|
await getArea() |
|
@ -265,7 +361,7 @@ onMounted(async function () { |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="23"> |
|
|
|
|
|
|
|
|
<el-col :span="24"> |
|
|
<div class="head-card-element"> |
|
|
<div class="head-card-element"> |
|
|
<el-text class="mx-1" size="large">充值时间:</el-text> |
|
|
<el-text class="mx-1" size="large">充值时间:</el-text> |
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" |
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" |
|
@ -282,8 +378,8 @@ onMounted(async function () { |
|
|
</el-button> |
|
|
</el-button> |
|
|
<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="openExportList">查看导出列表</el-button> --> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="exportExcel()">导出Excel</el-button> |
|
|
|
|
|
<el-button type="primary" @click="openExportList">查看导出列表</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
@ -295,8 +391,7 @@ onMounted(async function () { |
|
|
<el-card> |
|
|
<el-card> |
|
|
<div class="bean-info"> |
|
|
<div class="bean-info"> |
|
|
<!-- 汉字用 <strong> 加粗,动态数据用 <span> 包一层单独改色 --> |
|
|
<!-- 汉字用 <strong> 加粗,动态数据用 <span> 包一层单独改色 --> |
|
|
<strong>金豆总数:</strong><span class="data-text">{{ beanNum }}</span> |
|
|
|
|
|
<strong>, 充值金豆数:</strong><span class="data-text">{{ permanentBeans }}</span> |
|
|
|
|
|
|
|
|
<strong> 充值金豆数:</strong><span class="data-text">{{ beanNum }}</span> |
|
|
<strong>, 合计新币数:</strong><span class="data-text">{{ money }}</span>。 |
|
|
<strong>, 合计新币数:</strong><span class="data-text">{{ money }}</span>。 |
|
|
</div> |
|
|
</div> |
|
|
<!-- 设置表格容器的高度和滚动样式 --> |
|
|
<!-- 设置表格容器的高度和滚动样式 --> |
|
@ -336,13 +431,12 @@ onMounted(async function () { |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<!-- 导出弹窗 --> |
|
|
<!-- 导出弹窗 --> |
|
|
<!-- <el-dialog v-model="exportListVisible" title="导出列表" width="80%"> |
|
|
|
|
|
<el-table :data="exportList" style="width: 100%" :loading="exportListLoading"> |
|
|
|
|
|
|
|
|
<el-dialog v-model="exportListVisible" title="导出列表" width="80%" class="custom-height-dialog"> |
|
|
|
|
|
<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'"> |
|
|
{{ getTagText(scope.row.state) }} |
|
|
{{ getTagText(scope.row.state) }} |
|
|
</el-tag> |
|
|
</el-tag> |
|
|
</template> |
|
|
</template> |
|
@ -366,6 +460,27 @@ onMounted(async function () { |
|
|
<el-button text @click="exportListVisible = false">关闭</el-button> |
|
|
<el-button text @click="exportListVisible = false">关闭</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-dialog> --> |
|
|
|
|
|
|
|
|
</el-dialog> |
|
|
</template> |
|
|
</template> |
|
|
<style></style> |
|
|
|
|
|
|
|
|
<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> |