@dssp/dkpi 1.0.0-alpha.7 → 1.0.0-alpha.70
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/KPI-STATISTICS-SERVICE.md +233 -0
- package/_index.html +0 -5
- package/assets/favicon.ico +0 -0
- package/assets/images/project-image.png +0 -0
- package/assets/manifest/apple-1024.png +0 -0
- package/assets/manifest/apple-120.png +0 -0
- package/assets/manifest/apple-152.png +0 -0
- package/assets/manifest/apple-167.png +0 -0
- package/assets/manifest/apple-180.png +0 -0
- package/assets/manifest/apple-touch-icon.png +0 -0
- package/assets/manifest/badge-128x128.png +0 -0
- package/assets/manifest/chrome-splashscreen-icon-384x384.png +0 -0
- package/assets/manifest/chrome-touch-icon-192x192.png +0 -0
- package/assets/manifest/icon-128x128.png +0 -0
- package/assets/manifest/icon-192x192.png +0 -0
- package/assets/manifest/icon-512x512.png +0 -0
- package/assets/manifest/icon-72x72.png +0 -0
- package/assets/manifest/icon-96x96.png +0 -0
- package/assets/manifest/image-metaog.png +0 -0
- package/assets/manifest/maskable_icon.png +0 -0
- package/assets/manifest/ms-icon-144x144.png +0 -0
- package/assets/manifest/ms-touch-icon-144x144-precomposed.png +0 -0
- package/assets/videos/intro.mp4 +0 -0
- package/dist-client/bootstrap.js +64 -4
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/kpi-2d-lookup-chart.d.ts +43 -0
- package/dist-client/components/kpi-2d-lookup-chart.js +253 -0
- package/dist-client/components/kpi-2d-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-boxplot-chart.d.ts +24 -0
- package/dist-client/components/kpi-boxplot-chart.js +291 -0
- package/dist-client/components/kpi-boxplot-chart.js.map +1 -0
- package/dist-client/components/kpi-lookup-chart.d.ts +53 -0
- package/dist-client/components/kpi-lookup-chart.js +430 -0
- package/dist-client/components/kpi-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-mini-trend-chart.d.ts +14 -0
- package/dist-client/components/kpi-mini-trend-chart.js +148 -0
- package/dist-client/components/kpi-mini-trend-chart.js.map +1 -0
- package/dist-client/components/kpi-radar-chart.d.ts +17 -0
- package/dist-client/components/kpi-radar-chart.js +259 -0
- package/dist-client/components/kpi-radar-chart.js.map +1 -0
- package/dist-client/components/kpi-single-boxplot-chart.d.ts +24 -0
- package/dist-client/components/kpi-single-boxplot-chart.js +391 -0
- package/dist-client/components/kpi-single-boxplot-chart.js.map +1 -0
- package/dist-client/components/kpi-trend-chart.d.ts +25 -0
- package/dist-client/components/kpi-trend-chart.js +220 -0
- package/dist-client/components/kpi-trend-chart.js.map +1 -0
- package/dist-client/components/sv-pagenation-control.d.ts +18 -0
- package/dist-client/components/sv-pagenation-control.js +142 -0
- package/dist-client/components/sv-pagenation-control.js.map +1 -0
- package/dist-client/google-map/common-google-map.d.ts +35 -0
- package/dist-client/google-map/common-google-map.js +345 -0
- package/dist-client/google-map/common-google-map.js.map +1 -0
- package/dist-client/google-map/google-map-loader.d.ts +6 -0
- package/dist-client/google-map/google-map-loader.js +23 -0
- package/dist-client/google-map/google-map-loader.js.map +1 -0
- package/dist-client/icons/menu-icons.d.ts +6 -0
- package/dist-client/icons/menu-icons.js +42 -0
- package/dist-client/icons/menu-icons.js.map +1 -1
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.d.ts +22 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js +57 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js.map +1 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.d.ts +46 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.js +378 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.js.map +1 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.d.ts +20 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js +445 -0
- package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js.map +1 -0
- package/dist-client/pages/kpi-admin/kpi-system-guide.d.ts +18 -0
- package/dist-client/pages/kpi-admin/kpi-system-guide.js +535 -0
- package/dist-client/pages/kpi-admin/kpi-system-guide.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +259 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +22 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +346 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +26 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +433 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.d.ts +8 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js +78 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +38 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +851 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +42 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +316 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.d.ts +28 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +497 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +131 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +52 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +798 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +63 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +1089 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +147 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +57 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +719 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.d.ts +23 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js +76 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +68 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +380 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.d.ts +12 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +174 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +40 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +190 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.d.ts +23 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js +93 -0
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +71 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +464 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.d.ts +14 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js +339 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.d.ts +14 -0
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js +276 -0
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.d.ts +18 -0
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js +307 -0
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js.map +1 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.d.ts +18 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js +433 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js.map +1 -0
- package/dist-client/pages/sv-project-complete.d.ts +21 -0
- package/dist-client/pages/sv-project-complete.js +213 -0
- package/dist-client/pages/sv-project-complete.js.map +1 -0
- package/dist-client/pages/sv-project-completed-list.d.ts +27 -0
- package/dist-client/pages/sv-project-completed-list.js +416 -0
- package/dist-client/pages/sv-project-completed-list.js.map +1 -0
- package/dist-client/pages/sv-project-detail.d.ts +46 -0
- package/dist-client/pages/sv-project-detail.js +1236 -0
- package/dist-client/pages/sv-project-detail.js.map +1 -0
- package/dist-client/pages/sv-project-list.d.ts +165 -0
- package/dist-client/pages/sv-project-list.js +488 -0
- package/dist-client/pages/sv-project-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +35 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/shared/complete-api.d.ts +8 -0
- package/dist-client/shared/complete-api.js +177 -0
- package/dist-client/shared/complete-api.js.map +1 -0
- package/dist-client/shared/func.d.ts +2 -0
- package/dist-client/shared/func.js +22 -0
- package/dist-client/shared/func.js.map +1 -0
- package/dist-client/themes/dark.css +24 -24
- package/dist-client/themes/light.css +23 -23
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/menu-tools.d.ts +40 -5
- package/dist-client/viewparts/menu-tools.js +289 -34
- package/dist-client/viewparts/menu-tools.js.map +1 -1
- package/dist-server/index.d.ts +2 -0
- package/dist-server/index.js +5 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/scripts/calculate-kpi-scores.d.ts +10 -0
- package/dist-server/scripts/calculate-kpi-scores.js +333 -0
- package/dist-server/scripts/calculate-kpi-scores.js.map +1 -0
- package/dist-server/scripts/load-grade-data-migration.d.ts +14 -0
- package/dist-server/scripts/load-grade-data-migration.js +279 -0
- package/dist-server/scripts/load-grade-data-migration.js.map +1 -0
- package/dist-server/scripts/propagate-parent-kpi-values.d.ts +14 -0
- package/dist-server/scripts/propagate-parent-kpi-values.js +786 -0
- package/dist-server/scripts/propagate-parent-kpi-values.js.map +1 -0
- package/dist-server/scripts/recalculate-by-project-name.d.ts +2 -0
- package/dist-server/scripts/recalculate-by-project-name.js +72 -0
- package/dist-server/scripts/recalculate-by-project-name.js.map +1 -0
- package/dist-server/service/index.d.ts +4 -0
- package/dist-server/service/index.js +20 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/kpi-metric-value/index.d.ts +4 -0
- package/dist-server/service/kpi-metric-value/index.js +8 -0
- package/dist-server/service/kpi-metric-value/index.js.map +1 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +74 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +687 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.d.ts +7 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +52 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +1 -0
- package/dist-server/service/kpi-stat/index.d.ts +4 -0
- package/dist-server/service/kpi-stat/index.js +8 -0
- package/dist-server/service/kpi-stat/index.js.map +1 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.d.ts +12 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.js +662 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.js.map +1 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.d.ts +32 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.js +180 -0
- package/dist-server/service/kpi-stat/kpi-stat-types.js.map +1 -0
- package/dist-server/service/kpi-value/index.d.ts +3 -0
- package/dist-server/service/kpi-value/index.js +7 -0
- package/dist-server/service/kpi-value/index.js.map +1 -0
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +8 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +69 -0
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/kpi-module-service-tests.md +1286 -0
- package/kpi-module-test-report.md +676 -0
- package/kpi-module-unit-test-detailed-report.md +925 -0
- package/kpi-module-unit-tests-detailed.md +1452 -0
- package/package.json +65 -55
- package/recalculate-batch.sh +64 -0
- package/recalculate-projects-range.sh +98 -0
- package/schema.graphql +2514 -455
- package/things-factory.config.js +11 -1
- package/views/auth-page.html +0 -1
- package/views/public/home.html +0 -1
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
var KpiRegionPopup_1;
|
|
2
|
+
import { __decorate, __metadata } from "tslib";
|
|
3
|
+
import gql from 'graphql-tag';
|
|
4
|
+
import { LitElement, html, css, nothing } from 'lit';
|
|
5
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
6
|
+
import { client } from '@operato/graphql';
|
|
7
|
+
import { ScrollbarStyles } from '@operato/styles';
|
|
8
|
+
import '../../../components/kpi-radar-chart.js';
|
|
9
|
+
import '../../../components/kpi-boxplot-chart.js';
|
|
10
|
+
import '../../../components/kpi-trend-chart.js';
|
|
11
|
+
let KpiRegionPopup = KpiRegionPopup_1 = class KpiRegionPopup extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.selectedRegion = null;
|
|
15
|
+
this.geoGroup = null; // 시군구 geo_group 코드 (있으면 시군구 쿼리 사용)
|
|
16
|
+
this.selectedCategory = '전체 KPI';
|
|
17
|
+
this.selectedChartType = 'boxplot';
|
|
18
|
+
this.selectedPeriod = '월';
|
|
19
|
+
this.startYearMonth = ''; // YYYY-MM 형식
|
|
20
|
+
this.endYearMonth = ''; // YYYY-MM 형식
|
|
21
|
+
this.monthlyTrendData = []; // 부모에서 전달받은 월별 추이 데이터
|
|
22
|
+
this.totalKpiStats = []; // 전체 KPI 통계 (비교용)
|
|
23
|
+
this.chartData = [];
|
|
24
|
+
this.chartCategories = [];
|
|
25
|
+
this.trendData = [];
|
|
26
|
+
this.regionKpiStats = [];
|
|
27
|
+
}
|
|
28
|
+
updated(changedProperties) {
|
|
29
|
+
if (changedProperties.has('selectedRegion') && this.selectedRegion) {
|
|
30
|
+
this.fetchRegionKpiStats();
|
|
31
|
+
this.generateTrendData();
|
|
32
|
+
}
|
|
33
|
+
// selectedCategory 또는 monthlyTrendData가 변경되면 추이 데이터 재생성
|
|
34
|
+
if (changedProperties.has('selectedCategory') || changedProperties.has('monthlyTrendData')) {
|
|
35
|
+
this.generateTrendData();
|
|
36
|
+
}
|
|
37
|
+
// 기간이 변경되면 차트 데이터 다시 가져오기
|
|
38
|
+
if (changedProperties.has('startYearMonth') || changedProperties.has('endYearMonth')) {
|
|
39
|
+
if (this.selectedRegion) {
|
|
40
|
+
this.fetchRegionKpiStats();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async fetchRegionKpiStats() {
|
|
45
|
+
if (!this.selectedRegion)
|
|
46
|
+
return;
|
|
47
|
+
try {
|
|
48
|
+
let regionKpiStats;
|
|
49
|
+
if (this.geoGroup) {
|
|
50
|
+
// 시군구 모드: geo_group 코드로 조회
|
|
51
|
+
const response = await client.query({
|
|
52
|
+
query: gql `
|
|
53
|
+
query GetSigunguKpiStats($geoGroup: String!, $startYearMonth: String, $endYearMonth: String) {
|
|
54
|
+
kpiYValueStatsByGeoGroup(geoGroup: $geoGroup, startYearMonth: $startYearMonth, endYearMonth: $endYearMonth) {
|
|
55
|
+
kpiName
|
|
56
|
+
minVal
|
|
57
|
+
q1Val
|
|
58
|
+
medVal
|
|
59
|
+
q3Val
|
|
60
|
+
maxVal
|
|
61
|
+
avgVal
|
|
62
|
+
projectCount
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`,
|
|
66
|
+
variables: {
|
|
67
|
+
geoGroup: this.geoGroup,
|
|
68
|
+
startYearMonth: this.startYearMonth,
|
|
69
|
+
endYearMonth: this.endYearMonth
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
regionKpiStats = response.data.kpiYValueStatsByGeoGroup || [];
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// 광역 모드: 광역시도 이름으로 조회
|
|
76
|
+
const response = await client.query({
|
|
77
|
+
query: gql `
|
|
78
|
+
query GetRegionKpiStats($metroArea: String!, $startYearMonth: String, $endYearMonth: String) {
|
|
79
|
+
kpiYValueStatsByMetroArea(metroArea: $metroArea, startYearMonth: $startYearMonth, endYearMonth: $endYearMonth) {
|
|
80
|
+
kpiName
|
|
81
|
+
minVal
|
|
82
|
+
q1Val
|
|
83
|
+
medVal
|
|
84
|
+
q3Val
|
|
85
|
+
maxVal
|
|
86
|
+
avgVal
|
|
87
|
+
projectCount
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
`,
|
|
91
|
+
variables: {
|
|
92
|
+
metroArea: this.selectedRegion,
|
|
93
|
+
startYearMonth: this.startYearMonth,
|
|
94
|
+
endYearMonth: this.endYearMonth
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
regionKpiStats = response.data.kpiYValueStatsByMetroArea || [];
|
|
98
|
+
}
|
|
99
|
+
this.regionKpiStats = regionKpiStats;
|
|
100
|
+
this.generateChartData();
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
console.error('Failed to fetch region KPI stats:', error);
|
|
104
|
+
this.regionKpiStats = [];
|
|
105
|
+
this.generateChartData();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
generateChartData() {
|
|
109
|
+
// KPI 이름을 카테고리로 매핑 및 축약
|
|
110
|
+
const categoryMapping = {
|
|
111
|
+
'Y1. 일정성과': '일정',
|
|
112
|
+
'Y2. 비용성과': '비용',
|
|
113
|
+
'Y3. 품질성과': '품질',
|
|
114
|
+
'Y4. 안전성과': '안전',
|
|
115
|
+
'Y5. 환경성과': '환경',
|
|
116
|
+
'Y6. 생산성성과': '생산성'
|
|
117
|
+
};
|
|
118
|
+
// 레이더 차트와 박스플롯은 항상 전체 Y-level KPI 표시 (selectedCategory 무시)
|
|
119
|
+
if (this.selectedChartType === 'radar') {
|
|
120
|
+
// 레이더 차트용 데이터 생성 (전체평균 + 지역 비교)
|
|
121
|
+
const data = [];
|
|
122
|
+
const categories = [];
|
|
123
|
+
// 카테고리 수집
|
|
124
|
+
this.regionKpiStats.forEach(stat => {
|
|
125
|
+
const category = categoryMapping[stat.kpiName] || stat.kpiName;
|
|
126
|
+
if (!categories.includes(category)) {
|
|
127
|
+
categories.push(category);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
// 전체평균 데이터 추가
|
|
131
|
+
this.totalKpiStats.forEach(stat => {
|
|
132
|
+
const category = categoryMapping[stat.kpiName] || stat.kpiName;
|
|
133
|
+
data.push({
|
|
134
|
+
org: '전체평균',
|
|
135
|
+
category,
|
|
136
|
+
value: Math.round(stat.avgVal * 100)
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
// 지역 데이터 추가
|
|
140
|
+
this.regionKpiStats.forEach(stat => {
|
|
141
|
+
const category = categoryMapping[stat.kpiName] || stat.kpiName;
|
|
142
|
+
data.push({
|
|
143
|
+
org: this.selectedRegion || '지역',
|
|
144
|
+
category,
|
|
145
|
+
value: Math.round(stat.avgVal * 100)
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
this.chartCategories = categories.length > 0 ? categories : ['일정', '비용', '품질', '안전', '환경', '생산성'];
|
|
149
|
+
this.chartData = data;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
// 박스플롯용 데이터 생성
|
|
153
|
+
const data = [];
|
|
154
|
+
const categories = [];
|
|
155
|
+
this.regionKpiStats.forEach(stat => {
|
|
156
|
+
const category = categoryMapping[stat.kpiName] || stat.kpiName;
|
|
157
|
+
if (!categories.includes(category)) {
|
|
158
|
+
categories.push(category);
|
|
159
|
+
}
|
|
160
|
+
data.push({
|
|
161
|
+
org: category,
|
|
162
|
+
min: stat.minVal * 100,
|
|
163
|
+
max: stat.maxVal * 100,
|
|
164
|
+
q1: stat.q1Val * 100,
|
|
165
|
+
q3: stat.q3Val * 100,
|
|
166
|
+
median: stat.medVal * 100,
|
|
167
|
+
mean: stat.avgVal * 100,
|
|
168
|
+
value: stat.avgVal * 100
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
this.chartCategories = categories.length > 0 ? categories : ['일정', '비용', '품질', '안전', '환경', '생산성'];
|
|
172
|
+
this.chartData = data;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
generateTrendData() {
|
|
176
|
+
if (!this.selectedRegion)
|
|
177
|
+
return;
|
|
178
|
+
// 시군구 모드인 경우 소속 광역시도의 추이 데이터 사용
|
|
179
|
+
const trendRegion = this.geoGroup
|
|
180
|
+
? KpiRegionPopup_1.GEO_TO_METRO[this.geoGroup] || this.selectedRegion
|
|
181
|
+
: this.selectedRegion;
|
|
182
|
+
const regionTrendData = this.monthlyTrendData
|
|
183
|
+
.filter(d => d.geoGroup === trendRegion)
|
|
184
|
+
.sort((a, b) => a.yearMonth.localeCompare(b.yearMonth));
|
|
185
|
+
this.trendData = regionTrendData.map(d => {
|
|
186
|
+
const value = Math.round(d.avgVal * 100); // 20배 스케일
|
|
187
|
+
return {
|
|
188
|
+
date: d.yearMonth, // YYYY-MM 형식
|
|
189
|
+
value: value,
|
|
190
|
+
color: value > 60 ? '#4caf50' : value > 40 ? '#ff9800' : '#f44336'
|
|
191
|
+
};
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
onClose() {
|
|
195
|
+
this.dispatchEvent(new CustomEvent('popup-close', {
|
|
196
|
+
bubbles: true,
|
|
197
|
+
composed: true
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
onChartTypeChange(type) {
|
|
201
|
+
this.selectedChartType = type;
|
|
202
|
+
this.generateChartData();
|
|
203
|
+
}
|
|
204
|
+
render() {
|
|
205
|
+
if (!this.selectedRegion) {
|
|
206
|
+
return nothing;
|
|
207
|
+
}
|
|
208
|
+
return html `
|
|
209
|
+
<div class="popup-header">
|
|
210
|
+
<div class="popup-title">${this.selectedRegion} KPI</div>
|
|
211
|
+
<button class="popup-close" @click=${this.onClose}>×</button>
|
|
212
|
+
</div>
|
|
213
|
+
<div class="popup-content">
|
|
214
|
+
<!-- 종합 성과 -->
|
|
215
|
+
<div class="chart-section">
|
|
216
|
+
<div class="sub-title">종합 성과</div>
|
|
217
|
+
<div class="chart-toggle">
|
|
218
|
+
<button
|
|
219
|
+
class="toggle-button ${this.selectedChartType === 'boxplot' ? 'active' : ''}"
|
|
220
|
+
@click=${() => this.onChartTypeChange('boxplot')}
|
|
221
|
+
>
|
|
222
|
+
박스플롯
|
|
223
|
+
</button>
|
|
224
|
+
<button
|
|
225
|
+
class="toggle-button ${this.selectedChartType === 'radar' ? 'active' : ''}"
|
|
226
|
+
@click=${() => this.onChartTypeChange('radar')}
|
|
227
|
+
>
|
|
228
|
+
레이더차트
|
|
229
|
+
</button>
|
|
230
|
+
</div>
|
|
231
|
+
<div class="chart-container">
|
|
232
|
+
${this.selectedChartType === 'boxplot'
|
|
233
|
+
? html `
|
|
234
|
+
<sv-kpi-boxplot-chart
|
|
235
|
+
.data=${this.chartData}
|
|
236
|
+
.groups=${this.chartCategories}
|
|
237
|
+
.valueKey=${'value'}
|
|
238
|
+
></sv-kpi-boxplot-chart>
|
|
239
|
+
`
|
|
240
|
+
: html `
|
|
241
|
+
<sv-kpi-radar-chart
|
|
242
|
+
.data=${this.chartData}
|
|
243
|
+
.categories=${this.chartCategories}
|
|
244
|
+
.valueKey=${'value'}
|
|
245
|
+
></sv-kpi-radar-chart>
|
|
246
|
+
`}
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<!-- 기간별 성과 추이 -->
|
|
251
|
+
<div class="trend-section">
|
|
252
|
+
<div class="sub-title">기간별 성과 추이</div>
|
|
253
|
+
<div class="trend-chart-container" style="height: 200px; margin-bottom: 16px;">
|
|
254
|
+
<sv-kpi-trend-chart
|
|
255
|
+
.data=${this.trendData}
|
|
256
|
+
.lineColor=${'#2196f3'}
|
|
257
|
+
.strokeWidth=${2}
|
|
258
|
+
.showPoints=${false}
|
|
259
|
+
.pointRadius=${4}
|
|
260
|
+
></sv-kpi-trend-chart>
|
|
261
|
+
</div>
|
|
262
|
+
<div class="trend-table">
|
|
263
|
+
<table style="width: 100%; border-collapse: collapse; font-size: 0.85rem;">
|
|
264
|
+
<thead style="position: sticky; top: 0; background: white; z-index: 1;">
|
|
265
|
+
<tr style="border-bottom: 2px solid #f1f3f4; background-color: #f8f9fa;">
|
|
266
|
+
<th style="padding: 8px; text-align: left; font-weight: 600;">날짜</th>
|
|
267
|
+
<th style="padding: 8px; text-align: right; font-weight: 600;">성과</th>
|
|
268
|
+
<th style="padding: 8px; text-align: center; font-weight: 600;">추이</th>
|
|
269
|
+
</tr>
|
|
270
|
+
</thead>
|
|
271
|
+
<tbody>
|
|
272
|
+
${this.trendData.map((item) => html `
|
|
273
|
+
<tr style="border-bottom: 1px solid #f1f3f4;">
|
|
274
|
+
<td style="padding: 8px; font-size: 0.85rem;">${item.date}</td>
|
|
275
|
+
<td style="padding: 8px; text-align: right; font-size: 0.85rem; font-weight: 600;">
|
|
276
|
+
${item.value.toFixed(1)}
|
|
277
|
+
</td>
|
|
278
|
+
<td style="padding: 8px; text-align: center; font-size: 0.85rem;">
|
|
279
|
+
<span style="color: ${item.color};"> ${item.value > 60 ? '▲' : item.value > 40 ? '▲' : '▼'} </span>
|
|
280
|
+
</td>
|
|
281
|
+
</tr>
|
|
282
|
+
`)}
|
|
283
|
+
</tbody>
|
|
284
|
+
</table>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
`;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
KpiRegionPopup.styles = [
|
|
292
|
+
ScrollbarStyles,
|
|
293
|
+
css `
|
|
294
|
+
:host {
|
|
295
|
+
display: block;
|
|
296
|
+
position: absolute;
|
|
297
|
+
top: 0;
|
|
298
|
+
left: 402px;
|
|
299
|
+
width: 400px;
|
|
300
|
+
height: 100%;
|
|
301
|
+
background: #fff;
|
|
302
|
+
border-right: 1px solid #e0e0e0;
|
|
303
|
+
z-index: 1000;
|
|
304
|
+
overflow: hidden;
|
|
305
|
+
display: flex;
|
|
306
|
+
flex-direction: column;
|
|
307
|
+
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
|
|
308
|
+
}
|
|
309
|
+
.popup-content {
|
|
310
|
+
padding: 20px;
|
|
311
|
+
overflow-y: auto;
|
|
312
|
+
flex: 1;
|
|
313
|
+
}
|
|
314
|
+
.popup-header {
|
|
315
|
+
display: flex;
|
|
316
|
+
justify-content: space-between;
|
|
317
|
+
align-items: center;
|
|
318
|
+
padding: 20px;
|
|
319
|
+
border-bottom: 1px solid #e0e0e0;
|
|
320
|
+
background: #fff;
|
|
321
|
+
height: 70px;
|
|
322
|
+
box-sizing: border-box;
|
|
323
|
+
}
|
|
324
|
+
.popup-title {
|
|
325
|
+
font-size: 1.2rem;
|
|
326
|
+
font-weight: bold;
|
|
327
|
+
color: #333;
|
|
328
|
+
}
|
|
329
|
+
.popup-close {
|
|
330
|
+
width: 32px;
|
|
331
|
+
height: 32px;
|
|
332
|
+
border: none;
|
|
333
|
+
background: #fff;
|
|
334
|
+
border-radius: 50%;
|
|
335
|
+
cursor: pointer;
|
|
336
|
+
display: flex;
|
|
337
|
+
align-items: center;
|
|
338
|
+
justify-content: center;
|
|
339
|
+
font-size: 1.2rem;
|
|
340
|
+
color: #666;
|
|
341
|
+
transition: all 0.2s;
|
|
342
|
+
}
|
|
343
|
+
.popup-close:hover {
|
|
344
|
+
background: #e9ecef;
|
|
345
|
+
color: #333;
|
|
346
|
+
}
|
|
347
|
+
.sub-title {
|
|
348
|
+
font-size: 1rem;
|
|
349
|
+
font-weight: 600;
|
|
350
|
+
margin-bottom: 16px;
|
|
351
|
+
color: #495057;
|
|
352
|
+
}
|
|
353
|
+
.chart-section {
|
|
354
|
+
background: #f8f9fa;
|
|
355
|
+
border-radius: 8px;
|
|
356
|
+
padding: 16px;
|
|
357
|
+
margin-bottom: 20px;
|
|
358
|
+
}
|
|
359
|
+
.chart-toggle {
|
|
360
|
+
display: flex;
|
|
361
|
+
gap: 8px;
|
|
362
|
+
margin-bottom: 16px;
|
|
363
|
+
}
|
|
364
|
+
.toggle-button {
|
|
365
|
+
padding: 8px 16px;
|
|
366
|
+
border: 1px solid #ced4da;
|
|
367
|
+
background: #fff;
|
|
368
|
+
border-radius: 6px;
|
|
369
|
+
cursor: pointer;
|
|
370
|
+
font-size: 0.9rem;
|
|
371
|
+
transition: all 0.2s;
|
|
372
|
+
}
|
|
373
|
+
.toggle-button.active {
|
|
374
|
+
background: #667eea;
|
|
375
|
+
color: white;
|
|
376
|
+
border-color: #667eea;
|
|
377
|
+
}
|
|
378
|
+
.chart-container {
|
|
379
|
+
height: 300px;
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
justify-content: center;
|
|
383
|
+
background: white;
|
|
384
|
+
border-radius: 6px;
|
|
385
|
+
border: 1px solid #e9ecef;
|
|
386
|
+
}
|
|
387
|
+
.period-selector {
|
|
388
|
+
display: flex;
|
|
389
|
+
gap: 8px;
|
|
390
|
+
margin-bottom: 16px;
|
|
391
|
+
}
|
|
392
|
+
.period-button {
|
|
393
|
+
padding: 6px 12px;
|
|
394
|
+
border: 1px solid #ced4da;
|
|
395
|
+
background: #fff;
|
|
396
|
+
border-radius: 4px;
|
|
397
|
+
cursor: pointer;
|
|
398
|
+
font-size: 0.85rem;
|
|
399
|
+
transition: all 0.2s;
|
|
400
|
+
}
|
|
401
|
+
.period-button.active {
|
|
402
|
+
background: #667eea;
|
|
403
|
+
color: white;
|
|
404
|
+
border-color: #667eea;
|
|
405
|
+
}
|
|
406
|
+
.date-range-selector {
|
|
407
|
+
display: flex;
|
|
408
|
+
align-items: center;
|
|
409
|
+
gap: 8px;
|
|
410
|
+
margin-bottom: 16px;
|
|
411
|
+
}
|
|
412
|
+
.date-select {
|
|
413
|
+
padding: 6px 12px;
|
|
414
|
+
border: 1px solid #ced4da;
|
|
415
|
+
border-radius: 4px;
|
|
416
|
+
background: white;
|
|
417
|
+
font-size: 0.9rem;
|
|
418
|
+
}
|
|
419
|
+
`
|
|
420
|
+
];
|
|
421
|
+
// geo_group → 광역시도 매핑 (시군구 모드에서 추이 데이터 조회용)
|
|
422
|
+
KpiRegionPopup.GEO_TO_METRO = {
|
|
423
|
+
'01': '서울특별시', '02': '서울특별시', '03': '서울특별시', '04': '서울특별시',
|
|
424
|
+
'05': '서울특별시', '06': '서울특별시', '07': '서울특별시', '08': '서울특별시',
|
|
425
|
+
'10': '경기도', '11': '경기도', '12': '경기도', '13': '경기도', '14': '경기도',
|
|
426
|
+
'15': '경기도', '16': '경기도', '17': '경기도', '18': '경기도',
|
|
427
|
+
'21': '인천광역시', '22': '인천광역시', '23': '인천광역시',
|
|
428
|
+
'24': '강원도', '25': '강원도', '26': '강원도', '33': '강원도',
|
|
429
|
+
'27': '충청북도', '28': '충청북도', '29': '충청북도',
|
|
430
|
+
'30': '세종특별자치시', '31': '충청남도', '32': '충청남도',
|
|
431
|
+
'34': '대전광역시', '35': '대전광역시',
|
|
432
|
+
'36': '경상북도', '37': '경상북도', '38': '경상북도', '39': '경상북도', '40': '경상북도',
|
|
433
|
+
'41': '대구광역시', '42': '대구광역시', '43': '대구광역시',
|
|
434
|
+
'44': '울산광역시', '45': '울산광역시',
|
|
435
|
+
'46': '부산광역시', '47': '부산광역시', '48': '부산광역시', '49': '부산광역시',
|
|
436
|
+
'50': '경상남도', '51': '경상남도', '52': '경상남도', '53': '경상남도',
|
|
437
|
+
'54': '전라북도', '55': '전라북도', '56': '전라북도',
|
|
438
|
+
'57': '전라남도', '58': '전라남도', '59': '전라남도',
|
|
439
|
+
'61': '광주광역시', '62': '광주광역시', '63': '제주특별자치도'
|
|
440
|
+
};
|
|
441
|
+
__decorate([
|
|
442
|
+
property({ type: String }),
|
|
443
|
+
__metadata("design:type", Object)
|
|
444
|
+
], KpiRegionPopup.prototype, "selectedRegion", void 0);
|
|
445
|
+
__decorate([
|
|
446
|
+
property({ type: String }),
|
|
447
|
+
__metadata("design:type", Object)
|
|
448
|
+
], KpiRegionPopup.prototype, "geoGroup", void 0);
|
|
449
|
+
__decorate([
|
|
450
|
+
property({ type: String }),
|
|
451
|
+
__metadata("design:type", Object)
|
|
452
|
+
], KpiRegionPopup.prototype, "selectedCategory", void 0);
|
|
453
|
+
__decorate([
|
|
454
|
+
property({ type: String }),
|
|
455
|
+
__metadata("design:type", Object)
|
|
456
|
+
], KpiRegionPopup.prototype, "selectedChartType", void 0);
|
|
457
|
+
__decorate([
|
|
458
|
+
property({ type: String }),
|
|
459
|
+
__metadata("design:type", Object)
|
|
460
|
+
], KpiRegionPopup.prototype, "selectedPeriod", void 0);
|
|
461
|
+
__decorate([
|
|
462
|
+
property({ type: String }),
|
|
463
|
+
__metadata("design:type", Object)
|
|
464
|
+
], KpiRegionPopup.prototype, "startYearMonth", void 0);
|
|
465
|
+
__decorate([
|
|
466
|
+
property({ type: String }),
|
|
467
|
+
__metadata("design:type", Object)
|
|
468
|
+
], KpiRegionPopup.prototype, "endYearMonth", void 0);
|
|
469
|
+
__decorate([
|
|
470
|
+
property({ type: Array }),
|
|
471
|
+
__metadata("design:type", Array)
|
|
472
|
+
], KpiRegionPopup.prototype, "monthlyTrendData", void 0);
|
|
473
|
+
__decorate([
|
|
474
|
+
property({ type: Array }),
|
|
475
|
+
__metadata("design:type", Array)
|
|
476
|
+
], KpiRegionPopup.prototype, "totalKpiStats", void 0);
|
|
477
|
+
__decorate([
|
|
478
|
+
state(),
|
|
479
|
+
__metadata("design:type", Array)
|
|
480
|
+
], KpiRegionPopup.prototype, "chartData", void 0);
|
|
481
|
+
__decorate([
|
|
482
|
+
state(),
|
|
483
|
+
__metadata("design:type", Array)
|
|
484
|
+
], KpiRegionPopup.prototype, "chartCategories", void 0);
|
|
485
|
+
__decorate([
|
|
486
|
+
state(),
|
|
487
|
+
__metadata("design:type", Array)
|
|
488
|
+
], KpiRegionPopup.prototype, "trendData", void 0);
|
|
489
|
+
__decorate([
|
|
490
|
+
state(),
|
|
491
|
+
__metadata("design:type", Array)
|
|
492
|
+
], KpiRegionPopup.prototype, "regionKpiStats", void 0);
|
|
493
|
+
KpiRegionPopup = KpiRegionPopup_1 = __decorate([
|
|
494
|
+
customElement('kpi-region-popup')
|
|
495
|
+
], KpiRegionPopup);
|
|
496
|
+
export { KpiRegionPopup };
|
|
497
|
+
//# sourceMappingURL=kpi-region-popup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-region-popup.js","sourceRoot":"","sources":["../../../../client/pages/kpi-dashboard/components/kpi-region-popup.ts"],"names":[],"mappings":";;AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,wCAAwC,CAAA;AAC/C,OAAO,0CAA0C,CAAA;AACjD,OAAO,wCAAwC,CAAA;AAGxC,IAAM,cAAc,sBAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QAoIuB,mBAAc,GAAkB,IAAI,CAAA;QACpC,aAAQ,GAAkB,IAAI,CAAA,CAAC,mCAAmC;QAClE,qBAAgB,GAAG,QAAQ,CAAA;QAC3B,sBAAiB,GAAG,SAAS,CAA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AAhB,KAAK,EAAE;;iDAA0E;AACjE;IAAhB,KAAK,EAAE;;sDAAmC;AAjJhC,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA4c1B","sourcesContent":["import gql from 'graphql-tag'\nimport { LitElement, html, css, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport '../../../components/kpi-radar-chart.js'\nimport '../../../components/kpi-boxplot-chart.js'\nimport '../../../components/kpi-trend-chart.js'\n\n@customElement('kpi-region-popup')\nexport class KpiRegionPopup extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: block;\n position: absolute;\n top: 0;\n left: 402px;\n width: 400px;\n height: 100%;\n background: #fff;\n border-right: 1px solid #e0e0e0;\n z-index: 1000;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);\n }\n .popup-content {\n padding: 20px;\n overflow-y: auto;\n flex: 1;\n }\n .popup-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 20px;\n border-bottom: 1px solid #e0e0e0;\n background: #fff;\n height: 70px;\n box-sizing: border-box;\n }\n .popup-title {\n font-size: 1.2rem;\n font-weight: bold;\n color: #333;\n }\n .popup-close {\n width: 32px;\n height: 32px;\n border: none;\n background: #fff;\n border-radius: 50%;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.2rem;\n color: #666;\n transition: all 0.2s;\n }\n .popup-close:hover {\n background: #e9ecef;\n color: #333;\n }\n .sub-title {\n font-size: 1rem;\n font-weight: 600;\n margin-bottom: 16px;\n color: #495057;\n }\n .chart-section {\n background: #f8f9fa;\n border-radius: 8px;\n padding: 16px;\n margin-bottom: 20px;\n }\n .chart-toggle {\n display: flex;\n gap: 8px;\n margin-bottom: 16px;\n }\n .toggle-button {\n padding: 8px 16px;\n border: 1px solid #ced4da;\n background: #fff;\n border-radius: 6px;\n cursor: pointer;\n font-size: 0.9rem;\n transition: all 0.2s;\n }\n .toggle-button.active {\n background: #667eea;\n color: white;\n border-color: #667eea;\n }\n .chart-container {\n height: 300px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: white;\n border-radius: 6px;\n border: 1px solid #e9ecef;\n }\n .period-selector {\n display: flex;\n gap: 8px;\n margin-bottom: 16px;\n }\n .period-button {\n padding: 6px 12px;\n border: 1px solid #ced4da;\n background: #fff;\n border-radius: 4px;\n cursor: pointer;\n font-size: 0.85rem;\n transition: all 0.2s;\n }\n .period-button.active {\n background: #667eea;\n color: white;\n border-color: #667eea;\n }\n .date-range-selector {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 16px;\n }\n .date-select {\n padding: 6px 12px;\n border: 1px solid #ced4da;\n border-radius: 4px;\n background: white;\n font-size: 0.9rem;\n }\n `\n ]\n\n @property({ type: String }) selectedRegion: string | null = null\n @property({ type: String }) geoGroup: string | null = null // 시군구 geo_group 코드 (있으면 시군구 쿼리 사용)\n @property({ type: String }) selectedCategory = '전체 KPI'\n @property({ type: String }) selectedChartType = 'boxplot'\n @property({ type: String }) selectedPeriod = '월'\n @property({ type: String }) startYearMonth = '' // YYYY-MM 형식\n @property({ type: String }) endYearMonth = '' // YYYY-MM 형식\n @property({ type: Array }) monthlyTrendData: any[] = [] // 부모에서 전달받은 월별 추이 데이터\n @property({ type: Array }) totalKpiStats: any[] = [] // 전체 KPI 통계 (비교용)\n\n @state() private chartData: any[] = []\n @state() private chartCategories: string[] = []\n @state() private trendData: { date: string; value: number; color?: string }[] = []\n @state() private regionKpiStats: any[] = []\n\n updated(changedProperties: Map<string, any>) {\n if (changedProperties.has('selectedRegion') && this.selectedRegion) {\n this.fetchRegionKpiStats()\n this.generateTrendData()\n }\n\n // selectedCategory 또는 monthlyTrendData가 변경되면 추이 데이터 재생성\n if (changedProperties.has('selectedCategory') || changedProperties.has('monthlyTrendData')) {\n this.generateTrendData()\n }\n\n // 기간이 변경되면 차트 데이터 다시 가져오기\n if (changedProperties.has('startYearMonth') || changedProperties.has('endYearMonth')) {\n if (this.selectedRegion) {\n this.fetchRegionKpiStats()\n }\n }\n }\n\n async fetchRegionKpiStats() {\n if (!this.selectedRegion) return\n\n try {\n let regionKpiStats: any[]\n\n if (this.geoGroup) {\n // 시군구 모드: geo_group 코드로 조회\n const response = await client.query({\n query: gql`\n query GetSigunguKpiStats($geoGroup: String!, $startYearMonth: String, $endYearMonth: String) {\n kpiYValueStatsByGeoGroup(geoGroup: $geoGroup, startYearMonth: $startYearMonth, endYearMonth: $endYearMonth) {\n kpiName\n minVal\n q1Val\n medVal\n q3Val\n maxVal\n avgVal\n projectCount\n }\n }\n `,\n variables: {\n geoGroup: this.geoGroup,\n startYearMonth: this.startYearMonth,\n endYearMonth: this.endYearMonth\n }\n })\n regionKpiStats = response.data.kpiYValueStatsByGeoGroup || []\n } else {\n // 광역 모드: 광역시도 이름으로 조회\n const response = await client.query({\n query: gql`\n query GetRegionKpiStats($metroArea: String!, $startYearMonth: String, $endYearMonth: String) {\n kpiYValueStatsByMetroArea(metroArea: $metroArea, startYearMonth: $startYearMonth, endYearMonth: $endYearMonth) {\n kpiName\n minVal\n q1Val\n medVal\n q3Val\n maxVal\n avgVal\n projectCount\n }\n }\n `,\n variables: {\n metroArea: this.selectedRegion,\n startYearMonth: this.startYearMonth,\n endYearMonth: this.endYearMonth\n }\n })\n regionKpiStats = response.data.kpiYValueStatsByMetroArea || []\n }\n\n this.regionKpiStats = regionKpiStats\n this.generateChartData()\n } catch (error) {\n console.error('Failed to fetch region KPI stats:', error)\n this.regionKpiStats = []\n this.generateChartData()\n }\n }\n\n private generateChartData() {\n // KPI 이름을 카테고리로 매핑 및 축약\n const categoryMapping: Record<string, string> = {\n 'Y1. 일정성과': '일정',\n 'Y2. 비용성과': '비용',\n 'Y3. 품질성과': '품질',\n 'Y4. 안전성과': '안전',\n 'Y5. 환경성과': '환경',\n 'Y6. 생산성성과': '생산성'\n }\n\n // 레이더 차트와 박스플롯은 항상 전체 Y-level KPI 표시 (selectedCategory 무시)\n if (this.selectedChartType === 'radar') {\n // 레이더 차트용 데이터 생성 (전체평균 + 지역 비교)\n const data: Array<{ org: string; category: string; value: number }> = []\n const categories: string[] = []\n\n // 카테고리 수집\n this.regionKpiStats.forEach(stat => {\n const category = categoryMapping[stat.kpiName] || stat.kpiName\n if (!categories.includes(category)) {\n categories.push(category)\n }\n })\n\n // 전체평균 데이터 추가\n this.totalKpiStats.forEach(stat => {\n const category = categoryMapping[stat.kpiName] || stat.kpiName\n data.push({\n org: '전체평균',\n category,\n value: Math.round(stat.avgVal * 100)\n })\n })\n\n // 지역 데이터 추가\n this.regionKpiStats.forEach(stat => {\n const category = categoryMapping[stat.kpiName] || stat.kpiName\n data.push({\n org: this.selectedRegion || '지역',\n category,\n value: Math.round(stat.avgVal * 100)\n })\n })\n\n this.chartCategories = categories.length > 0 ? categories : ['일정', '비용', '품질', '안전', '환경', '생산성']\n this.chartData = data\n } else {\n // 박스플롯용 데이터 생성\n const data: Array<{\n org: string\n min: number\n max: number\n q1: number\n q3: number\n median: number\n mean: number\n value: number\n }> = []\n const categories: string[] = []\n\n this.regionKpiStats.forEach(stat => {\n const category = categoryMapping[stat.kpiName] || stat.kpiName\n if (!categories.includes(category)) {\n categories.push(category)\n }\n data.push({\n org: category,\n min: stat.minVal * 100,\n max: stat.maxVal * 100,\n q1: stat.q1Val * 100,\n q3: stat.q3Val * 100,\n median: stat.medVal * 100,\n mean: stat.avgVal * 100,\n value: stat.avgVal * 100\n })\n })\n\n this.chartCategories = categories.length > 0 ? categories : ['일정', '비용', '품질', '안전', '환경', '생산성']\n this.chartData = data\n }\n }\n\n // geo_group → 광역시도 매핑 (시군구 모드에서 추이 데이터 조회용)\n private static readonly GEO_TO_METRO: Record<string, string> = {\n '01':'서울특별시','02':'서울특별시','03':'서울특별시','04':'서울특별시',\n '05':'서울특별시','06':'서울특별시','07':'서울특별시','08':'서울특별시',\n '10':'경기도','11':'경기도','12':'경기도','13':'경기도','14':'경기도',\n '15':'경기도','16':'경기도','17':'경기도','18':'경기도',\n '21':'인천광역시','22':'인천광역시','23':'인천광역시',\n '24':'강원도','25':'강원도','26':'강원도','33':'강원도',\n '27':'충청북도','28':'충청북도','29':'충청북도',\n '30':'세종특별자치시','31':'충청남도','32':'충청남도',\n '34':'대전광역시','35':'대전광역시',\n '36':'경상북도','37':'경상북도','38':'경상북도','39':'경상북도','40':'경상북도',\n '41':'대구광역시','42':'대구광역시','43':'대구광역시',\n '44':'울산광역시','45':'울산광역시',\n '46':'부산광역시','47':'부산광역시','48':'부산광역시','49':'부산광역시',\n '50':'경상남도','51':'경상남도','52':'경상남도','53':'경상남도',\n '54':'전라북도','55':'전라북도','56':'전라북도',\n '57':'전라남도','58':'전라남도','59':'전라남도',\n '61':'광주광역시','62':'광주광역시','63':'제주특별자치도'\n }\n\n private generateTrendData() {\n if (!this.selectedRegion) return\n\n // 시군구 모드인 경우 소속 광역시도의 추이 데이터 사용\n const trendRegion = this.geoGroup\n ? KpiRegionPopup.GEO_TO_METRO[this.geoGroup] || this.selectedRegion\n : this.selectedRegion\n\n const regionTrendData = this.monthlyTrendData\n .filter(d => d.geoGroup === trendRegion)\n .sort((a, b) => a.yearMonth.localeCompare(b.yearMonth))\n\n this.trendData = regionTrendData.map(d => {\n const value = Math.round(d.avgVal * 100) // 20배 스케일\n return {\n date: d.yearMonth, // YYYY-MM 형식\n value: value,\n color: value > 60 ? '#4caf50' : value > 40 ? '#ff9800' : '#f44336'\n }\n })\n }\n\n private onClose() {\n this.dispatchEvent(\n new CustomEvent('popup-close', {\n bubbles: true,\n composed: true\n })\n )\n }\n\n private onChartTypeChange(type: string) {\n this.selectedChartType = type\n this.generateChartData()\n }\n\n render() {\n if (!this.selectedRegion) {\n return nothing\n }\n\n return html`\n <div class=\"popup-header\">\n <div class=\"popup-title\">${this.selectedRegion} KPI</div>\n <button class=\"popup-close\" @click=${this.onClose}>×</button>\n </div>\n <div class=\"popup-content\">\n <!-- 종합 성과 -->\n <div class=\"chart-section\">\n <div class=\"sub-title\">종합 성과</div>\n <div class=\"chart-toggle\">\n <button\n class=\"toggle-button ${this.selectedChartType === 'boxplot' ? 'active' : ''}\"\n @click=${() => this.onChartTypeChange('boxplot')}\n >\n 박스플롯\n </button>\n <button\n class=\"toggle-button ${this.selectedChartType === 'radar' ? 'active' : ''}\"\n @click=${() => this.onChartTypeChange('radar')}\n >\n 레이더차트\n </button>\n </div>\n <div class=\"chart-container\">\n ${this.selectedChartType === 'boxplot'\n ? html`\n <sv-kpi-boxplot-chart\n .data=${this.chartData}\n .groups=${this.chartCategories}\n .valueKey=${'value'}\n ></sv-kpi-boxplot-chart>\n `\n : html`\n <sv-kpi-radar-chart\n .data=${this.chartData}\n .categories=${this.chartCategories}\n .valueKey=${'value'}\n ></sv-kpi-radar-chart>\n `}\n </div>\n </div>\n\n <!-- 기간별 성과 추이 -->\n <div class=\"trend-section\">\n <div class=\"sub-title\">기간별 성과 추이</div>\n <div class=\"trend-chart-container\" style=\"height: 200px; margin-bottom: 16px;\">\n <sv-kpi-trend-chart\n .data=${this.trendData}\n .lineColor=${'#2196f3'}\n .strokeWidth=${2}\n .showPoints=${false}\n .pointRadius=${4}\n ></sv-kpi-trend-chart>\n </div>\n <div class=\"trend-table\">\n <table style=\"width: 100%; border-collapse: collapse; font-size: 0.85rem;\">\n <thead style=\"position: sticky; top: 0; background: white; z-index: 1;\">\n <tr style=\"border-bottom: 2px solid #f1f3f4; background-color: #f8f9fa;\">\n <th style=\"padding: 8px; text-align: left; font-weight: 600;\">날짜</th>\n <th style=\"padding: 8px; text-align: right; font-weight: 600;\">성과</th>\n <th style=\"padding: 8px; text-align: center; font-weight: 600;\">추이</th>\n </tr>\n </thead>\n <tbody>\n ${this.trendData.map(\n (item: any) => html`\n <tr style=\"border-bottom: 1px solid #f1f3f4;\">\n <td style=\"padding: 8px; font-size: 0.85rem;\">${item.date}</td>\n <td style=\"padding: 8px; text-align: right; font-size: 0.85rem; font-weight: 600;\">\n ${item.value.toFixed(1)}\n </td>\n <td style=\"padding: 8px; text-align: center; font-size: 0.85rem;\">\n <span style=\"color: ${item.color};\"> ${item.value > 60 ? '▲' : item.value > 40 ? '▲' : '▼'} </span>\n </td>\n </tr>\n `\n )}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class KpiAlertPanel extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
alerts: Array<{
|
|
5
|
+
level: string;
|
|
6
|
+
message: string;
|
|
7
|
+
kpi?: {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}>;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
error: string;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
fetchAlerts(): Promise<void>;
|
|
16
|
+
getIcon(level: string): "❗" | "⚠️" | "ℹ️";
|
|
17
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
18
|
+
}
|