|
@@ -113,6 +113,9 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
{ key: 'aftercare', label: '售后', stages: ['尾款结算', '客户评价', '投诉处理'] }
|
|
{ key: 'aftercare', label: '售后', stages: ['尾款结算', '客户评价', '投诉处理'] }
|
|
];
|
|
];
|
|
expandedSection: SectionKey | null = null;
|
|
expandedSection: SectionKey | null = null;
|
|
|
|
+
|
|
|
|
+ // 新增:进度下拉菜单状态
|
|
|
|
+ showProgressDropdown: boolean = false;
|
|
// 渲染异常反馈相关属性
|
|
// 渲染异常反馈相关属性
|
|
exceptionType: 'failed' | 'stuck' | 'quality' | 'other' = 'failed';
|
|
exceptionType: 'failed' | 'stuck' | 'quality' | 'other' = 'failed';
|
|
exceptionDescription: string = '';
|
|
exceptionDescription: string = '';
|
|
@@ -522,7 +525,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
}
|
|
}
|
|
|
|
|
|
// 计算当前激活板块:优先用户点击的 expandedSection;否则取当前阶段所属板块;再否则回退首个板块
|
|
// 计算当前激活板块:优先用户点击的 expandedSection;否则取当前阶段所属板块;再否则回退首个板块
|
|
- private getActiveSectionKey(): SectionKey {
|
|
|
|
|
|
+ getActiveSectionKey(): SectionKey {
|
|
if (this.expandedSection) return this.expandedSection;
|
|
if (this.expandedSection) return this.expandedSection;
|
|
const current = this.project?.currentStage as ProjectStage | undefined;
|
|
const current = this.project?.currentStage as ProjectStage | undefined;
|
|
return current ? this.getSectionKeyForStage(current) : this.sections[0].key;
|
|
return current ? this.getSectionKeyForStage(current) : this.sections[0].key;
|
|
@@ -1654,6 +1657,82 @@ export class ProjectDetail implements OnInit, OnDestroy {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 新增:切换进度下拉菜单显示状态
|
|
|
|
+ toggleProgressDropdown(event: Event): void {
|
|
|
|
+ event.stopPropagation();
|
|
|
|
+ this.showProgressDropdown = !this.showProgressDropdown;
|
|
|
|
+
|
|
|
|
+ // 点击其他地方时关闭下拉菜单
|
|
|
|
+ if (this.showProgressDropdown) {
|
|
|
|
+ const closeDropdown = (e: Event) => {
|
|
|
|
+ if (!((e.target as Element)?.closest('.progress-display'))) {
|
|
|
|
+ this.showProgressDropdown = false;
|
|
|
|
+ document.removeEventListener('click', closeDropdown);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ setTimeout(() => document.addEventListener('click', closeDropdown), 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 新增:跳转到指定板块
|
|
|
|
+ jumpToSection(key: SectionKey): void {
|
|
|
|
+ this.showProgressDropdown = false; // 关闭下拉菜单
|
|
|
|
+ this.toggleSection(key); // 使用现有的toggleSection方法
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 新增:获取板块状态文本
|
|
|
|
+ getSectionStatusText(key: SectionKey): string {
|
|
|
|
+ const status = this.getSectionStatus(key);
|
|
|
|
+ switch (status) {
|
|
|
|
+ case 'completed': return '已完成';
|
|
|
|
+ case 'active': return '进行中';
|
|
|
|
+ case 'pending': return '待开始';
|
|
|
|
+ default: return '未知';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 新增:获取板块进度百分比
|
|
|
|
+ getSectionProgress(key: SectionKey): number {
|
|
|
|
+ const section = this.sections.find(s => s.key === key);
|
|
|
|
+ if (!section) return 0;
|
|
|
|
+
|
|
|
|
+ const current = (this.currentStage || this.project?.currentStage) as ProjectStage | undefined;
|
|
|
|
+ if (!current) return 0;
|
|
|
|
+
|
|
|
|
+ // 获取当前阶段在整体流程中的权重
|
|
|
|
+ const stageWeights: Record<ProjectStage, number> = {
|
|
|
|
+ '订单创建': 10,
|
|
|
|
+ '需求沟通': 25,
|
|
|
|
+ '方案确认': 35,
|
|
|
|
+ '建模': 50,
|
|
|
|
+ '软装': 65,
|
|
|
|
+ '渲染': 75,
|
|
|
|
+ '后期': 85,
|
|
|
|
+ '尾款结算': 90,
|
|
|
|
+ '客户评价': 95,
|
|
|
|
+ '投诉处理': 100
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const currentWeight = stageWeights[current] || 0;
|
|
|
|
+ const status = this.getSectionStatus(key);
|
|
|
|
+
|
|
|
|
+ if (status === 'completed') {
|
|
|
|
+ return 100;
|
|
|
|
+ } else if (status === 'active') {
|
|
|
|
+ // 计算当前板块内的进度
|
|
|
|
+ const sectionStages = section.stages;
|
|
|
|
+ const currentStageIndex = sectionStages.indexOf(current);
|
|
|
|
+ if (currentStageIndex === -1) return 0;
|
|
|
|
+
|
|
|
|
+ // 基于阶段在板块内的位置计算进度
|
|
|
|
+ const baseProgress = Math.floor((currentStageIndex / sectionStages.length) * 100);
|
|
|
|
+ const stageProgress = Math.min(100, baseProgress + 25); // 每个阶段至少25%进度
|
|
|
|
+ return stageProgress;
|
|
|
|
+ } else {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// 阶段到锚点的映射
|
|
// 阶段到锚点的映射
|
|
stageToAnchor(stage: ProjectStage): string {
|
|
stageToAnchor(stage: ProjectStage): string {
|
|
const map: Record<ProjectStage, string> = {
|
|
const map: Record<ProjectStage, string> = {
|