From 070aa8ff5f0153a2adf1c524980ce1126adbbea5 Mon Sep 17 00:00:00 2001 From: xiaomai Date: Tue, 14 Oct 2025 21:11:59 +0800 Subject: [PATCH] feat(item): add brand field to items This commit introduces an optional 'brand' field to the item model, allowing for better organization and differentiation. - The Add/Edit modal now includes a form field to select or create a brand. - The item list on the main page now displays the brand next to the item name. - Name uniqueness validation is now brand-aware. An item name must be unique within the context of its brand. - The `addItem` logic is centralized in the `useItemsStore` to handle ID and timestamp generation. --- app/components/item/EditModal.vue | 35 ++++++++------ app/composables/items.ts | 76 ++++++++++++++++++++++++++----- app/pages/index.vue | 2 +- 3 files changed, 87 insertions(+), 26 deletions(-) diff --git a/app/components/item/EditModal.vue b/app/components/item/EditModal.vue index 2aa15a5..af121e0 100644 --- a/app/components/item/EditModal.vue +++ b/app/components/item/EditModal.vue @@ -4,11 +4,7 @@ :title="isEditMode ? '编辑物品' : '新增物品'" :description="isEditMode ? '修改现有物品信息' : '新增一件新的物品'" > - +