@dssp/dkpi 1.0.0-alpha.7 → 1.0.0-alpha.71
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 +67 -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,798 @@
|
|
|
1
|
+
var KpiDashboardMapPage_1;
|
|
2
|
+
import { __decorate, __metadata } from "tslib";
|
|
3
|
+
import gql from 'graphql-tag';
|
|
4
|
+
import { html, css, nothing } from 'lit';
|
|
5
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
6
|
+
import { PageView } from '@operato/shell';
|
|
7
|
+
import { ScrollbarStyles } from '@operato/styles';
|
|
8
|
+
import { client } from '@operato/graphql';
|
|
9
|
+
import { notify } from '@operato/layout';
|
|
10
|
+
import './components/kpi-map-panel';
|
|
11
|
+
import './components/kpi-left-panel';
|
|
12
|
+
import './components/kpi-region-popup';
|
|
13
|
+
let KpiDashboardMapPage = KpiDashboardMapPage_1 = class KpiDashboardMapPage extends PageView {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.selectedCategory = '전체 KPI';
|
|
17
|
+
this.selectedPeriod = '월';
|
|
18
|
+
this.startYearMonth = ''; // YYYY-MM 형식
|
|
19
|
+
this.endYearMonth = ''; // YYYY-MM 형식
|
|
20
|
+
this.selectedSectorType = ''; // PUBLIC | PRIVATE
|
|
21
|
+
this.selectedBuildingUsage = ''; // RESIDENTIAL | NON_RESIDENTIAL
|
|
22
|
+
this.currentZoom = 7.2;
|
|
23
|
+
this.sigunguData = []; // 시군구 단위 데이터
|
|
24
|
+
this.nationalData = null;
|
|
25
|
+
this.seoulData = null;
|
|
26
|
+
this.mapData = null;
|
|
27
|
+
this.monthlyTrendData = []; // 월별 추이 데이터
|
|
28
|
+
this.totalKpiYStats = []; // 전체 Y-level KPI 통계
|
|
29
|
+
this.regionalKpiStats = []; // 지역별 KPI 통계
|
|
30
|
+
// 팝업 관련 상태 추가
|
|
31
|
+
this.selectedRegion = null;
|
|
32
|
+
this.selectedGeoGroup = null; // 시군구 geo_group 코드
|
|
33
|
+
this.showRegionPopup = false;
|
|
34
|
+
}
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
super.connectedCallback();
|
|
37
|
+
this.initializeDefaultPeriod();
|
|
38
|
+
this.fetchDashboardData();
|
|
39
|
+
this.setupKeyboardEvents();
|
|
40
|
+
}
|
|
41
|
+
initializeDefaultPeriod() {
|
|
42
|
+
const now = new Date();
|
|
43
|
+
const currentYear = now.getFullYear();
|
|
44
|
+
const currentMonth = now.getMonth() + 1; // 0-based이므로 +1
|
|
45
|
+
// 12개월 전 계산
|
|
46
|
+
const startDate = new Date(now);
|
|
47
|
+
startDate.setMonth(startDate.getMonth() - 11); // 현재 월 포함 12개월
|
|
48
|
+
const startYear = startDate.getFullYear();
|
|
49
|
+
const startMonth = startDate.getMonth() + 1;
|
|
50
|
+
this.startYearMonth = `${startYear}-${startMonth.toString().padStart(2, '0')}`;
|
|
51
|
+
this.endYearMonth = `${currentYear}-${currentMonth.toString().padStart(2, '0')}`;
|
|
52
|
+
}
|
|
53
|
+
setupKeyboardEvents() {
|
|
54
|
+
document.addEventListener('keydown', e => {
|
|
55
|
+
if (e.key === 'Escape' && this.showRegionPopup) {
|
|
56
|
+
this.closeRegionPopup();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async fetchDashboardData() {
|
|
61
|
+
try {
|
|
62
|
+
// 새로운 KpiStatistic 구조 사용 - 지역별 집계된 통계 데이터 조회
|
|
63
|
+
const currentMonth = new Date().toISOString().substring(0, 7); // YYYY-MM
|
|
64
|
+
const statisticsResponse = await client.query({
|
|
65
|
+
query: gql `
|
|
66
|
+
query GetDashboardStatistics($valueDate: String!) {
|
|
67
|
+
regionalKpiStatistics(periodType: MONTH, valueDate: $valueDate) {
|
|
68
|
+
id
|
|
69
|
+
mean
|
|
70
|
+
median
|
|
71
|
+
count
|
|
72
|
+
minimum
|
|
73
|
+
maximum
|
|
74
|
+
standardDeviation
|
|
75
|
+
kpi {
|
|
76
|
+
id
|
|
77
|
+
name
|
|
78
|
+
description
|
|
79
|
+
}
|
|
80
|
+
kpiOrgScope {
|
|
81
|
+
id
|
|
82
|
+
scope02
|
|
83
|
+
entityName
|
|
84
|
+
org
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`,
|
|
89
|
+
variables: { valueDate: currentMonth }
|
|
90
|
+
});
|
|
91
|
+
this.nationalData = statisticsResponse.data.regionalKpiStatistics || [];
|
|
92
|
+
// 통계 데이터로부터 지도 데이터 생성
|
|
93
|
+
this.generateMapDataFromStatistics();
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
// KpiStatistic이 없는 경우 기존 방식으로 폴백
|
|
97
|
+
await this.fetchDashboardDataFallback();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// 폴백: KpiValue를 직접 집계하는 기존 방식
|
|
101
|
+
async fetchDashboardDataFallback() {
|
|
102
|
+
try {
|
|
103
|
+
const kpiResponse = await client.query({
|
|
104
|
+
query: gql `
|
|
105
|
+
query {
|
|
106
|
+
kpisLevel1 {
|
|
107
|
+
id
|
|
108
|
+
name
|
|
109
|
+
description
|
|
110
|
+
isLeaf
|
|
111
|
+
children {
|
|
112
|
+
id
|
|
113
|
+
name
|
|
114
|
+
isLeaf
|
|
115
|
+
value {
|
|
116
|
+
id
|
|
117
|
+
value
|
|
118
|
+
score
|
|
119
|
+
valueDate
|
|
120
|
+
kpiOrgScope {
|
|
121
|
+
id
|
|
122
|
+
entityName
|
|
123
|
+
org
|
|
124
|
+
scope01
|
|
125
|
+
scope02
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
value {
|
|
130
|
+
id
|
|
131
|
+
value
|
|
132
|
+
score
|
|
133
|
+
valueDate
|
|
134
|
+
kpiOrgScope {
|
|
135
|
+
id
|
|
136
|
+
entityName
|
|
137
|
+
org
|
|
138
|
+
scope01
|
|
139
|
+
scope02
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
`
|
|
145
|
+
});
|
|
146
|
+
this.nationalData = kpiResponse.data.kpisLevel1 || [];
|
|
147
|
+
this.generateMapDataFromKpiValues();
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
notify({
|
|
151
|
+
level: 'error',
|
|
152
|
+
message: '대시보드 데이터를 불러오지 못했습니다.'
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
generateMapDataFromKpiValues() {
|
|
157
|
+
// 실제 KPI 데이터로부터 지도 데이터 생성
|
|
158
|
+
const regionCoordinates = {
|
|
159
|
+
서울: { lat: 37.5665, lng: 126.978 },
|
|
160
|
+
부산: { lat: 35.1796, lng: 129.0756 },
|
|
161
|
+
대구: { lat: 35.8714, lng: 128.6014 },
|
|
162
|
+
인천: { lat: 37.4563, lng: 126.7052 },
|
|
163
|
+
광주: { lat: 35.1595, lng: 126.8526 },
|
|
164
|
+
대전: { lat: 36.3504, lng: 127.3845 },
|
|
165
|
+
울산: { lat: 35.5384, lng: 129.3114 },
|
|
166
|
+
세종: { lat: 36.4875, lng: 127.2816 },
|
|
167
|
+
경기: { lat: 37.4138, lng: 127.5183 },
|
|
168
|
+
강원: { lat: 37.8228, lng: 128.1555 },
|
|
169
|
+
충북: { lat: 36.8, lng: 127.7 },
|
|
170
|
+
충남: { lat: 36.5184, lng: 126.8 },
|
|
171
|
+
전북: { lat: 35.7175, lng: 127.153 },
|
|
172
|
+
전남: { lat: 34.8679, lng: 126.991 },
|
|
173
|
+
경북: { lat: 36.4919, lng: 128.8889 },
|
|
174
|
+
경남: { lat: 35.4606, lng: 128.2132 },
|
|
175
|
+
제주: { lat: 33.4996, lng: 126.5312 }
|
|
176
|
+
};
|
|
177
|
+
const mapDataMap = new Map();
|
|
178
|
+
// nationalData에서 KPI 값들을 지역별로 집계
|
|
179
|
+
this.nationalData.forEach((kpi) => {
|
|
180
|
+
// KPI 자체에 값이 있는 경우 (leaf KPI)
|
|
181
|
+
if (kpi.value && kpi.value.kpiOrgScope) {
|
|
182
|
+
const region = kpi.value.kpiOrgScope.scope02; // 시도는 scope02에 저장
|
|
183
|
+
if (region && regionCoordinates[region]) {
|
|
184
|
+
if (!mapDataMap.has(region)) {
|
|
185
|
+
mapDataMap.set(region, Object.assign({ region, values: [], scores: [] }, regionCoordinates[region]));
|
|
186
|
+
}
|
|
187
|
+
mapDataMap.get(region).values.push(kpi.value.value);
|
|
188
|
+
mapDataMap.get(region).scores.push(kpi.value.score);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// 하위 KPI들의 값들도 처리
|
|
192
|
+
if (kpi.children) {
|
|
193
|
+
kpi.children.forEach((child) => {
|
|
194
|
+
if (child.value && child.value.kpiOrgScope) {
|
|
195
|
+
const region = child.value.kpiOrgScope.scope02; // 시도는 scope02에 저장
|
|
196
|
+
if (region && regionCoordinates[region]) {
|
|
197
|
+
if (!mapDataMap.has(region)) {
|
|
198
|
+
mapDataMap.set(region, Object.assign({ region, values: [], scores: [] }, regionCoordinates[region]));
|
|
199
|
+
}
|
|
200
|
+
mapDataMap.get(region).values.push(child.value.value);
|
|
201
|
+
mapDataMap.get(region).scores.push(child.value.score);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
// 지역별 평균 계산 및 최종 지도 데이터 생성
|
|
208
|
+
this.mapData = Array.from(mapDataMap.values()).map(regionData => {
|
|
209
|
+
const avgValue = regionData.values.length > 0
|
|
210
|
+
? regionData.values.reduce((sum, val) => sum + val, 0) / regionData.values.length
|
|
211
|
+
: 0;
|
|
212
|
+
const avgScore = regionData.scores.length > 0
|
|
213
|
+
? regionData.scores.reduce((sum, val) => sum + val, 0) / regionData.scores.length
|
|
214
|
+
: 0;
|
|
215
|
+
// 간단한 변화율 계산 (실제로는 이전 기간과 비교해야 함)
|
|
216
|
+
const change = (Math.random() - 0.5) * 0.4; // 임시로 -0.2 ~ 0.2 범위
|
|
217
|
+
const trend = change >= 0 ? 'up' : 'down';
|
|
218
|
+
return {
|
|
219
|
+
region: regionData.region,
|
|
220
|
+
kpi: parseFloat(avgValue.toFixed(1)),
|
|
221
|
+
score: parseFloat(avgScore.toFixed(3)),
|
|
222
|
+
change: parseFloat(change.toFixed(2)),
|
|
223
|
+
trend,
|
|
224
|
+
lat: regionData.lat,
|
|
225
|
+
lng: regionData.lng,
|
|
226
|
+
dataCount: regionData.values.length
|
|
227
|
+
};
|
|
228
|
+
});
|
|
229
|
+
// 데이터가 없는 지역들도 기본값으로 추가
|
|
230
|
+
Object.keys(regionCoordinates).forEach(region => {
|
|
231
|
+
if (!mapDataMap.has(region)) {
|
|
232
|
+
this.mapData.push({
|
|
233
|
+
region,
|
|
234
|
+
kpi: 0,
|
|
235
|
+
score: 0,
|
|
236
|
+
change: 0,
|
|
237
|
+
trend: 'neutral',
|
|
238
|
+
lat: regionCoordinates[region].lat,
|
|
239
|
+
lng: regionCoordinates[region].lng,
|
|
240
|
+
dataCount: 0
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
generateMapDataFromStatistics() {
|
|
246
|
+
// KpiStatistic 데이터로부터 지도 데이터 생성 (최적화된 버전)
|
|
247
|
+
const regionCoordinates = {
|
|
248
|
+
서울: { lat: 37.5665, lng: 126.978 },
|
|
249
|
+
부산: { lat: 35.1796, lng: 129.0756 },
|
|
250
|
+
대구: { lat: 35.8714, lng: 128.6014 },
|
|
251
|
+
인천: { lat: 37.4563, lng: 126.7052 },
|
|
252
|
+
광주: { lat: 35.1595, lng: 126.8526 },
|
|
253
|
+
대전: { lat: 36.3504, lng: 127.3845 },
|
|
254
|
+
울산: { lat: 35.5384, lng: 129.3114 },
|
|
255
|
+
세종: { lat: 36.4875, lng: 127.2816 },
|
|
256
|
+
경기: { lat: 37.4138, lng: 127.5183 },
|
|
257
|
+
강원: { lat: 37.8228, lng: 128.1555 },
|
|
258
|
+
충북: { lat: 36.8, lng: 127.7 },
|
|
259
|
+
충남: { lat: 36.5184, lng: 126.8 },
|
|
260
|
+
전북: { lat: 35.7175, lng: 127.153 },
|
|
261
|
+
전남: { lat: 34.8679, lng: 126.991 },
|
|
262
|
+
경북: { lat: 36.4919, lng: 128.8889 },
|
|
263
|
+
경남: { lat: 35.4606, lng: 128.2132 },
|
|
264
|
+
제주: { lat: 33.4996, lng: 126.5312 }
|
|
265
|
+
};
|
|
266
|
+
const mapDataMap = new Map();
|
|
267
|
+
// 통계 데이터를 지역별로 집계 (이미 서버에서 계산된 데이터 사용)
|
|
268
|
+
this.nationalData.forEach((statistic) => {
|
|
269
|
+
var _a;
|
|
270
|
+
const region = (_a = statistic.kpiOrgScope) === null || _a === void 0 ? void 0 : _a.scope02;
|
|
271
|
+
if (region && regionCoordinates[region]) {
|
|
272
|
+
if (!mapDataMap.has(region)) {
|
|
273
|
+
mapDataMap.set(region, Object.assign({ region, means: [], counts: [] }, regionCoordinates[region]));
|
|
274
|
+
}
|
|
275
|
+
// 통계값 집계 (이미 계산된 평균값들 사용)
|
|
276
|
+
mapDataMap.get(region).means.push(statistic.mean || 0);
|
|
277
|
+
mapDataMap.get(region).counts.push(statistic.count || 0);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
// 지역별 최종 평균 계산 및 지도 데이터 생성
|
|
281
|
+
this.mapData = Array.from(mapDataMap.values()).map(regionData => {
|
|
282
|
+
const avgValue = regionData.means.length > 0
|
|
283
|
+
? regionData.means.reduce((sum, val) => sum + val, 0) / regionData.means.length
|
|
284
|
+
: 0;
|
|
285
|
+
const totalCount = regionData.counts.reduce((sum, val) => sum + val, 0);
|
|
286
|
+
// 간단한 변화율 계산 (실제로는 이전 기간과 비교해야 함)
|
|
287
|
+
const change = (Math.random() - 0.5) * 0.4;
|
|
288
|
+
const trend = change >= 0 ? 'up' : 'down';
|
|
289
|
+
return {
|
|
290
|
+
region: regionData.region,
|
|
291
|
+
kpi: parseFloat(avgValue.toFixed(1)),
|
|
292
|
+
change: parseFloat(change.toFixed(2)),
|
|
293
|
+
trend,
|
|
294
|
+
lat: regionData.lat,
|
|
295
|
+
lng: regionData.lng,
|
|
296
|
+
dataCount: totalCount,
|
|
297
|
+
statisticsCount: regionData.means.length // 통계 항목 수
|
|
298
|
+
};
|
|
299
|
+
});
|
|
300
|
+
// 데이터가 없는 지역들도 기본값으로 추가
|
|
301
|
+
Object.keys(regionCoordinates).forEach(region => {
|
|
302
|
+
if (!mapDataMap.has(region)) {
|
|
303
|
+
this.mapData.push({
|
|
304
|
+
region,
|
|
305
|
+
kpi: 0,
|
|
306
|
+
change: 0,
|
|
307
|
+
trend: 'neutral',
|
|
308
|
+
lat: regionCoordinates[region].lat,
|
|
309
|
+
lng: regionCoordinates[region].lng,
|
|
310
|
+
dataCount: 0,
|
|
311
|
+
statisticsCount: 0
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
generateMapDataFromRegionalStats() {
|
|
317
|
+
// regionalKpiStats와 monthlyTrendData를 사용하여 지도 데이터 생성
|
|
318
|
+
const regionCoordinates = {
|
|
319
|
+
서울특별시: { lat: 37.5665, lng: 126.978 },
|
|
320
|
+
부산광역시: { lat: 35.1796, lng: 129.0756 },
|
|
321
|
+
대구광역시: { lat: 35.8714, lng: 128.6014 },
|
|
322
|
+
인천광역시: { lat: 37.4563, lng: 126.7052 },
|
|
323
|
+
광주광역시: { lat: 35.1595, lng: 126.8526 },
|
|
324
|
+
대전광역시: { lat: 36.3504, lng: 127.3845 },
|
|
325
|
+
울산광역시: { lat: 35.5384, lng: 129.3114 },
|
|
326
|
+
세종특별자치시: { lat: 36.4875, lng: 127.2816 },
|
|
327
|
+
경기도: { lat: 37.4138, lng: 127.5183 },
|
|
328
|
+
강원도: { lat: 37.8228, lng: 128.1555 },
|
|
329
|
+
충청북도: { lat: 36.8, lng: 127.7 },
|
|
330
|
+
충청남도: { lat: 36.5184, lng: 126.8 },
|
|
331
|
+
전라북도: { lat: 35.7175, lng: 127.153 },
|
|
332
|
+
전라남도: { lat: 34.8679, lng: 126.991 },
|
|
333
|
+
경상북도: { lat: 36.4919, lng: 128.8889 },
|
|
334
|
+
경상남도: { lat: 35.4606, lng: 128.2132 },
|
|
335
|
+
제주특별자치도: { lat: 33.4996, lng: 126.5312 }
|
|
336
|
+
};
|
|
337
|
+
this.mapData = Object.keys(regionCoordinates).map(regionName => {
|
|
338
|
+
const stat = this.regionalKpiStats.find(s => s.geoGroup === regionName);
|
|
339
|
+
const changeRate = this.calculateChangeRate(regionName);
|
|
340
|
+
return {
|
|
341
|
+
region: regionName,
|
|
342
|
+
kpi: stat ? (stat.avgVal * 100).toFixed(1) : '0.0',
|
|
343
|
+
change: changeRate.toFixed(2),
|
|
344
|
+
trend: changeRate >= 0 ? 'up' : 'down',
|
|
345
|
+
lat: regionCoordinates[regionName].lat,
|
|
346
|
+
lng: regionCoordinates[regionName].lng,
|
|
347
|
+
dataCount: (stat === null || stat === void 0 ? void 0 : stat.projectCount) || 0
|
|
348
|
+
};
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
async fetchSigunguData() {
|
|
352
|
+
try {
|
|
353
|
+
const categoryToKpiName = {
|
|
354
|
+
'전체 KPI': null,
|
|
355
|
+
'일정 성과': 'Y1. 일정성과',
|
|
356
|
+
'비용 성과': 'Y2. 비용성과',
|
|
357
|
+
'품질 성과': 'Y3. 품질성과',
|
|
358
|
+
'안전 성과': 'Y4. 안전성과',
|
|
359
|
+
'환경 성과': 'Y5. 환경성과',
|
|
360
|
+
'생산성 성과': 'Y6. 생산성성과'
|
|
361
|
+
};
|
|
362
|
+
const kpiName = categoryToKpiName[this.selectedCategory];
|
|
363
|
+
const response = await client.query({
|
|
364
|
+
query: gql `
|
|
365
|
+
query GetSigunguStats(
|
|
366
|
+
$kpiName: String
|
|
367
|
+
$startYearMonth: String
|
|
368
|
+
$endYearMonth: String
|
|
369
|
+
$sectorType: String
|
|
370
|
+
$buildingUsage: String
|
|
371
|
+
) {
|
|
372
|
+
kpiZValueStatsBySigungu(
|
|
373
|
+
kpiName: $kpiName
|
|
374
|
+
startYearMonth: $startYearMonth
|
|
375
|
+
endYearMonth: $endYearMonth
|
|
376
|
+
sectorType: $sectorType
|
|
377
|
+
buildingUsage: $buildingUsage
|
|
378
|
+
) {
|
|
379
|
+
geoGroup
|
|
380
|
+
avgVal
|
|
381
|
+
minVal
|
|
382
|
+
maxVal
|
|
383
|
+
projectCount
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
`,
|
|
387
|
+
variables: {
|
|
388
|
+
kpiName,
|
|
389
|
+
startYearMonth: this.startYearMonth || null,
|
|
390
|
+
endYearMonth: this.endYearMonth || null,
|
|
391
|
+
sectorType: this.selectedSectorType || null,
|
|
392
|
+
buildingUsage: this.selectedBuildingUsage || null
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
this.sigunguData = response.data.kpiZValueStatsBySigungu || [];
|
|
396
|
+
this.generateSigunguMapData();
|
|
397
|
+
}
|
|
398
|
+
catch (e) {
|
|
399
|
+
console.error('시군구 데이터 조회 실패:', e);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
calculateChangeRate(metroName) {
|
|
403
|
+
const regionMonthlyData = this.monthlyTrendData
|
|
404
|
+
.filter((d) => d.geoGroup === metroName)
|
|
405
|
+
.sort((a, b) => a.yearMonth.localeCompare(b.yearMonth));
|
|
406
|
+
if (regionMonthlyData.length >= 2) {
|
|
407
|
+
const oldest = regionMonthlyData[0].avgVal;
|
|
408
|
+
const latest = regionMonthlyData[regionMonthlyData.length - 1].avgVal;
|
|
409
|
+
if (oldest !== 0) {
|
|
410
|
+
return ((latest - oldest) / oldest) * 100;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return 0;
|
|
414
|
+
}
|
|
415
|
+
generateSigunguMapData() {
|
|
416
|
+
const map = KpiDashboardMapPage_1.SIGUNGU_MAP;
|
|
417
|
+
const geoToMetro = KpiDashboardMapPage_1.GEO_TO_METRO;
|
|
418
|
+
this.mapData = this.sigunguData
|
|
419
|
+
.filter((s) => s.geoGroup && map[s.geoGroup])
|
|
420
|
+
.map((s) => {
|
|
421
|
+
const info = map[s.geoGroup];
|
|
422
|
+
const metro = geoToMetro[s.geoGroup] || '';
|
|
423
|
+
const changeRate = this.calculateChangeRate(metro);
|
|
424
|
+
return {
|
|
425
|
+
region: info.name,
|
|
426
|
+
kpi: (s.avgVal * 100).toFixed(1),
|
|
427
|
+
change: changeRate.toFixed(2),
|
|
428
|
+
trend: changeRate >= 0 ? 'up' : 'down',
|
|
429
|
+
lat: info.lat,
|
|
430
|
+
lng: info.lng,
|
|
431
|
+
dataCount: s.projectCount || 0
|
|
432
|
+
};
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
onZoomChanged(e) {
|
|
436
|
+
const newZoom = e.detail.zoom;
|
|
437
|
+
const threshold = KpiDashboardMapPage_1.SIGUNGU_ZOOM_THRESHOLD;
|
|
438
|
+
const wasAbove = this.currentZoom >= threshold;
|
|
439
|
+
const isAbove = newZoom >= threshold;
|
|
440
|
+
this.currentZoom = newZoom;
|
|
441
|
+
// 줌 레벨이 threshold를 넘나들 때만 데이터 전환
|
|
442
|
+
if (wasAbove !== isAbove) {
|
|
443
|
+
if (isAbove) {
|
|
444
|
+
this.fetchSigunguData();
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
this.generateMapDataFromRegionalStats();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
focusMapOnRegion(regionName) {
|
|
452
|
+
var _a;
|
|
453
|
+
const bounds = KpiDashboardMapPage_1.METRO_BOUNDS[regionName];
|
|
454
|
+
if (!bounds)
|
|
455
|
+
return;
|
|
456
|
+
const mapPanel = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('kpi-map-panel');
|
|
457
|
+
mapPanel === null || mapPanel === void 0 ? void 0 : mapPanel.focusOnLocation(bounds.lat, bounds.lng, bounds.zoom);
|
|
458
|
+
}
|
|
459
|
+
downloadExcel() {
|
|
460
|
+
}
|
|
461
|
+
onRegionClick(region) {
|
|
462
|
+
this.selectedRegion = region;
|
|
463
|
+
// 시군구 모드인 경우 region name → geo_group 코드 역매핑
|
|
464
|
+
const sigunguMap = KpiDashboardMapPage_1.SIGUNGU_MAP;
|
|
465
|
+
const entry = Object.entries(sigunguMap).find(([, v]) => v.name === region);
|
|
466
|
+
this.selectedGeoGroup = entry ? entry[0] : null;
|
|
467
|
+
this.showRegionPopup = true;
|
|
468
|
+
// fetchRegionData는 더 이상 필요하지 않음 (kpi-region-popup에서 직접 데이터 가져옴)
|
|
469
|
+
// this.fetchRegionData(region)
|
|
470
|
+
}
|
|
471
|
+
closeRegionPopup() {
|
|
472
|
+
this.showRegionPopup = false;
|
|
473
|
+
this.selectedRegion = null;
|
|
474
|
+
}
|
|
475
|
+
async fetchRegionData(region) {
|
|
476
|
+
try {
|
|
477
|
+
const response = await client.query({
|
|
478
|
+
query: gql `
|
|
479
|
+
query GetRegionKpiData($filters: [Filter!]) {
|
|
480
|
+
kpiValues(filters: $filters) {
|
|
481
|
+
items {
|
|
482
|
+
id
|
|
483
|
+
value
|
|
484
|
+
score
|
|
485
|
+
valueDate
|
|
486
|
+
kpiOrgScope {
|
|
487
|
+
id
|
|
488
|
+
org
|
|
489
|
+
scope01
|
|
490
|
+
scope02
|
|
491
|
+
entityName
|
|
492
|
+
}
|
|
493
|
+
kpi {
|
|
494
|
+
id
|
|
495
|
+
name
|
|
496
|
+
parent {
|
|
497
|
+
id
|
|
498
|
+
name
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
total
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
`,
|
|
506
|
+
variables: {
|
|
507
|
+
filters: [{ name: 'kpiOrgScope.scope02', operator: 'eq', value: region }]
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
this.seoulData = response.data.kpiValues.items || [];
|
|
511
|
+
}
|
|
512
|
+
catch (e) {
|
|
513
|
+
notify({
|
|
514
|
+
level: 'error',
|
|
515
|
+
message: '지역 데이터를 불러오지 못했습니다.'
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
get context() {
|
|
520
|
+
return {
|
|
521
|
+
title: '전국 KPI 대시보드',
|
|
522
|
+
description: '전국 및 지역별 KPI 성과 분석 대시보드'
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
_onSectorTypeChange(e) {
|
|
526
|
+
this.selectedSectorType = e.target.value;
|
|
527
|
+
}
|
|
528
|
+
_onBuildingUsageChange(e) {
|
|
529
|
+
this.selectedBuildingUsage = e.target.value;
|
|
530
|
+
}
|
|
531
|
+
render() {
|
|
532
|
+
return html `
|
|
533
|
+
<div class="dashboard-container">
|
|
534
|
+
<!-- 좌측 패널: 전국 KPI -->
|
|
535
|
+
<kpi-left-panel
|
|
536
|
+
.selectedCategory=${this.selectedCategory}
|
|
537
|
+
.startYearMonth=${this.startYearMonth}
|
|
538
|
+
.endYearMonth=${this.endYearMonth}
|
|
539
|
+
.sectorType=${this.selectedSectorType}
|
|
540
|
+
.buildingUsage=${this.selectedBuildingUsage}
|
|
541
|
+
.mapData=${this.mapData}
|
|
542
|
+
@category-change=${(e) => {
|
|
543
|
+
this.selectedCategory = e.detail.category;
|
|
544
|
+
}}
|
|
545
|
+
@region-click=${(e) => {
|
|
546
|
+
this.onRegionClick(e.detail.region);
|
|
547
|
+
}}
|
|
548
|
+
@focus-region=${(e) => {
|
|
549
|
+
this.focusMapOnRegion(e.detail.region);
|
|
550
|
+
}}
|
|
551
|
+
@monthly-trend-data-loaded=${(e) => {
|
|
552
|
+
this.monthlyTrendData = e.detail.data;
|
|
553
|
+
this.generateMapDataFromRegionalStats();
|
|
554
|
+
}}
|
|
555
|
+
@total-kpi-y-stats-loaded=${(e) => {
|
|
556
|
+
this.totalKpiYStats = e.detail.data;
|
|
557
|
+
}}
|
|
558
|
+
@regional-kpi-stats-loaded=${(e) => {
|
|
559
|
+
this.regionalKpiStats = e.detail.data;
|
|
560
|
+
this.generateMapDataFromRegionalStats();
|
|
561
|
+
}}
|
|
562
|
+
@download-excel=${this.downloadExcel}
|
|
563
|
+
></kpi-left-panel>
|
|
564
|
+
|
|
565
|
+
<!-- 우측 패널: 지도 -->
|
|
566
|
+
<kpi-map-panel
|
|
567
|
+
class="right-panel"
|
|
568
|
+
.selectedCategory=${this.selectedCategory}
|
|
569
|
+
.mapData=${this.mapData}
|
|
570
|
+
@region-click=${(e) => {
|
|
571
|
+
this.onRegionClick(e.detail.region);
|
|
572
|
+
}}
|
|
573
|
+
@zoom-changed=${(e) => {
|
|
574
|
+
this.onZoomChanged(e);
|
|
575
|
+
}}
|
|
576
|
+
></kpi-map-panel>
|
|
577
|
+
|
|
578
|
+
<!-- 지역 상세 팝업 -->
|
|
579
|
+
${this.showRegionPopup
|
|
580
|
+
? html `
|
|
581
|
+
<kpi-region-popup
|
|
582
|
+
.selectedRegion=${this.selectedRegion}
|
|
583
|
+
.geoGroup=${this.selectedGeoGroup}
|
|
584
|
+
.selectedCategory=${this.selectedCategory}
|
|
585
|
+
.monthlyTrendData=${this.monthlyTrendData}
|
|
586
|
+
.totalKpiStats=${this.totalKpiYStats}
|
|
587
|
+
.startYearMonth=${this.startYearMonth}
|
|
588
|
+
.endYearMonth=${this.endYearMonth}
|
|
589
|
+
@popup-close=${this.closeRegionPopup}
|
|
590
|
+
></kpi-region-popup>
|
|
591
|
+
`
|
|
592
|
+
: nothing}
|
|
593
|
+
</div>
|
|
594
|
+
`;
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
KpiDashboardMapPage.styles = [
|
|
598
|
+
ScrollbarStyles,
|
|
599
|
+
css `
|
|
600
|
+
:host {
|
|
601
|
+
display: flex;
|
|
602
|
+
flex-direction: column;
|
|
603
|
+
overflow: hidden;
|
|
604
|
+
position: relative;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.dashboard-container {
|
|
608
|
+
display: flex;
|
|
609
|
+
flex: 1;
|
|
610
|
+
overflow: hidden;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.right-panel {
|
|
614
|
+
flex: 1;
|
|
615
|
+
background: #f8f9fa;
|
|
616
|
+
overflow: hidden;
|
|
617
|
+
position: relative;
|
|
618
|
+
}
|
|
619
|
+
`
|
|
620
|
+
];
|
|
621
|
+
KpiDashboardMapPage.SIGUNGU_ZOOM_THRESHOLD = 10;
|
|
622
|
+
// 시군구별 좌표 (geo_group 2자리 코드 → { name, lat, lng })
|
|
623
|
+
KpiDashboardMapPage.SIGUNGU_MAP = {
|
|
624
|
+
'01': { name: '서울 종로구', lat: 37.5735, lng: 126.9790 },
|
|
625
|
+
'02': { name: '서울 중구', lat: 37.5641, lng: 126.9979 },
|
|
626
|
+
'03': { name: '서울 용산구', lat: 37.5326, lng: 126.9906 },
|
|
627
|
+
'04': { name: '서울 성동구', lat: 37.5634, lng: 127.0369 },
|
|
628
|
+
'05': { name: '서울 광진구', lat: 37.5385, lng: 127.0823 },
|
|
629
|
+
'06': { name: '서울 강남구', lat: 37.5172, lng: 127.0473 },
|
|
630
|
+
'07': { name: '서울 송파구', lat: 37.5145, lng: 127.1060 },
|
|
631
|
+
'08': { name: '서울 강서구', lat: 37.5510, lng: 126.8495 },
|
|
632
|
+
'10': { name: '수원시', lat: 37.2636, lng: 127.0286 },
|
|
633
|
+
'11': { name: '성남시', lat: 37.4200, lng: 127.1265 },
|
|
634
|
+
'12': { name: '고양시', lat: 37.6584, lng: 126.8320 },
|
|
635
|
+
'13': { name: '용인시', lat: 37.2411, lng: 127.1776 },
|
|
636
|
+
'14': { name: '부천시', lat: 37.5034, lng: 126.7660 },
|
|
637
|
+
'15': { name: '안산시', lat: 37.3219, lng: 126.8309 },
|
|
638
|
+
'16': { name: '화성시', lat: 37.1995, lng: 126.8312 },
|
|
639
|
+
'17': { name: '평택시', lat: 36.9921, lng: 127.1127 },
|
|
640
|
+
'18': { name: '파주시', lat: 37.7599, lng: 126.7799 },
|
|
641
|
+
'21': { name: '인천 남동구', lat: 37.4488, lng: 126.7308 },
|
|
642
|
+
'22': { name: '인천 부평구', lat: 37.5076, lng: 126.7218 },
|
|
643
|
+
'23': { name: '인천 서구', lat: 37.5458, lng: 126.6760 },
|
|
644
|
+
'24': { name: '춘천시', lat: 37.8813, lng: 127.7300 },
|
|
645
|
+
'25': { name: '원주시', lat: 37.3422, lng: 127.9202 },
|
|
646
|
+
'26': { name: '강릉시', lat: 37.7519, lng: 128.8761 },
|
|
647
|
+
'27': { name: '청주시', lat: 36.6424, lng: 127.4890 },
|
|
648
|
+
'28': { name: '충주시', lat: 36.9910, lng: 127.9259 },
|
|
649
|
+
'29': { name: '제천시', lat: 37.1327, lng: 128.1910 },
|
|
650
|
+
'30': { name: '세종시', lat: 36.4875, lng: 127.2816 },
|
|
651
|
+
'31': { name: '천안시', lat: 36.8151, lng: 127.1139 },
|
|
652
|
+
'32': { name: '아산시', lat: 36.7898, lng: 127.0018 },
|
|
653
|
+
'33': { name: '속초시', lat: 38.2071, lng: 128.5918 },
|
|
654
|
+
'34': { name: '대전 서구', lat: 36.3555, lng: 127.3835 },
|
|
655
|
+
'35': { name: '대전 유성구', lat: 36.3622, lng: 127.3561 },
|
|
656
|
+
'36': { name: '포항시', lat: 36.0190, lng: 129.3435 },
|
|
657
|
+
'37': { name: '경주시', lat: 35.8562, lng: 129.2247 },
|
|
658
|
+
'38': { name: '구미시', lat: 36.1196, lng: 128.3443 },
|
|
659
|
+
'39': { name: '안동시', lat: 36.5684, lng: 128.7294 },
|
|
660
|
+
'40': { name: '김천시', lat: 36.1398, lng: 128.1136 },
|
|
661
|
+
'41': { name: '대구 중구', lat: 35.8693, lng: 128.6062 },
|
|
662
|
+
'42': { name: '대구 수성구', lat: 35.8584, lng: 128.6308 },
|
|
663
|
+
'43': { name: '대구 달서구', lat: 35.8299, lng: 128.5327 },
|
|
664
|
+
'44': { name: '울산 남구', lat: 35.5444, lng: 129.3304 },
|
|
665
|
+
'45': { name: '울산 중구', lat: 35.5696, lng: 129.3324 },
|
|
666
|
+
'46': { name: '부산 중구', lat: 35.1060, lng: 129.0324 },
|
|
667
|
+
'47': { name: '부산 해운대구', lat: 35.1631, lng: 129.1636 },
|
|
668
|
+
'48': { name: '부산 사하구', lat: 35.1046, lng: 128.9751 },
|
|
669
|
+
'49': { name: '부산 금정구', lat: 35.2431, lng: 129.0923 },
|
|
670
|
+
'50': { name: '창원시', lat: 35.2281, lng: 128.6812 },
|
|
671
|
+
'51': { name: '김해시', lat: 35.2285, lng: 128.8894 },
|
|
672
|
+
'52': { name: '진주시', lat: 35.1798, lng: 128.1076 },
|
|
673
|
+
'53': { name: '양산시', lat: 35.3350, lng: 129.0373 },
|
|
674
|
+
'54': { name: '전주시', lat: 35.8242, lng: 127.1480 },
|
|
675
|
+
'55': { name: '익산시', lat: 35.9483, lng: 126.9576 },
|
|
676
|
+
'56': { name: '군산시', lat: 35.9676, lng: 126.7369 },
|
|
677
|
+
'57': { name: '목포시', lat: 34.8118, lng: 126.3922 },
|
|
678
|
+
'58': { name: '여수시', lat: 34.7604, lng: 127.6622 },
|
|
679
|
+
'59': { name: '순천시', lat: 34.9506, lng: 127.4873 },
|
|
680
|
+
'61': { name: '광주 서구', lat: 35.1525, lng: 126.8895 },
|
|
681
|
+
'62': { name: '광주 북구', lat: 35.1744, lng: 126.9120 },
|
|
682
|
+
'63': { name: '제주시', lat: 33.4996, lng: 126.5312 }
|
|
683
|
+
};
|
|
684
|
+
// geo_group 코드 → 광역시도 매핑
|
|
685
|
+
KpiDashboardMapPage.GEO_TO_METRO = {
|
|
686
|
+
'01': '서울특별시', '02': '서울특별시', '03': '서울특별시', '04': '서울특별시',
|
|
687
|
+
'05': '서울특별시', '06': '서울특별시', '07': '서울특별시', '08': '서울특별시',
|
|
688
|
+
'10': '경기도', '11': '경기도', '12': '경기도', '13': '경기도', '14': '경기도',
|
|
689
|
+
'15': '경기도', '16': '경기도', '17': '경기도', '18': '경기도',
|
|
690
|
+
'21': '인천광역시', '22': '인천광역시', '23': '인천광역시',
|
|
691
|
+
'24': '강원도', '25': '강원도', '26': '강원도', '33': '강원도',
|
|
692
|
+
'27': '충청북도', '28': '충청북도', '29': '충청북도',
|
|
693
|
+
'30': '세종특별자치시',
|
|
694
|
+
'31': '충청남도', '32': '충청남도',
|
|
695
|
+
'34': '대전광역시', '35': '대전광역시',
|
|
696
|
+
'36': '경상북도', '37': '경상북도', '38': '경상북도', '39': '경상북도', '40': '경상북도',
|
|
697
|
+
'41': '대구광역시', '42': '대구광역시', '43': '대구광역시',
|
|
698
|
+
'44': '울산광역시', '45': '울산광역시',
|
|
699
|
+
'46': '부산광역시', '47': '부산광역시', '48': '부산광역시', '49': '부산광역시',
|
|
700
|
+
'50': '경상남도', '51': '경상남도', '52': '경상남도', '53': '경상남도',
|
|
701
|
+
'54': '전라북도', '55': '전라북도', '56': '전라북도',
|
|
702
|
+
'57': '전라남도', '58': '전라남도', '59': '전라남도',
|
|
703
|
+
'61': '광주광역시', '62': '광주광역시',
|
|
704
|
+
'63': '제주특별자치도'
|
|
705
|
+
};
|
|
706
|
+
// 광역시도별 중심 좌표 + 줌 레벨 (시군구가 모두 보이는 수준)
|
|
707
|
+
KpiDashboardMapPage.METRO_BOUNDS = {
|
|
708
|
+
서울특별시: { lat: 37.5665, lng: 126.978, zoom: 11 },
|
|
709
|
+
부산광역시: { lat: 35.1796, lng: 129.0756, zoom: 11 },
|
|
710
|
+
대구광역시: { lat: 35.8714, lng: 128.6014, zoom: 11 },
|
|
711
|
+
인천광역시: { lat: 37.4563, lng: 126.7052, zoom: 11 },
|
|
712
|
+
광주광역시: { lat: 35.1595, lng: 126.8526, zoom: 12 },
|
|
713
|
+
대전광역시: { lat: 36.3504, lng: 127.3845, zoom: 12 },
|
|
714
|
+
울산광역시: { lat: 35.5384, lng: 129.3114, zoom: 11 },
|
|
715
|
+
세종특별자치시: { lat: 36.4875, lng: 127.2816, zoom: 12 },
|
|
716
|
+
경기도: { lat: 37.4138, lng: 127.0183, zoom: 9 },
|
|
717
|
+
강원도: { lat: 37.8228, lng: 128.1555, zoom: 9 },
|
|
718
|
+
충청북도: { lat: 36.8, lng: 127.7, zoom: 9 },
|
|
719
|
+
충청남도: { lat: 36.5184, lng: 126.8, zoom: 10 },
|
|
720
|
+
전라북도: { lat: 35.7175, lng: 127.153, zoom: 10 },
|
|
721
|
+
전라남도: { lat: 34.8679, lng: 126.991, zoom: 9 },
|
|
722
|
+
경상북도: { lat: 36.4919, lng: 128.8889, zoom: 9 },
|
|
723
|
+
경상남도: { lat: 35.4606, lng: 128.2132, zoom: 9 },
|
|
724
|
+
제주특별자치도: { lat: 33.4996, lng: 126.5312, zoom: 11 }
|
|
725
|
+
};
|
|
726
|
+
__decorate([
|
|
727
|
+
state(),
|
|
728
|
+
__metadata("design:type", Object)
|
|
729
|
+
], KpiDashboardMapPage.prototype, "selectedCategory", void 0);
|
|
730
|
+
__decorate([
|
|
731
|
+
state(),
|
|
732
|
+
__metadata("design:type", Object)
|
|
733
|
+
], KpiDashboardMapPage.prototype, "selectedPeriod", void 0);
|
|
734
|
+
__decorate([
|
|
735
|
+
state(),
|
|
736
|
+
__metadata("design:type", Object)
|
|
737
|
+
], KpiDashboardMapPage.prototype, "startYearMonth", void 0);
|
|
738
|
+
__decorate([
|
|
739
|
+
state(),
|
|
740
|
+
__metadata("design:type", Object)
|
|
741
|
+
], KpiDashboardMapPage.prototype, "endYearMonth", void 0);
|
|
742
|
+
__decorate([
|
|
743
|
+
state(),
|
|
744
|
+
__metadata("design:type", Object)
|
|
745
|
+
], KpiDashboardMapPage.prototype, "selectedSectorType", void 0);
|
|
746
|
+
__decorate([
|
|
747
|
+
state(),
|
|
748
|
+
__metadata("design:type", Object)
|
|
749
|
+
], KpiDashboardMapPage.prototype, "selectedBuildingUsage", void 0);
|
|
750
|
+
__decorate([
|
|
751
|
+
state(),
|
|
752
|
+
__metadata("design:type", Object)
|
|
753
|
+
], KpiDashboardMapPage.prototype, "currentZoom", void 0);
|
|
754
|
+
__decorate([
|
|
755
|
+
state(),
|
|
756
|
+
__metadata("design:type", Array)
|
|
757
|
+
], KpiDashboardMapPage.prototype, "sigunguData", void 0);
|
|
758
|
+
__decorate([
|
|
759
|
+
state(),
|
|
760
|
+
__metadata("design:type", Object)
|
|
761
|
+
], KpiDashboardMapPage.prototype, "nationalData", void 0);
|
|
762
|
+
__decorate([
|
|
763
|
+
state(),
|
|
764
|
+
__metadata("design:type", Object)
|
|
765
|
+
], KpiDashboardMapPage.prototype, "seoulData", void 0);
|
|
766
|
+
__decorate([
|
|
767
|
+
state(),
|
|
768
|
+
__metadata("design:type", Object)
|
|
769
|
+
], KpiDashboardMapPage.prototype, "mapData", void 0);
|
|
770
|
+
__decorate([
|
|
771
|
+
state(),
|
|
772
|
+
__metadata("design:type", Array)
|
|
773
|
+
], KpiDashboardMapPage.prototype, "monthlyTrendData", void 0);
|
|
774
|
+
__decorate([
|
|
775
|
+
state(),
|
|
776
|
+
__metadata("design:type", Array)
|
|
777
|
+
], KpiDashboardMapPage.prototype, "totalKpiYStats", void 0);
|
|
778
|
+
__decorate([
|
|
779
|
+
state(),
|
|
780
|
+
__metadata("design:type", Array)
|
|
781
|
+
], KpiDashboardMapPage.prototype, "regionalKpiStats", void 0);
|
|
782
|
+
__decorate([
|
|
783
|
+
state(),
|
|
784
|
+
__metadata("design:type", Object)
|
|
785
|
+
], KpiDashboardMapPage.prototype, "selectedRegion", void 0);
|
|
786
|
+
__decorate([
|
|
787
|
+
state(),
|
|
788
|
+
__metadata("design:type", Object)
|
|
789
|
+
], KpiDashboardMapPage.prototype, "selectedGeoGroup", void 0);
|
|
790
|
+
__decorate([
|
|
791
|
+
state(),
|
|
792
|
+
__metadata("design:type", Object)
|
|
793
|
+
], KpiDashboardMapPage.prototype, "showRegionPopup", void 0);
|
|
794
|
+
KpiDashboardMapPage = KpiDashboardMapPage_1 = __decorate([
|
|
795
|
+
customElement('kpi-dashboard-map')
|
|
796
|
+
], KpiDashboardMapPage);
|
|
797
|
+
export { KpiDashboardMapPage };
|
|
798
|
+
//# sourceMappingURL=kpi-dashboard-map.js.map
|