@things-factory/kpi 9.0.29 → 9.0.31
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/client/charts/kpi-mini-trend-chart.ts +125 -0
- package/client/charts/kpi-trend-chart.ts +163 -0
- package/client/google-map/common-google-map.ts +370 -0
- package/client/google-map/google-map-loader.ts +29 -0
- package/client/pages/kpi-dashboard/cards/kpi-level1-card.ts +248 -0
- package/client/pages/kpi-dashboard/cards/kpi-level2-comparison.ts +369 -0
- package/client/pages/kpi-dashboard/cards/kpi-level3-comparison.ts +443 -0
- package/client/pages/kpi-dashboard/components/kpi-chart-toggle.ts +72 -0
- package/client/pages/kpi-dashboard/components/kpi-left-panel.ts +399 -0
- package/client/pages/kpi-dashboard/components/kpi-map-panel.ts +302 -0
- package/client/pages/kpi-dashboard/components/kpi-region-popup.ts +355 -0
- package/client/pages/kpi-dashboard/kpi-dashboard-map.ts +243 -0
- package/client/pages/kpi-dashboard/kpi-dashboard.ts +416 -0
- package/client/route.ts +4 -0
- package/dist-client/charts/kpi-mini-trend-chart.d.ts +14 -0
- package/dist-client/charts/kpi-mini-trend-chart.js +148 -0
- package/dist-client/charts/kpi-mini-trend-chart.js.map +1 -0
- package/dist-client/charts/kpi-trend-chart.d.ts +25 -0
- package/dist-client/charts/kpi-trend-chart.js +186 -0
- package/dist-client/charts/kpi-trend-chart.js.map +1 -0
- package/dist-client/google-map/common-google-map.d.ts +34 -0
- package/dist-client/google-map/common-google-map.js +333 -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 +22 -0
- package/dist-client/google-map/google-map-loader.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +17 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +279 -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 +19 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +385 -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 +23 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +465 -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 +22 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +404 -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 +28 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +298 -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 +23 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +368 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +29 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +271 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +21 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +398 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +1 -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/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/index.ts +1 -0
- package/server/migrations/index.ts +9 -0
- package/things-factory.config.js +2 -1
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import gql from 'graphql-tag';
|
|
3
|
+
import { html, css, nothing } from 'lit';
|
|
4
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
5
|
+
import { PageView } from '@operato/shell';
|
|
6
|
+
import { ScrollbarStyles } from '@operato/styles';
|
|
7
|
+
import { client } from '@operato/graphql';
|
|
8
|
+
import { notify } from '@operato/layout';
|
|
9
|
+
import './components/kpi-map-panel';
|
|
10
|
+
import './components/kpi-left-panel';
|
|
11
|
+
import './components/kpi-region-popup';
|
|
12
|
+
let KpiDashboardMapPage = class KpiDashboardMapPage extends PageView {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.selectedCategory = '전체 KPI';
|
|
16
|
+
this.selectedPeriod = '월';
|
|
17
|
+
this.startDate = '전체';
|
|
18
|
+
this.endDate = '전체';
|
|
19
|
+
this.nationalData = null;
|
|
20
|
+
this.seoulData = null;
|
|
21
|
+
this.mapData = null;
|
|
22
|
+
// 팝업 관련 상태 추가
|
|
23
|
+
this.selectedRegion = null;
|
|
24
|
+
this.showRegionPopup = false;
|
|
25
|
+
}
|
|
26
|
+
static { this.styles = [
|
|
27
|
+
ScrollbarStyles,
|
|
28
|
+
css `
|
|
29
|
+
:host {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
position: relative;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dashboard-container {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex: 1;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.right-panel {
|
|
43
|
+
flex: 1;
|
|
44
|
+
background: #f8f9fa;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
position: relative;
|
|
47
|
+
}
|
|
48
|
+
`
|
|
49
|
+
]; }
|
|
50
|
+
connectedCallback() {
|
|
51
|
+
super.connectedCallback();
|
|
52
|
+
this.fetchDashboardData();
|
|
53
|
+
this.setupKeyboardEvents();
|
|
54
|
+
}
|
|
55
|
+
setupKeyboardEvents() {
|
|
56
|
+
document.addEventListener('keydown', e => {
|
|
57
|
+
if (e.key === 'Escape' && this.showRegionPopup) {
|
|
58
|
+
this.closeRegionPopup();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async fetchDashboardData() {
|
|
63
|
+
try {
|
|
64
|
+
// 전국 KPI 데이터 조회
|
|
65
|
+
const nationalResponse = await client.query({
|
|
66
|
+
query: gql `
|
|
67
|
+
query {
|
|
68
|
+
kpiStatistics {
|
|
69
|
+
items {
|
|
70
|
+
id
|
|
71
|
+
valueDate
|
|
72
|
+
periodType
|
|
73
|
+
mean
|
|
74
|
+
median
|
|
75
|
+
standardDeviation
|
|
76
|
+
kpi {
|
|
77
|
+
id
|
|
78
|
+
name
|
|
79
|
+
category {
|
|
80
|
+
id
|
|
81
|
+
name
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`
|
|
88
|
+
});
|
|
89
|
+
this.nationalData = nationalResponse.data.kpiStatistics.items || [];
|
|
90
|
+
// 서울특별시 데이터는 전국 데이터에서 필터링
|
|
91
|
+
this.seoulData = this.nationalData.filter((item) => item.kpi?.category?.name === '서울특별시');
|
|
92
|
+
// 지도 데이터 생성 (시도별)
|
|
93
|
+
this.generateMapData();
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
notify({
|
|
97
|
+
level: 'error',
|
|
98
|
+
message: '대시보드 데이터를 불러오지 못했습니다.'
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
generateMapData() {
|
|
103
|
+
// 시도별 샘플 데이터 생성 (실제 좌표 포함)
|
|
104
|
+
this.mapData = [
|
|
105
|
+
{ region: '강원', kpi: 101.5, change: -0.08, trend: 'down', lat: 37.8228, lng: 128.1555 },
|
|
106
|
+
{ region: '경북', kpi: 94.8, change: -0.1, trend: 'down', lat: 36.4919, lng: 128.8889 },
|
|
107
|
+
{ region: '대구', kpi: 79.4, change: -0.2, trend: 'down', lat: 35.8714, lng: 128.6014 },
|
|
108
|
+
{ region: '경남', kpi: 92.1, change: -0.08, trend: 'down', lat: 35.4606, lng: 128.2132 },
|
|
109
|
+
{ region: '부산', kpi: 85.2, change: -0.18, trend: 'down', lat: 35.1796, lng: 129.0756 },
|
|
110
|
+
{ region: '울산', kpi: 91.4, change: 0.19, trend: 'up', lat: 35.5384, lng: 129.3114 },
|
|
111
|
+
{ region: '서울', kpi: 98.1, change: 1.28, trend: 'up', lat: 37.5665, lng: 126.978 },
|
|
112
|
+
{ region: '인천', kpi: 87.3, change: 0.05, trend: 'up', lat: 37.4563, lng: 126.7052 },
|
|
113
|
+
{ region: '대전', kpi: 89.7, change: -0.12, trend: 'down', lat: 36.3504, lng: 127.3845 },
|
|
114
|
+
{ region: '광주', kpi: 91.1, change: -0.16, trend: 'down', lat: 35.1595, lng: 126.8526 },
|
|
115
|
+
{ region: '전북', kpi: 99.3, change: 0.15, trend: 'up', lat: 35.7175, lng: 127.153 },
|
|
116
|
+
{ region: '전남', kpi: 91.8, change: -0.12, trend: 'down', lat: 34.8679, lng: 126.991 },
|
|
117
|
+
{ region: '충북', kpi: 93.2, change: 0.08, trend: 'up', lat: 36.8, lng: 127.7 },
|
|
118
|
+
{ region: '충남', kpi: 88.9, change: -0.05, trend: 'down', lat: 36.5184, lng: 126.8 },
|
|
119
|
+
{ region: '제주', kpi: 95.6, change: 0.22, trend: 'up', lat: 33.4996, lng: 126.5312 }
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
downloadExcel() {
|
|
123
|
+
// 엑셀 다운로드 기능
|
|
124
|
+
console.log('엑셀 다운로드');
|
|
125
|
+
}
|
|
126
|
+
onRegionClick(region) {
|
|
127
|
+
this.selectedRegion = region;
|
|
128
|
+
this.showRegionPopup = true;
|
|
129
|
+
this.fetchRegionData(region);
|
|
130
|
+
}
|
|
131
|
+
closeRegionPopup() {
|
|
132
|
+
this.showRegionPopup = false;
|
|
133
|
+
this.selectedRegion = null;
|
|
134
|
+
}
|
|
135
|
+
async fetchRegionData(region) {
|
|
136
|
+
try {
|
|
137
|
+
const response = await client.query({
|
|
138
|
+
query: gql `
|
|
139
|
+
query GetRegionKpiData($region: String) {
|
|
140
|
+
kpiStatistics(filters: [{ field: "kpi.category.name", operator: "eq", value: $region }]) {
|
|
141
|
+
items {
|
|
142
|
+
id
|
|
143
|
+
valueDate
|
|
144
|
+
periodType
|
|
145
|
+
mean
|
|
146
|
+
median
|
|
147
|
+
standardDeviation
|
|
148
|
+
kpi {
|
|
149
|
+
id
|
|
150
|
+
name
|
|
151
|
+
category {
|
|
152
|
+
id
|
|
153
|
+
name
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
`,
|
|
160
|
+
variables: { region }
|
|
161
|
+
});
|
|
162
|
+
this.seoulData = response.data.kpiStatistics.items || [];
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
notify({
|
|
166
|
+
level: 'error',
|
|
167
|
+
message: '지역 데이터를 불러오지 못했습니다.'
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
get context() {
|
|
172
|
+
return {
|
|
173
|
+
title: '전국 KPI 대시보드',
|
|
174
|
+
description: '전국 및 지역별 KPI 성과 분석 대시보드'
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
render() {
|
|
178
|
+
return html `
|
|
179
|
+
<div class="dashboard-container">
|
|
180
|
+
<!-- 좌측 패널: 전국 KPI -->
|
|
181
|
+
<kpi-left-panel
|
|
182
|
+
.selectedCategory=${this.selectedCategory}
|
|
183
|
+
.mapData=${this.mapData}
|
|
184
|
+
@category-change=${(e) => {
|
|
185
|
+
this.selectedCategory = e.detail.category;
|
|
186
|
+
this.fetchDashboardData();
|
|
187
|
+
}}
|
|
188
|
+
@region-click=${(e) => {
|
|
189
|
+
this.onRegionClick(e.detail.region);
|
|
190
|
+
}}
|
|
191
|
+
@download-excel=${this.downloadExcel}
|
|
192
|
+
></kpi-left-panel>
|
|
193
|
+
|
|
194
|
+
<!-- 우측 패널: 지도 -->
|
|
195
|
+
<kpi-map-panel
|
|
196
|
+
class="right-panel"
|
|
197
|
+
.selectedCategory=${this.selectedCategory}
|
|
198
|
+
.mapData=${this.mapData}
|
|
199
|
+
@category-change=${(e) => {
|
|
200
|
+
this.selectedCategory = e.detail.category;
|
|
201
|
+
this.fetchDashboardData();
|
|
202
|
+
}}
|
|
203
|
+
@region-click=${(e) => {
|
|
204
|
+
this.onRegionClick(e.detail.region);
|
|
205
|
+
}}
|
|
206
|
+
></kpi-map-panel>
|
|
207
|
+
|
|
208
|
+
<!-- 지역 상세 팝업 -->
|
|
209
|
+
${this.showRegionPopup
|
|
210
|
+
? html `
|
|
211
|
+
<kpi-region-popup
|
|
212
|
+
.selectedRegion=${this.selectedRegion}
|
|
213
|
+
.selectedPeriod=${this.selectedPeriod}
|
|
214
|
+
.startDate=${this.startDate}
|
|
215
|
+
.endDate=${this.endDate}
|
|
216
|
+
@popup-close=${this.closeRegionPopup}
|
|
217
|
+
@period-change=${(e) => {
|
|
218
|
+
this.selectedPeriod = e.detail.period;
|
|
219
|
+
}}
|
|
220
|
+
@date-range-change=${(e) => {
|
|
221
|
+
this.startDate = e.detail.startDate;
|
|
222
|
+
this.endDate = e.detail.endDate;
|
|
223
|
+
}}
|
|
224
|
+
></kpi-region-popup>
|
|
225
|
+
`
|
|
226
|
+
: nothing}
|
|
227
|
+
</div>
|
|
228
|
+
`;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
__decorate([
|
|
232
|
+
state(),
|
|
233
|
+
__metadata("design:type", Object)
|
|
234
|
+
], KpiDashboardMapPage.prototype, "selectedCategory", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
state(),
|
|
237
|
+
__metadata("design:type", Object)
|
|
238
|
+
], KpiDashboardMapPage.prototype, "selectedPeriod", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
state(),
|
|
241
|
+
__metadata("design:type", Object)
|
|
242
|
+
], KpiDashboardMapPage.prototype, "startDate", void 0);
|
|
243
|
+
__decorate([
|
|
244
|
+
state(),
|
|
245
|
+
__metadata("design:type", Object)
|
|
246
|
+
], KpiDashboardMapPage.prototype, "endDate", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
state(),
|
|
249
|
+
__metadata("design:type", Object)
|
|
250
|
+
], KpiDashboardMapPage.prototype, "nationalData", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
state(),
|
|
253
|
+
__metadata("design:type", Object)
|
|
254
|
+
], KpiDashboardMapPage.prototype, "seoulData", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
state(),
|
|
257
|
+
__metadata("design:type", Object)
|
|
258
|
+
], KpiDashboardMapPage.prototype, "mapData", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
state(),
|
|
261
|
+
__metadata("design:type", Object)
|
|
262
|
+
], KpiDashboardMapPage.prototype, "selectedRegion", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
state(),
|
|
265
|
+
__metadata("design:type", Object)
|
|
266
|
+
], KpiDashboardMapPage.prototype, "showRegionPopup", void 0);
|
|
267
|
+
KpiDashboardMapPage = __decorate([
|
|
268
|
+
customElement('kpi-dashboard-map')
|
|
269
|
+
], KpiDashboardMapPage);
|
|
270
|
+
export { KpiDashboardMapPage };
|
|
271
|
+
//# sourceMappingURL=kpi-dashboard-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-dashboard-map.js","sourceRoot":"","sources":["../../../client/pages/kpi-dashboard/kpi-dashboard-map.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,4BAA4B,CAAA;AACnC,OAAO,6BAA6B,CAAA;AACpC,OAAO,+BAA+B,CAAA;AAG/B,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,QAAQ;IAA1C;;QA0BI,qBAAgB,GAAG,QAAQ,CAAA;QAC3B,mBAAc,GAAG,GAAG,CAAA;QACpB,cAAS,GAAG,IAAI,CAAA;QAChB,YAAO,GAAG,IAAI,CAAA;QACd,iBAAY,GAAQ,IAAI,CAAA;QACxB,cAAS,GAAQ,IAAI,CAAA;QACrB,YAAO,GAAQ,IAAI,CAAA;QAC5B,cAAc;QACL,mBAAc,GAAkB,IAAI,CAAA;QACpC,oBAAe,GAAG,KAAK,CAAA;IAiMlC,CAAC;aAnOQ,WAAM,GAAG;QACd,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;KA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ag'\nimport { html, css, nothing } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\n\nimport { PageView } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\n\nimport './components/kpi-map-panel'\nimport './components/kpi-left-panel'\nimport './components/kpi-region-popup'\n\n@customElement('kpi-dashboard-map')\nexport class KpiDashboardMapPage extends PageView {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n position: relative;\n }\n\n .dashboard-container {\n display: flex;\n flex: 1;\n overflow: hidden;\n }\n\n .right-panel {\n flex: 1;\n background: #f8f9fa;\n overflow: hidden;\n position: relative;\n }\n `\n ]\n\n @state() selectedCategory = '전체 KPI'\n @state() selectedPeriod = '월'\n @state() startDate = '전체'\n @state() endDate = '전체'\n @state() nationalData: any = null\n @state() seoulData: any = null\n @state() mapData: any = null\n // 팝업 관련 상태 추가\n @state() selectedRegion: string | null = null\n @state() showRegionPopup = false\n\n connectedCallback() {\n super.connectedCallback()\n this.fetchDashboardData()\n this.setupKeyboardEvents()\n }\n\n private setupKeyboardEvents() {\n document.addEventListener('keydown', e => {\n if (e.key === 'Escape' && this.showRegionPopup) {\n this.closeRegionPopup()\n }\n })\n }\n\n async fetchDashboardData() {\n try {\n // 전국 KPI 데이터 조회\n const nationalResponse = await client.query({\n query: gql`\n query {\n kpiStatistics {\n items {\n id\n valueDate\n periodType\n mean\n median\n standardDeviation\n kpi {\n id\n name\n category {\n id\n name\n }\n }\n }\n }\n }\n `\n })\n\n this.nationalData = nationalResponse.data.kpiStatistics.items || []\n\n // 서울특별시 데이터는 전국 데이터에서 필터링\n this.seoulData = this.nationalData.filter((item: any) => item.kpi?.category?.name === '서울특별시')\n\n // 지도 데이터 생성 (시도별)\n this.generateMapData()\n } catch (e) {\n notify({\n level: 'error',\n message: '대시보드 데이터를 불러오지 못했습니다.'\n })\n }\n }\n\n private generateMapData() {\n // 시도별 샘플 데이터 생성 (실제 좌표 포함)\n this.mapData = [\n { region: '강원', kpi: 101.5, change: -0.08, trend: 'down', lat: 37.8228, lng: 128.1555 },\n { region: '경북', kpi: 94.8, change: -0.1, trend: 'down', lat: 36.4919, lng: 128.8889 },\n { region: '대구', kpi: 79.4, change: -0.2, trend: 'down', lat: 35.8714, lng: 128.6014 },\n { region: '경남', kpi: 92.1, change: -0.08, trend: 'down', lat: 35.4606, lng: 128.2132 },\n { region: '부산', kpi: 85.2, change: -0.18, trend: 'down', lat: 35.1796, lng: 129.0756 },\n { region: '울산', kpi: 91.4, change: 0.19, trend: 'up', lat: 35.5384, lng: 129.3114 },\n { region: '서울', kpi: 98.1, change: 1.28, trend: 'up', lat: 37.5665, lng: 126.978 },\n { region: '인천', kpi: 87.3, change: 0.05, trend: 'up', lat: 37.4563, lng: 126.7052 },\n { region: '대전', kpi: 89.7, change: -0.12, trend: 'down', lat: 36.3504, lng: 127.3845 },\n { region: '광주', kpi: 91.1, change: -0.16, trend: 'down', lat: 35.1595, lng: 126.8526 },\n { region: '전북', kpi: 99.3, change: 0.15, trend: 'up', lat: 35.7175, lng: 127.153 },\n { region: '전남', kpi: 91.8, change: -0.12, trend: 'down', lat: 34.8679, lng: 126.991 },\n { region: '충북', kpi: 93.2, change: 0.08, trend: 'up', lat: 36.8, lng: 127.7 },\n { region: '충남', kpi: 88.9, change: -0.05, trend: 'down', lat: 36.5184, lng: 126.8 },\n { region: '제주', kpi: 95.6, change: 0.22, trend: 'up', lat: 33.4996, lng: 126.5312 }\n ]\n }\n\n private downloadExcel() {\n // 엑셀 다운로드 기능\n console.log('엑셀 다운로드')\n }\n\n private onRegionClick(region: string) {\n this.selectedRegion = region\n this.showRegionPopup = true\n this.fetchRegionData(region)\n }\n\n private closeRegionPopup() {\n this.showRegionPopup = false\n this.selectedRegion = null\n }\n\n private async fetchRegionData(region: string) {\n try {\n const response = await client.query({\n query: gql`\n query GetRegionKpiData($region: String) {\n kpiStatistics(filters: [{ field: \"kpi.category.name\", operator: \"eq\", value: $region }]) {\n items {\n id\n valueDate\n periodType\n mean\n median\n standardDeviation\n kpi {\n id\n name\n category {\n id\n name\n }\n }\n }\n }\n }\n `,\n variables: { region }\n })\n\n this.seoulData = response.data.kpiStatistics.items || []\n } catch (e) {\n notify({\n level: 'error',\n message: '지역 데이터를 불러오지 못했습니다.'\n })\n }\n }\n\n get context() {\n return {\n title: '전국 KPI 대시보드',\n description: '전국 및 지역별 KPI 성과 분석 대시보드'\n }\n }\n\n render() {\n return html`\n <div class=\"dashboard-container\">\n <!-- 좌측 패널: 전국 KPI -->\n <kpi-left-panel\n .selectedCategory=${this.selectedCategory}\n .mapData=${this.mapData}\n @category-change=${(e: CustomEvent) => {\n this.selectedCategory = e.detail.category\n this.fetchDashboardData()\n }}\n @region-click=${(e: CustomEvent) => {\n this.onRegionClick(e.detail.region)\n }}\n @download-excel=${this.downloadExcel}\n ></kpi-left-panel>\n\n <!-- 우측 패널: 지도 -->\n <kpi-map-panel\n class=\"right-panel\"\n .selectedCategory=${this.selectedCategory}\n .mapData=${this.mapData}\n @category-change=${(e: CustomEvent) => {\n this.selectedCategory = e.detail.category\n this.fetchDashboardData()\n }}\n @region-click=${(e: CustomEvent) => {\n this.onRegionClick(e.detail.region)\n }}\n ></kpi-map-panel>\n\n <!-- 지역 상세 팝업 -->\n ${this.showRegionPopup\n ? html`\n <kpi-region-popup\n .selectedRegion=${this.selectedRegion}\n .selectedPeriod=${this.selectedPeriod}\n .startDate=${this.startDate}\n .endDate=${this.endDate}\n @popup-close=${this.closeRegionPopup}\n @period-change=${(e: CustomEvent) => {\n this.selectedPeriod = e.detail.period\n }}\n @date-range-change=${(e: CustomEvent) => {\n this.startDate = e.detail.startDate\n this.endDate = e.detail.endDate\n }}\n ></kpi-region-popup>\n `\n : nothing}\n </div>\n `\n }\n}\n"]}
|
|
@@ -9,6 +9,9 @@ import './kpi-value-entry';
|
|
|
9
9
|
import './kpi-alert-panel';
|
|
10
10
|
import '../../charts/kpi-radar-chart';
|
|
11
11
|
import '../../charts/kpi-boxplot-chart';
|
|
12
|
+
import './cards/kpi-level1-card';
|
|
13
|
+
import './cards/kpi-level2-comparison';
|
|
14
|
+
import './cards/kpi-level3-comparison';
|
|
12
15
|
export declare class KpiDashboardPage extends PageView {
|
|
13
16
|
static styles: import("lit").CSSResult[];
|
|
14
17
|
categories: any[];
|
|
@@ -18,6 +21,10 @@ export declare class KpiDashboardPage extends PageView {
|
|
|
18
21
|
showHistoryModal: boolean;
|
|
19
22
|
modalHistories: any[];
|
|
20
23
|
modalKpiName: string;
|
|
24
|
+
kpiStatistics: any[];
|
|
25
|
+
statisticsLoading: boolean;
|
|
26
|
+
selectedPeriodType: string;
|
|
27
|
+
selectedValueDate: string;
|
|
21
28
|
private get sampleCategories();
|
|
22
29
|
private get sampleGroups();
|
|
23
30
|
private get sampleSeriesData();
|
|
@@ -27,9 +34,23 @@ export declare class KpiDashboardPage extends PageView {
|
|
|
27
34
|
private get sampleBoxplotData();
|
|
28
35
|
private get sampleBoxplotGroups();
|
|
29
36
|
private get sampleCurrentGroup();
|
|
37
|
+
private get currentMonth();
|
|
38
|
+
private get filteredKpiStatistics();
|
|
39
|
+
private get availablePeriodTypes();
|
|
40
|
+
private get availableValueDates();
|
|
41
|
+
private get statisticsSummary();
|
|
42
|
+
private _onPeriodTypeChange;
|
|
43
|
+
private _onValueDateChange;
|
|
44
|
+
private get realKpiRadarData();
|
|
45
|
+
private get realKpiRadarCategories();
|
|
46
|
+
private get realKpiRadarGroups();
|
|
47
|
+
private get realKpiBoxplotData();
|
|
48
|
+
private get realKpiBoxplotGroups();
|
|
49
|
+
private get realKpiCurrentGroup();
|
|
30
50
|
connectedCallback(): void;
|
|
31
51
|
pageUpdated(changes: any, lifecycle: any): void;
|
|
32
52
|
fetchCategories(): Promise<void>;
|
|
53
|
+
fetchKpiStatistics(): Promise<void>;
|
|
33
54
|
openHistoryModal(kpi: any): Promise<void>;
|
|
34
55
|
closeHistoryModal(): void;
|
|
35
56
|
_renderKpiValue(kpi: any): import("lit-html").TemplateResult<1>;
|