浏览代码

fix: delivery with file category

Future 3 小时之前
父节点
当前提交
be2a74272d
共有 2 个文件被更改,包括 15 次插入15 次删除
  1. 8 8
      docs/prd/项目-交付执行.md
  2. 7 7
      rules/schemas.md

+ 8 - 8
docs/prd/项目-交付执行.md

@@ -316,7 +316,7 @@ interface ProductContent {
     name: string;
     url: string;
     size?: string;
-    fileCategory: string;               // 'delivery' | 'reference' | 'other'
+    category: string;               // 'delivery' | 'reference' | 'other'
     reviewStatus?: 'pending' | 'approved' | 'rejected';
     synced?: boolean;                    // 是否已同步到客户端
     uploadTime: Date;                     // 上传时间
@@ -411,7 +411,7 @@ class ProductDeliveryService {
             name: file.get("fileName"),
             url: file.get("fileUrl"),
             size: this.formatFileSize(file.get("fileSize")),
-            fileCategory: file.get("fileCategory"),
+            category: file.get("category"),
             reviewStatus: file.get("data")?.reviewStatus || "pending",
             uploadTime: file.get("createdAt"),
             uploadedBy: file.get("uploadedBy")?.get("name")
@@ -438,7 +438,7 @@ class ProductDeliveryService {
   async getProductDeliveryFiles(productId: string, stage: string): Promise<Parse.Object[]> {
     const fileQuery = new Parse.Query("ProjectFile");
     fileQuery.equalTo("product", { __type: "Pointer", className: "Product", objectId: productId });
-    fileQuery.equalTo("fileCategory", "delivery");
+    fileQuery.equalTo("category", "delivery");
     fileQuery.equalTo("stage", stage);
     fileQuery.notEqualTo("isDeleted", true);
     fileQuery.descending("createdAt");
@@ -726,7 +726,7 @@ class BatchOperationService {
   async batchUploadFiles(
     productIds: string[],
     files: File[],
-    fileCategory: string,
+    category: string,
     stage: string,
     uploaderId: string
   ): Promise<BatchUploadResult> {
@@ -746,7 +746,7 @@ class BatchOperationService {
         for (const productId of productIds) {
           const projectFile = new Parse.Object("ProjectFile");
           projectFile.set("product", { __type: "Pointer", className: "Product", objectId: productId });
-          projectFile.set("fileCategory", fileCategory);
+          projectFile.set("category", category);
           projectFile.set("stage", stage);
           projectFile.set("uploadedBy", { __type: "Pointer", className: "Profile", objectId: uploaderId });
 
@@ -1527,7 +1527,7 @@ export class ProgressTrackerComponent {
 
 #### 3.4.1 文件分类结构
 ```typescript
-interface FileCategory {
+interface category {
   id: 'white_model' | 'soft_decor' | 'rendering' | 'post_process';
   name: string;
   icon: string;
@@ -1536,7 +1536,7 @@ interface FileCategory {
   maxSize: number; // MB
 }
 
-export const FILE_CATEGORIES: FileCategory[] = [
+export const FILE_CATEGORIES: category[] = [
   {
     id: 'white_model',
     name: '白模建模',
@@ -1975,7 +1975,7 @@ export const TEAM_ROLES: TeamRole[] = [
       <div class="upload-options">
         <div class="form-group">
           <label>文件分类:</label>
-          <select v-model="batchUploadOptions.fileCategory">
+          <select v-model="batchUploadOptions.category">
             <option value="delivery">交付物文件</option>
             <option value="reference">参考文件</option>
             <option value="document">文档资料</option>

+ 7 - 7
rules/schemas.md

@@ -24,7 +24,7 @@ label: database
 **空间管理优化**:
 - 🎯 **Product即空间**:每个Product代表一个空间的设计产品
 - 💰 **产品报价**:通过Product的`.quotation`字段管理空间级报价
-- 📁 **文件分类**:ProjectFile通过`.fileCategory`区分panorama、delivery等类型
+- 📁 **文件分类**:ProjectFile通过`.category`区分panorama、delivery等类型
 - 👥 **设计师分配**:通过Product的`.profile`字段直接关联负责设计师
 - 🎯 **产品需求**:通过Product的`.requirements`字段管理空间需求
 - ⭐ **产品评价**:通过Product的`.reviews`字段管理空间评价
@@ -569,7 +569,7 @@ const designerProducts = await designerProductQuery.find();
 
 ### 6. ProjectFile(项目文件表)
 
-**用途**: 存储项目相关的所有文件,**简化设计**,通过 `.fileCategory` 字段区分文件类型。
+**用途**: 存储项目相关的所有文件,**简化设计**,通过 `.category` 字段区分文件类型。
 
 | 字段名 | 类型 | 必填 | 说明 | 示例值 |
 |--------|------|------|------|--------|
@@ -655,7 +655,7 @@ const ProjectFile = Parse.Object.extend("ProjectFile");
 const file = new ProjectFile();
 file.set("project", project.toPointer());
 file.set("product", product.toPointer()); // 关联到具体空间产品
-file.set("fileCategory", "panorama"); // 标记为全景图文件
+file.set("category", "panorama"); // 标记为全景图文件
 file.set("fileName", "主卧720全景图.jpg");
 file.set("uploadedBy", profile.toPointer());
 await file.save();
@@ -663,14 +663,14 @@ await file.save();
 // 查询空间产品的所有全景图文件
 const panoramaQuery = new Parse.Query("ProjectFile");
 panoramaQuery.equalTo("product", productId);
-panoramaQuery.equalTo("fileCategory", "panorama");
+panoramaQuery.equalTo("category", "panorama");
 panoramaQuery.notEqualTo("isDeleted", true);
 const panoramaFiles = await panoramaQuery.find();
 
 // 查询空间产品的所有报价文件
 const quotationQuery = new Parse.Query("ProjectFile");
 quotationQuery.equalTo("product", productId);
-quotationQuery.equalTo("fileCategory", "quotation");
+quotationQuery.equalTo("category", "quotation");
 const quotationFiles = await quotationQuery.find();
 ```
 
@@ -842,7 +842,7 @@ const totalPaid = payments.reduce((sum, payment) => {
 
 ### 2. 数据结构极简
 - **单表多能**:Product表承载空间管理的所有核心功能
-- **文件分类管理**:通过ProjectFile.fileCategory区分不同类型文件
+- **文件分类管理**:通过ProjectFile.category区分不同类型文件
 - **设计师直连**:通过Product.profile直接关联负责设计师
 
 ### 3. 使用场景优化
@@ -866,5 +866,5 @@ const deliveries = await deliveryQuery.equalTo("project", projectId).find();
 // 一次查询获得所有空间设计产品
 const products = await productQuery.equalTo("project", projectId).find();
 // 每个product包含完整的space、quotation、requirements信息
-// 文件通过ProjectFile按fileCategory分类查询
+// 文件通过ProjectFile按category分类查询
 ```