@dssp/dkpi 1.0.0-alpha.99 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +55 -55
- package/dist-client/bootstrap.d.ts +0 -9
- package/dist-client/bootstrap.js +0 -272
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/components/kpi-2d-lookup-chart.d.ts +0 -50
- package/dist-client/components/kpi-2d-lookup-chart.js +0 -263
- package/dist-client/components/kpi-2d-lookup-chart.js.map +0 -1
- package/dist-client/components/kpi-boxplot-chart.d.ts +0 -31
- package/dist-client/components/kpi-boxplot-chart.js +0 -306
- package/dist-client/components/kpi-boxplot-chart.js.map +0 -1
- package/dist-client/components/kpi-lookup-chart.d.ts +0 -58
- package/dist-client/components/kpi-lookup-chart.js +0 -464
- package/dist-client/components/kpi-lookup-chart.js.map +0 -1
- package/dist-client/components/kpi-mini-trend-chart.d.ts +0 -14
- package/dist-client/components/kpi-mini-trend-chart.js +0 -180
- package/dist-client/components/kpi-mini-trend-chart.js.map +0 -1
- package/dist-client/components/kpi-radar-chart.d.ts +0 -17
- package/dist-client/components/kpi-radar-chart.js +0 -259
- package/dist-client/components/kpi-radar-chart.js.map +0 -1
- package/dist-client/components/kpi-single-boxplot-chart.d.ts +0 -36
- package/dist-client/components/kpi-single-boxplot-chart.js +0 -417
- package/dist-client/components/kpi-single-boxplot-chart.js.map +0 -1
- package/dist-client/components/kpi-step-lookup-chart.d.ts +0 -33
- package/dist-client/components/kpi-step-lookup-chart.js +0 -181
- package/dist-client/components/kpi-step-lookup-chart.js.map +0 -1
- package/dist-client/components/kpi-trend-chart.d.ts +0 -25
- package/dist-client/components/kpi-trend-chart.js +0 -241
- package/dist-client/components/kpi-trend-chart.js.map +0 -1
- package/dist-client/components/sv-pagenation-control.d.ts +0 -18
- package/dist-client/components/sv-pagenation-control.js +0 -142
- package/dist-client/components/sv-pagenation-control.js.map +0 -1
- package/dist-client/entries/auth/checkin.d.ts +0 -38
- package/dist-client/entries/auth/checkin.js +0 -551
- package/dist-client/entries/auth/checkin.js.map +0 -1
- package/dist-client/entries/public/home.d.ts +0 -8
- package/dist-client/entries/public/home.js +0 -97
- package/dist-client/entries/public/home.js.map +0 -1
- package/dist-client/google-map/common-google-map.d.ts +0 -35
- package/dist-client/google-map/common-google-map.js +0 -349
- package/dist-client/google-map/common-google-map.js.map +0 -1
- package/dist-client/google-map/google-map-loader.d.ts +0 -6
- package/dist-client/google-map/google-map-loader.js +0 -23
- package/dist-client/google-map/google-map-loader.js.map +0 -1
- package/dist-client/icons/menu-icons.d.ts +0 -11
- package/dist-client/icons/menu-icons.js +0 -126
- package/dist-client/icons/menu-icons.js.map +0 -1
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +0 -2
- package/dist-client/index.js.map +0 -1
- package/dist-client/menu.d.ts +0 -23
- package/dist-client/menu.js +0 -59
- package/dist-client/menu.js.map +0 -1
- package/dist-client/pages/component/project-update-header.d.ts +0 -1
- package/dist-client/pages/component/project-update-header.js +0 -127
- package/dist-client/pages/component/project-update-header.js.map +0 -1
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.d.ts +0 -22
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js +0 -57
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js.map +0 -1
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.d.ts +0 -47
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.js +0 -393
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.js.map +0 -1
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.d.ts +0 -20
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js +0 -445
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js.map +0 -1
- package/dist-client/pages/kpi-admin/kpi-system-guide.d.ts +0 -18
- package/dist-client/pages/kpi-admin/kpi-system-guide.js +0 -696
- package/dist-client/pages/kpi-admin/kpi-system-guide.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +0 -18
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +0 -259
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +0 -22
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +0 -346
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +0 -26
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +0 -433
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.d.ts +0 -8
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js +0 -78
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +0 -46
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +0 -945
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +0 -34
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +0 -238
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.d.ts +0 -37
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +0 -689
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +0 -18
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +0 -131
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +0 -57
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +0 -866
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +0 -63
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +0 -1097
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +0 -12
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +0 -82
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +0 -11
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +0 -65
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +0 -13
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +0 -115
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +0 -15
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +0 -147
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +0 -1
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +0 -7
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +0 -86
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +0 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +0 -57
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +0 -719
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +0 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.d.ts +0 -23
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js +0 -76
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js.map +0 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +0 -68
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +0 -394
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +0 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.d.ts +0 -12
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +0 -174
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +0 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +0 -40
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +0 -190
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +0 -1
- package/dist-client/pages/kpi-value/kpi-value-importer.d.ts +0 -23
- package/dist-client/pages/kpi-value/kpi-value-importer.js +0 -93
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +0 -1
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +0 -71
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +0 -454
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +0 -1
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.d.ts +0 -69
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js +0 -790
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js.map +0 -1
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.d.ts +0 -22
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js +0 -344
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js.map +0 -1
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.d.ts +0 -21
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js +0 -335
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js.map +0 -1
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.d.ts +0 -51
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js +0 -674
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js.map +0 -1
- package/dist-client/pages/sv-project-complete.d.ts +0 -31
- package/dist-client/pages/sv-project-complete.js +0 -359
- package/dist-client/pages/sv-project-complete.js.map +0 -1
- package/dist-client/pages/sv-project-completed-list.d.ts +0 -27
- package/dist-client/pages/sv-project-completed-list.js +0 -416
- package/dist-client/pages/sv-project-completed-list.js.map +0 -1
- package/dist-client/pages/sv-project-detail.d.ts +0 -73
- package/dist-client/pages/sv-project-detail.js +0 -1501
- package/dist-client/pages/sv-project-detail.js.map +0 -1
- package/dist-client/pages/sv-project-list.d.ts +0 -175
- package/dist-client/pages/sv-project-list.js +0 -581
- package/dist-client/pages/sv-project-list.js.map +0 -1
- package/dist-client/pages/sv-project-update.d.ts +0 -91
- package/dist-client/pages/sv-project-update.js +0 -1150
- package/dist-client/pages/sv-project-update.js.map +0 -1
- package/dist-client/pages/sv-user-management.d.ts +0 -6
- package/dist-client/pages/sv-user-management.js +0 -224
- package/dist-client/pages/sv-user-management.js.map +0 -1
- package/dist-client/route.d.ts +0 -1
- package/dist-client/route.js +0 -58
- package/dist-client/route.js.map +0 -1
- package/dist-client/shared/complete-api.d.ts +0 -45
- package/dist-client/shared/complete-api.js +0 -272
- package/dist-client/shared/complete-api.js.map +0 -1
- package/dist-client/shared/func.d.ts +0 -2
- package/dist-client/shared/func.js +0 -22
- package/dist-client/shared/func.js.map +0 -1
- package/dist-client/shared/geo-group-mapping.d.ts +0 -25
- package/dist-client/shared/geo-group-mapping.js +0 -189
- package/dist-client/shared/geo-group-mapping.js.map +0 -1
- package/dist-client/shared/integration-fetch.d.ts +0 -35
- package/dist-client/shared/integration-fetch.js +0 -53
- package/dist-client/shared/integration-fetch.js.map +0 -1
- package/dist-client/shared/kpi-project-sync.d.ts +0 -16
- package/dist-client/shared/kpi-project-sync.js +0 -129
- package/dist-client/shared/kpi-project-sync.js.map +0 -1
- package/dist-client/themes/dark.css +0 -51
- package/dist-client/themes/light.css +0 -51
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/viewparts/menu-tools.d.ts +0 -62
- package/dist-client/viewparts/menu-tools.js +0 -554
- package/dist-client/viewparts/menu-tools.js.map +0 -1
- package/dist-client/viewparts/user-circle.d.ts +0 -5
- package/dist-client/viewparts/user-circle.js +0 -26
- package/dist-client/viewparts/user-circle.js.map +0 -1
- package/dist-server/index.d.ts +0 -2
- package/dist-server/index.js +0 -6
- package/dist-server/index.js.map +0 -1
- package/dist-server/migrations/index.d.ts +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/scripts/calculate-kpi-scores.d.ts +0 -10
- package/dist-server/scripts/calculate-kpi-scores.js +0 -333
- package/dist-server/scripts/calculate-kpi-scores.js.map +0 -1
- package/dist-server/scripts/load-grade-data-migration.d.ts +0 -14
- package/dist-server/scripts/load-grade-data-migration.js +0 -279
- package/dist-server/scripts/load-grade-data-migration.js.map +0 -1
- package/dist-server/scripts/propagate-parent-kpi-values.d.ts +0 -14
- package/dist-server/scripts/propagate-parent-kpi-values.js +0 -786
- package/dist-server/scripts/propagate-parent-kpi-values.js.map +0 -1
- package/dist-server/scripts/recalculate-by-project-name.d.ts +0 -2
- package/dist-server/scripts/recalculate-by-project-name.js +0 -72
- package/dist-server/scripts/recalculate-by-project-name.js.map +0 -1
- package/dist-server/service/index.d.ts +0 -4
- package/dist-server/service/index.js +0 -20
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/service/kpi-metric-value/index.d.ts +0 -4
- package/dist-server/service/kpi-metric-value/index.js +0 -8
- package/dist-server/service/kpi-metric-value/index.js.map +0 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +0 -171
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +0 -993
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +0 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.d.ts +0 -12
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +0 -56
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +0 -1
- package/dist-server/service/kpi-stat/index.d.ts +0 -4
- package/dist-server/service/kpi-stat/index.js +0 -8
- package/dist-server/service/kpi-stat/index.js.map +0 -1
- package/dist-server/service/kpi-stat/kpi-stat-query.d.ts +0 -13
- package/dist-server/service/kpi-stat/kpi-stat-query.js +0 -751
- package/dist-server/service/kpi-stat/kpi-stat-query.js.map +0 -1
- package/dist-server/service/kpi-stat/kpi-stat-types.d.ts +0 -32
- package/dist-server/service/kpi-stat/kpi-stat-types.js +0 -180
- package/dist-server/service/kpi-stat/kpi-stat-types.js.map +0 -1
- package/dist-server/service/kpi-value/index.d.ts +0 -3
- package/dist-server/service/kpi-value/index.js +0 -7
- package/dist-server/service/kpi-value/index.js.map +0 -1
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +0 -8
- package/dist-server/service/kpi-value/kpi-value-query.js +0 -90
- package/dist-server/service/kpi-value/kpi-value-query.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
|
@@ -1,1097 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { html, css, nothing } from 'lit';
|
|
3
|
-
import { customElement } from 'lit/decorators.js';
|
|
4
|
-
import { PageView } from '@operato/shell';
|
|
5
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
6
|
-
import { client } from '@operato/graphql';
|
|
7
|
-
import gql from 'graphql-tag';
|
|
8
|
-
import { state } from 'lit/decorators.js';
|
|
9
|
-
import '@material/web/icon/icon.js';
|
|
10
|
-
import './kpi-performance-summary';
|
|
11
|
-
import './kpi-grade-visualization';
|
|
12
|
-
import './kpi-history-viewer';
|
|
13
|
-
import './kpi-list-summary';
|
|
14
|
-
import './kpi-value-entry';
|
|
15
|
-
import './kpi-alert-panel';
|
|
16
|
-
import '../../components/kpi-radar-chart';
|
|
17
|
-
import '../../components/kpi-boxplot-chart';
|
|
18
|
-
// 3레벨 KPI 플로팅 컴포넌트들
|
|
19
|
-
import './cards/kpi-level1-card';
|
|
20
|
-
import './cards/kpi-level2-comparison';
|
|
21
|
-
import './cards/kpi-level3-comparison';
|
|
22
|
-
let KpiDashboardPage = class KpiDashboardPage extends PageView {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.categories = [];
|
|
26
|
-
this.loading = true;
|
|
27
|
-
this.error = '';
|
|
28
|
-
this.alerts = [];
|
|
29
|
-
this.showHistoryModal = false;
|
|
30
|
-
this.modalHistories = [];
|
|
31
|
-
this.modalKpiName = '';
|
|
32
|
-
this.kpiStatistics = []; // 실제 KPI 통계 데이터
|
|
33
|
-
this.statisticsLoading = true; // 통계 데이터 로딩 상태
|
|
34
|
-
this.selectedPeriodType = 'MONTH'; // 선택된 기간 타입 (MONTH로 고정)
|
|
35
|
-
this.selectedValueDate = ''; // 선택된 값 날짜
|
|
36
|
-
this.selectedSectorType = ''; // 공공/민간 필터
|
|
37
|
-
this.selectedBuildingUsage = ''; // 주거/비주거 필터
|
|
38
|
-
}
|
|
39
|
-
// 샘플 데이터
|
|
40
|
-
get sampleCategories() {
|
|
41
|
-
return ['생산성', '품질', '안전', '환경', '비용', '일정'];
|
|
42
|
-
}
|
|
43
|
-
get sampleGroups() {
|
|
44
|
-
return ['A', 'B', 'C'];
|
|
45
|
-
}
|
|
46
|
-
get sampleSeriesData() {
|
|
47
|
-
// 각 카테고리별로 10개 이상의 다양한 값(평균, 분산, 이상치 포함)
|
|
48
|
-
// 생산성: 평균 높고 분산 큼, 이상치 포함
|
|
49
|
-
const 생산성 = [95, 92, 90, 88, 85, 80, 78, 75, 70, 60, 100]; // 100은 이상치
|
|
50
|
-
// 품질: 평균 높고 분산 작음
|
|
51
|
-
const 품질 = [90, 89, 88, 87, 86, 85, 84, 83, 82, 80, 70];
|
|
52
|
-
// 안전: 평균 중간, 이상치 포함
|
|
53
|
-
const 안전 = [92, 91, 90, 89, 88, 87, 86, 85, 84, 65, 60]; // 60은 이상치
|
|
54
|
-
// 환경: 낮은 값에 몰림, 분산 큼
|
|
55
|
-
const 환경 = [95, 90, 85, 80, 75, 70, 65, 60, 60, 60, 55];
|
|
56
|
-
// 비용: 전체적으로 낮음, 이상치 포함
|
|
57
|
-
const 비용 = [80, 78, 76, 74, 72, 70, 68, 66, 64, 62, 50]; // 50은 이상치
|
|
58
|
-
// 일정: 분산 큼, 이상치 포함
|
|
59
|
-
const 일정 = [90, 88, 86, 84, 82, 80, 78, 76, 74, 60, 100]; // 100은 이상치
|
|
60
|
-
const categories = this.sampleCategories;
|
|
61
|
-
const groups = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'];
|
|
62
|
-
const all = [];
|
|
63
|
-
categories.forEach((cat, i) => {
|
|
64
|
-
let arr = [];
|
|
65
|
-
switch (cat) {
|
|
66
|
-
case '생산성':
|
|
67
|
-
arr = 생산성;
|
|
68
|
-
break;
|
|
69
|
-
case '품질':
|
|
70
|
-
arr = 품질;
|
|
71
|
-
break;
|
|
72
|
-
case '안전':
|
|
73
|
-
arr = 안전;
|
|
74
|
-
break;
|
|
75
|
-
case '환경':
|
|
76
|
-
arr = 환경;
|
|
77
|
-
break;
|
|
78
|
-
case '비용':
|
|
79
|
-
arr = 비용;
|
|
80
|
-
break;
|
|
81
|
-
case '일정':
|
|
82
|
-
arr = 일정;
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
arr.forEach((v, idx) => {
|
|
86
|
-
var _a;
|
|
87
|
-
all.push({ group: (_a = groups[idx]) !== null && _a !== void 0 ? _a : `G${idx + 1}`, category: cat, value: v });
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
return all;
|
|
91
|
-
}
|
|
92
|
-
get sampleRadarData() {
|
|
93
|
-
// 카테고리별로 min, max, avg, A(자신의 그룹)만 반환
|
|
94
|
-
const categories = this.sampleCategories;
|
|
95
|
-
const data = this.sampleSeriesData;
|
|
96
|
-
const minData = { group: 'Min' };
|
|
97
|
-
const maxData = { group: 'Max' };
|
|
98
|
-
const avgData = { group: 'Avg' };
|
|
99
|
-
const aData = { group: 'A' };
|
|
100
|
-
categories.forEach(category => {
|
|
101
|
-
var _a, _b;
|
|
102
|
-
const values = data.filter(d => d.category === category).map(d => d.value);
|
|
103
|
-
minData[category] = Math.min(...values);
|
|
104
|
-
maxData[category] = Math.max(...values);
|
|
105
|
-
avgData[category] = values.reduce((a, b) => a + b, 0) / values.length;
|
|
106
|
-
aData[category] = (_b = (_a = data.find(d => d.category === category && d.org === 'A')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : avgData[category];
|
|
107
|
-
});
|
|
108
|
-
// kpi-radar-chart가 기대하는 구조로 변환: [{org, category, value} ...]
|
|
109
|
-
const result = [];
|
|
110
|
-
categories.forEach(category => {
|
|
111
|
-
result.push({ org: 'Min', category, value: minData[category] });
|
|
112
|
-
result.push({ org: 'Max', category, value: maxData[category] });
|
|
113
|
-
result.push({ org: 'Avg', category, value: avgData[category] });
|
|
114
|
-
result.push({ org: 'A', category, value: aData[category] });
|
|
115
|
-
});
|
|
116
|
-
return result;
|
|
117
|
-
}
|
|
118
|
-
get sampleRadarCategories() {
|
|
119
|
-
return this.sampleCategories;
|
|
120
|
-
}
|
|
121
|
-
get sampleRadarGroups() {
|
|
122
|
-
return this.sampleGroups;
|
|
123
|
-
}
|
|
124
|
-
get sampleBoxplotData() {
|
|
125
|
-
// 카테고리별로 그룹별 value의 분포 계산
|
|
126
|
-
const categories = this.sampleCategories;
|
|
127
|
-
const data = this.sampleSeriesData;
|
|
128
|
-
return categories.map(category => {
|
|
129
|
-
var _a, _b;
|
|
130
|
-
const values = data.filter(d => d.category === category).map(d => d.value);
|
|
131
|
-
const sorted = [...values].sort((a, b) => a - b);
|
|
132
|
-
const min = sorted[0];
|
|
133
|
-
const max = sorted[sorted.length - 1];
|
|
134
|
-
const mean = values.reduce((a, b) => a + b, 0) / values.length;
|
|
135
|
-
const median = sorted.length % 2 === 0
|
|
136
|
-
? (sorted[sorted.length / 2 - 1] + sorted[sorted.length / 2]) / 2
|
|
137
|
-
: sorted[Math.floor(sorted.length / 2)];
|
|
138
|
-
const q1 = sorted[Math.floor(sorted.length / 4)];
|
|
139
|
-
const q3 = sorted[Math.floor((sorted.length * 3) / 4)];
|
|
140
|
-
// value: A그룹의 실제값(강조)
|
|
141
|
-
const value = (_b = (_a = data.find(d => d.category === category && d.org === 'A')) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : mean;
|
|
142
|
-
return {
|
|
143
|
-
org: category, // x축: 카테고리
|
|
144
|
-
min,
|
|
145
|
-
q1,
|
|
146
|
-
median,
|
|
147
|
-
q3,
|
|
148
|
-
max,
|
|
149
|
-
mean,
|
|
150
|
-
value
|
|
151
|
-
};
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
get sampleBoxplotGroups() {
|
|
155
|
-
return this.sampleCategories;
|
|
156
|
-
}
|
|
157
|
-
get sampleCurrentGroup() {
|
|
158
|
-
return 'A';
|
|
159
|
-
}
|
|
160
|
-
// 현재 월을 YYYY-MM 형식으로 반환
|
|
161
|
-
get currentMonth() {
|
|
162
|
-
const now = new Date();
|
|
163
|
-
const year = now.getFullYear();
|
|
164
|
-
const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
165
|
-
return `${year}-${month}`;
|
|
166
|
-
}
|
|
167
|
-
// 필터링된 KPI 통계 데이터
|
|
168
|
-
get filteredKpiStatistics() {
|
|
169
|
-
if (!this.kpiStatistics || this.kpiStatistics.length === 0)
|
|
170
|
-
return [];
|
|
171
|
-
return this.kpiStatistics.filter(stat => stat.periodType === 'MONTH' && stat.valueDate === this.selectedValueDate);
|
|
172
|
-
}
|
|
173
|
-
// 사용 가능한 기간 타입들 (MONTH로 고정)
|
|
174
|
-
get availablePeriodTypes() {
|
|
175
|
-
return ['MONTH'];
|
|
176
|
-
}
|
|
177
|
-
// MONTH 기간에 사용 가능한 날짜들
|
|
178
|
-
get availableValueDates() {
|
|
179
|
-
if (!this.kpiStatistics || this.kpiStatistics.length === 0)
|
|
180
|
-
return [];
|
|
181
|
-
const valueDates = new Set();
|
|
182
|
-
this.kpiStatistics.forEach(stat => {
|
|
183
|
-
if (stat.periodType === 'MONTH' && stat.valueDate) {
|
|
184
|
-
valueDates.add(stat.valueDate);
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
return Array.from(valueDates).sort().reverse(); // 최신 날짜부터 정렬
|
|
188
|
-
}
|
|
189
|
-
// 통계 요약 정보
|
|
190
|
-
get statisticsSummary() {
|
|
191
|
-
const filteredStats = this.filteredKpiStatistics;
|
|
192
|
-
if (filteredStats.length === 0)
|
|
193
|
-
return null;
|
|
194
|
-
const totalKpis = filteredStats.length;
|
|
195
|
-
const categories = new Set(filteredStats.map(s => { var _a, _b; return (_b = (_a = s.kpi) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.name; }).filter(Boolean));
|
|
196
|
-
const totalCategories = categories.size;
|
|
197
|
-
const means = filteredStats.map(s => s.mean || 0).filter(v => v > 0);
|
|
198
|
-
const medians = filteredStats.map(s => s.median || 0).filter(v => v > 0);
|
|
199
|
-
const stdDevs = filteredStats.map(s => s.standardDeviation || 0).filter(v => v > 0);
|
|
200
|
-
const avgMean = means.length > 0 ? means.reduce((a, b) => a + b, 0) / means.length : 0;
|
|
201
|
-
const avgMedian = medians.length > 0 ? medians.reduce((a, b) => a + b, 0) / medians.length : 0;
|
|
202
|
-
const avgStdDev = stdDevs.length > 0 ? stdDevs.reduce((a, b) => a + b, 0) / stdDevs.length : 0;
|
|
203
|
-
return {
|
|
204
|
-
totalKpis,
|
|
205
|
-
totalCategories,
|
|
206
|
-
avgMean: avgMean.toFixed(2),
|
|
207
|
-
avgMedian: avgMedian.toFixed(2),
|
|
208
|
-
avgStdDev: avgStdDev.toFixed(2),
|
|
209
|
-
periodType: this.selectedPeriodType,
|
|
210
|
-
valueDate: this.selectedValueDate
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
// 기간 타입 변경 핸들러 (사용하지 않음 - MONTH로 고정)
|
|
214
|
-
_onPeriodTypeChange(event) {
|
|
215
|
-
// MONTH로 고정되어 있으므로 변경하지 않음
|
|
216
|
-
}
|
|
217
|
-
// 날짜 변경 핸들러
|
|
218
|
-
_onValueDateChange(event) {
|
|
219
|
-
const target = event.target;
|
|
220
|
-
this.selectedValueDate = target.value;
|
|
221
|
-
}
|
|
222
|
-
_onSectorTypeChange(event) {
|
|
223
|
-
const target = event.target;
|
|
224
|
-
this.selectedSectorType = target.value;
|
|
225
|
-
}
|
|
226
|
-
_onBuildingUsageChange(event) {
|
|
227
|
-
const target = event.target;
|
|
228
|
-
this.selectedBuildingUsage = target.value;
|
|
229
|
-
}
|
|
230
|
-
// 실제 KPI 통계 데이터를 기반으로 한 레이더 차트 데이터
|
|
231
|
-
get realKpiRadarData() {
|
|
232
|
-
const filteredStats = this.filteredKpiStatistics;
|
|
233
|
-
if (filteredStats.length === 0)
|
|
234
|
-
return [];
|
|
235
|
-
// 카테고리별로 통계 데이터 그룹화
|
|
236
|
-
const categoryStats = new Map();
|
|
237
|
-
filteredStats.forEach(stat => {
|
|
238
|
-
var _a, _b;
|
|
239
|
-
if ((_b = (_a = stat.kpi) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.name) {
|
|
240
|
-
const categoryName = stat.kpi.category.name;
|
|
241
|
-
if (!categoryStats.has(categoryName)) {
|
|
242
|
-
categoryStats.set(categoryName, []);
|
|
243
|
-
}
|
|
244
|
-
categoryStats.get(categoryName).push(stat);
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
// 각 카테고리별로 평균, 중앙값, 표준편차 계산
|
|
248
|
-
const result = [];
|
|
249
|
-
const categories = Array.from(categoryStats.keys());
|
|
250
|
-
categories.forEach(category => {
|
|
251
|
-
const stats = categoryStats.get(category);
|
|
252
|
-
const means = stats.map(s => s.mean || 0).filter(v => v > 0);
|
|
253
|
-
const medians = stats.map(s => s.median || 0).filter(v => v > 0);
|
|
254
|
-
const stdDevs = stats.map(s => s.standardDeviation || 0).filter(v => v > 0);
|
|
255
|
-
if (means.length > 0) {
|
|
256
|
-
result.push({ group: '평균', category, value: means.reduce((a, b) => a + b, 0) / means.length });
|
|
257
|
-
}
|
|
258
|
-
if (medians.length > 0) {
|
|
259
|
-
result.push({ group: '중앙값', category, value: medians.reduce((a, b) => a + b, 0) / medians.length });
|
|
260
|
-
}
|
|
261
|
-
if (stdDevs.length > 0) {
|
|
262
|
-
result.push({ group: '표준편차', category, value: stdDevs.reduce((a, b) => a + b, 0) / stdDevs.length });
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
return result;
|
|
266
|
-
}
|
|
267
|
-
get realKpiRadarCategories() {
|
|
268
|
-
const filteredStats = this.filteredKpiStatistics;
|
|
269
|
-
if (filteredStats.length === 0)
|
|
270
|
-
return [];
|
|
271
|
-
const categories = new Set();
|
|
272
|
-
filteredStats.forEach(stat => {
|
|
273
|
-
var _a, _b;
|
|
274
|
-
if ((_b = (_a = stat.kpi) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.name) {
|
|
275
|
-
categories.add(stat.kpi.category.name);
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
return Array.from(categories);
|
|
279
|
-
}
|
|
280
|
-
get realKpiRadarGroups() {
|
|
281
|
-
return ['평균', '중앙값', '표준편차'];
|
|
282
|
-
}
|
|
283
|
-
// 실제 KPI 통계 데이터를 기반으로 한 박스플롯 데이터
|
|
284
|
-
get realKpiBoxplotData() {
|
|
285
|
-
const filteredStats = this.filteredKpiStatistics;
|
|
286
|
-
if (filteredStats.length === 0)
|
|
287
|
-
return [];
|
|
288
|
-
// 카테고리별로 통계 데이터 그룹화
|
|
289
|
-
const categoryStats = new Map();
|
|
290
|
-
filteredStats.forEach(stat => {
|
|
291
|
-
var _a, _b;
|
|
292
|
-
if ((_b = (_a = stat.kpi) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.name) {
|
|
293
|
-
const categoryName = stat.kpi.category.name;
|
|
294
|
-
if (!categoryStats.has(categoryName)) {
|
|
295
|
-
categoryStats.set(categoryName, []);
|
|
296
|
-
}
|
|
297
|
-
categoryStats.get(categoryName).push(stat);
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
const result = [];
|
|
301
|
-
const categories = Array.from(categoryStats.keys());
|
|
302
|
-
categories.forEach(category => {
|
|
303
|
-
const stats = categoryStats.get(category);
|
|
304
|
-
// 각 KPI의 통계값들을 수집
|
|
305
|
-
const allMeans = stats.map(s => s.mean || 0).filter(v => v > 0);
|
|
306
|
-
const allMedians = stats.map(s => s.median || 0).filter(v => v > 0);
|
|
307
|
-
const allMins = stats.map(s => s.minimum || 0).filter(v => v > 0);
|
|
308
|
-
const allMaxs = stats.map(s => s.maximum || 0).filter(v => v > 0);
|
|
309
|
-
const allQ1s = stats.map(s => s.percentile25 || 0).filter(v => v > 0);
|
|
310
|
-
const allQ3s = stats.map(s => s.percentile75 || 0).filter(v => v > 0);
|
|
311
|
-
if (allMeans.length > 0) {
|
|
312
|
-
const sortedMeans = [...allMeans].sort((a, b) => a - b);
|
|
313
|
-
const min = sortedMeans[0];
|
|
314
|
-
const max = sortedMeans[sortedMeans.length - 1];
|
|
315
|
-
const mean = allMeans.reduce((a, b) => a + b, 0) / allMeans.length;
|
|
316
|
-
const median = allMedians.length > 0 ? allMedians.reduce((a, b) => a + b, 0) / allMedians.length : mean;
|
|
317
|
-
const q1 = sortedMeans[Math.floor(sortedMeans.length / 4)];
|
|
318
|
-
const q3 = sortedMeans[Math.floor((sortedMeans.length * 3) / 4)];
|
|
319
|
-
result.push({
|
|
320
|
-
group: category,
|
|
321
|
-
min,
|
|
322
|
-
q1,
|
|
323
|
-
median,
|
|
324
|
-
q3,
|
|
325
|
-
max,
|
|
326
|
-
mean,
|
|
327
|
-
value: mean // 현재 값으로 평균 사용
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
return result;
|
|
332
|
-
}
|
|
333
|
-
get realKpiBoxplotGroups() {
|
|
334
|
-
const filteredStats = this.filteredKpiStatistics;
|
|
335
|
-
if (filteredStats.length === 0)
|
|
336
|
-
return [];
|
|
337
|
-
const categories = new Set();
|
|
338
|
-
filteredStats.forEach(stat => {
|
|
339
|
-
var _a, _b;
|
|
340
|
-
if ((_b = (_a = stat.kpi) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.name) {
|
|
341
|
-
categories.add(stat.kpi.category.name);
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
return Array.from(categories);
|
|
345
|
-
}
|
|
346
|
-
get realKpiCurrentGroup() {
|
|
347
|
-
return '평균';
|
|
348
|
-
}
|
|
349
|
-
connectedCallback() {
|
|
350
|
-
super.connectedCallback();
|
|
351
|
-
this.fetchCategories();
|
|
352
|
-
this.fetchKpiStatistics();
|
|
353
|
-
}
|
|
354
|
-
pageUpdated(changes, lifecycle) {
|
|
355
|
-
if (this.active) {
|
|
356
|
-
this.fetchCategories();
|
|
357
|
-
this.fetchKpiStatistics();
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
async fetchCategories() {
|
|
361
|
-
this.loading = true;
|
|
362
|
-
this.error = '';
|
|
363
|
-
try {
|
|
364
|
-
const response = await client.query({
|
|
365
|
-
query: gql `
|
|
366
|
-
query {
|
|
367
|
-
kpiCategories: kpisLevel1 {
|
|
368
|
-
id
|
|
369
|
-
name
|
|
370
|
-
kpis: children {
|
|
371
|
-
id
|
|
372
|
-
name
|
|
373
|
-
value {
|
|
374
|
-
value
|
|
375
|
-
valueDate
|
|
376
|
-
}
|
|
377
|
-
targetValue
|
|
378
|
-
unit
|
|
379
|
-
grades
|
|
380
|
-
vizType
|
|
381
|
-
vizMeta
|
|
382
|
-
histories(limit: 1) {
|
|
383
|
-
version
|
|
384
|
-
updatedAt
|
|
385
|
-
updater {
|
|
386
|
-
name
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
kpiAlerts {
|
|
392
|
-
id
|
|
393
|
-
kpi {
|
|
394
|
-
id
|
|
395
|
-
}
|
|
396
|
-
message
|
|
397
|
-
level
|
|
398
|
-
createdAt
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
`
|
|
402
|
-
});
|
|
403
|
-
this.categories = response.data.kpiCategories || [];
|
|
404
|
-
this.alerts = response.data.kpiAlerts || [];
|
|
405
|
-
}
|
|
406
|
-
catch (e) {
|
|
407
|
-
this.error = 'KPI 카테고리 데이터를 불러오지 못했습니다.';
|
|
408
|
-
}
|
|
409
|
-
finally {
|
|
410
|
-
this.loading = false;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
async fetchKpiStatistics() {
|
|
414
|
-
this.statisticsLoading = true;
|
|
415
|
-
try {
|
|
416
|
-
const response = await client.query({
|
|
417
|
-
query: gql `
|
|
418
|
-
query {
|
|
419
|
-
kpiStatistics {
|
|
420
|
-
items {
|
|
421
|
-
id
|
|
422
|
-
valueDate
|
|
423
|
-
periodType
|
|
424
|
-
count
|
|
425
|
-
sum
|
|
426
|
-
range
|
|
427
|
-
mean
|
|
428
|
-
median
|
|
429
|
-
minimum
|
|
430
|
-
maximum
|
|
431
|
-
standardDeviation
|
|
432
|
-
variance
|
|
433
|
-
percentile25
|
|
434
|
-
percentile75
|
|
435
|
-
iqr
|
|
436
|
-
lowerFence
|
|
437
|
-
upperFence
|
|
438
|
-
additionalStatistics
|
|
439
|
-
metadata
|
|
440
|
-
kpi {
|
|
441
|
-
id
|
|
442
|
-
name
|
|
443
|
-
unit
|
|
444
|
-
category: parent {
|
|
445
|
-
id
|
|
446
|
-
name
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
`
|
|
453
|
-
});
|
|
454
|
-
this.kpiStatistics = response.data.kpiStatistics.items || [];
|
|
455
|
-
// 현재 월을 기본값으로 설정
|
|
456
|
-
const currentMonth = this.currentMonth;
|
|
457
|
-
const availableDates = this.availableValueDates;
|
|
458
|
-
if (availableDates.includes(currentMonth)) {
|
|
459
|
-
// 현재 월 데이터가 있으면 현재 월로 설정
|
|
460
|
-
this.selectedValueDate = currentMonth;
|
|
461
|
-
}
|
|
462
|
-
else if (availableDates.length > 0) {
|
|
463
|
-
// 현재 월 데이터가 없으면 가장 최근 데이터로 설정
|
|
464
|
-
this.selectedValueDate = availableDates[0];
|
|
465
|
-
}
|
|
466
|
-
else {
|
|
467
|
-
// 데이터가 없으면 현재 월로 설정
|
|
468
|
-
this.selectedValueDate = currentMonth;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
catch (e) {
|
|
472
|
-
console.error('KPI 통계 데이터를 불러오지 못했습니다:', e);
|
|
473
|
-
}
|
|
474
|
-
finally {
|
|
475
|
-
this.statisticsLoading = false;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
async openHistoryModal(kpi) {
|
|
479
|
-
// 전체 이력 fetch (limit 없이)
|
|
480
|
-
try {
|
|
481
|
-
const response = await client.query({
|
|
482
|
-
query: gql `
|
|
483
|
-
query ($kpiId: String!) {
|
|
484
|
-
kpi(id: $kpiId) {
|
|
485
|
-
name
|
|
486
|
-
histories {
|
|
487
|
-
version
|
|
488
|
-
updatedAt
|
|
489
|
-
updater {
|
|
490
|
-
name
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
`,
|
|
496
|
-
variables: { kpiId: kpi.id }
|
|
497
|
-
});
|
|
498
|
-
this.modalHistories = response.data.kpi.histories || [];
|
|
499
|
-
this.modalKpiName = response.data.kpi.name || '';
|
|
500
|
-
this.showHistoryModal = true;
|
|
501
|
-
}
|
|
502
|
-
catch (e) {
|
|
503
|
-
alert('이력 데이터를 불러오지 못했습니다.');
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
closeHistoryModal() {
|
|
507
|
-
this.showHistoryModal = false;
|
|
508
|
-
this.modalHistories = [];
|
|
509
|
-
this.modalKpiName = '';
|
|
510
|
-
}
|
|
511
|
-
_renderKpiValue(kpi) {
|
|
512
|
-
var _a, _b, _c, _d;
|
|
513
|
-
const kpiValue = (_b = (_a = kpi.value) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0;
|
|
514
|
-
const targetValue = (_c = kpi.targetValue) !== null && _c !== void 0 ? _c : 100;
|
|
515
|
-
const unit = (_d = kpi.unit) !== null && _d !== void 0 ? _d : '';
|
|
516
|
-
const vizType = kpi.vizType || 'CARD';
|
|
517
|
-
const vizMeta = kpi.vizMeta || {};
|
|
518
|
-
const color = vizMeta.color || '#3a3ad6';
|
|
519
|
-
const icon = vizMeta.icon || 'trending_up';
|
|
520
|
-
const minValue = vizMeta.minValue || 0;
|
|
521
|
-
const maxValue = vizMeta.maxValue || 100;
|
|
522
|
-
const decimalPlaces = vizMeta.decimalPlaces || 0;
|
|
523
|
-
const formattedValue = typeof kpiValue === 'number' ? kpiValue.toFixed(decimalPlaces) : kpiValue;
|
|
524
|
-
switch (vizType) {
|
|
525
|
-
case 'GAUGE':
|
|
526
|
-
const gaugePercentage = Math.min(((kpiValue - minValue) / (maxValue - minValue)) * 100, 100);
|
|
527
|
-
return html `
|
|
528
|
-
<div style="text-align:center;margin:16px 0;">
|
|
529
|
-
<div
|
|
530
|
-
style="width:120px;height:60px;border-radius:60px 60px 0 0;background:conic-gradient(${color} 0deg ${gaugePercentage *
|
|
531
|
-
3.6}deg, #e0e0e0 ${gaugePercentage * 3.6}deg 360deg);margin:0 auto;position:relative;"
|
|
532
|
-
>
|
|
533
|
-
<div
|
|
534
|
-
style="position:absolute;bottom:0;left:50%;transform:translateX(-50%);font-size:1.2rem;font-weight:bold;color:${color};"
|
|
535
|
-
>
|
|
536
|
-
${formattedValue}${unit}
|
|
537
|
-
</div>
|
|
538
|
-
</div>
|
|
539
|
-
</div>
|
|
540
|
-
`;
|
|
541
|
-
case 'PROGRESS':
|
|
542
|
-
const progressPercentage = Math.min(((kpiValue - minValue) / (maxValue - minValue)) * 100, 100);
|
|
543
|
-
return html `
|
|
544
|
-
<div style="margin:16px 0;">
|
|
545
|
-
<div style="background:#e0e0e0;height:20px;border-radius:10px;overflow:hidden;">
|
|
546
|
-
<div style="background:${color};height:100%;width:${progressPercentage}%;transition:width 0.3s;"></div>
|
|
547
|
-
</div>
|
|
548
|
-
<div style="text-align:center;margin-top:8px;font-weight:bold;color:${color};font-size:1.2rem;">
|
|
549
|
-
${formattedValue}${unit}
|
|
550
|
-
</div>
|
|
551
|
-
</div>
|
|
552
|
-
`;
|
|
553
|
-
case 'ICON':
|
|
554
|
-
return html `
|
|
555
|
-
<div style="text-align:center;margin:16px 0;">
|
|
556
|
-
<md-icon style="color:${color};font-size:48px;">${icon}</md-icon>
|
|
557
|
-
<div style="font-size:1.5rem;font-weight:bold;color:${color};margin-top:8px;">${formattedValue}${unit}</div>
|
|
558
|
-
</div>
|
|
559
|
-
`;
|
|
560
|
-
case 'THERMOMETER':
|
|
561
|
-
const thermoPercentage = Math.min(((kpiValue - minValue) / (maxValue - minValue)) * 100, 100);
|
|
562
|
-
return html `
|
|
563
|
-
<div style="text-align:center;margin:16px 0;">
|
|
564
|
-
<div
|
|
565
|
-
style="width:40px;height:120px;background:#e0e0e0;border-radius:20px;margin:0 auto;position:relative;overflow:hidden;"
|
|
566
|
-
>
|
|
567
|
-
<div
|
|
568
|
-
style="position:absolute;bottom:0;width:100%;height:${thermoPercentage}%;background:${color};border-radius:20px;"
|
|
569
|
-
></div>
|
|
570
|
-
</div>
|
|
571
|
-
<div style="font-size:1.2rem;font-weight:bold;color:${color};margin-top:8px;">${formattedValue}${unit}</div>
|
|
572
|
-
</div>
|
|
573
|
-
`;
|
|
574
|
-
case 'SPEEDOMETER':
|
|
575
|
-
const speedPercentage = Math.min(((kpiValue - minValue) / (maxValue - minValue)) * 100, 100);
|
|
576
|
-
const angle = (speedPercentage / 100) * 180 - 90; // -90도에서 90도까지
|
|
577
|
-
return html `
|
|
578
|
-
<div style="text-align:center;margin:16px 0;">
|
|
579
|
-
<div
|
|
580
|
-
style="width:120px;height:60px;border-radius:60px 60px 0 0;background:conic-gradient(${color} -90deg ${angle}deg, #e0e0e0 ${angle}deg 90deg);margin:0 auto;position:relative;"
|
|
581
|
-
>
|
|
582
|
-
<div
|
|
583
|
-
style="position:absolute;bottom:0;left:50%;transform:translateX(-50%);font-size:1.2rem;font-weight:bold;color:${color};"
|
|
584
|
-
>
|
|
585
|
-
${formattedValue}${unit}
|
|
586
|
-
</div>
|
|
587
|
-
</div>
|
|
588
|
-
</div>
|
|
589
|
-
`;
|
|
590
|
-
case 'BULLET':
|
|
591
|
-
const bulletPercentage = Math.min(((kpiValue - minValue) / (maxValue - minValue)) * 100, 100);
|
|
592
|
-
const targetPercentage = Math.min(((targetValue - minValue) / (maxValue - minValue)) * 100, 100);
|
|
593
|
-
return html `
|
|
594
|
-
<div style="margin:16px 0;">
|
|
595
|
-
<div style="background:#e0e0e0;height:30px;border-radius:15px;overflow:hidden;position:relative;">
|
|
596
|
-
<div style="background:${color};height:100%;width:${bulletPercentage}%;transition:width 0.3s;"></div>
|
|
597
|
-
<div style="position:absolute;top:0;left:${targetPercentage}%;width:2px;height:100%;background:#333;"></div>
|
|
598
|
-
</div>
|
|
599
|
-
<div style="text-align:center;margin-top:8px;font-weight:bold;color:${color};font-size:1.2rem;">
|
|
600
|
-
${formattedValue}${unit}
|
|
601
|
-
</div>
|
|
602
|
-
</div>
|
|
603
|
-
`;
|
|
604
|
-
case 'TEXT':
|
|
605
|
-
return html `
|
|
606
|
-
<div style="text-align:center;margin:16px 0;">
|
|
607
|
-
<div style="font-size:1.5rem;font-weight:bold;color:${color};">${formattedValue}${unit}</div>
|
|
608
|
-
</div>
|
|
609
|
-
`;
|
|
610
|
-
case 'BADGE':
|
|
611
|
-
return html `
|
|
612
|
-
<div style="text-align:center;margin:16px 0;">
|
|
613
|
-
<span
|
|
614
|
-
style="display:inline-block;padding:8px 16px;background:${color};color:white;border-radius:20px;font-size:1.2rem;font-weight:bold;"
|
|
615
|
-
>${formattedValue}${unit}</span
|
|
616
|
-
>
|
|
617
|
-
</div>
|
|
618
|
-
`;
|
|
619
|
-
default: // CARD, BAR, LINE, PIE, DONUT, RADAR, TABLE
|
|
620
|
-
return html ` <div class="kpi-value">${formattedValue}${unit}</div> `;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
get context() {
|
|
624
|
-
return {
|
|
625
|
-
title: 'KPI 대시보드',
|
|
626
|
-
description: '조직 KPI 실적, 등급, 이력, 시각화 등 KPI 전용 대시보드'
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
render() {
|
|
630
|
-
var _a, _b, _c, _d;
|
|
631
|
-
if (this.loading)
|
|
632
|
-
return nothing;
|
|
633
|
-
if (this.error)
|
|
634
|
-
return html `<div>${this.error}</div>`;
|
|
635
|
-
return html `
|
|
636
|
-
<div class="dashboard-root">
|
|
637
|
-
<!-- 샘플 차트 섹션 -->
|
|
638
|
-
<div class="sample-charts-section">
|
|
639
|
-
<div class="sample-chart-card">
|
|
640
|
-
<div class="sample-chart-title">그룹별 KPI 비교 (Radar)</div>
|
|
641
|
-
<div class="sample-chart-container">
|
|
642
|
-
<sv-kpi-radar-chart
|
|
643
|
-
.data=${(_a = this.sampleRadarData) !== null && _a !== void 0 ? _a : []}
|
|
644
|
-
.categories=${(_b = this.sampleRadarCategories) !== null && _b !== void 0 ? _b : []}
|
|
645
|
-
.currentGroup=${this.sampleCurrentGroup}
|
|
646
|
-
></sv-kpi-radar-chart>
|
|
647
|
-
</div>
|
|
648
|
-
<div style="margin-top:12px;color:#666;font-size:0.98em;">
|
|
649
|
-
※ <b>Radar 차트</b>는 각 카테고리별로 최소(Min), 최대(Max), 평균(Avg), 그리고 이 프로젝트의 값을 한눈에 비교할 수
|
|
650
|
-
있도록 시각화합니다.<br />
|
|
651
|
-
<b>진한 파란색</b> 다각형이 이 프로젝트의 성과이며, 회색 다각형은 기준값(최소/최대/평균)입니다.
|
|
652
|
-
</div>
|
|
653
|
-
</div>
|
|
654
|
-
<div class="sample-chart-card">
|
|
655
|
-
<div class="sample-chart-title">성과영역별 KPI (Boxplot)</div>
|
|
656
|
-
<div class="sample-chart-container">
|
|
657
|
-
<sv-kpi-boxplot-chart
|
|
658
|
-
.data=${(_c = this.sampleBoxplotData) !== null && _c !== void 0 ? _c : []}
|
|
659
|
-
.groups=${(_d = this.sampleBoxplotGroups) !== null && _d !== void 0 ? _d : []}
|
|
660
|
-
.currentGroup=${this.sampleCurrentGroup}
|
|
661
|
-
></sv-kpi-boxplot-chart>
|
|
662
|
-
</div>
|
|
663
|
-
<div style="margin-top:12px;color:#666;font-size:0.98em;">
|
|
664
|
-
※ <b>Boxplot(박스플롯)</b> <b>박스</b>는 중앙 50% 구간, <b>수염</b>은 전체 범위, <b>굵은 파란색 가로선</b>은
|
|
665
|
-
중앙값(메디안), <b>초록색 원</b>은 평균값(Mean)을 의미합니다.<br />
|
|
666
|
-
<b>당해 프로젝트의 값</b>은 <b>붉은색 원</b>으로 표시됩니다.<br />
|
|
667
|
-
</div>
|
|
668
|
-
</div>
|
|
669
|
-
</div>
|
|
670
|
-
|
|
671
|
-
<!-- 실제 KPI 통계 차트 섹션 -->
|
|
672
|
-
<div class="sample-charts-section">
|
|
673
|
-
<!-- 통계 필터 및 요약 -->
|
|
674
|
-
<div style="margin-bottom: 24px; background: #f8f9fa; padding: 16px; border-radius: 8px;">
|
|
675
|
-
<div style="display: flex; gap: 16px; align-items: center; flex-wrap: wrap;">
|
|
676
|
-
<div style="display: flex; align-items: center; gap: 8px;">
|
|
677
|
-
<label style="font-weight: 500; color: #333;">기간:</label>
|
|
678
|
-
<span style="padding: 6px 12px; background: #e9ecef; border-radius: 4px; color: #495057;"> MONTH (월별) </span>
|
|
679
|
-
</div>
|
|
680
|
-
<div style="display: flex; align-items: center; gap: 8px;">
|
|
681
|
-
<label style="font-weight: 500; color: #333;">날짜:</label>
|
|
682
|
-
<select
|
|
683
|
-
.value=${this.selectedValueDate}
|
|
684
|
-
@change=${this._onValueDateChange}
|
|
685
|
-
style="padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; background: white;"
|
|
686
|
-
>
|
|
687
|
-
${this.availableValueDates.map(date => html `<option value="${date}">${date}${date === this.currentMonth ? ' (현재)' : ''}</option>`)}
|
|
688
|
-
</select>
|
|
689
|
-
</div>
|
|
690
|
-
${this.statisticsSummary
|
|
691
|
-
? html `
|
|
692
|
-
<div style="display: flex; gap: 16px; margin-left: auto;">
|
|
693
|
-
<span style="color: #666; font-size: 0.9em;"> <b>KPI:</b> ${this.statisticsSummary.totalKpis}개 </span>
|
|
694
|
-
<span style="color: #666; font-size: 0.9em;">
|
|
695
|
-
<b>카테고리:</b> ${this.statisticsSummary.totalCategories}개
|
|
696
|
-
</span>
|
|
697
|
-
<span style="color: #666; font-size: 0.9em;"> <b>평균:</b> ${this.statisticsSummary.avgMean} </span>
|
|
698
|
-
<span style="color: #666; font-size: 0.9em;"> <b>중앙값:</b> ${this.statisticsSummary.avgMedian} </span>
|
|
699
|
-
<span style="color: #666; font-size: 0.9em;"> <b>표준편차:</b> ${this.statisticsSummary.avgStdDev} </span>
|
|
700
|
-
</div>
|
|
701
|
-
`
|
|
702
|
-
: nothing}
|
|
703
|
-
</div>
|
|
704
|
-
</div>
|
|
705
|
-
|
|
706
|
-
<div class="sample-chart-card">
|
|
707
|
-
<div class="sample-chart-title">실제 KPI 통계 비교 (Radar)</div>
|
|
708
|
-
<div class="sample-chart-container">
|
|
709
|
-
${this.statisticsLoading
|
|
710
|
-
? html `<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#666;">
|
|
711
|
-
통계 데이터 로딩 중...
|
|
712
|
-
</div>`
|
|
713
|
-
: this.realKpiRadarData.length > 0
|
|
714
|
-
? html `<sv-kpi-radar-chart
|
|
715
|
-
.data=${this.realKpiRadarData}
|
|
716
|
-
.categories=${this.realKpiRadarCategories}
|
|
717
|
-
.currentGroup=${'평균'}
|
|
718
|
-
></sv-kpi-radar-chart>`
|
|
719
|
-
: html `<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#666;">
|
|
720
|
-
선택된 기간에 통계 데이터가 없습니다.
|
|
721
|
-
</div>`}
|
|
722
|
-
</div>
|
|
723
|
-
<div style="margin-top:12px;color:#666;font-size:0.98em;">
|
|
724
|
-
※ <b>실제 KPI 통계 Radar 차트</b>는 실제 KPIStatistic 데이터를 기반으로 각 카테고리별 평균, 중앙값, 표준편차를
|
|
725
|
-
비교합니다.<br />
|
|
726
|
-
<b>평균</b>은 산술평균, <b>중앙값</b>은 50분위수, <b>표준편차</b>는 데이터 분산 정도를 나타냅니다.
|
|
727
|
-
</div>
|
|
728
|
-
</div>
|
|
729
|
-
<div class="sample-chart-card">
|
|
730
|
-
<div class="sample-chart-title">실제 KPI 통계 분포 (Boxplot)</div>
|
|
731
|
-
<div class="sample-chart-container">
|
|
732
|
-
${this.statisticsLoading
|
|
733
|
-
? html `<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#666;">
|
|
734
|
-
통계 데이터 로딩 중...
|
|
735
|
-
</div>`
|
|
736
|
-
: this.realKpiBoxplotData.length > 0
|
|
737
|
-
? html `<sv-kpi-boxplot-chart
|
|
738
|
-
.data=${this.realKpiBoxplotData}
|
|
739
|
-
.groups=${this.realKpiBoxplotGroups}
|
|
740
|
-
.currentGroup=${'평균'}
|
|
741
|
-
></sv-kpi-boxplot-chart>`
|
|
742
|
-
: html `<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#666;">
|
|
743
|
-
선택된 기간에 통계 데이터가 없습니다.
|
|
744
|
-
</div>`}
|
|
745
|
-
</div>
|
|
746
|
-
<div style="margin-top:12px;color:#666;font-size:0.98em;">
|
|
747
|
-
※ <b>실제 KPI 통계 Boxplot</b>은 실제 KPIStatistic 데이터를 기반으로 각 카테고리별 통계값의 분포를 보여줍니다.<br />
|
|
748
|
-
각 카테고리의 <b>평균값들</b>을 기준으로 분포를 계산하여, 카테고리 간 통계적 특성을 비교할 수 있습니다.
|
|
749
|
-
</div>
|
|
750
|
-
</div>
|
|
751
|
-
</div>
|
|
752
|
-
|
|
753
|
-
<!-- 3레벨 KPI 플로팅 섹션 -->
|
|
754
|
-
<div class="sample-charts-section">
|
|
755
|
-
<div style="margin-bottom: 24px;">
|
|
756
|
-
<h2 style="font-size: 1.5rem; font-weight: bold; color: #333; text-align: center; margin-bottom: 8px;">
|
|
757
|
-
3레벨 KPI 분석
|
|
758
|
-
</h2>
|
|
759
|
-
<p style="text-align: center; color: #666; font-size: 0.95rem;">프로젝트 데이터 기반 다층적 KPI 성과 분석</p>
|
|
760
|
-
</div>
|
|
761
|
-
|
|
762
|
-
<!-- 프로젝트 속성 필터 -->
|
|
763
|
-
<div style="margin-bottom: 24px; background: #f8f9fa; padding: 16px; border-radius: 8px; border: 1px solid #e9ecef;">
|
|
764
|
-
<div style="display: flex; gap: 16px; align-items: center; flex-wrap: wrap;">
|
|
765
|
-
<div style="display: flex; align-items: center; gap: 8px;">
|
|
766
|
-
<label style="font-weight: 500; color: #333; white-space: nowrap;">사업 유형:</label>
|
|
767
|
-
<select
|
|
768
|
-
.value=${this.selectedSectorType}
|
|
769
|
-
@change=${this._onSectorTypeChange}
|
|
770
|
-
style="padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; background: white;"
|
|
771
|
-
>
|
|
772
|
-
<option value="">전체</option>
|
|
773
|
-
<option value="PUBLIC">공공</option>
|
|
774
|
-
<option value="PRIVATE">민간</option>
|
|
775
|
-
</select>
|
|
776
|
-
</div>
|
|
777
|
-
<div style="display: flex; align-items: center; gap: 8px;">
|
|
778
|
-
<label style="font-weight: 500; color: #333; white-space: nowrap;">건물 용도:</label>
|
|
779
|
-
<select
|
|
780
|
-
.value=${this.selectedBuildingUsage}
|
|
781
|
-
@change=${this._onBuildingUsageChange}
|
|
782
|
-
style="padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; background: white;"
|
|
783
|
-
>
|
|
784
|
-
<option value="">전체</option>
|
|
785
|
-
<option value="RESIDENTIAL">주거</option>
|
|
786
|
-
<option value="NON_RESIDENTIAL">비주거</option>
|
|
787
|
-
</select>
|
|
788
|
-
</div>
|
|
789
|
-
${this.selectedSectorType || this.selectedBuildingUsage
|
|
790
|
-
? html `<span style="color:#1976d2;font-size:0.9em;margin-left:8px;">
|
|
791
|
-
필터 적용 중:
|
|
792
|
-
${[
|
|
793
|
-
this.selectedSectorType === 'PUBLIC' ? '공공' : this.selectedSectorType === 'PRIVATE' ? '민간' : '',
|
|
794
|
-
this.selectedBuildingUsage === 'RESIDENTIAL'
|
|
795
|
-
? '주거'
|
|
796
|
-
: this.selectedBuildingUsage === 'NON_RESIDENTIAL'
|
|
797
|
-
? '비주거'
|
|
798
|
-
: ''
|
|
799
|
-
]
|
|
800
|
-
.filter(Boolean)
|
|
801
|
-
.join(' · ')}
|
|
802
|
-
</span>`
|
|
803
|
-
: nothing}
|
|
804
|
-
</div>
|
|
805
|
-
</div>
|
|
806
|
-
|
|
807
|
-
<!-- 1레벨: 그룹 총 스코어 -->
|
|
808
|
-
<div style="margin-bottom: 32px;">
|
|
809
|
-
<h3 style="font-size: 1.2rem; font-weight: 600; color: #495057; margin-bottom: 16px;">📊 1레벨: 그룹 총 스코어</h3>
|
|
810
|
-
<kpi-level1-card
|
|
811
|
-
.sectorType=${this.selectedSectorType}
|
|
812
|
-
.buildingUsage=${this.selectedBuildingUsage}
|
|
813
|
-
></kpi-level1-card>
|
|
814
|
-
</div>
|
|
815
|
-
|
|
816
|
-
<!-- 2레벨: 카테고리 비교 -->
|
|
817
|
-
<div style="margin-bottom: 32px;">
|
|
818
|
-
<h3 style="font-size: 1.2rem; font-weight: 600; color: #495057; margin-bottom: 16px;">
|
|
819
|
-
📈 2레벨: 카테고리 비교 분석
|
|
820
|
-
</h3>
|
|
821
|
-
<kpi-level2-comparison
|
|
822
|
-
.sectorType=${this.selectedSectorType}
|
|
823
|
-
.buildingUsage=${this.selectedBuildingUsage}
|
|
824
|
-
></kpi-level2-comparison>
|
|
825
|
-
</div>
|
|
826
|
-
|
|
827
|
-
<!-- 3레벨: 개별 KPI 비교 -->
|
|
828
|
-
<div style="margin-bottom: 32px;">
|
|
829
|
-
<h3 style="font-size: 1.2rem; font-weight: 600; color: #495057; margin-bottom: 16px;">
|
|
830
|
-
🔍 3레벨: 개별 KPI 상세 분석
|
|
831
|
-
</h3>
|
|
832
|
-
<kpi-level3-comparison
|
|
833
|
-
.sectorType=${this.selectedSectorType}
|
|
834
|
-
.buildingUsage=${this.selectedBuildingUsage}
|
|
835
|
-
></kpi-level3-comparison>
|
|
836
|
-
</div>
|
|
837
|
-
</div>
|
|
838
|
-
${this.showHistoryModal
|
|
839
|
-
? html `
|
|
840
|
-
<div
|
|
841
|
-
style="position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.25);z-index:1000;display:flex;align-items:center;justify-content:center;"
|
|
842
|
-
>
|
|
843
|
-
<div
|
|
844
|
-
style="background:#fff;padding:32px 40px;border-radius:16px;min-width:340px;max-width:90vw;max-height:80vh;overflow:auto;box-shadow:0 4px 24px rgba(0,0,0,0.15);"
|
|
845
|
-
>
|
|
846
|
-
<div style="font-size:1.2rem;font-weight:bold;margin-bottom:16px;">${this.modalKpiName} 변경 이력</div>
|
|
847
|
-
<ul style="padding:0;list-style:none;">
|
|
848
|
-
${this.modalHistories.length === 0
|
|
849
|
-
? html `<li style="color:#bbb;">이력이 없습니다.</li>`
|
|
850
|
-
: this.modalHistories.map(h => {
|
|
851
|
-
var _a, _b, _c, _d;
|
|
852
|
-
return html `<li style="margin-bottom:8px;">
|
|
853
|
-
v${h.version} (${(_b = (_a = h.updatedAt) === null || _a === void 0 ? void 0 : _a.slice(0, 10)) !== null && _b !== void 0 ? _b : ''} ${(_d = (_c = h.updater) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : ''})
|
|
854
|
-
</li>`;
|
|
855
|
-
})}
|
|
856
|
-
</ul>
|
|
857
|
-
<button style="margin-top:16px;padding:6px 18px;" @click=${() => this.closeHistoryModal()}>닫기</button>
|
|
858
|
-
</div>
|
|
859
|
-
</div>
|
|
860
|
-
`
|
|
861
|
-
: nothing}
|
|
862
|
-
${this.categories.map(cat => html `
|
|
863
|
-
<div class="category-section">
|
|
864
|
-
<div class="category-title">${cat.name}</div>
|
|
865
|
-
<div class="kpi-cards">
|
|
866
|
-
${(cat.kpis || []).map(kpi => {
|
|
867
|
-
var _a, _b, _c, _d, _e, _f;
|
|
868
|
-
return html `
|
|
869
|
-
<div class="kpi-card">
|
|
870
|
-
<div class="kpi-name">${kpi.name}</div>
|
|
871
|
-
${this._renderKpiValue(kpi)}
|
|
872
|
-
<div class="kpi-target">목표: ${(_a = kpi.targetValue) !== null && _a !== void 0 ? _a : '-'}${(_b = kpi.unit) !== null && _b !== void 0 ? _b : ''}</div>
|
|
873
|
-
<!-- 등급 시각화 -->
|
|
874
|
-
<div style="margin-top:8px;">
|
|
875
|
-
<b>등급:</b>
|
|
876
|
-
${(() => {
|
|
877
|
-
var _a, _b, _c, _d, _e;
|
|
878
|
-
const grades = kpi.grades || [];
|
|
879
|
-
const kpiValue = (_a = kpi.value) === null || _a === void 0 ? void 0 : _a.value;
|
|
880
|
-
if (grades.length > 5) {
|
|
881
|
-
// 5개를 넘으면 현재 값에 해당하는 grade만 표시
|
|
882
|
-
const currentGrade = grades.find(g => kpiValue >= g.minValue && kpiValue <= g.maxValue);
|
|
883
|
-
if (currentGrade) {
|
|
884
|
-
return html `<span
|
|
885
|
-
style="display:inline-block;margin-right:8px;padding:4px 12px;border-radius:12px;background:${(_b = currentGrade.color) !== null && _b !== void 0 ? _b : '#3a3ad6'};color:white;font-size:1em;font-weight:bold;box-shadow:0 2px 8px rgba(58,58,214,0.3);border:2px solid ${(_c = currentGrade.color) !== null && _c !== void 0 ? _c : '#3a3ad6'};"
|
|
886
|
-
>${currentGrade.name}(${currentGrade.minValue}~${currentGrade.maxValue}${(_d = kpi.unit) !== null && _d !== void 0 ? _d : ''},
|
|
887
|
-
${(_e = currentGrade.score) !== null && _e !== void 0 ? _e : ''}점)</span
|
|
888
|
-
>`;
|
|
889
|
-
}
|
|
890
|
-
else {
|
|
891
|
-
return html `<span style="color:#bbb;font-size:0.95em;">등급 없음</span>`;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
895
|
-
// 5개 이하면 전체 리스트 표시하되 현재 등급은 강조
|
|
896
|
-
return grades.map(g => {
|
|
897
|
-
var _a, _b, _c, _d, _e;
|
|
898
|
-
const isCurrentGrade = kpiValue >= g.minValue && kpiValue <= g.maxValue;
|
|
899
|
-
return html `<span
|
|
900
|
-
style="display:inline-block;margin-right:8px;padding:${isCurrentGrade
|
|
901
|
-
? '4px 12px'
|
|
902
|
-
: '2px 8px'};border-radius:${isCurrentGrade ? '12px' : '8px'};background:${isCurrentGrade
|
|
903
|
-
? ((_a = g.color) !== null && _a !== void 0 ? _a : '#3a3ad6')
|
|
904
|
-
: ((_b = g.color) !== null && _b !== void 0 ? _b : '#eee')};color:${isCurrentGrade ? 'white' : '#222'};font-size:${isCurrentGrade
|
|
905
|
-
? '1em'
|
|
906
|
-
: '0.95em'};font-weight:${isCurrentGrade ? 'bold' : 'normal'};box-shadow:${isCurrentGrade
|
|
907
|
-
? '0 2px 8px rgba(58,58,214,0.3)'
|
|
908
|
-
: 'none'};border:${isCurrentGrade ? `2px solid ${(_c = g.color) !== null && _c !== void 0 ? _c : '#3a3ad6'}` : 'none'};"
|
|
909
|
-
>${g.name}(${g.minValue}~${g.maxValue}${(_d = kpi.unit) !== null && _d !== void 0 ? _d : ''}, ${(_e = g.score) !== null && _e !== void 0 ? _e : ''}점)</span
|
|
910
|
-
>`;
|
|
911
|
-
});
|
|
912
|
-
}
|
|
913
|
-
})()}
|
|
914
|
-
</div>
|
|
915
|
-
<!-- 최근 변경 이력(1건만) -->
|
|
916
|
-
<div style="margin-top:8px;font-size:0.95em;color:#888;">
|
|
917
|
-
<b>최근 변경:</b>
|
|
918
|
-
${kpi.histories && kpi.histories.length > 0
|
|
919
|
-
? html `<span style="margin-right:8px;"
|
|
920
|
-
>v${kpi.histories[0].version} (${(_d = (_c = kpi.histories[0].updatedAt) === null || _c === void 0 ? void 0 : _c.slice(0, 10)) !== null && _d !== void 0 ? _d : ''}
|
|
921
|
-
${(_f = (_e = kpi.histories[0].updater) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : ''})</span
|
|
922
|
-
>`
|
|
923
|
-
: html `<span style="color:#bbb">없음</span>`}
|
|
924
|
-
<button
|
|
925
|
-
style="margin-left:8px;font-size:0.95em;padding:2px 8px;"
|
|
926
|
-
@click=${() => this.openHistoryModal(kpi)}
|
|
927
|
-
>
|
|
928
|
-
더보기
|
|
929
|
-
</button>
|
|
930
|
-
</div>
|
|
931
|
-
<!-- 경고/알림 -->
|
|
932
|
-
<div style="margin-top:8px;">
|
|
933
|
-
${this.alerts.filter(a => { var _a; return ((_a = a.kpi) === null || _a === void 0 ? void 0 : _a.id) === kpi.id; }).length > 0
|
|
934
|
-
? this.alerts
|
|
935
|
-
.filter(a => { var _a; return ((_a = a.kpi) === null || _a === void 0 ? void 0 : _a.id) === kpi.id; })
|
|
936
|
-
.map(a => html `<span
|
|
937
|
-
style="display:inline-block;margin-right:8px;padding:2px 8px;border-radius:8px;background:${a.level ===
|
|
938
|
-
'critical'
|
|
939
|
-
? '#ffb3b3'
|
|
940
|
-
: a.level === 'warning'
|
|
941
|
-
? '#ffe082'
|
|
942
|
-
: '#e0e0e0'};color:#b71c1c;font-size:0.95em;"
|
|
943
|
-
>${a.message}</span
|
|
944
|
-
>`)
|
|
945
|
-
: html `<span style="color:#4caf50;font-size:0.95em;">이상/경고 없음</span>`}
|
|
946
|
-
</div>
|
|
947
|
-
</div>
|
|
948
|
-
`;
|
|
949
|
-
})}
|
|
950
|
-
</div>
|
|
951
|
-
</div>
|
|
952
|
-
`)}
|
|
953
|
-
</div>
|
|
954
|
-
`;
|
|
955
|
-
}
|
|
956
|
-
};
|
|
957
|
-
KpiDashboardPage.styles = [
|
|
958
|
-
ScrollbarStyles,
|
|
959
|
-
css `
|
|
960
|
-
:host {
|
|
961
|
-
display: flex;
|
|
962
|
-
flex-direction: column;
|
|
963
|
-
overflow-y: auto;
|
|
964
|
-
}
|
|
965
|
-
.dashboard-root {
|
|
966
|
-
flex: 1;
|
|
967
|
-
padding: 24px;
|
|
968
|
-
}
|
|
969
|
-
.sample-charts-section {
|
|
970
|
-
display: flex;
|
|
971
|
-
flex-direction: column;
|
|
972
|
-
gap: 40px;
|
|
973
|
-
margin-bottom: 48px;
|
|
974
|
-
align-items: flex-start;
|
|
975
|
-
}
|
|
976
|
-
.sample-chart-card {
|
|
977
|
-
background: #fff;
|
|
978
|
-
border-radius: 12px;
|
|
979
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
980
|
-
border: 1px solid #ececec;
|
|
981
|
-
padding: 24px 32px;
|
|
982
|
-
min-width: 340px;
|
|
983
|
-
flex: 1;
|
|
984
|
-
display: flex;
|
|
985
|
-
flex-direction: column;
|
|
986
|
-
align-items: stretch;
|
|
987
|
-
min-height: 500px;
|
|
988
|
-
}
|
|
989
|
-
.sample-chart-title {
|
|
990
|
-
font-size: 1.1rem;
|
|
991
|
-
font-weight: bold;
|
|
992
|
-
margin-bottom: 12px;
|
|
993
|
-
}
|
|
994
|
-
.sample-chart-container {
|
|
995
|
-
width: 100%;
|
|
996
|
-
height: 340px;
|
|
997
|
-
min-height: 340px;
|
|
998
|
-
}
|
|
999
|
-
.category-section {
|
|
1000
|
-
margin-bottom: 40px;
|
|
1001
|
-
}
|
|
1002
|
-
.category-title {
|
|
1003
|
-
font-size: 1.3rem;
|
|
1004
|
-
font-weight: bold;
|
|
1005
|
-
margin-bottom: 16px;
|
|
1006
|
-
}
|
|
1007
|
-
.kpi-cards {
|
|
1008
|
-
display: flex;
|
|
1009
|
-
gap: 24px;
|
|
1010
|
-
flex-wrap: wrap;
|
|
1011
|
-
}
|
|
1012
|
-
.kpi-card {
|
|
1013
|
-
background: #fff;
|
|
1014
|
-
border-radius: 12px;
|
|
1015
|
-
padding: 24px 32px;
|
|
1016
|
-
min-width: 220px;
|
|
1017
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
1018
|
-
display: flex;
|
|
1019
|
-
flex-direction: column;
|
|
1020
|
-
align-items: flex-start;
|
|
1021
|
-
margin-bottom: 8px;
|
|
1022
|
-
border: 1px solid #ececec;
|
|
1023
|
-
}
|
|
1024
|
-
.kpi-name {
|
|
1025
|
-
font-size: 1.1rem;
|
|
1026
|
-
font-weight: 500;
|
|
1027
|
-
margin-bottom: 8px;
|
|
1028
|
-
}
|
|
1029
|
-
.kpi-value {
|
|
1030
|
-
font-size: 2.2rem;
|
|
1031
|
-
font-weight: bold;
|
|
1032
|
-
color: #3a3ad6;
|
|
1033
|
-
margin-bottom: 4px;
|
|
1034
|
-
}
|
|
1035
|
-
.kpi-target {
|
|
1036
|
-
font-size: 1rem;
|
|
1037
|
-
color: #888;
|
|
1038
|
-
}
|
|
1039
|
-
`
|
|
1040
|
-
];
|
|
1041
|
-
__decorate([
|
|
1042
|
-
state(),
|
|
1043
|
-
__metadata("design:type", Array)
|
|
1044
|
-
], KpiDashboardPage.prototype, "categories", void 0);
|
|
1045
|
-
__decorate([
|
|
1046
|
-
state(),
|
|
1047
|
-
__metadata("design:type", Object)
|
|
1048
|
-
], KpiDashboardPage.prototype, "loading", void 0);
|
|
1049
|
-
__decorate([
|
|
1050
|
-
state(),
|
|
1051
|
-
__metadata("design:type", Object)
|
|
1052
|
-
], KpiDashboardPage.prototype, "error", void 0);
|
|
1053
|
-
__decorate([
|
|
1054
|
-
state(),
|
|
1055
|
-
__metadata("design:type", Array)
|
|
1056
|
-
], KpiDashboardPage.prototype, "alerts", void 0);
|
|
1057
|
-
__decorate([
|
|
1058
|
-
state(),
|
|
1059
|
-
__metadata("design:type", Boolean)
|
|
1060
|
-
], KpiDashboardPage.prototype, "showHistoryModal", void 0);
|
|
1061
|
-
__decorate([
|
|
1062
|
-
state(),
|
|
1063
|
-
__metadata("design:type", Array)
|
|
1064
|
-
], KpiDashboardPage.prototype, "modalHistories", void 0);
|
|
1065
|
-
__decorate([
|
|
1066
|
-
state(),
|
|
1067
|
-
__metadata("design:type", String)
|
|
1068
|
-
], KpiDashboardPage.prototype, "modalKpiName", void 0);
|
|
1069
|
-
__decorate([
|
|
1070
|
-
state(),
|
|
1071
|
-
__metadata("design:type", Array)
|
|
1072
|
-
], KpiDashboardPage.prototype, "kpiStatistics", void 0);
|
|
1073
|
-
__decorate([
|
|
1074
|
-
state(),
|
|
1075
|
-
__metadata("design:type", Object)
|
|
1076
|
-
], KpiDashboardPage.prototype, "statisticsLoading", void 0);
|
|
1077
|
-
__decorate([
|
|
1078
|
-
state(),
|
|
1079
|
-
__metadata("design:type", String)
|
|
1080
|
-
], KpiDashboardPage.prototype, "selectedPeriodType", void 0);
|
|
1081
|
-
__decorate([
|
|
1082
|
-
state(),
|
|
1083
|
-
__metadata("design:type", String)
|
|
1084
|
-
], KpiDashboardPage.prototype, "selectedValueDate", void 0);
|
|
1085
|
-
__decorate([
|
|
1086
|
-
state(),
|
|
1087
|
-
__metadata("design:type", String)
|
|
1088
|
-
], KpiDashboardPage.prototype, "selectedSectorType", void 0);
|
|
1089
|
-
__decorate([
|
|
1090
|
-
state(),
|
|
1091
|
-
__metadata("design:type", String)
|
|
1092
|
-
], KpiDashboardPage.prototype, "selectedBuildingUsage", void 0);
|
|
1093
|
-
KpiDashboardPage = __decorate([
|
|
1094
|
-
customElement('kpi-dashboard')
|
|
1095
|
-
], KpiDashboardPage);
|
|
1096
|
-
export { KpiDashboardPage };
|
|
1097
|
-
//# sourceMappingURL=kpi-dashboard.js.map
|