|
@@ -1,6 +1,7 @@
|
|
|
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
|
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
|
|
import { CommonModule } from '@angular/common';
|
|
import { CommonModule } from '@angular/common';
|
|
|
import { FormsModule } from '@angular/forms';
|
|
import { FormsModule } from '@angular/forms';
|
|
|
|
|
+import { RouterModule } from '@angular/router';
|
|
|
import { ProjectSpaceDeliverableSummary, PhaseProgressInfo } from '../../services/project-space-deliverable.service';
|
|
import { ProjectSpaceDeliverableSummary, PhaseProgressInfo } from '../../services/project-space-deliverable.service';
|
|
|
import { PHASE_INFO, PhaseName } from '../../../../app/models/project-phase.model';
|
|
import { PHASE_INFO, PhaseName } from '../../../../app/models/project-phase.model';
|
|
|
|
|
|
|
@@ -21,13 +22,14 @@ import { PHASE_INFO, PhaseName } from '../../../../app/models/project-phase.mode
|
|
|
@Component({
|
|
@Component({
|
|
|
selector: 'app-project-progress-modal',
|
|
selector: 'app-project-progress-modal',
|
|
|
standalone: true,
|
|
standalone: true,
|
|
|
- imports: [CommonModule, FormsModule],
|
|
|
|
|
|
|
+ imports: [CommonModule, FormsModule, RouterModule],
|
|
|
templateUrl: './project-progress-modal.component.html',
|
|
templateUrl: './project-progress-modal.component.html',
|
|
|
styleUrl: './project-progress-modal.component.scss'
|
|
styleUrl: './project-progress-modal.component.scss'
|
|
|
})
|
|
})
|
|
|
export class ProjectProgressModalComponent implements OnInit {
|
|
export class ProjectProgressModalComponent implements OnInit {
|
|
|
@Input() summary: ProjectSpaceDeliverableSummary | null = null;
|
|
@Input() summary: ProjectSpaceDeliverableSummary | null = null;
|
|
|
@Input() visible: boolean = false;
|
|
@Input() visible: boolean = false;
|
|
|
|
|
+ @Input() companyId: string = ''; // 🆕 公司ID,用于项目详情页导航
|
|
|
@Output() close = new EventEmitter<void>();
|
|
@Output() close = new EventEmitter<void>();
|
|
|
@Output() reportIssue = new EventEmitter<string>(); // 提交问题,传递项目ID
|
|
@Output() reportIssue = new EventEmitter<string>(); // 提交问题,传递项目ID
|
|
|
|
|
|
|
@@ -131,5 +133,22 @@ export class ProjectProgressModalComponent implements OnInit {
|
|
|
if (!this.summary) return '加载中';
|
|
if (!this.summary) return '加载中';
|
|
|
return this.getPhaseStatusLabel(this.summary.overallCompletionRate);
|
|
return this.getPhaseStatusLabel(this.summary.overallCompletionRate);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 🆕 获取项目详情页路由
|
|
|
|
|
+ */
|
|
|
|
|
+ getProjectDetailRoute(): string[] {
|
|
|
|
|
+ if (!this.summary || !this.companyId) {
|
|
|
|
|
+ return [];
|
|
|
|
|
+ }
|
|
|
|
|
+ return ['/wxwork', this.companyId, 'project', this.summary.projectId];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 🆕 检查是否可以导航到项目详情页
|
|
|
|
|
+ */
|
|
|
|
|
+ canNavigateToProject(): boolean {
|
|
|
|
|
+ return !!(this.summary?.projectId && this.companyId);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|