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
+74 -17
View File
@@ -19,39 +19,96 @@ watchEffect(() => {
<div v-if="isAuthPage">
<NuxtPage />
</div>
<div v-else class="min-h-screen bg-bg font-sans text-text">
<div v-else class="bg-bg text-text min-h-screen font-sans">
<div class="flex min-h-screen">
<aside class="w-60 shrink-0 border-r border-border bg-surface px-4 py-5">
<div class="mb-6 px-3 text-lg font-bold text-text">{{ $t("common.appName") }} · Shop</div>
<aside class="border-border bg-surface w-60 shrink-0 border-r px-4 py-5">
<div class="text-text mb-6 px-3 text-lg font-bold">{{ $t("common.appName") }} · Shop</div>
<nav class="grid gap-1" :aria-label="$t('common.appName')">
<NuxtLink to="/" exact-active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.dashboard") }}</NuxtLink>
<NuxtLink to="/products" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.products") }}</NuxtLink>
<NuxtLink to="/shop-profile" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.shopProfile") }}</NuxtLink>
<NuxtLink to="/orders" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.orders") }}</NuxtLink>
<NuxtLink to="/aftersales" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.aftersales") }}</NuxtLink>
<NuxtLink to="/shipments" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.shipments") }}</NuxtLink>
<NuxtLink to="/invoices" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.invoices") }}</NuxtLink>
<NuxtLink to="/coupons" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.coupons") }}</NuxtLink>
<NuxtLink to="/flash-sales" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.flashSales") }}</NuxtLink>
<NuxtLink to="/group-buying" active-class="bg-primary-soft text-primary" class="rounded-md px-3 py-2 text-sm font-medium text-muted hover:bg-bg">{{ $t("nav.groupBuying") }}</NuxtLink>
<NuxtLink
to="/"
exact-active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.dashboard") }}</NuxtLink
>
<NuxtLink
to="/products"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.products") }}</NuxtLink
>
<NuxtLink
to="/shop-profile"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.shopProfile") }}</NuxtLink
>
<NuxtLink
to="/orders"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.orders") }}</NuxtLink
>
<NuxtLink
to="/aftersales"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.aftersales") }}</NuxtLink
>
<NuxtLink
to="/shipments"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.shipments") }}</NuxtLink
>
<NuxtLink
to="/invoices"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.invoices") }}</NuxtLink
>
<NuxtLink
to="/coupons"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.coupons") }}</NuxtLink
>
<NuxtLink
to="/flash-sales"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.flashSales") }}</NuxtLink
>
<NuxtLink
to="/group-buying"
active-class="bg-primary-soft text-primary"
class="text-muted hover:bg-bg rounded-md px-3 py-2 text-sm font-medium"
>{{ $t("nav.groupBuying") }}</NuxtLink
>
</nav>
</aside>
<main class="min-w-0 flex-1">
<header class="flex min-h-16 items-center justify-end gap-4 border-b border-border bg-surface px-6">
<header
class="border-border bg-surface flex min-h-16 items-center justify-end gap-4 border-b px-6"
>
<VAccentSwatch />
<select
:value="locale"
:aria-label="$t('common.language')"
class="rounded-md border border-border bg-surface px-3 py-2 text-sm text-text focus:border-primary focus:outline-2 focus:outline-primary/30"
class="border-border bg-surface text-text focus:border-primary focus:outline-primary/30 rounded-md border px-3 py-2 text-sm focus:outline-2"
@change="setLocale(($event.target as HTMLSelectElement).value as 'en' | 'zh')"
>
<option v-for="l in locales" :key="l.code" :value="l.code">{{ l.name }}</option>
</select>
<template v-if="session.isLoggedIn">
<span class="text-sm text-muted">{{ session.user?.display_name }}</span>
<span class="text-muted text-sm">{{ session.user?.display_name }}</span>
<VBtn size="sm" @click="session.logout()">{{ $t("common.logout") }}</VBtn>
</template>
<NuxtLink v-else to="/login" class="inline-flex items-center justify-center rounded-md border border-primary bg-primary px-2.5 py-1 text-[13px] font-medium text-white hover:bg-primary-hover">{{ $t("common.login") }}</NuxtLink>
<NuxtLink
v-else
to="/login"
class="border-primary bg-primary hover:bg-primary-hover inline-flex items-center justify-center rounded-md border px-2.5 py-1 text-[13px] font-medium text-white"
>{{ $t("common.login") }}</NuxtLink
>
</header>
<div class="px-6">
<NuxtPage />