|
@@ -1,12 +1,109 @@
|
|
import { Component } from '@angular/core';
|
|
import { Component } from '@angular/core';
|
|
|
|
+import { CommonNzModule } from '../../../../common.nz.module';
|
|
|
|
+import { PlanCardComponent } from './plan-card/plan-card.component';
|
|
|
|
+
|
|
|
|
+const notificationConfig = [
|
|
|
|
+ { type: 1, text: '通知', color: '#165DFF', backgroundColor: '#E8F3FF' },
|
|
|
|
+ { type: 2, text: '消息', color: '#0FC6C2', backgroundColor: '#E8FFFB' },
|
|
|
|
+];
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-inspection-plan',
|
|
selector: 'app-inspection-plan',
|
|
standalone: true,
|
|
standalone: true,
|
|
- imports: [],
|
|
|
|
|
|
+ imports: [CommonNzModule, PlanCardComponent],
|
|
templateUrl: './inspection-plan.component.html',
|
|
templateUrl: './inspection-plan.component.html',
|
|
- styleUrl: './inspection-plan.component.less'
|
|
|
|
|
|
+ styleUrl: './inspection-plan.component.less',
|
|
})
|
|
})
|
|
export class InspectionPlanComponent {
|
|
export class InspectionPlanComponent {
|
|
|
|
+ semiAnnualOptions = [
|
|
|
|
+ { label: '2023上半年度', value: 202301 },
|
|
|
|
+ { label: '2023下半年度', value: 202306 },
|
|
|
|
+ { label: '2024上半年度', value: 202401 },
|
|
|
|
+ { label: '2024下半年度', value: 202406 },
|
|
|
|
+ { label: '2025上半年度', value: 202501 },
|
|
|
|
+ ];
|
|
|
|
+ firstSection = [
|
|
|
|
+ { label: '日常隐患排查计划', value: 3, key: 'normal' },
|
|
|
|
+ { label: '专项隐患排查计划', value: 6, key: 'special' },
|
|
|
|
+ { label: '其他隐患排查计划', value: 9, key: 'other' },
|
|
|
|
+ ];
|
|
|
|
+ secondSection = [
|
|
|
|
+ { label: '计划站点排查覆盖', value: 65 },
|
|
|
|
+ { label: '其他场所排查覆盖', value: 100 },
|
|
|
|
+ { label: '计划人员排查占比', value: 95 },
|
|
|
|
+ ];
|
|
|
|
+ discovery = {
|
|
|
|
+ significant: 1,
|
|
|
|
+ a: 2,
|
|
|
|
+ b: 3,
|
|
|
|
+ c: 5,
|
|
|
|
+ };
|
|
|
|
+ notifications = [
|
|
|
|
+ {
|
|
|
|
+ type: 1,
|
|
|
|
+ title:
|
|
|
|
+ '当前产品试用期即将截止,在这段宝贵的试用时光里,您想必已经充分领略到了它的独特魅力与卓越性能。它犹如一位得力助手,在您的工作与生活中默默耕耘,助力您轻松跨越一道道难关,高效完成各项任务。无论是处理复杂的文档、分析海量的数据,还是畅享流畅的娱乐体验,它都表现得游刃有余',
|
|
|
|
+ createDate: '2024/6/16',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: 1,
|
|
|
|
+ title:
|
|
|
|
+ '1月新系统升级计划通知,为了给您提供更优质、高效、稳定的服务体验,提升系统性能与功能,我们计划于 1 月进行系统升级。现将相关事宜详细通知如下:',
|
|
|
|
+ createDate: '2024/10/16',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: 2,
|
|
|
|
+ title:
|
|
|
|
+ '新增内容已经通过审核,详情如下:此次审核涵盖了文本、图像、音频等多方面元素,确保了新增内容在质量与合规性上均达到了既定标准。文本部分,语言表达流畅自然,逻辑严谨清晰,无论是专业术语的运用还是普通语句的叙述,都经过了仔细的斟酌与校对,避免了歧义与错误信息的出现。',
|
|
|
|
+ createDate: '2024/11/4',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: 1,
|
|
|
|
+ title:
|
|
|
|
+ '1月新系统升级计划通知为了给您提供更优质、高效、稳定的服务体验,提升系统性能与功能,我们计划于 1 月进行系统升级。现将相关事宜详细通知如下:',
|
|
|
|
+ createDate: '2024/11/16',
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ currentPlanKey = 'special';
|
|
|
|
+ semiAnnualKey = 202406;
|
|
|
|
+ handlePlanTypeChange(type: string) {
|
|
|
|
+ this.currentPlanKey = type;
|
|
|
|
+ }
|
|
|
|
+ handleSemiAnnualChange(direction: 'left' | 'right') {
|
|
|
|
+ const index = this.currentSemiAnnualOptionIndex;
|
|
|
|
+ if (direction === 'left') {
|
|
|
|
+ if (!this.leftArrowVisible) return;
|
|
|
|
+ }
|
|
|
|
+ if (direction === 'right') {
|
|
|
|
+ if (!this.rightArrowVisible) return;
|
|
|
|
+ }
|
|
|
|
+ this.semiAnnualKey = this.semiAnnualOptions[index + (direction === 'left' ? -1 : 1)]?.value || 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ getNotificationTypeText(t: number) {
|
|
|
|
+ return notificationConfig.find(n => n.type === t)?.text || '未知';
|
|
|
|
+ }
|
|
|
|
+ getNotificationTypeColor(t: number) {
|
|
|
|
+ return notificationConfig.find(n => n.type === t)?.color || '';
|
|
|
|
+ }
|
|
|
|
+ getNotificationTypeBgColor(t: number) {
|
|
|
|
+ return notificationConfig.find(n => n.type === t)?.backgroundColor || '';
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ get currentSemiAnnualOptionIndex() {
|
|
|
|
+ return this.semiAnnualOptions.findIndex(se => se.value === this.semiAnnualKey);
|
|
|
|
+ }
|
|
|
|
+ get semiAnnualText() {
|
|
|
|
+ return this.semiAnnualOptions.find(se => se.value === this.semiAnnualKey)?.label || '';
|
|
|
|
+ }
|
|
|
|
+ get leftArrowVisible() {
|
|
|
|
+ const index = this.currentSemiAnnualOptionIndex;
|
|
|
|
+ if (index === -1) return false;
|
|
|
|
+ return !!this.semiAnnualOptions[index - 1];
|
|
|
|
+ }
|
|
|
|
+ get rightArrowVisible() {
|
|
|
|
+ const index = this.currentSemiAnnualOptionIndex;
|
|
|
|
+ if (index === -1) return false;
|
|
|
|
+ return !!this.semiAnnualOptions[index + 1];
|
|
|
|
+ }
|
|
}
|
|
}
|