大R列表-增加总充值金额千分位
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
<span>分区</span>
|
||||
<partition-select v-model:partition-id="formData.partitionId" />
|
||||
</div>
|
||||
<el-button style="" type="primary" @click="addDialog = true">新增</el-button>
|
||||
<el-button style="" type="primary" @click="getData()">查询</el-button>
|
||||
<el-button style="" type="primary" @click="resetFormData()">重置</el-button>
|
||||
<el-button style="" type="primary" @click="addDialog = true">新增</el-button>
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="tableData.loading" :data="tableData.data" ref="multipleTable"
|
||||
@selection-change="handleSelectionChange" border style="width: 100%; margin-top: 25px">
|
||||
@@ -18,7 +18,11 @@
|
||||
<el-table-column prop="nick" align="center" label="用户昵称" />
|
||||
<el-table-column prop="partitionDesc" align="center" label="分区" />
|
||||
<el-table-column prop="regionDesc" align="center" label="国家" />
|
||||
<el-table-column prop="totalGold" align="center" label="总充值金额" />
|
||||
<el-table-column prop="totalGold" align="center" label="总充值金额">
|
||||
<template v-slot="scope">
|
||||
{{ formattedNumber(scope.row.totalGold) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button class="primary" type="primary" @click="
|
||||
@@ -50,7 +54,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
import { ref, onMounted, reactive, computed } from 'vue'
|
||||
import PartitionSelect from "@/views/common/partitionSelect.vue";
|
||||
import { getHighRechargeUserList, delHighRechargeUser, addHighRechargeUser } from '@/api/listLargeRUsers/listLargeRUsers'
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
@@ -141,6 +145,13 @@ export default {
|
||||
});
|
||||
|
||||
};
|
||||
// 千分位
|
||||
const formattedNumber = computed(() => {
|
||||
return (num) => {
|
||||
if (num === null || num === undefined) return '';
|
||||
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
};
|
||||
})
|
||||
const handleSizeChange = (val) => {
|
||||
formData.pageSize = val;
|
||||
getData();
|
||||
@@ -162,7 +173,8 @@ export default {
|
||||
resetFormData,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
detailPageFun
|
||||
detailPageFun,
|
||||
formattedNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -8,9 +8,9 @@
|
||||
<span>分区</span>
|
||||
<partition-select v-model:partition-id="formData.partitionId" />
|
||||
</div>
|
||||
<el-button style="" type="primary" @click="addDialog = true">新增</el-button>
|
||||
<el-button style="" type="primary" @click="getData()">查询</el-button>
|
||||
<el-button style="" type="primary" @click="resetFormData()">重置</el-button>
|
||||
<el-button style="" type="primary" @click="addDialog = true">新增</el-button>
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="tableData.loading" :data="tableData.data" ref="multipleTable"
|
||||
@selection-change="handleSelectionChange" border style="width: 100%; margin-top: 25px">
|
||||
@@ -18,7 +18,11 @@
|
||||
<el-table-column prop="nick" align="center" label="用户昵称" />
|
||||
<el-table-column prop="partitionDesc" align="center" label="分区" />
|
||||
<el-table-column prop="regionDesc" align="center" label="国家" />
|
||||
<el-table-column prop="totalGold" align="center" label="总充值金额" />
|
||||
<el-table-column prop="totalGold" align="center" label="总充值金额">
|
||||
<template v-slot="scope">
|
||||
{{ formattedNumber(scope.row.totalGold) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button class="primary" type="primary" @click="
|
||||
@@ -50,7 +54,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
import { ref, onMounted, reactive ,computed} from 'vue'
|
||||
import PartitionSelect from "@/views/common/partitionSelect.vue";
|
||||
import { getHighRechargeUserList, delHighRechargeUser, addHighRechargeUser } from '@/api/listLargeRUsers/listLargeRUsers'
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
@@ -141,6 +145,13 @@ export default {
|
||||
});
|
||||
|
||||
};
|
||||
// 千分位
|
||||
const formattedNumber = computed(() => {
|
||||
return (num) => {
|
||||
if (num === null || num === undefined) return '';
|
||||
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
};
|
||||
})
|
||||
const handleSizeChange = (val) => {
|
||||
formData.pageSize = val;
|
||||
getData();
|
||||
@@ -162,7 +173,8 @@ export default {
|
||||
resetFormData,
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
detailPageFun
|
||||
detailPageFun,
|
||||
formattedNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user