|
@@ -25,8 +25,9 @@ import { QuotationDetailsComponent, QuotationData } from './components/quotation
|
|
|
import { DesignerAssignmentComponent, DesignerAssignmentData, Designer as AssignmentDesigner } from './components/designer-assignment/designer-assignment.component';
|
|
|
// 引入客户服务模块的设计师日历组件
|
|
|
import { DesignerCalendarComponent, Designer as CalendarDesigner, ProjectGroup as CalendarProjectGroup } from '../../customer-service/consultation-order/components/designer-calendar/designer-calendar.component';
|
|
|
+import { UploadSuccessModalComponent } from '../../../shared/components/upload-success-modal/upload-success-modal.component';
|
|
|
|
|
|
-import { ColorAnalysisResult } from '../../../shared/services/color-analysis.service';
|
|
|
+import { ColorAnalysisResult, ColorAnalysisService } from '../../../shared/services/color-analysis.service';
|
|
|
|
|
|
interface ExceptionHistory {
|
|
|
id: string;
|
|
@@ -263,7 +264,7 @@ interface DeliveryProcess {
|
|
|
@Component({
|
|
|
selector: 'app-project-detail',
|
|
|
standalone: true,
|
|
|
- imports: [CommonModule, FormsModule, ReactiveFormsModule, RequirementsConfirmCardComponent, SettlementCardComponent, CustomerReviewCardComponent, CustomerReviewFormComponent, ComplaintCardComponent, PanoramicSynthesisCardComponent, QuotationDetailsComponent, DesignerAssignmentComponent, DesignerCalendarComponent],
|
|
|
+ imports: [CommonModule, FormsModule, ReactiveFormsModule, RequirementsConfirmCardComponent, SettlementCardComponent, CustomerReviewCardComponent, CustomerReviewFormComponent, ComplaintCardComponent, PanoramicSynthesisCardComponent, QuotationDetailsComponent, DesignerAssignmentComponent, DesignerCalendarComponent, UploadSuccessModalComponent],
|
|
|
templateUrl: './project-detail.html',
|
|
|
styleUrls: ['./project-detail.scss', './debug-styles.scss', './horizontal-panel.scss']
|
|
|
})
|
|
@@ -334,6 +335,12 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
mappingIsAnalyzing: boolean = false;
|
|
|
mappingIsGeneratingMapping: boolean = false;
|
|
|
|
|
|
+ // 上传成功弹窗相关(从子组件移到父组件以解决定位问题)
|
|
|
+ showUploadSuccessModal = false;
|
|
|
+ uploadedFiles: { id: string; name: string; url: string; size?: number; type?: 'image' | 'cad' | 'text'; preview?: string }[] = [];
|
|
|
+ uploadType: 'image' | 'document' | 'mixed' = 'image';
|
|
|
+ isAnalyzingColors = false;
|
|
|
+
|
|
|
// 新增:9阶段顺序(串式流程)- 包含后期阶段
|
|
|
stageOrder: ProjectStage[] = ['订单创建', '需求沟通', '方案确认', '建模', '软装', '渲染', '后期', '尾款结算', '客户评价', '投诉处理'];
|
|
|
// 新增:阶段展开状态(默认全部收起,当前阶段在数据加载后自动展开)
|
|
@@ -495,7 +502,8 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
private fb: FormBuilder,
|
|
|
private cdr: ChangeDetectorRef,
|
|
|
private paymentVoucherService: PaymentVoucherRecognitionService,
|
|
|
- private projectReviewService: ProjectReviewService
|
|
|
+ private projectReviewService: ProjectReviewService,
|
|
|
+ private colorAnalysisService: ColorAnalysisService
|
|
|
) {}
|
|
|
|
|
|
// 切换标签页
|
|
@@ -5420,4 +5428,71 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
|
};
|
|
|
return nameMap[flow] || flow;
|
|
|
}
|
|
|
+
|
|
|
+ // 上传成功弹窗相关方法(从子组件移到父组件)
|
|
|
+ onModalClose(): void {
|
|
|
+ console.log('❌ 关闭弹窗被调用');
|
|
|
+ this.showUploadSuccessModal = false;
|
|
|
+ this.uploadedFiles = [];
|
|
|
+ this.colorAnalysisResult = null;
|
|
|
+ console.log('✅ 弹窗状态设置为:', this.showUploadSuccessModal);
|
|
|
+ }
|
|
|
+
|
|
|
+ onAnalyzeColors(): void {
|
|
|
+ if (this.uploadedFiles.length > 0 && this.uploadType === 'image') {
|
|
|
+ const imageFile = this.uploadedFiles[0];
|
|
|
+
|
|
|
+ // 设置分析状态为true
|
|
|
+ this.isAnalyzingColors = true;
|
|
|
+
|
|
|
+ // 从URL获取文件数据并创建File对象
|
|
|
+ fetch(imageFile.url)
|
|
|
+ .then(response => response.blob())
|
|
|
+ .then(blob => {
|
|
|
+ const file = new File([blob], imageFile.name, { type: 'image/jpeg' });
|
|
|
+
|
|
|
+ // 使用真实的颜色分析服务
|
|
|
+ this.colorAnalysisService.simulateAnalysis(file).subscribe({
|
|
|
+ next: (result) => {
|
|
|
+ this.colorAnalysisResult = result;
|
|
|
+ this.isAnalyzingColors = false;
|
|
|
+ console.log('✅ 颜色分析完成:', result);
|
|
|
+ },
|
|
|
+ error: (error) => {
|
|
|
+ console.error('❌ 颜色分析失败:', error);
|
|
|
+ this.isAnalyzingColors = false;
|
|
|
+ // 使用默认结果以避免一直加载
|
|
|
+ this.colorAnalysisResult = {
|
|
|
+ colors: [
|
|
|
+ { hex: '#FF6B6B', percentage: 40 },
|
|
|
+ { hex: '#4ECDC4', percentage: 35 },
|
|
|
+ { hex: '#45B7D1', percentage: 25 }
|
|
|
+ ],
|
|
|
+ originalImage: imageFile.url
|
|
|
+ } as ColorAnalysisResult;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error('❌ 获取文件数据失败:', error);
|
|
|
+ this.isAnalyzingColors = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ onViewReport(): void {
|
|
|
+ console.log('查看报告:', this.colorAnalysisResult);
|
|
|
+ // 可以在这里添加查看报告的逻辑
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理子组件的弹窗请求
|
|
|
+ onUploadModalRequested(event: any): void {
|
|
|
+ console.log('🎯 接收到弹窗请求:', event);
|
|
|
+ this.showUploadSuccessModal = event.show;
|
|
|
+ this.uploadedFiles = event.uploadedFiles || [];
|
|
|
+ this.uploadType = event.uploadType || 'image';
|
|
|
+ this.colorAnalysisResult = event.colorAnalysisResult;
|
|
|
+ this.isAnalyzingColors = event.isAnalyzing || false;
|
|
|
+ console.log('✅ 弹窗状态设置为:', this.showUploadSuccessModal);
|
|
|
+ }
|
|
|
}
|