wip(freight): migration 0017 + model/column-list groundwork for add-freight-templates

This commit is contained in:
Chengdong Zhang
2026-09-23 17:39:45 +08:00
parent a83e857bdf
commit 5b426486ac
105 changed files with 6193 additions and 1566 deletions
+18 -8
View File
@@ -105,7 +105,6 @@ async function save(): Promise<void> {
}
}
onMounted(() => {
void loadBrands();
});
@@ -113,10 +112,14 @@ onMounted(() => {
<template>
<VPage :title="$t('nav.brands')">
<p v-if="loading" class="text-sm text-muted">{{ $t("common.loading") }}</p>
<p v-else-if="loadError" class="my-2 text-sm text-danger" role="alert">{{ loadError }}</p>
<p v-if="loading" class="text-muted text-sm">{{ $t("common.loading") }}</p>
<p v-else-if="loadError" class="text-danger my-2 text-sm" role="alert">{{ loadError }}</p>
<VCard v-else>
<div v-for="(row, index) in rows" :key="index" class="mb-3 rounded-md border border-border p-3">
<div
v-for="(row, index) in rows"
:key="index"
class="border-border mb-3 rounded-md border p-3"
>
<div class="grid items-end gap-3 md:grid-cols-[1fr_1fr_1fr_auto_auto]">
<VField :label="$t('admin.brandSlug')" :error="rowErrors[index]">
<VInput v-model="row.slug" placeholder="acme" />
@@ -128,12 +131,14 @@ onMounted(() => {
<VInput v-model="row.nameZh" />
</VField>
<label class="mb-3.5 flex items-center gap-2 text-sm">
<input v-model="row.active" type="checkbox" class="h-4 w-4 accent-primary" />
<input v-model="row.active" type="checkbox" class="accent-primary h-4 w-4" />
{{ $t("admin.enabled") }}
</label>
<div class="mb-3.5 flex gap-1">
<VBtn size="sm" :disabled="index === 0" @click="moveRow(index, -1)">↑</VBtn>
<VBtn size="sm" :disabled="index === rows.length - 1" @click="moveRow(index, 1)">↓</VBtn>
<VBtn size="sm" :disabled="index === rows.length - 1" @click="moveRow(index, 1)"
>↓</VBtn
>
<VBtn size="sm" @click="removeRow(index)">{{ $t("common.delete") }}</VBtn>
</div>
</div>
@@ -143,10 +148,15 @@ onMounted(() => {
<VBtn variant="primary" :disabled="saving" @click="save">
{{ saving ? $t("common.loading") : $t("common.save") }}
</VBtn>
<p v-if="feedback" role="status" class="text-sm" :class="feedback.ok ? 'text-success' : 'text-danger'">
<p
v-if="feedback"
role="status"
class="text-sm"
:class="feedback.ok ? 'text-success' : 'text-danger'"
>
{{ feedback.message }}
</p>
</div>
</VCard>
</VPage>
</template>
</template>