feat(admin): 同步单赛事筛选与排序功能 (从 main 分支)

This commit is contained in:
2026-06-18 17:46:39 +08:00
parent b0dc56db1c
commit 5fbb1fd1f6
6 changed files with 197 additions and 4 deletions

View File

@@ -318,6 +318,10 @@ const zh: Record<string, string> = {
'match.status.CLOSED': '已封盘',
'match.status.SETTLED': '已结算',
'match.status.PENDING_SETTLEMENT': '待结算',
'match.filter.has_bets': '仅显示有下注',
'match.sort.default': '默认排序',
'match.sort.bet_count': '按注单数',
'match.sort.total_stake': '按投注额',
// 列表页/弹窗文案通过 bundles/zh-CN 动态平载,不在此处静态 spread
};
@@ -627,6 +631,10 @@ const en: Record<string, string> = {
'match.status.CLOSED': 'Closed',
'match.status.SETTLED': 'Settled',
'match.status.PENDING_SETTLEMENT': 'Pending settlement',
'match.filter.has_bets': 'Show Placed Bets Only',
'match.sort.default': 'Default Order',
'match.sort.bet_count': 'By Bet Count',
'match.sort.total_stake': 'By Stake Amount',
// 列表页/弹窗文案通过 bundles/en-US 动态平载,不在此处静态 spread
};
@@ -936,6 +944,10 @@ const ms: Record<string, string> = {
'match.status.CLOSED': 'Ditutup',
'match.status.SETTLED': 'Diselesaikan',
'match.status.PENDING_SETTLEMENT': 'Menunggu penyelesaian',
'match.filter.has_bets': 'Tunjukkan Pertaruhan Sahaja',
'match.sort.default': 'Susunan Lalai',
'match.sort.bet_count': 'Ikut Bil. Pertaruhan',
'match.sort.total_stake': 'Ikut Jumlah Taruhan',
// 列表页/弹窗文案通过 bundles/ms-MY 动态平载,不在此处静态 spread
};

View File

@@ -27,6 +27,14 @@ const router = useRouter();
const archiveVisible = ref(false);
const archiveMatchId = ref('');
const archiveTitle = ref('');
const filterHasBets = ref(false);
const orderBy = ref('default');
function onFilterChange() {
matchPage.value = 1;
void load();
}
const matches = ref<unknown[]>([]);
const loading = ref(false);
const matchPage = ref(1);
@@ -44,6 +52,8 @@ async function load() {
locale: locale.value,
page: matchPage.value,
pageSize: matchPageSize.value,
hasBets: filterHasBets.value ? 'true' : undefined,
orderBy: orderBy.value !== 'default' ? orderBy.value : undefined,
},
});
const payload = data.data as {
@@ -328,6 +338,16 @@ defineExpose({ reload: load });
<template>
<div class="league-matches-panel">
<div class="nested-panel-toolbar">
<el-checkbox v-model="filterHasBets" size="default" @change="onFilterChange">
{{ t('match.filter.has_bets') }}
</el-checkbox>
<el-select v-model="orderBy" size="small" style="width: 140px;" @change="onFilterChange">
<el-option :label="t('match.sort.default')" value="default" />
<el-option :label="t('match.sort.bet_count')" value="betCount" />
<el-option :label="t('match.sort.total_stake')" value="totalStake" />
</el-select>
</div>
<el-table v-loading="loading" :data="matches" stripe row-key="id" class="nested-match-table">
<el-table-column type="index" :index="(i: number) => (matchPage - 1) * matchPageSize + i + 1" :label="t('common.seq')" width="70" align="center" />
@@ -476,9 +496,14 @@ defineExpose({ reload: load });
}
.nested-panel-toolbar {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-bottom: 8px;
align-items: center;
justify-content: flex-start;
gap: 16px;
margin-bottom: 10px;
padding: 6px 12px;
background: #ffffff;
border: 1px solid var(--border-soft, #eaeaea);
border-radius: 6px;
}
.nested-pager {
display: flex;