Browse Source

add:汇率小数7位

图表优化
zhangyong/milestone-20250913-现金管理
lihui 2 months ago
parent
commit
e7619b3035
  1. 14
      src/components/workspace/GoldGraph.vue
  2. 22
      src/components/workspace/GoldGraphMarkets.vue
  3. 11
      src/views/managerecharge/rate.vue

14
src/components/workspace/GoldGraph.vue

@ -47,11 +47,16 @@
</div>
<div class="graph-content">
<div ref="chartRef" class="left"></div>
<div ref="chartRef" class="left"
v-loading="loading"
element-loading-background="rgba(122, 122, 122, 0)">
<!-- 加上loading动画 图表有点慢-->
</div>
<div class="right">
<el-card class="graph-card-list">
<div class="card-large">金币{{ activeTab === 'recharge' ? '充值' : '消费' }}排名</div>
<el-select popper-class="mySelectStyle" class="card-select" v-model="selectedType" style="width: 100%; margin-bottom: 15px">
<el-select popper-class="mySelectStyle" class="card-select" v-model="selectedType"
style="width: 100%; margin-bottom: 15px">
<el-option label="全部类型" value="all"></el-option>
<el-option label="永久金币" value="permanent"></el-option>
<el-option label="免费金币" value="free"></el-option>
@ -92,7 +97,8 @@ const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 2, 1, 23, 59, 59),
]
//
const loading = ref(true)
//
const markets = ref([])
//
@ -806,10 +812,12 @@ onUnmounted(() => {
}
}
/* select 列表项 初始颜色 */
.el-select-dropdown__item {
background: #ffffff;
}
/* select hover状态*/
.el-select-dropdown__item:hover {
border-radius: 8px;

22
src/components/workspace/GoldGraphMarkets.vue

@ -11,10 +11,10 @@
</div>
<div class="condition">
<div class="stats">
<div v-if="activeTab === 'consume'">合计{{ sumConsume / 100 }}</div>&nbsp;&nbsp;
永久金币: {{ activeTab === 'recharge' ? sumRechargePermanent / 100 : sumConsumePermanent / 100 }}&nbsp;&nbsp;
免费金币: {{ activeTab === 'recharge' ? sumRechargeFree / 100 : sumConsumeFree / 100 }}&nbsp;&nbsp;
任务金币: {{ activeTab === 'recharge' ? sumRechargeTask / 100 : sumConsumeTask / 100 }}&nbsp;&nbsp;
<div v-if="activeTab === 'consume'">合计{{ sumConsume }}</div>&nbsp;&nbsp;
永久金币: {{ activeTab === 'recharge' ? sumRechargePermanent : sumConsumePermanent }}&nbsp;&nbsp;
免费金币: {{ activeTab === 'recharge' ? sumRechargeFree : sumConsumeFree }}&nbsp;&nbsp;
任务金币: {{ activeTab === 'recharge' ? sumRechargeTask : sumConsumeTask }}&nbsp;&nbsp;
</div>
<div style="display: flex;">
<el-button @click="getYes()" size="small" :type="activeTimeRange === 'yes' ? 'primary' : ''">昨天
@ -473,6 +473,16 @@ const updateChart = (chartData) => {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' },
formatter: function (params) {
let result = params[0].name + '<br/>'
let total = 0
params.forEach(param => {
result += `${param.seriesName}: ${param.value.toLocaleString()}<br/>`
total += param.value
})
result += `${activeTab.value === 'recharge' ? '充值' : '消费'}: ${total.toLocaleString()}`
return result
}
},
legend: {
data: legend,
@ -488,7 +498,9 @@ const updateChart = (chartData) => {
type: 'category',
data: chartData.dates.value,
axisLabel: {
rotate: 45
// 1545
rotate: chartData.dates.value.length > 15 ? 45 : 0
// rotate: 45
}
},
yAxis: {

11
src/views/managerecharge/rate.vue

@ -5,6 +5,7 @@ import request from '@/util/http'
import {useAdminStore} from "@/store/index.js";
import {storeToRefs} from "pinia";
import {permissionMapping, hasMenuPermission} from "@/utils/menuTreePermission.js"
const adminStore = useAdminStore()
const {adminData, menuTree} = storeToRefs(adminStore)
const regeEdit = ref(false)
@ -181,6 +182,7 @@ const handleEditDialogClose = () => {
getAllRate()
}
}
//
function formatDate(value) {
if (!value) return ''
@ -193,6 +195,7 @@ function formatDate(value) {
const seconds = date.getSeconds().toString().padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
}
//
function handleInput(value) {
// 使
@ -220,10 +223,10 @@ function handleInput(value) {
ElMessage.info('整数部分最多允许六位')
}
//
if (parts[1].length > 2) {
parts[1] = parts[1].slice(0, 2)
if (parts[1].length > 7) {
parts[1] = parts[1].slice(0, 7)
value = parts[0] + '.' + parts[1]
ElMessage.info('最多允许位小数')
ElMessage.info('最多允许位小数')
} else {
value = parts[0] + '.' + parts[1]
}
@ -245,6 +248,7 @@ function handleInput(value) {
return value
}
onMounted(async function () {
initPermissions()
await getAllRate()
@ -326,6 +330,7 @@ onMounted(async function () {
.card1 {
background: #F3FAFE;
}
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),

Loading…
Cancel
Save