|
|
|
@ -14,6 +14,7 @@ const { adminData, menuTree, flag } = storeToRefs(adminStore) |
|
|
|
} |
|
|
|
}) |
|
|
|
import { onMounted, ref, watch, nextTick } from 'vue' |
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
import moment from 'moment' |
|
|
|
import API from '@/util/http.js' |
|
|
|
@ -21,6 +22,7 @@ import { reverseMarketMapping } from "@/utils/marketMap.js"; |
|
|
|
// 国际化 |
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
const { t } = useI18n() |
|
|
|
const router = useRouter() |
|
|
|
|
|
|
|
//新增员工数据复选框 |
|
|
|
// const showEmployeeData = ref(false) |
|
|
|
@ -76,6 +78,38 @@ const getObj = ref({ |
|
|
|
const sortField = ref('') |
|
|
|
const sortOrder = ref('') |
|
|
|
|
|
|
|
// 获取单用户的钱包详情 (直接展示后端返回的 walletList) |
|
|
|
const getUserWalletDetail = (row) => { |
|
|
|
// 后端返回的钱包列表 (可能为空) |
|
|
|
const walletList = row.walletList || []; |
|
|
|
|
|
|
|
if (walletList.length === 0) { |
|
|
|
return []; |
|
|
|
} |
|
|
|
|
|
|
|
// 直接映射后端数据 |
|
|
|
return walletList.map(item => { |
|
|
|
// 移除 "钱包" 后缀,保持简洁展示 |
|
|
|
let displayName = item.walletName || ''; |
|
|
|
if (displayName.endsWith('钱包')) { |
|
|
|
displayName = displayName.slice(0, -2); |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
wallet: displayName, |
|
|
|
amount: (item.permanentGold || 0).toFixed(2) |
|
|
|
}; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 跳转到钱包详情页 |
|
|
|
const goToWalletDetail = (row) => { |
|
|
|
router.push({ |
|
|
|
name: 'clientCountWallet', |
|
|
|
query: { jwcode: row.jwcode } |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 方法 |
|
|
|
// 搜索=========================================================================== |
|
|
|
// 搜索方法 |
|
|
|
@ -398,6 +432,21 @@ const format3 = (num) => { |
|
|
|
return num.toLocaleString('en-US') |
|
|
|
} |
|
|
|
|
|
|
|
// 虚拟 Popover 逻辑 |
|
|
|
const popoverVisible = ref(false) |
|
|
|
const popoverData = ref(null) |
|
|
|
const virtualRef = ref(null) |
|
|
|
|
|
|
|
const handleMouseEnter = (row, e) => { |
|
|
|
popoverData.value = row |
|
|
|
popoverVisible.value = true |
|
|
|
virtualRef.value = e.currentTarget |
|
|
|
} |
|
|
|
|
|
|
|
const handleMouseLeave = () => { |
|
|
|
popoverVisible.value = false |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
@ -455,7 +504,13 @@ const format3 = (num) => { |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="currentPermanentGold" :label="$t('common_list.permanentGold')" sortable="custom" width="210"> |
|
|
|
<template #default="scope"> |
|
|
|
<div |
|
|
|
class="hover-cell-wrapper" |
|
|
|
@mouseenter="handleMouseEnter(scope.row, $event)" |
|
|
|
@mouseleave="handleMouseLeave" |
|
|
|
> |
|
|
|
<span>{{ (scope.row.currentPermanentGold || 0) }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="currentFreeJune" :label="$t('common_list.freeGold6Month')" sortable="custom" width="200"> |
|
|
|
@ -473,53 +528,6 @@ const format3 = (num) => { |
|
|
|
<span>{{ (scope.row.currentTaskGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column prop="rcoin" label="历史金币总额" width="150"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-popover trigger="hover" placement="left" width="150"> |
|
|
|
<template #default> |
|
|
|
<div> |
|
|
|
<div>永久金币:{{ (scope.row.sumPermanentGold || 0) }}</div> |
|
|
|
<div>免费金币:{{ ((scope.row.sumFreeJune || 0) + (scope.row.sumFreeDecember || 0)) }}</div> |
|
|
|
<div>任务金币:{{ (scope.row.sumTaskGold || 0) }}</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template #reference> |
|
|
|
<span> |
|
|
|
{{ |
|
|
|
(scope.row.sumPermanentGold || 0) + |
|
|
|
(scope.row.sumFreeJune || 0) + |
|
|
|
(scope.row.sumFreeDecember || 0) + |
|
|
|
(scope.row.sumTaskGold || 0) |
|
|
|
}}</span> |
|
|
|
</template> |
|
|
|
</el-popover> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="sumConsume" label="历史消费" width="150"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-popover trigger="hover" placement="left" width="150"> |
|
|
|
<template #default> |
|
|
|
<div> |
|
|
|
<div>永久金币:{{ (scope.row.sumConsumeGold || 0) }}</div> |
|
|
|
<div>免费金币:{{ |
|
|
|
((scope.row.sumConsumeJune || 0) + (scope.row.sumConsumeDecember || 0)) |
|
|
|
}} |
|
|
|
</div> |
|
|
|
<div>任务金币:{{ (scope.row.sumConsumeJune || 0) }}</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template #reference> |
|
|
|
<span> |
|
|
|
{{ |
|
|
|
(scope.row.sumConsumeGold || 0) + |
|
|
|
(scope.row.sumConsumeTaskGold || 0) + |
|
|
|
(scope.row.sumConsumeJune || 0) + |
|
|
|
(scope.row.sumConsumeDecember || 0) |
|
|
|
}}</span> |
|
|
|
</template> |
|
|
|
</el-popover> |
|
|
|
</template> |
|
|
|
</el-table-column>--> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<!-- 分页 --> |
|
|
|
@ -560,9 +568,115 @@ const format3 = (num) => { |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- Global Virtual Popover --> |
|
|
|
<el-popover |
|
|
|
v-model:visible="popoverVisible" |
|
|
|
:virtual-ref="virtualRef" |
|
|
|
virtual-triggering |
|
|
|
placement="right" |
|
|
|
:width="200" |
|
|
|
popper-class="custom-blue-popover" |
|
|
|
:show-arrow="false" |
|
|
|
:offset="-100" |
|
|
|
:hide-after="0" |
|
|
|
> |
|
|
|
<div class="popover-content" v-if="popoverData"> |
|
|
|
<div class="popover-header"> |
|
|
|
<span class="header-title">永久金币</span> |
|
|
|
<span class="header-amount">{{ popoverData.currentPermanentGold || 0 }}</span> |
|
|
|
</div> |
|
|
|
<div class="popover-list"> |
|
|
|
<div v-for="(item, index) in getUserWalletDetail(popoverData)" :key="index" class="popover-item"> |
|
|
|
<span class="wallet-name">{{ item.wallet }}</span> |
|
|
|
<span class="wallet-amount">{{ item.amount }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-popover> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style> |
|
|
|
/* 全局样式或非 scoped 样式用于覆盖 el-popover */ |
|
|
|
.el-popover.custom-blue-popover { |
|
|
|
background-color: #E5EBFE !important; |
|
|
|
border-color: #E5EBFE !important; |
|
|
|
padding: 0 !important; /* Remove default padding to let content control it */ |
|
|
|
border-radius: 8px !important; |
|
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important; |
|
|
|
color: #333 !important; |
|
|
|
} |
|
|
|
|
|
|
|
/* 隐藏箭头 */ |
|
|
|
.el-popover.custom-blue-popover .el-popper__arrow { |
|
|
|
display: none !important; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.hover-cell-wrapper { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: flex-start; /* Changed to left align */ |
|
|
|
cursor: pointer; |
|
|
|
/* Optional: add a subtle hover effect on the cell text itself */ |
|
|
|
&:hover { |
|
|
|
color: #409EFF; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.popover-content { |
|
|
|
padding: 16px; |
|
|
|
font-family: "PingFang SC", "Microsoft YaHei", sans-serif; |
|
|
|
} |
|
|
|
|
|
|
|
.popover-header { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
margin-bottom: 12px; |
|
|
|
padding-bottom: 8px; |
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.05); |
|
|
|
|
|
|
|
.header-title { |
|
|
|
font-size: 14px; |
|
|
|
font-weight: bold; |
|
|
|
color: #333; |
|
|
|
} |
|
|
|
|
|
|
|
.header-amount { |
|
|
|
font-size: 16px; |
|
|
|
font-weight: bold; |
|
|
|
color: #409EFF; /* Highlight color */ |
|
|
|
margin: 0 8px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.popover-list { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
gap: 8px; |
|
|
|
} |
|
|
|
|
|
|
|
.popover-item { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
font-size: 13px; |
|
|
|
color: #555; |
|
|
|
|
|
|
|
.wallet-name { |
|
|
|
color: #666; |
|
|
|
} |
|
|
|
|
|
|
|
.wallet-amount { |
|
|
|
font-weight: 500; |
|
|
|
color: #333; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 搜索的卡片样式 |
|
|
|
.card1 { |
|
|
|
background: #F3FAFE; |
|
|
|
@ -604,7 +718,6 @@ const format3 = (num) => { |
|
|
|
background-color: #E5EBFE !important; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pagination { |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
|