Przeglądaj źródła

feat: 添加产品总能量字段及更新环境配置

IlhamTahir 1 miesiąc temu
rodzic
commit
16365ceb29
3 zmienionych plików z 8 dodań i 1 usunięć
  1. 3 1
      .env.development
  2. 1 0
      src/model/product.ts
  3. 4 0
      src/pages/product/index.vue

+ 3 - 1
.env.development

@@ -1 +1,3 @@
-VITE_ENABLE_MOCK=true
+VITE_ENABLE_MOCK=false
+VITE_API_PREFIX=/api
+VITE_PROXY_ENDPOINT=http://localhost:3000

+ 1 - 0
src/model/product.ts

@@ -13,6 +13,7 @@ export interface Product extends BaseModel{
   fiber: number;
   ash: number;
   moisture: number;
+  totalCalories: number; // 产品总能量(kcal),由后端基于ME算法计算
 }
 
 export interface CreateProductRequest extends Pick<Product, "name" | 'photo' | 'tags' | 'totalWeight' | 'category' | 'protein' | 'fat' | 'fiber' | 'ash' | 'moisture'> {}

+ 4 - 0
src/pages/product/index.vue

@@ -34,6 +34,10 @@ const columns: BaseTableColumns = [
     title: '净重',
     colKey: 'totalWeight',
   },
+  {
+    title: '总能量',
+    colKey: 'totalCalories',
+  },
   {
     title: '蛋白质',
     colKey: 'protein',