统计-占比-百分比

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

View File

@@ -93,7 +93,11 @@
>
<el-table-column prop="regionDesc" 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>
<!-- 操作 -->
<template #footer>
@@ -171,6 +175,9 @@ export default {
(this.tableDataIn = JSON.parse(res));
this.detailsDialog = true;
},
formatPercentage(value) {
return parseFloat((value * 100).toFixed(2));
},
// 分页导航
handleSizeChange() {
this.getData();

View File

@@ -17,7 +17,7 @@
type="text"
size="small"
>
{{ scope.row.arCount }}
{{ scope.row.totalCount }}
</el-button>
</template>
</el-table-column>
@@ -104,7 +104,11 @@
>
<el-table-column prop="regionDesc" 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>
<!-- 操作 -->
<template #footer>
@@ -182,6 +186,9 @@ export default {
(this.tableDataIn = JSON.parse(res));
this.detailsDialog = true;
},
formatPercentage(value) {
return parseFloat((value * 100).toFixed(2));
},
// 分页导航
handleSizeChange() {
this.getData();