feat: WC2026 赛事 seed、生产上线初始化脚本与目录归档
重构 seed 为 WC2026 72 场小组赛与 48 强优胜盘;新增 production 模式仅保留 admin 与赛事示例;提供 prod-init-db 全量重置脚本;管理端 i18n 分包与赛事归档能力。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -308,7 +308,7 @@ function batchDelete() {
|
||||
|
||||
function resetForm() {
|
||||
form.value = {
|
||||
sortOrder: total.value + 1,
|
||||
sortOrder: 0,
|
||||
status: 'DRAFT',
|
||||
linkType: '',
|
||||
linkTarget: '',
|
||||
@@ -381,6 +381,7 @@ async function submitForm() {
|
||||
saving.value = true;
|
||||
try {
|
||||
const payload = buildPayload();
|
||||
const isCreate = !editingId.value;
|
||||
if (editingId.value) {
|
||||
const { contentType: _type, ...updateBody } = payload;
|
||||
await api.put(`/admin/contents/${editingId.value}`, updateBody);
|
||||
@@ -389,6 +390,7 @@ async function submitForm() {
|
||||
}
|
||||
ElMessage.success(t('msg.saved'));
|
||||
dialogVisible.value = false;
|
||||
if (isCreate) page.value = 1;
|
||||
await load();
|
||||
} catch (e: unknown) {
|
||||
const err = e as { response?: { data?: { error?: string; message?: string | string[] } } };
|
||||
@@ -471,23 +473,37 @@ void load();
|
||||
<el-button type="primary" plain size="small" @click="openCreate">
|
||||
{{ t('content.btn.create') }}
|
||||
</el-button>
|
||||
<span v-if="hasSelection" class="batch-hint">
|
||||
{{ t('content.batch.selected', { n: selectedRows.length }) }}
|
||||
</span>
|
||||
<el-button
|
||||
size="small"
|
||||
:disabled="!hasSelection || saving"
|
||||
@click="batchEnable"
|
||||
>
|
||||
{{ t('content.batch.enable') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
:disabled="!hasSelection || saving"
|
||||
@click="batchDisable"
|
||||
>
|
||||
{{ t('content.batch.disable') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
size="small"
|
||||
:disabled="!hasSelection || saving"
|
||||
@click="batchDelete"
|
||||
>
|
||||
{{ t('content.batch.delete') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card v-loading="loading" class="data-card" shadow="never">
|
||||
<div v-if="hasSelection" class="table-toolbar">
|
||||
<span class="batch-hint">{{ t('content.batch.selected', { n: selectedRows.length }) }}</span>
|
||||
<el-button size="small" :disabled="saving" @click="batchEnable">
|
||||
{{ t('content.batch.enable') }}
|
||||
</el-button>
|
||||
<el-button size="small" :disabled="saving" @click="batchDisable">
|
||||
{{ t('content.batch.disable') }}
|
||||
</el-button>
|
||||
<el-button size="small" type="danger" :disabled="saving" @click="batchDelete">
|
||||
{{ t('content.batch.delete') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="table-wrap">
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
@@ -730,22 +746,6 @@ void load();
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.table-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
padding: 10px 12px;
|
||||
border-bottom: 1px solid #222;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.batch-hint {
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.type-hint {
|
||||
margin: 0 0 8px;
|
||||
font-size: 12px;
|
||||
@@ -757,6 +757,13 @@ void load();
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.batch-hint {
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
margin: 0 4px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.thumb {
|
||||
width: 56px;
|
||||
height: 32px;
|
||||
|
||||
Reference in New Issue
Block a user