增加新字段
This commit is contained in:
parent
d92285ae4a
commit
a62e5a65a5
@ -14,6 +14,7 @@ export interface CountryDashboardMetric {
|
|||||||
d30RetentionRate: number | string;
|
d30RetentionRate: number | string;
|
||||||
d30RetentionUser: number;
|
d30RetentionUser: number;
|
||||||
dailyActiveUser: number;
|
dailyActiveUser: number;
|
||||||
|
dailyRechargeUser: number;
|
||||||
dealerRecharge: number | string;
|
dealerRecharge: number | string;
|
||||||
googleRecharge: number | string;
|
googleRecharge: number | string;
|
||||||
gamePayoutRate: number | string;
|
gamePayoutRate: number | string;
|
||||||
@ -32,6 +33,7 @@ export interface CountryDashboardMetric {
|
|||||||
luckyGiftUser: number;
|
luckyGiftUser: number;
|
||||||
luckyGiftUserRate: number | string;
|
luckyGiftUserRate: number | string;
|
||||||
mifapayRecharge: number | string;
|
mifapayRecharge: number | string;
|
||||||
|
newDealerUserRecharge: number | string;
|
||||||
newUserRecharge: number | string;
|
newUserRecharge: number | string;
|
||||||
officialRecharge: number | string;
|
officialRecharge: number | string;
|
||||||
periodKey: string;
|
periodKey: string;
|
||||||
@ -39,6 +41,7 @@ export interface CountryDashboardMetric {
|
|||||||
salaryExchange: number | string;
|
salaryExchange: number | string;
|
||||||
salaryTransfer: number | string;
|
salaryTransfer: number | string;
|
||||||
totalRecharge: number | string;
|
totalRecharge: number | string;
|
||||||
|
userRecharge: number | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CountryDashboardResult {
|
export interface CountryDashboardResult {
|
||||||
|
|||||||
@ -164,6 +164,7 @@ const metricColumns = new Set([
|
|||||||
'd7RetentionRate',
|
'd7RetentionRate',
|
||||||
'd30RetentionRate',
|
'd30RetentionRate',
|
||||||
'dailyActiveUser',
|
'dailyActiveUser',
|
||||||
|
'dailyRechargeUser',
|
||||||
'dealerRecharge',
|
'dealerRecharge',
|
||||||
'gamePayout',
|
'gamePayout',
|
||||||
'gamePayoutRate',
|
'gamePayoutRate',
|
||||||
@ -181,15 +182,18 @@ const metricColumns = new Set([
|
|||||||
'luckyGiftUser',
|
'luckyGiftUser',
|
||||||
'luckyGiftUserRate',
|
'luckyGiftUserRate',
|
||||||
'mifapayRecharge',
|
'mifapayRecharge',
|
||||||
|
'newDealerUserRecharge',
|
||||||
'newUserRecharge',
|
'newUserRecharge',
|
||||||
'salaryExchange',
|
'salaryExchange',
|
||||||
'salaryTransfer',
|
'salaryTransfer',
|
||||||
'totalRecharge',
|
'totalRecharge',
|
||||||
|
'userRecharge',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const integerMetricColumns = new Set([
|
const integerMetricColumns = new Set([
|
||||||
'countryNewUser',
|
'countryNewUser',
|
||||||
'dailyActiveUser',
|
'dailyActiveUser',
|
||||||
|
'dailyRechargeUser',
|
||||||
'gameUser',
|
'gameUser',
|
||||||
'luckyGiftUser',
|
'luckyGiftUser',
|
||||||
]);
|
]);
|
||||||
@ -208,8 +212,11 @@ const percentMetricColumns = new Set([
|
|||||||
const summaryMetricKeys = [
|
const summaryMetricKeys = [
|
||||||
'countryNewUser',
|
'countryNewUser',
|
||||||
'dailyActiveUser',
|
'dailyActiveUser',
|
||||||
|
'dailyRechargeUser',
|
||||||
'newUserRecharge',
|
'newUserRecharge',
|
||||||
'dealerRecharge',
|
'dealerRecharge',
|
||||||
|
'newDealerUserRecharge',
|
||||||
|
'userRecharge',
|
||||||
'mifapayRecharge',
|
'mifapayRecharge',
|
||||||
'googleRecharge',
|
'googleRecharge',
|
||||||
'salaryExchange',
|
'salaryExchange',
|
||||||
@ -235,8 +242,11 @@ const summaryMetricKeys = [
|
|||||||
const summaryMetricDefinitions = [
|
const summaryMetricDefinitions = [
|
||||||
{ key: 'countryNewUser', label: '新增' },
|
{ key: 'countryNewUser', label: '新增' },
|
||||||
{ key: 'dailyActiveUser', label: '当日活跃' },
|
{ key: 'dailyActiveUser', label: '当日活跃' },
|
||||||
{ key: 'newUserRecharge', label: '新增充值' },
|
{ key: 'dailyRechargeUser', label: '新增当日充值用户数' },
|
||||||
{ key: 'dealerRecharge', label: '币商充值' },
|
{ key: 'newUserRecharge', label: '新增用户充值' },
|
||||||
|
{ key: 'dealerRecharge', label: '币商平台充值' },
|
||||||
|
{ key: 'newDealerUserRecharge', label: '新增币商用户充值' },
|
||||||
|
{ key: 'userRecharge', label: '用户充值' },
|
||||||
{ key: 'mifapayRecharge', label: 'MifaPay 充值' },
|
{ key: 'mifapayRecharge', label: 'MifaPay 充值' },
|
||||||
{ key: 'googleRecharge', label: 'Google 充值' },
|
{ key: 'googleRecharge', label: 'Google 充值' },
|
||||||
{ key: 'salaryExchange', label: '工资兑换' },
|
{ key: 'salaryExchange', label: '工资兑换' },
|
||||||
@ -284,8 +294,11 @@ const overviewColumns: any[] = [
|
|||||||
{ align: 'right', dataIndex: 'd1RetentionRate', key: 'd1RetentionRate', title: '次日留存率', width: 140 },
|
{ align: 'right', dataIndex: 'd1RetentionRate', key: 'd1RetentionRate', title: '次日留存率', width: 140 },
|
||||||
{ align: 'right', dataIndex: 'd7RetentionRate', key: 'd7RetentionRate', title: '七日留存率', width: 140 },
|
{ align: 'right', dataIndex: 'd7RetentionRate', key: 'd7RetentionRate', title: '七日留存率', width: 140 },
|
||||||
{ align: 'right', dataIndex: 'd30RetentionRate', key: 'd30RetentionRate', title: '30 日留存率', width: 150 },
|
{ align: 'right', dataIndex: 'd30RetentionRate', key: 'd30RetentionRate', title: '30 日留存率', width: 150 },
|
||||||
{ align: 'right', dataIndex: 'newUserRecharge', key: 'newUserRecharge', title: '新增充值', width: 130 },
|
{ align: 'right', dataIndex: 'dailyRechargeUser', key: 'dailyRechargeUser', title: '新增当日充值用户数', width: 180 },
|
||||||
{ align: 'right', dataIndex: 'dealerRecharge', key: 'dealerRecharge', title: '币商充值', width: 130 },
|
{ align: 'right', dataIndex: 'newUserRecharge', key: 'newUserRecharge', title: '新增用户充值', width: 140 },
|
||||||
|
{ align: 'right', dataIndex: 'dealerRecharge', key: 'dealerRecharge', title: '币商平台充值', width: 140 },
|
||||||
|
{ align: 'right', dataIndex: 'newDealerUserRecharge', key: 'newDealerUserRecharge', title: '新增币商用户充值', width: 170 },
|
||||||
|
{ align: 'right', dataIndex: 'userRecharge', key: 'userRecharge', title: '用户充值', width: 130 },
|
||||||
{ align: 'right', dataIndex: 'mifapayRecharge', key: 'mifapayRecharge', title: 'MifaPay 充值', width: 150 },
|
{ align: 'right', dataIndex: 'mifapayRecharge', key: 'mifapayRecharge', title: 'MifaPay 充值', width: 150 },
|
||||||
{ align: 'right', dataIndex: 'googleRecharge', key: 'googleRecharge', title: 'Google 充值', width: 140 },
|
{ align: 'right', dataIndex: 'googleRecharge', key: 'googleRecharge', title: 'Google 充值', width: 140 },
|
||||||
{ align: 'right', dataIndex: 'salaryExchange', key: 'salaryExchange', title: '工资兑换', width: 130 },
|
{ align: 'right', dataIndex: 'salaryExchange', key: 'salaryExchange', title: '工资兑换', width: 130 },
|
||||||
@ -315,7 +328,9 @@ const rechargeColumns: any[] = [
|
|||||||
{ dataIndex: 'countryName', fixed: 'left' as const, key: 'countryName', title: '国家', width: 150 },
|
{ dataIndex: 'countryName', fixed: 'left' as const, key: 'countryName', title: '国家', width: 150 },
|
||||||
{ dataIndex: 'countryCode', key: 'countryCode', title: 'Code', width: 86 },
|
{ dataIndex: 'countryCode', key: 'countryCode', title: 'Code', width: 86 },
|
||||||
{ dataIndex: 'periodName', key: 'periodName', title: '周期', width: 110 },
|
{ dataIndex: 'periodName', key: 'periodName', title: '周期', width: 110 },
|
||||||
{ align: 'right', dataIndex: 'dealerRecharge', key: 'dealerRecharge', title: '币商充值', width: 140 },
|
{ align: 'right', dataIndex: 'dealerRecharge', key: 'dealerRecharge', title: '币商平台充值', width: 150 },
|
||||||
|
{ align: 'right', dataIndex: 'newDealerUserRecharge', key: 'newDealerUserRecharge', title: '新增币商用户充值', width: 170 },
|
||||||
|
{ align: 'right', dataIndex: 'userRecharge', key: 'userRecharge', title: '用户充值', width: 140 },
|
||||||
{ align: 'right', dataIndex: 'mifapayRecharge', key: 'mifapayRecharge', title: 'MifaPay 充值', width: 160 },
|
{ align: 'right', dataIndex: 'mifapayRecharge', key: 'mifapayRecharge', title: 'MifaPay 充值', width: 160 },
|
||||||
{ align: 'right', dataIndex: 'googleRecharge', key: 'googleRecharge', title: 'Google 充值', width: 150 },
|
{ align: 'right', dataIndex: 'googleRecharge', key: 'googleRecharge', title: 'Google 充值', width: 150 },
|
||||||
{ align: 'right', dataIndex: 'totalRecharge', key: 'totalRecharge', title: '总充值', width: 140 },
|
{ align: 'right', dataIndex: 'totalRecharge', key: 'totalRecharge', title: '总充值', width: 140 },
|
||||||
@ -385,7 +400,7 @@ const rechargeDetailScrollX = rechargeDetailColumns.reduce(
|
|||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
const rechargeSourceNameMap: Record<string, string> = {
|
const rechargeSourceNameMap: Record<string, string> = {
|
||||||
DEALER: '币商充值',
|
DEALER: '币商平台充值',
|
||||||
MIFAPAY: 'MifaPay 充值',
|
MIFAPAY: 'MifaPay 充值',
|
||||||
OFFICIAL: '官方充值',
|
OFFICIAL: '官方充值',
|
||||||
};
|
};
|
||||||
@ -446,6 +461,7 @@ const appDataCards = computed(() => {
|
|||||||
const arpuCards = computed(() => {
|
const arpuCards = computed(() => {
|
||||||
return [
|
return [
|
||||||
{ label: '日 ARPU', value: formatArpu(arpuDashboards.value.day) },
|
{ label: '日 ARPU', value: formatArpu(arpuDashboards.value.day) },
|
||||||
|
{ label: '充值用户日 ARPU', value: formatRechargeUserDayArpu(arpuDashboards.value.day) },
|
||||||
{ label: '3 日 ARPU', value: formatArpu(arpuDashboards.value.threeDay) },
|
{ label: '3 日 ARPU', value: formatArpu(arpuDashboards.value.threeDay) },
|
||||||
{ label: '周 ARPU', value: formatArpu(arpuDashboards.value.week) },
|
{ label: '周 ARPU', value: formatArpu(arpuDashboards.value.week) },
|
||||||
{ label: '筛选 ARPU', value: formatAmount(calcArpu(visibleSummary.value)) },
|
{ label: '筛选 ARPU', value: formatAmount(calcArpu(visibleSummary.value)) },
|
||||||
@ -455,6 +471,10 @@ const totalRechargeCard = computed(() => ({
|
|||||||
label: '总充值',
|
label: '总充值',
|
||||||
value: formatAmount(visibleSummary.value.totalRecharge),
|
value: formatAmount(visibleSummary.value.totalRecharge),
|
||||||
}));
|
}));
|
||||||
|
const userRechargeCard = computed(() => ({
|
||||||
|
label: '用户充值',
|
||||||
|
value: formatAmount(visibleSummary.value.userRecharge),
|
||||||
|
}));
|
||||||
|
|
||||||
function hasPermission(code: string) {
|
function hasPermission(code: string) {
|
||||||
const codes = accessCodes.value;
|
const codes = accessCodes.value;
|
||||||
@ -800,11 +820,24 @@ function calcArpu(summary: Record<string, any>) {
|
|||||||
return toAmount(summary.totalRecharge) / activeUser;
|
return toAmount(summary.totalRecharge) / activeUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calcRechargeUserDayArpu(summary: Record<string, any>) {
|
||||||
|
const dailyRechargeUser = toAmount(summary.dailyRechargeUser);
|
||||||
|
if (dailyRechargeUser === 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return toAmount(summary.userRecharge) / dailyRechargeUser;
|
||||||
|
}
|
||||||
|
|
||||||
function formatArpu(result?: CountryDashboardResult | null) {
|
function formatArpu(result?: CountryDashboardResult | null) {
|
||||||
const summary = buildVisibleSummary(filterRecordsBySelectedCountries(result?.records || []));
|
const summary = buildVisibleSummary(filterRecordsBySelectedCountries(result?.records || []));
|
||||||
return formatAmount(calcArpu(summary));
|
return formatAmount(calcArpu(summary));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatRechargeUserDayArpu(result?: CountryDashboardResult | null) {
|
||||||
|
const summary = buildVisibleSummary(filterRecordsBySelectedCountries(result?.records || []));
|
||||||
|
return formatAmount(calcRechargeUserDayArpu(summary));
|
||||||
|
}
|
||||||
|
|
||||||
function emptySummary(): SummaryMetric {
|
function emptySummary(): SummaryMetric {
|
||||||
return {
|
return {
|
||||||
countryNewUser: 0,
|
countryNewUser: 0,
|
||||||
@ -818,6 +851,7 @@ function emptySummary(): SummaryMetric {
|
|||||||
d30RetentionRate: 0,
|
d30RetentionRate: 0,
|
||||||
d30RetentionUser: 0,
|
d30RetentionUser: 0,
|
||||||
dailyActiveUser: 0,
|
dailyActiveUser: 0,
|
||||||
|
dailyRechargeUser: 0,
|
||||||
dealerRecharge: 0,
|
dealerRecharge: 0,
|
||||||
googleRecharge: 0,
|
googleRecharge: 0,
|
||||||
gamePayout: 0,
|
gamePayout: 0,
|
||||||
@ -835,10 +869,12 @@ function emptySummary(): SummaryMetric {
|
|||||||
luckyGiftUser: 0,
|
luckyGiftUser: 0,
|
||||||
luckyGiftUserRate: 0,
|
luckyGiftUserRate: 0,
|
||||||
mifapayRecharge: 0,
|
mifapayRecharge: 0,
|
||||||
|
newDealerUserRecharge: 0,
|
||||||
newUserRecharge: 0,
|
newUserRecharge: 0,
|
||||||
salaryExchange: 0,
|
salaryExchange: 0,
|
||||||
salaryTransfer: 0,
|
salaryTransfer: 0,
|
||||||
totalRecharge: 0,
|
totalRecharge: 0,
|
||||||
|
userRecharge: 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1057,8 +1093,11 @@ async function renderVisualCharts() {
|
|||||||
}
|
}
|
||||||
renderUserRechargeChart(baseChartOption('新增用户与充值', list, [
|
renderUserRechargeChart(baseChartOption('新增用户与充值', list, [
|
||||||
amountSeries('新增用户', 'countryNewUser', list),
|
amountSeries('新增用户', 'countryNewUser', list),
|
||||||
amountSeries('新增充值', 'newUserRecharge', list),
|
amountSeries('当日充值用户数', 'dailyRechargeUser', list),
|
||||||
amountSeries('币商充值', 'dealerRecharge', list),
|
amountSeries('新增用户充值', 'newUserRecharge', list),
|
||||||
|
amountSeries('币商平台充值', 'dealerRecharge', list),
|
||||||
|
amountSeries('新增币商用户充值', 'newDealerUserRecharge', list),
|
||||||
|
amountSeries('用户充值', 'userRecharge', list),
|
||||||
amountSeries('MifaPay 充值', 'mifapayRecharge', list),
|
amountSeries('MifaPay 充值', 'mifapayRecharge', list),
|
||||||
amountSeries('Google 充值', 'googleRecharge', list),
|
amountSeries('Google 充值', 'googleRecharge', list),
|
||||||
amountSeries('工资兑换', 'salaryExchange', list),
|
amountSeries('工资兑换', 'salaryExchange', list),
|
||||||
@ -1224,6 +1263,10 @@ onBeforeUnmount(() => {
|
|||||||
<div class="metric-card__label">{{ totalRechargeCard.label }}</div>
|
<div class="metric-card__label">{{ totalRechargeCard.label }}</div>
|
||||||
<div class="metric-card__value">{{ totalRechargeCard.value }}</div>
|
<div class="metric-card__value">{{ totalRechargeCard.value }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="metric-card">
|
||||||
|
<div class="metric-card__label">{{ userRechargeCard.label }}</div>
|
||||||
|
<div class="metric-card__value">{{ userRechargeCard.value }}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@ -1565,7 +1608,7 @@ onBeforeUnmount(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.metric-card-grid--recharge {
|
.metric-card-grid--recharge {
|
||||||
grid-template-columns: minmax(180px, 260px);
|
grid-template-columns: repeat(2, minmax(180px, 260px));
|
||||||
}
|
}
|
||||||
|
|
||||||
.metric-card {
|
.metric-card {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user