统计-占比-百分比

This commit is contained in:
khalil
2025-02-26 16:24:49 +08:00
parent 64af9bc602
commit 3dfff36aaa
3 changed files with 22 additions and 5 deletions

View File

@@ -188,7 +188,7 @@
v-if="detailsIsShow" v-if="detailsIsShow"
> >
<template v-slot="scope"> <template v-slot="scope">
{{ scope.row.guildGoldFlow / scope.row.lastGuildGoldFlow }} {{ formatPercentage(scope.row.guildGoldFlow / scope.row.lastGuildGoldFlow) }}%
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -271,6 +271,9 @@ export default {
this.tableDataIn = JSON.parse(res); this.tableDataIn = JSON.parse(res);
this.detailsDialog = true; this.detailsDialog = true;
}, },
formatPercentage(value) {
return parseFloat((value * 100).toFixed(2));
},
// 分页导航 // 分页导航
handleSizeChange() { handleSizeChange() {
this.getData(); this.getData();

View File

@@ -93,7 +93,11 @@
> >
<el-table-column prop="regionDesc" align="center" label="国家" /> <el-table-column prop="regionDesc" align="center" label="国家" />
<el-table-column prop="count" align="center" label="新注册(完善资料)" /> <el-table-column prop="count" align="center" label="新注册(完善资料)" />
<el-table-column prop="ratio" align="center" label="占比" /> <el-table-column prop="ratio" align="center" label="占比">
<template v-slot="scope">
{{ formatPercentage(scope.row.ratio) }}%
</template>
</el-table-column>
</el-table> </el-table>
<!-- 操作 --> <!-- 操作 -->
<template #footer> <template #footer>
@@ -171,6 +175,9 @@ export default {
(this.tableDataIn = JSON.parse(res)); (this.tableDataIn = JSON.parse(res));
this.detailsDialog = true; this.detailsDialog = true;
}, },
formatPercentage(value) {
return parseFloat((value * 100).toFixed(2));
},
// 分页导航 // 分页导航
handleSizeChange() { handleSizeChange() {
this.getData(); this.getData();
@@ -226,4 +233,4 @@ export default {
margin: -25px 0 20px 0px; margin: -25px 0 20px 0px;
} }
} }
</style> </style>

View File

@@ -17,7 +17,7 @@
type="text" type="text"
size="small" size="small"
> >
{{ scope.row.arCount }} {{ scope.row.totalCount }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -104,7 +104,11 @@
> >
<el-table-column prop="regionDesc" align="center" label="国家" /> <el-table-column prop="regionDesc" align="center" label="国家" />
<el-table-column prop="count" align="center" label="活跃度" /> <el-table-column prop="count" align="center" label="活跃度" />
<el-table-column prop="ratio" align="center" label="占比" /> <el-table-column prop="ratio" align="center" label="占比">
<template v-slot="scope">
{{ formatPercentage(scope.row.ratio) }}%
</template>
</el-table-column>
</el-table> </el-table>
<!-- 操作 --> <!-- 操作 -->
<template #footer> <template #footer>
@@ -182,6 +186,9 @@ export default {
(this.tableDataIn = JSON.parse(res)); (this.tableDataIn = JSON.parse(res));
this.detailsDialog = true; this.detailsDialog = true;
}, },
formatPercentage(value) {
return parseFloat((value * 100).toFixed(2));
},
// 分页导航 // 分页导航
handleSizeChange() { handleSizeChange() {
this.getData(); this.getData();