feat(admin): 赛事管理单赛事信息增加筛选与排序功能 (支持按有下注过滤及按注单数/投注额排序)

This commit is contained in:
2026-06-18 17:45:25 +08:00
parent 7288ef3f57
commit 499522f3fb
6 changed files with 197 additions and 4 deletions

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;