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
+30 -6
View File
@@ -60,7 +60,9 @@ function submit(): void {
<template>
<VCard class="mx-auto my-10 w-full max-w-[720px]">
<form @submit.prevent="submit">
<div v-if="validationError" class="my-2 text-sm text-danger" role="alert">{{ validationError }}</div>
<div v-if="validationError" class="text-danger my-2 text-sm" role="alert">
{{ validationError }}
</div>
<VField :label="$t('product.slug')">
<VInput id="product-slug" v-model="slug" required pattern="[a-z0-9]+(?:-[a-z0-9]+)*" />
</VField>
@@ -71,13 +73,27 @@ function submit(): void {
<VInput id="product-name-zh" v-model="nameZh" />
</VField>
<VField :label="$t('product.descEn')">
<textarea id="product-description-en" v-model="descriptionEn" rows="4" class="w-full resize-y 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" />
<textarea
id="product-description-en"
v-model="descriptionEn"
rows="4"
class="border-border bg-surface text-text focus:border-primary focus:outline-primary/30 w-full resize-y rounded-md border px-3 py-2 text-sm focus:outline-2"
/>
</VField>
<VField :label="$t('product.descZh')">
<textarea id="product-description-zh" v-model="descriptionZh" rows="4" class="w-full resize-y 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" />
<textarea
id="product-description-zh"
v-model="descriptionZh"
rows="4"
class="border-border bg-surface text-text focus:border-primary focus:outline-primary/30 w-full resize-y rounded-md border px-3 py-2 text-sm focus:outline-2"
/>
</VField>
<VField :label="$t('product.category')">
<select id="product-category" v-model="categoryId" class="w-full 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">
<select
id="product-category"
v-model="categoryId"
class="border-border bg-surface text-text focus:border-primary focus:outline-primary/30 w-full rounded-md border px-3 py-2 text-sm focus:outline-2"
>
<option value="">{{ $t("shop.categoryOptional") }}</option>
<option v-for="category in categories" :key="category.id" :value="category.id">
{{ localized(category.name, locale) }}
@@ -85,10 +101,18 @@ function submit(): void {
</select>
</VField>
<VField :label="$t('product.images')">
<textarea id="product-images" v-model="images" rows="4" :placeholder="$t('shop.imagesHint')" class="w-full resize-y 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" />
<textarea
id="product-images"
v-model="images"
rows="4"
:placeholder="$t('shop.imagesHint')"
class="border-border bg-surface text-text focus:border-primary focus:outline-primary/30 w-full resize-y rounded-md border px-3 py-2 text-sm focus:outline-2"
/>
</VField>
<VBtn variant="primary" type="submit" :disabled="busy">
{{ busy ? $t("common.loading") : product ? $t("shop.updateProduct") : $t("shop.saveProduct") }}
{{
busy ? $t("common.loading") : product ? $t("shop.updateProduct") : $t("shop.saveProduct")
}}
</VBtn>
</form>
</VCard>