feat(admin+api+player): 优胜赛结算态、禁止新增单场与钱包流水展示优化

- API/管理端:优胜赛 SETTLED 后禁止新增单场,列表与子页展示结算状态
- 玩家端:已结算 outright 只读展示并高亮冠军
- 管理端:结算后 stale 标记驱动列表刷新;财务流水时间与备注 i18n 优化
- shared:txDisplayAmount 与 LEAGUE_OUTRIGHT_SETTLED 错误码
This commit is contained in:
2026-06-23 12:20:40 +08:00
parent ce84226219
commit d3c211411b
36 changed files with 525 additions and 128 deletions

View File

@@ -2,6 +2,7 @@
export interface LeagueRowView {
id: string;
isPublished: boolean;
isOutrightSettled?: boolean;
isPublishing: boolean;
labels: {
edit: string;
@@ -30,7 +31,12 @@ defineEmits<{
<el-button size="small" type="primary" @click.stop="$emit('edit')">
{{ row.labels.edit }}
</el-button>
<el-button size="small" type="primary" @click.stop="$emit('createFixture')">
<el-button
v-if="!row.isOutrightSettled"
size="small"
type="primary"
@click.stop="$emit('createFixture')"
>
{{ row.labels.createFixture }}
</el-button>
<el-button

View File

@@ -4,8 +4,9 @@ import { useAuthStore } from '../stores/auth';
import { useAdminLocale } from '../composables/useAdminLocale';
import api from '../api';
import AdminTableEmpty from './AdminTableEmpty.vue';
import { formatAmount, formatAmountFull } from '../utils/format-amount';
import { walletDepositMethodLabel, walletTxTypeKey } from '../utils/walletTx';
import { formatAmountFull } from '../utils/format-amount';
import { formatAdminDateTimeBrief, formatAdminDateTimeFull } from '../utils/format-datetime';
import { walletDepositMethodLabel, walletTxTypeKey, txDisplayAmount, walletRemarkLabel } from '../utils/walletTx';
interface WalletTxRow {
id: string;
@@ -34,7 +35,7 @@ const emit = defineEmits<{
'update:modelValue': [value: boolean];
}>();
const { t, locale, localeTag } = useAdminLocale();
const { t, locale } = useAdminLocale();
const auth = useAuthStore();
const visible = computed({
@@ -68,17 +69,6 @@ function depositMethodLabel(row: WalletTxRow) {
return walletDepositMethodLabel(row, t);
}
function formatTime(v: string) {
return new Date(v).toLocaleString(localeTag.value, {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
});
}
function dateParams() {
if (!dateRange.value?.length) return {};
const [from, to] = dateRange.value;
@@ -172,8 +162,12 @@ watch(
<template #empty>
<AdminTableEmpty />
</template>
<el-table-column :label="t('audit.col.time')" min-width="140">
<template #default="{ row }">{{ formatTime(row.createdAt) }}</template>
<el-table-column :label="t('audit.col.time')" min-width="88">
<template #default="{ row }">
<el-tooltip :content="formatAdminDateTimeFull(row.createdAt, locale)" placement="top">
<span>{{ formatAdminDateTimeBrief(row.createdAt, locale) }}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column :label="t('finance.col.tx_id')" min-width="120" show-overflow-tooltip>
<template #default="{ row }">{{ row.transactionId }}</template>
@@ -181,45 +175,27 @@ watch(
<el-table-column :label="t('finance.col.tx_type')" min-width="80">
<template #default="{ row }">{{ walletTypeLabel(row.transactionType) }}</template>
</el-table-column>
<el-table-column :label="t('finance.col.deposit_method')" min-width="100" show-overflow-tooltip>
<el-table-column :label="t('finance.col.deposit_method')" min-width="72" show-overflow-tooltip>
<template #default="{ row }">{{ depositMethodLabel(row) }}</template>
</el-table-column>
<el-table-column :label="t('finance.col.balance_change')" min-width="96" align="right">
<el-table-column :label="t('finance.col.balance_change')" min-width="110" align="right">
<template #default="{ row }">
<el-tooltip :content="formatAmountFull(row.amount)" placement="top">
<span :class="parseFloat(row.amount) >= 0 ? 'amt-pos' : 'amt-neg'">
{{ formatAmount(row.amount) }}
</span>
</el-tooltip>
<span :class="parseFloat(txDisplayAmount(row)) >= 0 ? 'amt-pos' : 'amt-neg'">
{{ formatAmountFull(txDisplayAmount(row)) }}
</span>
</template>
</el-table-column>
<el-table-column :label="t('finance.col.balance_before')" min-width="90" align="right">
<template #default="{ row }">
<el-tooltip :content="formatAmountFull(row.balanceBefore)" placement="top">
<span>{{ formatAmount(row.balanceBefore) }}</span>
</el-tooltip>
</template>
<el-table-column :label="t('finance.col.balance_before')" min-width="110" align="right">
<template #default="{ row }">{{ formatAmountFull(row.balanceBefore) }}</template>
</el-table-column>
<el-table-column :label="t('finance.col.balance_after')" min-width="90" align="right">
<template #default="{ row }">
<el-tooltip :content="formatAmountFull(row.balanceAfter)" placement="top">
<span>{{ formatAmount(row.balanceAfter) }}</span>
</el-tooltip>
</template>
<el-table-column :label="t('finance.col.balance_after')" min-width="110" align="right">
<template #default="{ row }">{{ formatAmountFull(row.balanceAfter) }}</template>
</el-table-column>
<el-table-column :label="t('finance.col.frozen_before')" min-width="90" align="right">
<template #default="{ row }">
<el-tooltip :content="formatAmountFull(row.frozenBefore)" placement="top">
<span>{{ formatAmount(row.frozenBefore) }}</span>
</el-tooltip>
</template>
<el-table-column :label="t('finance.col.frozen_before')" min-width="110" align="right">
<template #default="{ row }">{{ formatAmountFull(row.frozenBefore) }}</template>
</el-table-column>
<el-table-column :label="t('finance.col.frozen_after')" min-width="90" align="right">
<template #default="{ row }">
<el-tooltip :content="formatAmountFull(row.frozenAfter)" placement="top">
<span>{{ formatAmount(row.frozenAfter) }}</span>
</el-tooltip>
</template>
<el-table-column :label="t('finance.col.frozen_after')" min-width="110" align="right">
<template #default="{ row }">{{ formatAmountFull(row.frozenAfter) }}</template>
</el-table-column>
<el-table-column :label="t('finance.col.reference')" min-width="105" show-overflow-tooltip>
<template #default="{ row }">
@@ -237,8 +213,8 @@ watch(
<el-table-column :label="t('agent.credit_tx.col.operator')" min-width="85">
<template #default="{ row }">{{ row.operatorUsername ?? '—' }}</template>
</el-table-column>
<el-table-column :label="t('user.field.remark')" min-width="100" show-overflow-tooltip>
<template #default="{ row }">{{ row.remark ?? '—' }}</template>
<el-table-column :label="t('user.field.remark')" min-width="180">
<template #default="{ row }">{{ walletRemarkLabel(row.remark, row.transactionType, t) }}</template>
</el-table-column>
</el-table>
</div>