Преглед изворни кода

feat(project-detail): 自动展开阶段面板并添加确认上传按钮

新增自动展开建模、软装和渲染阶段对应折叠面板的功能,优化用户体验
为各阶段添加确认上传按钮,方便用户提交对应内容
0235711 пре 2 дана
родитељ
комит
e363685ffd

+ 27 - 0
src/app/pages/designer/project-detail/project-detail.html

@@ -868,6 +868,15 @@
                                                   }
                                                 </div>
 
+                                                
+                                                <!-- 确认上传按钮 -->
+                                                @if (canEditSection('delivery') && (process.content[space.id]?.images?.length || 0) > 0) {
+                                                  <div class="upload-actions">
+                                                    <button class="primary-btn" (click)="confirmWhiteModelUpload()">
+                                                      确认上传
+                                                    </button>
+                                                  </div>
+                                                }
                                               </div>
                                             } @else if (process.type === 'softDecor') {
                                               <!-- 软装内容 -->
@@ -918,6 +927,15 @@
                                                     </div>
                                                   }
                                                 </div>
+                                                
+                                                <!-- 软装阶段确认上传按钮 -->
+                                                @if (canEditSection('delivery') && (process.content[space.id]?.images?.length || 0) > 0) {
+                                                  <div class="upload-actions">
+                                                    <button class="primary-btn" (click)="confirmSoftDecorUpload()">
+                                                      确认上传
+                                                    </button>
+                                                  </div>
+                                                }
                                               </div>
                                             } @else if (process.type === 'rendering') {
                                               <!-- 渲染内容 -->
@@ -992,6 +1010,15 @@
                                                     </div>
                                                   }
                                                 </div>
+                                                
+                                                <!-- 渲染阶段确认上传按钮 -->
+                                                @if (canEditSection('delivery') && (process.content[space.id]?.images?.length || 0) > 0) {
+                                                  <div class="upload-actions">
+                                                    <button class="primary-btn" (click)="confirmRenderUpload()">
+                                                      确认上传
+                                                    </button>
+                                                  </div>
+                                                }
                                               </div>
                                             }
                                           </div>

+ 39 - 0
src/app/pages/designer/project-detail/project-detail.ts

@@ -1030,6 +1030,28 @@ export class ProjectDetail implements OnInit, OnDestroy {
     const currentSec = this.getSectionKeyForStage(currentStage);
     this.expandedSection = currentSec;
     console.log('展开板块:', currentSec);
+    
+    // 新增:如果当前阶段是建模、软装或渲染,自动展开对应的折叠面板
+    if (currentStage === '建模' || currentStage === '软装' || currentStage === '渲染') {
+      const processTypeMap = {
+        '建模': 'modeling',
+        '软装': 'softDecor', 
+        '渲染': 'rendering'
+      };
+      const processType = processTypeMap[currentStage] as 'modeling' | 'softDecor' | 'rendering';
+      const targetProcess = this.deliveryProcesses.find(p => p.type === processType);
+      if (targetProcess) {
+        // 展开对应的流程面板
+        targetProcess.isExpanded = true;
+        // 展开第一个空间以便用户操作
+        if (targetProcess.spaces.length > 0) {
+          targetProcess.spaces[0].isExpanded = true;
+          // 关闭其他空间
+          targetProcess.spaces.slice(1).forEach(space => space.isExpanded = false);
+        }
+        console.log('自动展开折叠面板:', currentStage, processType);
+      }
+    }
   }
   
   // 整理项目详情
@@ -1142,6 +1164,23 @@ export class ProjectDetail implements OnInit, OnDestroy {
       // 更新板块展开状态
       const nextSection = this.getSectionKeyForStage(next);
       this.expandedSection = nextSection;
+      
+      // 新增:自动展开对应阶段的折叠面板
+      if (next === '软装' || next === '渲染') {
+        const processType = next === '软装' ? 'softDecor' : 'rendering';
+        const targetProcess = this.deliveryProcesses.find(p => p.type === processType);
+        if (targetProcess) {
+          // 展开对应的流程面板
+          targetProcess.isExpanded = true;
+          // 展开第一个空间以便用户操作
+          if (targetProcess.spaces.length > 0) {
+            targetProcess.spaces[0].isExpanded = true;
+            // 关闭其他空间
+            targetProcess.spaces.slice(1).forEach(space => space.isExpanded = false);
+          }
+        }
+      }
+      
       // 触发变更检测以更新导航栏颜色
       this.cdr.detectChanges();
     }