feat(theme-4): sync inbox/announcements/presence/deposit from main

This commit is contained in:
2026-06-18 10:08:03 +08:00
parent d3ca8498fb
commit 5c5aa7e55a
87 changed files with 6911 additions and 1026 deletions

View File

@@ -6,6 +6,7 @@ import { resolveApiError } from '../i18n/form-validation';
import api from '../api';
import AdminTableEmpty from '../components/AdminTableEmpty.vue';
import { formatAmount } from '../utils/format-amount';
import { refreshDepositPendingCount } from '../composables/useDepositPendingCount';
const { t } = useAdminLocale();
@@ -45,7 +46,7 @@ interface DepositAuditLogRow {
const items = ref<DepositOrderRow[]>([]);
const total = ref(0);
const page = ref(1);
const pageSize = ref(20);
const pageSize = ref(10);
const loading = ref(false);
// Filters
@@ -85,6 +86,7 @@ async function fetchList() {
const result = data.data ?? { items: [], total: 0 };
items.value = result.items ?? [];
total.value = result.total ?? 0;
void refreshDepositPendingCount();
} catch { /* */ } finally {
loading.value = false;
}
@@ -238,6 +240,10 @@ function statusLabel(s: string) {
return '● ' + t('deposit.status_pending');
}
function refreshList() {
void fetchList();
}
function prevPage() { if (page.value > 1) { page.value--; fetchList(); } }
function nextPage() { if (page.value * pageSize.value < total.value) { page.value++; fetchList(); } }
@@ -268,6 +274,9 @@ onMounted(fetchList);
@keydown.enter="page = 1; fetchList()"
/>
<button class="btn-search" @click="page = 1; fetchList()">{{ t('common.search') }}</button>
<button class="btn-refresh" type="button" :disabled="loading" @click="refreshList">
{{ t('common.refresh') }}
</button>
</div>
<AdminTableEmpty v-if="!loading && !items.length" />
@@ -275,6 +284,7 @@ onMounted(fetchList);
<table v-if="items.length" class="data-table">
<thead>
<tr>
<th style="width: 60px; text-align: center;">{{ t('common.seq') }}</th>
<th>{{ t('deposit.order_no') }}</th>
<th>{{ t('deposit.player') }}</th>
<th>{{ t('common.type') }}</th>
@@ -289,7 +299,8 @@ onMounted(fetchList);
</tr>
</thead>
<tbody>
<tr v-for="row in items" :key="row.id">
<tr v-for="(row, idx) in items" :key="row.id">
<td style="text-align: center;">{{ (page - 1) * pageSize + idx + 1 }}</td>
<td class="mono">{{ row.orderNo }}</td>
<td>{{ row.playerUsername || row.playerId }}</td>
<td><span :class="['badge', row.methodType === 'BANK' ? 'badge-blue' : 'badge-green']">{{ row.methodType }}</span></td>
@@ -445,6 +456,24 @@ onMounted(fetchList);
.filters select, .filters input { padding: 6px 10px; border-radius: 4px; border: 1px solid #444; background: #1e1e1e; color: #eee; font-size: 13px; }
.filters input { min-width: 160px; }
.btn-search { background: #409eff; color: #fff; border: none; border-radius: 4px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.btn-refresh {
background: #fff;
color: #606266;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 6px 14px;
cursor: pointer;
font-weight: 600;
font-size: 13px;
}
.btn-refresh:hover:not(:disabled) {
border-color: #409eff;
color: #409eff;
}
.btn-refresh:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 6px; border-bottom: 1px solid #333; text-align: left; }
.data-table th { font-weight: 700; color: #aaa; font-size: 11px; text-transform: uppercase; }