feat(admin+api+player): 优胜赛结算态、禁止新增单场与钱包流水展示优化
- API/管理端:优胜赛 SETTLED 后禁止新增单场,列表与子页展示结算状态 - 玩家端:已结算 outright 只读展示并高亮冠军 - 管理端:结算后 stale 标记驱动列表刷新;财务流水时间与备注 i18n 优化 - shared:txDisplayAmount 与 LEAGUE_OUTRIGHT_SETTLED 错误码
This commit is contained in:
@@ -8,8 +8,9 @@ import { useAdminLocale } from '../composables/useAdminLocale';
|
||||
import api from '../api';
|
||||
import AdminTableEmpty from '../components/AdminTableEmpty.vue';
|
||||
import { formatAmount, formatAmountFull } from '../utils/format-amount';
|
||||
import { walletTxTypeKey } from '../utils/walletTx';
|
||||
const { t, locale, localeTag } = useAdminLocale();
|
||||
import { formatAdminDateTimeBrief, formatAdminDateTimeFull } from '../utils/format-datetime';
|
||||
import { walletTxTypeKey, walletRemarkLabel } from '../utils/walletTx';
|
||||
const { t, locale } = useAdminLocale();
|
||||
const auth = useAuthStore();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -84,36 +85,8 @@ function transferTypeLabel(type: string) {
|
||||
return key ? t(key) : type;
|
||||
}
|
||||
|
||||
const TRANSFER_REMARK_KEYS: Record<string, string> = {
|
||||
'Agent deposit': 'finance.remark.agent_deposit',
|
||||
'Agent withdraw': 'finance.remark.agent_withdraw',
|
||||
'代理上分': 'finance.remark.agent_deposit',
|
||||
'代理下分': 'finance.remark.agent_withdraw',
|
||||
'管理员上分': 'finance.remark.admin_deposit',
|
||||
'管理员下分': 'finance.remark.admin_withdraw',
|
||||
'开户初始余额': 'finance.remark.initial_balance',
|
||||
};
|
||||
|
||||
function transferRemarkLabel(remark: string | null | undefined, transactionType: string) {
|
||||
const raw = remark?.trim();
|
||||
if (!raw) {
|
||||
if (transactionType === 'MANUAL_DEPOSIT') return t('finance.remark.agent_deposit');
|
||||
if (transactionType === 'MANUAL_WITHDRAW') return t('finance.remark.agent_withdraw');
|
||||
return '—';
|
||||
}
|
||||
const key = TRANSFER_REMARK_KEYS[raw];
|
||||
return key ? t(key) : raw;
|
||||
}
|
||||
|
||||
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',
|
||||
});
|
||||
return walletRemarkLabel(remark, transactionType, t);
|
||||
}
|
||||
|
||||
function dateParams() {
|
||||
@@ -339,8 +312,12 @@ watch(
|
||||
<AdminTableEmpty />
|
||||
</template>
|
||||
<el-table-column type="index" :index="(i: number) => (creditPage - 1) * creditPageSize + i + 1" :label="t('common.seq')" width="70" align="center" />
|
||||
<el-table-column :label="t('audit.col.time')" min-width="158">
|
||||
<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('user.col.username')" min-width="110">
|
||||
<template #default="{ row }">
|
||||
@@ -410,8 +387,12 @@ watch(
|
||||
<AdminTableEmpty />
|
||||
</template>
|
||||
<el-table-column type="index" :index="(i: number) => (transferPage - 1) * transferPageSize + i + 1" :label="t('common.seq')" width="70" align="center" />
|
||||
<el-table-column :label="t('audit.col.time')" min-width="158">
|
||||
<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="130" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.transactionId }}</template>
|
||||
|
||||
Reference in New Issue
Block a user