@dssp/dkpi 1.0.0-alpha.9 → 1.0.0-alpha.90

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.
Files changed (261) hide show
  1. package/KPI-STATISTICS-SERVICE.md +233 -0
  2. package/_index.html +4 -9
  3. package/assets/favicon.ico +0 -0
  4. package/assets/helps/index.md +1 -1
  5. package/assets/images/project-image.png +0 -0
  6. package/assets/manifest/apple-1024.png +0 -0
  7. package/assets/manifest/apple-120.png +0 -0
  8. package/assets/manifest/apple-152.png +0 -0
  9. package/assets/manifest/apple-167.png +0 -0
  10. package/assets/manifest/apple-180.png +0 -0
  11. package/assets/manifest/apple-touch-icon.png +0 -0
  12. package/assets/manifest/badge-128x128.png +0 -0
  13. package/assets/manifest/chrome-splashscreen-icon-384x384.png +0 -0
  14. package/assets/manifest/chrome-touch-icon-192x192.png +0 -0
  15. package/assets/manifest/icon-128x128.png +0 -0
  16. package/assets/manifest/icon-192x192.png +0 -0
  17. package/assets/manifest/icon-512x512.png +0 -0
  18. package/assets/manifest/icon-72x72.png +0 -0
  19. package/assets/manifest/icon-96x96.png +0 -0
  20. package/assets/manifest/image-metaog.png +0 -0
  21. package/assets/manifest/maskable_icon.png +0 -0
  22. package/assets/manifest/ms-icon-144x144.png +0 -0
  23. package/assets/manifest/ms-touch-icon-144x144-precomposed.png +0 -0
  24. package/assets/manifest.json +2 -2
  25. package/assets/videos/intro.mp4 +0 -0
  26. package/config/config.development.js +2 -1
  27. package/config/config.production.js +2 -1
  28. package/dist-client/bootstrap.d.ts +1 -0
  29. package/dist-client/bootstrap.js +75 -4
  30. package/dist-client/bootstrap.js.map +1 -1
  31. package/dist-client/components/kpi-2d-lookup-chart.d.ts +50 -0
  32. package/dist-client/components/kpi-2d-lookup-chart.js +263 -0
  33. package/dist-client/components/kpi-2d-lookup-chart.js.map +1 -0
  34. package/dist-client/components/kpi-boxplot-chart.d.ts +31 -0
  35. package/dist-client/components/kpi-boxplot-chart.js +306 -0
  36. package/dist-client/components/kpi-boxplot-chart.js.map +1 -0
  37. package/dist-client/components/kpi-lookup-chart.d.ts +58 -0
  38. package/dist-client/components/kpi-lookup-chart.js +459 -0
  39. package/dist-client/components/kpi-lookup-chart.js.map +1 -0
  40. package/dist-client/components/kpi-mini-trend-chart.d.ts +14 -0
  41. package/dist-client/components/kpi-mini-trend-chart.js +180 -0
  42. package/dist-client/components/kpi-mini-trend-chart.js.map +1 -0
  43. package/dist-client/components/kpi-radar-chart.d.ts +17 -0
  44. package/dist-client/components/kpi-radar-chart.js +259 -0
  45. package/dist-client/components/kpi-radar-chart.js.map +1 -0
  46. package/dist-client/components/kpi-single-boxplot-chart.d.ts +36 -0
  47. package/dist-client/components/kpi-single-boxplot-chart.js +417 -0
  48. package/dist-client/components/kpi-single-boxplot-chart.js.map +1 -0
  49. package/dist-client/components/kpi-step-lookup-chart.d.ts +33 -0
  50. package/dist-client/components/kpi-step-lookup-chart.js +181 -0
  51. package/dist-client/components/kpi-step-lookup-chart.js.map +1 -0
  52. package/dist-client/components/kpi-trend-chart.d.ts +25 -0
  53. package/dist-client/components/kpi-trend-chart.js +241 -0
  54. package/dist-client/components/kpi-trend-chart.js.map +1 -0
  55. package/dist-client/components/sv-pagenation-control.d.ts +18 -0
  56. package/dist-client/components/sv-pagenation-control.js +142 -0
  57. package/dist-client/components/sv-pagenation-control.js.map +1 -0
  58. package/dist-client/entries/auth/checkin.d.ts +38 -0
  59. package/dist-client/entries/auth/checkin.js +551 -0
  60. package/dist-client/entries/auth/checkin.js.map +1 -0
  61. package/dist-client/google-map/common-google-map.d.ts +35 -0
  62. package/dist-client/google-map/common-google-map.js +349 -0
  63. package/dist-client/google-map/common-google-map.js.map +1 -0
  64. package/dist-client/google-map/google-map-loader.d.ts +6 -0
  65. package/dist-client/google-map/google-map-loader.js +23 -0
  66. package/dist-client/google-map/google-map-loader.js.map +1 -0
  67. package/dist-client/icons/menu-icons.d.ts +6 -0
  68. package/dist-client/icons/menu-icons.js +42 -0
  69. package/dist-client/icons/menu-icons.js.map +1 -1
  70. package/dist-client/pages/component/project-update-header.d.ts +1 -0
  71. package/dist-client/pages/component/project-update-header.js +127 -0
  72. package/dist-client/pages/component/project-update-header.js.map +1 -0
  73. package/dist-client/pages/kpi-admin/dssp-kpi-list-page.d.ts +22 -0
  74. package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js +57 -0
  75. package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js.map +1 -0
  76. package/dist-client/pages/kpi-admin/dssp-kpi-overview.d.ts +47 -0
  77. package/dist-client/pages/kpi-admin/dssp-kpi-overview.js +393 -0
  78. package/dist-client/pages/kpi-admin/dssp-kpi-overview.js.map +1 -0
  79. package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.d.ts +20 -0
  80. package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js +445 -0
  81. package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js.map +1 -0
  82. package/dist-client/pages/kpi-admin/kpi-system-guide.d.ts +18 -0
  83. package/dist-client/pages/kpi-admin/kpi-system-guide.js +696 -0
  84. package/dist-client/pages/kpi-admin/kpi-system-guide.js.map +1 -0
  85. package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +18 -0
  86. package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +259 -0
  87. package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -0
  88. package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +22 -0
  89. package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +346 -0
  90. package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -0
  91. package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +26 -0
  92. package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +433 -0
  93. package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -0
  94. package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.d.ts +8 -0
  95. package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js +78 -0
  96. package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js.map +1 -0
  97. package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +46 -0
  98. package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +937 -0
  99. package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -0
  100. package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +33 -0
  101. package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +231 -0
  102. package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -0
  103. package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.d.ts +35 -0
  104. package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +632 -0
  105. package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -0
  106. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
  107. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +131 -0
  108. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
  109. package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +52 -0
  110. package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +842 -0
  111. package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -0
  112. package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +63 -0
  113. package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +1097 -0
  114. package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
  115. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
  116. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
  117. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
  118. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
  119. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
  120. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
  121. package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
  122. package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
  123. package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
  124. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
  125. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +147 -0
  126. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
  127. package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
  128. package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
  129. package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
  130. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +57 -0
  131. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +719 -0
  132. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -0
  133. package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.d.ts +23 -0
  134. package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js +76 -0
  135. package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js.map +1 -0
  136. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +68 -0
  137. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +394 -0
  138. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -0
  139. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.d.ts +12 -0
  140. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +174 -0
  141. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -0
  142. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +40 -0
  143. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +190 -0
  144. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -0
  145. package/dist-client/pages/kpi-value/kpi-value-importer.d.ts +23 -0
  146. package/dist-client/pages/kpi-value/kpi-value-importer.js +93 -0
  147. package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -0
  148. package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +71 -0
  149. package/dist-client/pages/kpi-value/kpi-value-list-page.js +454 -0
  150. package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -0
  151. package/dist-client/pages/project-complete-tabs/pc-tab1-plan.d.ts +66 -0
  152. package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js +775 -0
  153. package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js.map +1 -0
  154. package/dist-client/pages/project-complete-tabs/pc-tab2-rating.d.ts +16 -0
  155. package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js +337 -0
  156. package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js.map +1 -0
  157. package/dist-client/pages/project-complete-tabs/pc-tab3-upload.d.ts +21 -0
  158. package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js +335 -0
  159. package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js.map +1 -0
  160. package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.d.ts +42 -0
  161. package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js +635 -0
  162. package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js.map +1 -0
  163. package/dist-client/pages/sv-project-complete.d.ts +25 -0
  164. package/dist-client/pages/sv-project-complete.js +259 -0
  165. package/dist-client/pages/sv-project-complete.js.map +1 -0
  166. package/dist-client/pages/sv-project-completed-list.d.ts +27 -0
  167. package/dist-client/pages/sv-project-completed-list.js +416 -0
  168. package/dist-client/pages/sv-project-completed-list.js.map +1 -0
  169. package/dist-client/pages/sv-project-detail.d.ts +70 -0
  170. package/dist-client/pages/sv-project-detail.js +1486 -0
  171. package/dist-client/pages/sv-project-detail.js.map +1 -0
  172. package/dist-client/pages/sv-project-list.d.ts +175 -0
  173. package/dist-client/pages/sv-project-list.js +581 -0
  174. package/dist-client/pages/sv-project-list.js.map +1 -0
  175. package/dist-client/pages/sv-project-update.d.ts +91 -0
  176. package/dist-client/pages/sv-project-update.js +1151 -0
  177. package/dist-client/pages/sv-project-update.js.map +1 -0
  178. package/dist-client/pages/sv-user-management.d.ts +1 -0
  179. package/dist-client/pages/sv-user-management.js +5 -0
  180. package/dist-client/pages/sv-user-management.js.map +1 -1
  181. package/dist-client/route.d.ts +1 -1
  182. package/dist-client/route.js +50 -2
  183. package/dist-client/route.js.map +1 -1
  184. package/dist-client/shared/complete-api.d.ts +37 -0
  185. package/dist-client/shared/complete-api.js +227 -0
  186. package/dist-client/shared/complete-api.js.map +1 -0
  187. package/dist-client/shared/func.d.ts +2 -0
  188. package/dist-client/shared/func.js +22 -0
  189. package/dist-client/shared/func.js.map +1 -0
  190. package/dist-client/shared/geo-group-mapping.d.ts +25 -0
  191. package/dist-client/shared/geo-group-mapping.js +189 -0
  192. package/dist-client/shared/geo-group-mapping.js.map +1 -0
  193. package/dist-client/shared/integration-fetch.d.ts +35 -0
  194. package/dist-client/shared/integration-fetch.js +53 -0
  195. package/dist-client/shared/integration-fetch.js.map +1 -0
  196. package/dist-client/themes/dark.css +24 -24
  197. package/dist-client/themes/light.css +23 -23
  198. package/dist-client/tsconfig.tsbuildinfo +1 -1
  199. package/dist-client/viewparts/menu-tools.d.ts +40 -5
  200. package/dist-client/viewparts/menu-tools.js +317 -52
  201. package/dist-client/viewparts/menu-tools.js.map +1 -1
  202. package/dist-server/index.d.ts +2 -0
  203. package/dist-server/index.js +5 -0
  204. package/dist-server/index.js.map +1 -1
  205. package/dist-server/migrations/index.d.ts +1 -0
  206. package/dist-server/migrations/index.js +12 -0
  207. package/dist-server/migrations/index.js.map +1 -0
  208. package/dist-server/scripts/calculate-kpi-scores.d.ts +10 -0
  209. package/dist-server/scripts/calculate-kpi-scores.js +333 -0
  210. package/dist-server/scripts/calculate-kpi-scores.js.map +1 -0
  211. package/dist-server/scripts/load-grade-data-migration.d.ts +14 -0
  212. package/dist-server/scripts/load-grade-data-migration.js +279 -0
  213. package/dist-server/scripts/load-grade-data-migration.js.map +1 -0
  214. package/dist-server/scripts/propagate-parent-kpi-values.d.ts +14 -0
  215. package/dist-server/scripts/propagate-parent-kpi-values.js +786 -0
  216. package/dist-server/scripts/propagate-parent-kpi-values.js.map +1 -0
  217. package/dist-server/scripts/recalculate-by-project-name.d.ts +2 -0
  218. package/dist-server/scripts/recalculate-by-project-name.js +72 -0
  219. package/dist-server/scripts/recalculate-by-project-name.js.map +1 -0
  220. package/dist-server/service/index.d.ts +4 -0
  221. package/dist-server/service/index.js +20 -0
  222. package/dist-server/service/index.js.map +1 -0
  223. package/dist-server/service/kpi-metric-value/index.d.ts +4 -0
  224. package/dist-server/service/kpi-metric-value/index.js +8 -0
  225. package/dist-server/service/kpi-metric-value/index.js.map +1 -0
  226. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +171 -0
  227. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +983 -0
  228. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -0
  229. package/dist-server/service/kpi-metric-value/kpi-metric-value-query.d.ts +12 -0
  230. package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +56 -0
  231. package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +1 -0
  232. package/dist-server/service/kpi-stat/index.d.ts +4 -0
  233. package/dist-server/service/kpi-stat/index.js +8 -0
  234. package/dist-server/service/kpi-stat/index.js.map +1 -0
  235. package/dist-server/service/kpi-stat/kpi-stat-query.d.ts +13 -0
  236. package/dist-server/service/kpi-stat/kpi-stat-query.js +727 -0
  237. package/dist-server/service/kpi-stat/kpi-stat-query.js.map +1 -0
  238. package/dist-server/service/kpi-stat/kpi-stat-types.d.ts +32 -0
  239. package/dist-server/service/kpi-stat/kpi-stat-types.js +180 -0
  240. package/dist-server/service/kpi-stat/kpi-stat-types.js.map +1 -0
  241. package/dist-server/service/kpi-value/index.d.ts +3 -0
  242. package/dist-server/service/kpi-value/index.js +7 -0
  243. package/dist-server/service/kpi-value/index.js.map +1 -0
  244. package/dist-server/service/kpi-value/kpi-value-query.d.ts +8 -0
  245. package/dist-server/service/kpi-value/kpi-value-query.js +90 -0
  246. package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -0
  247. package/dist-server/tsconfig.tsbuildinfo +1 -1
  248. package/kpi-module-service-tests.md +1286 -0
  249. package/kpi-module-test-report.md +676 -0
  250. package/kpi-module-unit-test-detailed-report.md +925 -0
  251. package/kpi-module-unit-tests-detailed.md +1452 -0
  252. package/openapi/unstable.yaml +2 -2
  253. package/package.json +69 -55
  254. package/recalculate-batch.sh +64 -0
  255. package/recalculate-projects-range.sh +98 -0
  256. package/schema.graphql +3464 -458
  257. package/things-factory.config.js +12 -1
  258. package/translations/en.json +5 -1
  259. package/translations/ko.json +5 -1
  260. package/views/auth-page.html +4 -5
  261. package/views/public/home.html +5 -6
@@ -0,0 +1,1486 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { navigate, PageView } from '@operato/shell';
3
+ import { ScrollbarStyles } from '@operato/styles';
4
+ import { css, html } from 'lit';
5
+ import { customElement, state } from 'lit/decorators.js';
6
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
7
+ import { PROJECT_STATE } from './sv-project-list';
8
+ import { client } from '@operato/graphql';
9
+ import gql from 'graphql-tag';
10
+ import moment from 'moment-timezone';
11
+ import { isProjectTypeDomain, tenantHeaders } from '@dssp/project/dist-client/shared/domain-context';
12
+ import '../components/kpi-boxplot-chart';
13
+ import '../components/kpi-single-boxplot-chart';
14
+ import '../components/kpi-radar-chart';
15
+ import '../components/kpi-lookup-chart';
16
+ import '../components/kpi-step-lookup-chart';
17
+ import '../components/kpi-2d-lookup-chart';
18
+ let SvProjectDetailPage = class SvProjectDetailPage extends ScopedElementsMixin(PageView) {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.project = {};
22
+ this.kpiComprehensiveStats = [];
23
+ this.kpiYComprehensiveStats = [];
24
+ this.projectXKpiValues = [];
25
+ this.showScoreDistribution = false;
26
+ this.selectedKpi = null;
27
+ /** 이 프로젝트에 아직 한 번도 입력되지 않은 metric (active 한 manual/import 한정) */
28
+ this.pendingMetrics = [];
29
+ /** 현재 프로젝트의 모든 KpiMetricValue (metric.name 포함) — 2D lookup chart 의 progressRate / value 도출용. */
30
+ this.allKpiMetricValues = [];
31
+ }
32
+ get context() {
33
+ var _a;
34
+ return {
35
+ title: !isProjectTypeDomain() && this.project ? `프로젝트 상세 정보 - ${(_a = this.project) === null || _a === void 0 ? void 0 : _a.name}` : '프로젝트 상세 정보'
36
+ };
37
+ }
38
+ render() {
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
40
+ return html `
41
+ <div content>
42
+ <div left>
43
+ <div class="card">
44
+ <div class="card-title">
45
+ <div>${this.project.name}</div>
46
+ <div class="triangle"></div>
47
+ </div>
48
+
49
+ <div class="top-info" style="margin-top: 10px;">
50
+ <img pic src=${((_a = this.project.mainPhoto) === null || _a === void 0 ? void 0 : _a.fullpath) || '/assets/images/project-image.png'} alt="project" />
51
+ <div class="info">
52
+ <div class="row">
53
+ <div class="label">• 주소</div>
54
+ <div class="value">${(_b = this.project.buildingComplex) === null || _b === void 0 ? void 0 : _b.address}</div>
55
+ </div>
56
+ <div class="row">
57
+ <div class="label">• 공사기간</div>
58
+ <div class="value">${this.project.startDate} ~ ${this.project.endDate}</div>
59
+ </div>
60
+ <div class="row">
61
+ <div class="label">• 프로젝트 상태</div>
62
+ <div class="value status-value">${PROJECT_STATE[this.project.state]}</div>
63
+ </div>
64
+ <div class="row">
65
+ <div class="label">• 유형</div>
66
+ <div class="value">
67
+ ${this.project.sectorType === 'PUBLIC'
68
+ ? '공공'
69
+ : this.project.sectorType === 'PRIVATE'
70
+ ? '민간'
71
+ : '-'}
72
+ </div>
73
+ </div>
74
+ <div class="row">
75
+ <div class="label">• 용도</div>
76
+ <div class="value">
77
+ ${this.project.buildingUsage === 'RESIDENTIAL'
78
+ ? '주거'
79
+ : this.project.buildingUsage === 'NON_RESIDENTIAL'
80
+ ? '비주거'
81
+ : '-'}
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <div class="detail-grid">
88
+ <div class="grid-item row">
89
+ <div class="label">• 공사비</div>
90
+ <div class="value">${((_d = (_c = this.project.buildingComplex) === null || _c === void 0 ? void 0 : _c.constructionCost) === null || _d === void 0 ? void 0 : _d.toLocaleString()) || '-'} 억원</div>
91
+ </div>
92
+ <div class="grid-item row">
93
+ <div class="label">• 연면적</div>
94
+ <div class="value">${((_f = (_e = this.project.buildingComplex) === null || _e === void 0 ? void 0 : _e.area) === null || _f === void 0 ? void 0 : _f.toLocaleString()) || '-'} ㎡</div>
95
+ </div>
96
+ <div class="grid-item row">
97
+ <div class="label">• 용적률</div>
98
+ <div class="value">${((_h = (_g = this.project.buildingComplex) === null || _g === void 0 ? void 0 : _g.floorAreaRatio) === null || _h === void 0 ? void 0 : _h.toLocaleString()) || '-'} %</div>
99
+ </div>
100
+ <div class="grid-item row">
101
+ <div class="label">• 총 투입인력(M/M)</div>
102
+ <div class="value">${((_k = (_j = this.project.buildingComplex) === null || _j === void 0 ? void 0 : _j.workerCount) === null || _k === void 0 ? void 0 : _k.toLocaleString()) || '-'} 명</div>
103
+ </div>
104
+ </div>
105
+ </div>
106
+
107
+ <div class="card">
108
+ <div class="card-title">
109
+ <div>입력 대기 중</div>
110
+ <div class="triangle"></div>
111
+ </div>
112
+ <div class="sub-desc">
113
+ 이 프로젝트에 아직 입력되지 않은 KPI 항목입니다. 해당 항목에 대한 데이터를 입력 해 주시기 바랍니다.
114
+ </div>
115
+
116
+ <div class="list-block">
117
+ <div class="list-title">• 미입력 ${this.pendingMetrics.length}건</div>
118
+ ${this.pendingMetrics.length === 0
119
+ ? html `<div class="list-text">모든 항목이 입력되었습니다.</div>`
120
+ : this.pendingMetrics.map(m => html `
121
+ <div
122
+ class="list-text"
123
+ style="cursor: pointer;"
124
+ @click=${async () => {
125
+ if (isProjectTypeDomain()) {
126
+ navigate('project-complete');
127
+ return;
128
+ }
129
+ const id = this.project.id || (await this._resolveProjectIdFromDomain());
130
+ if (id)
131
+ navigate(`project-complete/${id}`);
132
+ }}
133
+ >
134
+ # ${m.name}
135
+ </div>
136
+ `)}
137
+ </div>
138
+ </div>
139
+ </div>
140
+
141
+ <div right>
142
+ ${html `
143
+ <div class="button-line">
144
+ <div
145
+ class="ghost-btn"
146
+ @click=${async () => {
147
+ // project-type domain 에서는 대상 페이지가 subdomain 으로 자동 해석하므로 id 불필요
148
+ if (isProjectTypeDomain()) {
149
+ navigate('project-update');
150
+ return;
151
+ }
152
+ const id = this.project.id || (await this._resolveProjectIdFromDomain());
153
+ if (id)
154
+ navigate(`project-update/${id}`);
155
+ }}
156
+ >
157
+ <md-icon slot="">assignment</md-icon>
158
+ <div>프로젝트 수정</div>
159
+ </div>
160
+ <div
161
+ class="ghost-btn"
162
+ @click=${async () => {
163
+ if (isProjectTypeDomain()) {
164
+ navigate('project-complete');
165
+ return;
166
+ }
167
+ const id = this.project.id || (await this._resolveProjectIdFromDomain());
168
+ if (id)
169
+ navigate(`project-complete/${id}`);
170
+ }}
171
+ >
172
+ <md-icon slot="">assignment_turned_in</md-icon>
173
+ <div>KPI 데이타입력</div>
174
+ </div>
175
+ </div>
176
+ `}
177
+
178
+ <div class="card kpi-box">
179
+ <div class="kpi-header">
180
+ <div>
181
+ <div>종합 KPI</div>
182
+ <div class="triangle"></div>
183
+ </div>
184
+ <div class="kpi-desc">프로젝트의 6개 성과를 종합한 종합 KPI포인트와 각 지표별 분포</div>
185
+ </div>
186
+
187
+ <div class="kpi-summary">
188
+ <div class="mini-boxplot" title="boxplot placeholder">
189
+ <div class="boxplot-area">
190
+ <kpi-single-boxplot-chart .data=${this.getBoxPlotDataForProject(this.project)}></kpi-single-boxplot-chart>
191
+ </div>
192
+
193
+ <div class="boxplot-point">
194
+ <div class="value">${this.project.kpi ? this.project.kpi.toFixed(1) : '-'}</div>
195
+ <div class="label">Point</div>
196
+ </div>
197
+ </div>
198
+
199
+ <div class="spider-area">
200
+ <sv-kpi-radar-chart
201
+ .data=${this.getRadarChartData().data}
202
+ .categories=${this.getRadarChartData().categories}
203
+ .currentGroup=${'프로젝트성과'}
204
+ ></sv-kpi-radar-chart>
205
+ </div>
206
+ </div>
207
+ </div>
208
+
209
+ <div class="card group-box">
210
+ <div class="kpi-header">
211
+ <div>
212
+ <div>성과영역별 KPI</div>
213
+ <div class="triangle"></div>
214
+ </div>
215
+ </div>
216
+ <div class="desc">
217
+ Boxplot(박스플롯)은 박스는 중앙 50% 구간, 수염은 전체 범위, 굵은 파란색 가로선은 중앙값(median), 초록색 원은
218
+ 평균값(Mean)을 의미합니다. 당해 프로젝트의 값은 붉은색 원으로 표시됩니다.
219
+ </div>
220
+ <div class="group-chart">
221
+ <sv-kpi-boxplot-chart .data=${this.getYKpiBoxplotData()}></sv-kpi-boxplot-chart>
222
+ </div>
223
+ </div>
224
+
225
+ <div class="metrics-card">
226
+ <div class="metrics-header">
227
+ <div class="title">
228
+ <span>성과영역별 KPI 측정값</span>
229
+ <div class="triangle"></div>
230
+ </div>
231
+ </div>
232
+ <div class="desc">
233
+ 프로젝트의 6개 성과별 상세 주요 매트릭 데이터 (각 세부 항목을 클릭하시면 평가 기준표를 확인할 수 있습니다)
234
+ </div>
235
+ <div class="metrics-content">
236
+ ${Object.values(this.getMetricGroups()).map(group => html `
237
+ <div class="metric-group">
238
+ <div class="metric-group-header">
239
+ <div class="metric-group-icon"></div>
240
+ <span>${group.name}</span>
241
+ <span style="margin-left: 10px; color: #4caf50; font-weight: 700;">[${group.score}]</span>
242
+ </div>
243
+ <div class="metric-items">
244
+ ${group.metrics.map(metric => html `
245
+ <div class="metric-item">
246
+ <span
247
+ class="metric-label"
248
+ @click=${() => this._onMetricLabelClick(metric)}
249
+ title="클릭하시면 평가 기준표를 확인할 수 있습니다"
250
+ >
251
+ ${metric.label}
252
+ </span>
253
+ <span class="metric-value">${metric.value}</span>
254
+ </div>
255
+ `)}
256
+ </div>
257
+ </div>
258
+ `)}
259
+ </div>
260
+ </div>
261
+ </div>
262
+ </div>
263
+
264
+ ${this.showScoreDistribution && this.selectedKpi
265
+ ? html `
266
+ <div class="popup-overlay" @click=${this._closePopup}>
267
+ <div class="popup-content" @click=${(e) => e.stopPropagation()}>
268
+ <div class="popup-header">
269
+ <div class="popup-title">${this.selectedKpi.kpiName} — 성과 분포</div>
270
+ ${this.selectedKpi.score !== undefined && this.selectedKpi.score !== null
271
+ ? html `
272
+ <div class="popup-score">
273
+ <span class="score-value">${parseFloat(Number(this.selectedKpi.score).toFixed(2))}</span>
274
+ </div>
275
+ `
276
+ : ''}
277
+ <button class="popup-close" @click=${this._closePopup}>×</button>
278
+ </div>
279
+ <div class="popup-chart-container">
280
+ ${
281
+ /*
282
+ * scoreType 기반 차트 분기:
283
+ *
284
+ * CUSTOM (X13 등): 2D 룩업 히트맵 — 단, 증강데이터에서는 value가
285
+ * 이미 1~5 정수(룩업 결과)이므로 히트맵 대신 게이지로 폴백.
286
+ * 실제 프로젝트에서는 value가 편차율(소수점)이므로 히트맵 표시.
287
+ *
288
+ * LOOKUP: 성과 분포 커브 (kpi-lookup-chart)
289
+ * ASSESSMENT: 5단계 게이지 (kpi-lookup-chart 자동 감지)
290
+ */ ''}
291
+ ${
292
+ // SL-PA 결과(X34 품질, X43 안전) 만 계단형 등급 분포 차트로 표시.
293
+ // (다른 KPI 차트 경로에는 영향 없음)
294
+ this.selectedKpi.pattern === 'X34' || this.selectedKpi.pattern === 'X43'
295
+ ? html `
296
+ <kpi-step-lookup-chart
297
+ .grades=${this.selectedKpi.grades || []}
298
+ .value=${this.selectedKpi.value}
299
+ .score=${(_l = this.selectedKpi.score) !== null && _l !== void 0 ? _l : null}
300
+ unit=${this.selectedKpi.unit || ''}
301
+ ></kpi-step-lookup-chart>
302
+ `
303
+ : // 2D lookup KPI (X13 등) 는 항상 등급 기준 + 히트맵 함께 표시 (value 가
304
+ // 정수든 소수든 일관). _renderAssessmentGrades 안의 is2D 분기가 히트맵
305
+ // 같이 그림. 그 외 ASSESSMENT 도 등급 기준, LOOKUP 은 분포 커브.
306
+ this.selectedKpi.scoreType === 'CUSTOM' || ((_m = this.selectedKpi.grades) === null || _m === void 0 ? void 0 : _m.type) === 'PROGRESS_DEVIATION_LOOKUP'
307
+ ? this._renderAssessmentGrades()
308
+ : this._isAssessmentOrIntegerScore()
309
+ ? this._renderAssessmentGrades()
310
+ : html `
311
+ <kpi-lookup-chart
312
+ .grades=${this.selectedKpi.grades || []}
313
+ .value=${this.selectedKpi.value}
314
+ .score=${(_o = this.selectedKpi.score) !== null && _o !== void 0 ? _o : null}
315
+ .scoreType=${this.selectedKpi.scoreType || ''}
316
+ .valueType=${this.selectedKpi.valueType || ''}
317
+ unit=${this.selectedKpi.unit || ''}
318
+ ></kpi-lookup-chart>
319
+ `}
320
+ </div>
321
+ </div>
322
+ </div>
323
+ `
324
+ : ''}
325
+ `;
326
+ }
327
+ async pageUpdated(changes, lifecycle) {
328
+ if (!this.active)
329
+ return;
330
+ let projectId = lifecycle.resourceId;
331
+ // 프로젝트 테넌트 컨텍스트(/project/<code>/) 에서 진입한 경우 resourceId 가 비어있다.
332
+ // 현재 도메인의 subdomain(= Project.code) 으로 프로젝트를 역조회.
333
+ if (!projectId) {
334
+ projectId = await this._resolveProjectIdFromDomain();
335
+ }
336
+ if (!projectId)
337
+ return;
338
+ // initProject 의 GraphQL 응답을 기다리지 않고 project.id 를 즉시 채워서,
339
+ // 링크의 `project-update/${project.id}` 가 절대 undefined 가 되지 않도록 보장.
340
+ this.project = Object.assign(Object.assign({}, this.project), { id: projectId });
341
+ // 후속 query 들이 tenant 컨텍스트로 동작하도록 project.code 를 먼저 가볍게 resolve.
342
+ // (tenant 컨텍스트에서 진입한 경우는 헤더 불필요 — tenantHeaders 가 빈 객체 반환.)
343
+ if (!isProjectTypeDomain()) {
344
+ await this._resolveProjectCode(projectId);
345
+ }
346
+ this.initProject(projectId);
347
+ this.getKpiComprehensiveStats();
348
+ this.getKpiYComprehensiveStats();
349
+ this.getProjectXKpiValues(projectId);
350
+ }
351
+ async _resolveProjectCode(projectId) {
352
+ var _a, _b;
353
+ try {
354
+ const resp = await client.query({
355
+ query: gql `
356
+ query ProjectCode($id: String!) {
357
+ project(id: $id) {
358
+ id
359
+ code
360
+ }
361
+ }
362
+ `,
363
+ variables: { id: projectId }
364
+ });
365
+ const code = (_b = (_a = resp.data) === null || _a === void 0 ? void 0 : _a.project) === null || _b === void 0 ? void 0 : _b.code;
366
+ if (code) {
367
+ this.project = Object.assign(Object.assign({}, this.project), { code });
368
+ }
369
+ }
370
+ catch (e) {
371
+ console.warn('[project-detail] project.code resolve 실패', e);
372
+ }
373
+ }
374
+ async _resolveProjectIdFromDomain() {
375
+ var _a, _b;
376
+ const response = await client.query({
377
+ query: gql `
378
+ query CurrentProject {
379
+ currentProject {
380
+ id
381
+ }
382
+ }
383
+ `
384
+ });
385
+ return ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.currentProject) === null || _b === void 0 ? void 0 : _b.id) || '';
386
+ }
387
+ async initProject(projectId = '') {
388
+ var _a, _b;
389
+ const response = await client.query({
390
+ query: gql `
391
+ query Project($id: String!) {
392
+ project(id: $id) {
393
+ id
394
+ code
395
+ name
396
+ state
397
+ startDate
398
+ endDate
399
+ projectType
400
+ sectorType
401
+ buildingUsage
402
+ mainPhoto {
403
+ fullpath
404
+ }
405
+ totalProgress
406
+ weeklyProgress
407
+ kpi
408
+ kpiValues {
409
+ kpiName
410
+ value
411
+ }
412
+ inspPassRate
413
+ robotProgressRate
414
+ structuralSafetyRate
415
+ robotCount
416
+ buildingComplex {
417
+ id
418
+ address
419
+ latitude
420
+ longitude
421
+ area
422
+ coverageRatio
423
+ floorAreaRatio
424
+ siteType
425
+ workerCount
426
+ clientCompany
427
+ constructionCompany
428
+ supervisoryCompany
429
+ designCompany
430
+ drawing {
431
+ id
432
+ name
433
+ fullpath
434
+ }
435
+ constructionType
436
+ constructionCost
437
+ etc
438
+ notice
439
+ householdCount
440
+ buildingCount
441
+ virtualTourLink
442
+ buildings {
443
+ id
444
+ name
445
+ floorCount
446
+ }
447
+ }
448
+ }
449
+ }
450
+ `,
451
+ variables: { id: projectId },
452
+ context: { headers: tenantHeaders((_a = this.project) === null || _a === void 0 ? void 0 : _a.code) }
453
+ });
454
+ if (response.errors)
455
+ return;
456
+ this.project = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.project) || {};
457
+ this.updateContext();
458
+ this._loadPendingMetrics();
459
+ }
460
+ /**
461
+ * 이 프로젝트의 미입력 KPI metric 들을 조회 — Step 1/2 와 동일 기준.
462
+ * - 대상: active=true 인 manual/import metric (자동수집/외부API 제외)
463
+ * - 판정:
464
+ * · MONTH metric → 전월 row (periodType='MONTH', valueDate startsWith 전월) 없으면 pending
465
+ * · 그 외 → (metric, periodType) 매칭 row 없으면 pending
466
+ */
467
+ async _loadPendingMetrics() {
468
+ var _a, _b, _c, _d, _e, _f, _g;
469
+ if (!((_a = this.project) === null || _a === void 0 ? void 0 : _a.id)) {
470
+ this.pendingMetrics = [];
471
+ return;
472
+ }
473
+ try {
474
+ // 1) Active manual/import metric 정의 목록 (periodType 포함)
475
+ const metricsResp = await client.query({
476
+ query: gql `
477
+ query KpiMetrics {
478
+ kpiMetrics {
479
+ items {
480
+ id
481
+ name
482
+ description
483
+ periodType
484
+ collectType
485
+ active
486
+ }
487
+ }
488
+ }
489
+ `,
490
+ context: { headers: tenantHeaders((_b = this.project) === null || _b === void 0 ? void 0 : _b.code) }
491
+ });
492
+ // collectType 필터 제거 — Step 1/2 가 모든 metric 을 보여주므로 동일하게 전체 대상.
493
+ // active=false 인 metric 만 제외.
494
+ const targets = (((_d = (_c = metricsResp.data) === null || _c === void 0 ? void 0 : _c.kpiMetrics) === null || _d === void 0 ? void 0 : _d.items) || []).filter((m) => m.active);
495
+ if (targets.length === 0) {
496
+ this.pendingMetrics = [];
497
+ return;
498
+ }
499
+ // 2) 이 프로젝트의 모든 KpiMetricValue (metric.name 포함 — 2D 차트의 latest lookup 에도 사용)
500
+ const valuesResp = await client.query({
501
+ query: gql `
502
+ query KpiMetricValues($filters: [Filter!]) {
503
+ kpiMetricValues(filters: $filters) {
504
+ items {
505
+ metricId
506
+ periodType
507
+ valueDate
508
+ value
509
+ metric {
510
+ id
511
+ name
512
+ }
513
+ }
514
+ }
515
+ }
516
+ `,
517
+ variables: { filters: [{ name: 'org', operator: 'eq', value: this.project.id }] },
518
+ context: { headers: tenantHeaders((_e = this.project) === null || _e === void 0 ? void 0 : _e.code) }
519
+ });
520
+ const values = ((_g = (_f = valuesResp.data) === null || _f === void 0 ? void 0 : _f.kpiMetricValues) === null || _g === void 0 ? void 0 : _g.items) || [];
521
+ this.allKpiMetricValues = values;
522
+ const lastMonthYm = moment().tz('Asia/Seoul').subtract(1, 'month').format('YYYY-MM');
523
+ // 3) Step 1/2 와 동일 기준으로 미입력 판정 — row 존재 AND value 존재 (null/undefined 아님).
524
+ const hasValid = (v) => v.value !== null && v.value !== undefined;
525
+ this.pendingMetrics = targets.filter((m) => {
526
+ if (m.periodType === 'MONTH') {
527
+ return !values.some(v => v.metricId === m.id && v.periodType === 'MONTH' && (v.valueDate || '').startsWith(lastMonthYm) && hasValid(v));
528
+ }
529
+ return !values.some(v => v.metricId === m.id && v.periodType === m.periodType && hasValid(v));
530
+ });
531
+ }
532
+ catch (e) {
533
+ console.error('[입력 대기 중] 조회 실패', e);
534
+ this.pendingMetrics = [];
535
+ }
536
+ }
537
+ async getKpiComprehensiveStats() {
538
+ var _a;
539
+ try {
540
+ const response = await client.query({
541
+ query: gql `
542
+ query GetKpiZValueComprehensiveStats {
543
+ totalKpiZValueComprehensiveStats {
544
+ minVal
545
+ q1Val
546
+ medVal
547
+ q3Val
548
+ maxVal
549
+ }
550
+ }
551
+ `,
552
+ context: { headers: tenantHeaders((_a = this.project) === null || _a === void 0 ? void 0 : _a.code) }
553
+ });
554
+ this.kpiComprehensiveStats = response.data.totalKpiZValueComprehensiveStats || [];
555
+ }
556
+ catch (error) {
557
+ console.error('Failed to fetch KPI comprehensive stats:', error);
558
+ this.kpiComprehensiveStats = [];
559
+ }
560
+ }
561
+ async getKpiYComprehensiveStats() {
562
+ var _a;
563
+ try {
564
+ const response = await client.query({
565
+ query: gql `
566
+ query GetKpiYValueComprehensiveStats {
567
+ totalKpiYValueComprehensiveStats {
568
+ kpiName
569
+ minVal
570
+ q1Val
571
+ medVal
572
+ q3Val
573
+ maxVal
574
+ avgVal
575
+ projectCount
576
+ }
577
+ }
578
+ `,
579
+ context: { headers: tenantHeaders((_a = this.project) === null || _a === void 0 ? void 0 : _a.code) }
580
+ });
581
+ this.kpiYComprehensiveStats = response.data.totalKpiYValueComprehensiveStats || [];
582
+ }
583
+ catch (error) {
584
+ console.error('Failed to fetch KPI Y comprehensive stats:', error);
585
+ this.kpiYComprehensiveStats = [];
586
+ }
587
+ }
588
+ async getProjectXKpiValues(projectId) {
589
+ var _a;
590
+ try {
591
+ const response = await client.query({
592
+ query: gql `
593
+ query GetProjectXKpiValues($projectId: String!) {
594
+ projectXKpiValues(projectId: $projectId) {
595
+ id
596
+ value
597
+ score
598
+ valueDate
599
+ kpi {
600
+ id
601
+ name
602
+ description
603
+ }
604
+ }
605
+ }
606
+ `,
607
+ variables: { projectId },
608
+ context: { headers: tenantHeaders((_a = this.project) === null || _a === void 0 ? void 0 : _a.code) }
609
+ });
610
+ this.projectXKpiValues = response.data.projectXKpiValues || [];
611
+ }
612
+ catch (error) {
613
+ console.error('Failed to fetch project X KPI values:', error);
614
+ this.projectXKpiValues = [];
615
+ }
616
+ }
617
+ _onMetricLabelClick(metric) {
618
+ // metric.pattern을 사용하여 X-KPI 조회
619
+ if (!metric.pattern) {
620
+ console.warn('No pattern found for metric:', metric);
621
+ return;
622
+ }
623
+ // X-KPI 이름 패턴 (예: X11, X12, X21, ...)
624
+ const kpiNamePattern = metric.pattern;
625
+ // 해당 KPI 정보 조회
626
+ this._fetchKpiWithGradesByPattern(kpiNamePattern, metric.label);
627
+ }
628
+ async _fetchKpiWithGradesByPattern(kpiNamePattern, displayName) {
629
+ var _a, _b, _c, _d, _e;
630
+ try {
631
+ // X-KPI 이름 패턴으로 전체 이름 찾기 (projectXKpiValues에서)
632
+ const kpiValue = this.projectXKpiValues.find(kv => { var _a; return ((_a = kv.kpi) === null || _a === void 0 ? void 0 : _a.name) && kv.kpi.name.includes(kpiNamePattern); });
633
+ if (!kpiValue || !kpiValue.kpi) {
634
+ console.warn(`No KPI found for pattern: ${kpiNamePattern}`);
635
+ return;
636
+ }
637
+ // GraphQL로 KPI 상세 정보 (grades 포함) 조회
638
+ const response = await client.query({
639
+ query: gql `
640
+ query Kpi($id: String!) {
641
+ kpi(id: $id) {
642
+ id
643
+ name
644
+ grades
645
+ scoreType
646
+ valueType
647
+ vizMeta
648
+ }
649
+ }
650
+ `,
651
+ variables: { id: kpiValue.kpi.id },
652
+ context: { headers: tenantHeaders((_a = this.project) === null || _a === void 0 ? void 0 : _a.code) }
653
+ });
654
+ if (response.errors || !((_b = response.data) === null || _b === void 0 ? void 0 : _b.kpi)) {
655
+ console.error('KPI not found or error:', response.errors);
656
+ return;
657
+ }
658
+ const kpi = response.data.kpi;
659
+ // grades가 없으면 경고
660
+ const is2D = kpi.grades && !Array.isArray(kpi.grades) && kpi.grades.type === 'PROGRESS_DEVIATION_LOOKUP';
661
+ if (!kpi.grades || (!is2D && (!Array.isArray(kpi.grades) || kpi.grades.length === 0))) {
662
+ console.warn(`No grades found for KPI: ${kpiValue.kpi.name}`);
663
+ }
664
+ this.selectedKpi = {
665
+ kpiName: displayName,
666
+ pattern: kpiNamePattern, // X34/X43 등 — 계단형 차트 라우팅용
667
+ grades: kpi.grades || [],
668
+ scoreType: kpi.scoreType || '',
669
+ valueType: kpi.valueType || '',
670
+ value: (_c = kpiValue.value) !== null && _c !== void 0 ? _c : null,
671
+ score: (_d = kpiValue.score) !== null && _d !== void 0 ? _d : null,
672
+ unit: ((_e = kpi.vizMeta) === null || _e === void 0 ? void 0 : _e.unit) || ''
673
+ };
674
+ this.showScoreDistribution = true;
675
+ }
676
+ catch (error) {
677
+ console.error('Error fetching KPI:', error);
678
+ }
679
+ }
680
+ /**
681
+ * 등급 기준으로 표시할지 판별 (차트 대신 등급 설명 목록)
682
+ *
683
+ * - valueType=ASSESSED: 감리자 직접 평가 → 등급 설명
684
+ * - CUSTOM/COMPOSITE이지만 value가 1~5 정수 (증강데이터): 등급 설명 + 히트맵
685
+ * - grades가 배열이 아닌 경우 (2D lookup 객체): 등급 설명 + 히트맵
686
+ */
687
+ _isAssessmentOrIntegerScore() {
688
+ const kpi = this.selectedKpi;
689
+ if (!kpi)
690
+ return false;
691
+ // valueType 기반 판별 (우선)
692
+ if (kpi.valueType === 'ASSESSED')
693
+ return true;
694
+ // CUSTOM/COMPOSITE이지만 value가 1~5 정수 (증강데이터)
695
+ if ((kpi.scoreType === 'CUSTOM' || kpi.valueType === 'COMPOSITE') &&
696
+ kpi.value !== null &&
697
+ kpi.value === Math.floor(kpi.value) &&
698
+ kpi.value >= 1 &&
699
+ kpi.value <= 5)
700
+ return true;
701
+ // grades가 배열이 아닌 경우 (2D lookup 객체)
702
+ if (kpi.grades && !Array.isArray(kpi.grades))
703
+ return true;
704
+ return false;
705
+ }
706
+ /** 등급 기준 표시 (ASSESSED / 1~5 정수 score) — 현재 값 강조 + CUSTOM은 2D 히트맵도 표시 */
707
+ _renderAssessmentGrades() {
708
+ var _a;
709
+ const kpi = this.selectedKpi;
710
+ // score 가 진짜 등급. kpi.value 는 raw 측정값 (편차율 등) 이라 score 로 쓰면 안 됨.
711
+ const currentScore = (kpi === null || kpi === void 0 ? void 0 : kpi.score) != null ? Math.round(kpi.score) : 0;
712
+ const grades = Array.isArray(kpi === null || kpi === void 0 ? void 0 : kpi.grades) ? kpi.grades : [];
713
+ const colors = ['#e53935', '#ff9800', '#ffca28', '#66bb6a', '#2e7d32'];
714
+ const is2D = (kpi === null || kpi === void 0 ? void 0 : kpi.scoreType) === 'CUSTOM' ||
715
+ (kpi === null || kpi === void 0 ? void 0 : kpi.valueType) === 'COMPOSITE' ||
716
+ ((kpi === null || kpi === void 0 ? void 0 : kpi.grades) &&
717
+ typeof kpi.grades === 'object' &&
718
+ !Array.isArray(kpi.grades) &&
719
+ kpi.grades.type === 'PROGRESS_DEVIATION_LOOKUP');
720
+ // grades가 있으면 description 사용, 없으면 기본 라벨
721
+ const defaultLabels = ['매우 미흡', '미흡', '보통', '양호', '우수'];
722
+ const items = [1, 2, 3, 4, 5].map(score => {
723
+ const grade = grades.find((g) => g.score === score);
724
+ return {
725
+ score,
726
+ desc: (grade === null || grade === void 0 ? void 0 : grade.description) || (grade === null || grade === void 0 ? void 0 : grade.name) || defaultLabels[score - 1],
727
+ color: colors[score - 1],
728
+ active: score === currentScore
729
+ };
730
+ });
731
+ // ASSESSED(감리자 평가)이고 grades에 description이 있는 경우만 한 줄씩 상세 표시
732
+ // X13 등 COMPOSITE/CUSTOM은 인라인 칩으로 간결하게
733
+ const hasDescriptions = !is2D && grades.length > 0 && grades.some((g) => g.description);
734
+ // ASSESSMENT (감리자 평가) 의 등급 description 만 노출. 2D lookup 은 score 가 이미
735
+ // popup-header 큰 점수로 표시되므로 등급 기준 행/동그라미 중복 제거.
736
+ return html `
737
+ <div style="padding: 20px; display: flex; flex-direction: column; height: 100%;">
738
+ ${hasDescriptions
739
+ ? items.map(item => html ` <div
740
+ style="
741
+ display: flex; align-items: center; gap: 10px;
742
+ padding: 10px 14px; margin-bottom: 6px;
743
+ border-radius: 8px;
744
+ background: ${item.active ? item.color + '18' : '#f9f9f9'};
745
+ border: 2px solid ${item.active ? item.color : 'transparent'};
746
+ transition: all 0.2s;
747
+ "
748
+ >
749
+ <span
750
+ style="
751
+ width: 32px; height: 32px; border-radius: 50%;
752
+ background: ${item.active ? item.color : '#e0e0e0'};
753
+ color: ${item.active ? '#fff' : '#999'};
754
+ display: flex; align-items: center; justify-content: center;
755
+ font-weight: 700; font-size: 14px; flex-shrink: 0;
756
+ "
757
+ >${item.score}</span
758
+ >
759
+ <span
760
+ style="font-size: 0.9rem; color: ${item.active ? '#333' : '#666'}; font-weight: ${item.active
761
+ ? '600'
762
+ : '400'};"
763
+ >
764
+ ${item.desc}
765
+ </span>
766
+ </div>`)
767
+ : ''}
768
+ ${is2D && ((_a = kpi === null || kpi === void 0 ? void 0 : kpi.grades) === null || _a === void 0 ? void 0 : _a.rows)
769
+ ? html `
770
+ <div style="flex: 1; display: flex; flex-direction: column; min-height: 0;">
771
+ <div style="font-size: 0.9rem; font-weight: 700; color: #333; margin-bottom: 8px;">
772
+ 공정률 × 공기편차 성과 분포
773
+ </div>
774
+ <div style="flex: 1; min-height: 0;">
775
+ <kpi-2d-lookup-chart
776
+ .grades=${kpi.grades}
777
+ .value=${this._getScheduleDeviation()}
778
+ .progressRate=${this._getProgressRate()}
779
+ ></kpi-2d-lookup-chart>
780
+ </div>
781
+ </div>
782
+ `
783
+ : ''}
784
+ </div>
785
+ `;
786
+ }
787
+ _closePopup() {
788
+ this.showScoreDistribution = false;
789
+ this.selectedKpi = null;
790
+ }
791
+ getMetricValue(kpiNamePattern) {
792
+ const kpiValue = this.projectXKpiValues.find(kv => { var _a; return ((_a = kv.kpi) === null || _a === void 0 ? void 0 : _a.name) && kv.kpi.name.includes(kpiNamePattern); });
793
+ const value = (kpiValue === null || kpiValue === void 0 ? void 0 : kpiValue.value) || 0;
794
+ // 정수면 그대로, 소수면 최대 3자리까지만 표시
795
+ if (Number.isInteger(value)) {
796
+ return value.toString();
797
+ }
798
+ else {
799
+ return value.toFixed(3).replace(/\.?0+$/, '');
800
+ }
801
+ }
802
+ getYKpiScoreFormatted(kpiName) {
803
+ const value = this.getProjectYKpiValue(kpiName);
804
+ if (value === 0)
805
+ return '-';
806
+ return (value * 100).toFixed(1);
807
+ }
808
+ getMetricGroups() {
809
+ return {
810
+ Y1: {
811
+ name: '일정성과 (Y1)',
812
+ score: this.getYKpiScoreFormatted('일정성과(Y1)'),
813
+ metrics: [
814
+ { label: '연면적 대비 공사기간', pattern: 'X11', value: this.getMetricValue('X11') },
815
+ { label: '설계변경 공기 증감률', pattern: 'X12', value: this.getMetricValue('X12') },
816
+ { label: '일정 이탈 수준', pattern: 'X13', value: this.getMetricValue('X13') },
817
+ { label: '일정성과 정성 평가', pattern: 'X14', value: this.getMetricValue('X14') }
818
+ ]
819
+ },
820
+ Y2: {
821
+ name: '비용성과 (Y2)',
822
+ score: this.getYKpiScoreFormatted('비용성과(Y2)'),
823
+ metrics: [
824
+ { label: '연면적 대비 공사비', pattern: 'X21', value: this.getMetricValue('X21') },
825
+ { label: '설계변경 공사비 증감률', pattern: 'X22', value: this.getMetricValue('X22') },
826
+ { label: '비용성과 정성 평가', pattern: 'X23', value: this.getMetricValue('X23') }
827
+ ]
828
+ },
829
+ Y3: {
830
+ name: '품질성과 (Y3)',
831
+ score: this.getYKpiScoreFormatted('품질성과(Y3)'),
832
+ metrics: [
833
+ { label: '검측 불합격률', pattern: 'X33', value: this.getMetricValue('X33') },
834
+ { label: '품질 SL-PA 결과', pattern: 'X34', value: this.getMetricValue('X34') },
835
+ { label: '품질성과 정성 평가', pattern: 'X35', value: this.getMetricValue('X35') }
836
+ ]
837
+ },
838
+ Y4: {
839
+ name: '안전성과 (Y4)',
840
+ score: this.getYKpiScoreFormatted('Y4. 안전성과'),
841
+ metrics: [
842
+ { label: '재해율', pattern: 'X41', value: this.getMetricValue('X41') },
843
+ { label: '재해강도율', pattern: 'X42', value: this.getMetricValue('X42') },
844
+ { label: '안전 SL-PA 결과', pattern: 'X43', value: this.getMetricValue('X43') },
845
+ { label: '안전성과 정성 평가', pattern: 'X44', value: this.getMetricValue('X44') }
846
+ ]
847
+ },
848
+ Y5: {
849
+ name: '환경성과 (Y5)',
850
+ score: this.getYKpiScoreFormatted('환경성과(Y5)'),
851
+ metrics: [
852
+ { label: '건설폐기물 발생량', pattern: 'X51', value: this.getMetricValue('X51') },
853
+ { label: '환경성과 정성 평가', pattern: 'X52', value: this.getMetricValue('X52') }
854
+ ]
855
+ },
856
+ Y6: {
857
+ name: '생산성 성과 (Y6)',
858
+ score: this.getYKpiScoreFormatted('생산성성과(Y6)'),
859
+ metrics: [
860
+ { label: '총 투입인력(M/M) 생산성', pattern: 'X61', value: this.getMetricValue('X61') },
861
+ { label: '생산성성과 정성 평가', pattern: 'X62', value: this.getMetricValue('X62') }
862
+ ]
863
+ }
864
+ };
865
+ }
866
+ getYKpiBoxplotData() {
867
+ // kpiName 표기가 환경마다 다양('Y1. 일정성과' / 'Y1. 일정' / '일정성과(Y1)' 등)하므로
868
+ // Y1~Y6 코드만 추출해 짧은 X축 라벨로 매핑 — 전체 문자열에 의존하지 않아 견고함.
869
+ const yLabelByCode = {
870
+ Y1: '일정',
871
+ Y2: '비용',
872
+ Y3: '품질',
873
+ Y4: '안전',
874
+ Y5: '환경',
875
+ Y6: '생산성'
876
+ };
877
+ const data = [];
878
+ // Y-KPI 카테고리별로 통합된 통계 생성
879
+ this.kpiYComprehensiveStats.forEach(stat => {
880
+ var _a, _b;
881
+ const category = yLabelByCode[(_b = (_a = (stat.kpiName || '').match(/Y[1-6]/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : ''] || stat.kpiName;
882
+ data.push({
883
+ org: category, // org 필드 사용 (boxplot 차트가 기대하는 필드명)
884
+ min: stat.minVal * 100,
885
+ max: stat.maxVal * 100,
886
+ q1: stat.q1Val * 100,
887
+ q3: stat.q3Val * 100,
888
+ median: stat.medVal * 100,
889
+ mean: stat.avgVal * 100,
890
+ value: this.getProjectYKpiValue(stat.kpiName) * 100 // 현재 프로젝트의 실제 Y-KPI 값 (0~1 → 0~20)
891
+ });
892
+ });
893
+ // 가나다순(localeCompare)이 아니라 Y1~Y6 고정 순서로 정렬 (일정·비용·품질·안전·환경·생산성)
894
+ const ORDER = ['일정', '비용', '품질', '안전', '환경', '생산성'];
895
+ return data.sort((a, b) => ORDER.indexOf(a.org) - ORDER.indexOf(b.org));
896
+ }
897
+ /**
898
+ * KpiMetric.name 이 주어진 이름인 KpiMetricValue 중 가장 최근 valueDate 의 value.
899
+ * 2D lookup chart 의 progressRate / value 도출용.
900
+ */
901
+ _getLatestMetricValue(metricName) {
902
+ const candidates = this.allKpiMetricValues
903
+ .filter(v => { var _a; return ((_a = v.metric) === null || _a === void 0 ? void 0 : _a.name) === metricName && v.value !== null && v.value !== undefined; })
904
+ .sort((a, b) => (b.valueDate || '').localeCompare(a.valueDate || ''));
905
+ return candidates.length > 0 ? candidates[0].value : null;
906
+ }
907
+ /** 2D lookup chart 의 progressRate (X축, 실적공정율 %) — 실적공정율 metric latest 우선, 없으면 fallback. */
908
+ _getProgressRate() {
909
+ var _a, _b;
910
+ const latest = this._getLatestMetricValue('실적공정율');
911
+ if (latest !== null)
912
+ return latest;
913
+ return (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.totalProgress) !== null && _b !== void 0 ? _b : 50;
914
+ }
915
+ /** 2D lookup chart 의 value (Y축, 공기편차 비율) — '일정 이탈 수준' metric latest 우선, 없으면 selectedKpi.value. */
916
+ _getScheduleDeviation() {
917
+ var _a, _b;
918
+ const latest = this._getLatestMetricValue('일정 이탈 수준');
919
+ if (latest !== null)
920
+ return latest;
921
+ return (_b = (_a = this.selectedKpi) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null;
922
+ }
923
+ getProjectYKpiValue(kpiName) {
924
+ var _a, _b, _c;
925
+ // kpiName 표기가 'Y1. 일정성과' / '일정성과(Y1)' 등으로 달라 정확 매칭은 자주 실패함.
926
+ // Y1~Y6 코드만 추출해 매칭 → 형식 차이와 무관하게 값 조회.
927
+ const code = (_a = (kpiName || '').match(/Y[1-6]/)) === null || _a === void 0 ? void 0 : _a[0];
928
+ const kpiValue = (_c = (_b = this.project) === null || _b === void 0 ? void 0 : _b.kpiValues) === null || _c === void 0 ? void 0 : _c.find(kv => { var _a; return code ? ((_a = (kv.kpiName || '').match(/Y[1-6]/)) === null || _a === void 0 ? void 0 : _a[0]) === code : kv.kpiName === kpiName; });
929
+ return (kpiValue === null || kpiValue === void 0 ? void 0 : kpiValue.value) || 0;
930
+ }
931
+ getRadarChartData() {
932
+ // kpiName 표기가 다양하므로 Y1~Y6 코드만 추출해 짧은 라벨로 매핑 (박스플롯과 동일 방식).
933
+ const yLabelByCode = {
934
+ Y1: '일정',
935
+ Y2: '비용',
936
+ Y3: '품질',
937
+ Y4: '안전',
938
+ Y5: '환경',
939
+ Y6: '생산성'
940
+ };
941
+ const data = [];
942
+ const categories = [];
943
+ // Create baseline data from comprehensive stats (using avgVal as baseline)
944
+ this.kpiYComprehensiveStats.forEach(stat => {
945
+ var _a, _b;
946
+ const category = yLabelByCode[(_b = (_a = (stat.kpiName || '').match(/Y[1-6]/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : ''] || stat.kpiName;
947
+ if (!categories.includes(category)) {
948
+ categories.push(category);
949
+ }
950
+ // Add baseline average
951
+ data.push({
952
+ org: '기준평균',
953
+ category,
954
+ value: Math.round(stat.avgVal * 100) // Scale to match expected range (0~1 → 0~20)
955
+ });
956
+ // Add current project performance (using project's individual values)
957
+ data.push({
958
+ org: '프로젝트성과',
959
+ category,
960
+ value: Math.round(this.getProjectYKpiValue(stat.kpiName) * 100) // Y-KPI 값 (0~1 → 0~20)
961
+ });
962
+ });
963
+ return {
964
+ data,
965
+ categories: categories.length > 0
966
+ ? categories
967
+ : ['일정', '비용', '품질', '안전', '환경', '생산성']
968
+ };
969
+ }
970
+ getBoxPlotDataForProject(project) {
971
+ var _a;
972
+ // 프로젝트의 지역(geo_group)에 해당하는 통계 찾기
973
+ const stats = (_a = this.kpiComprehensiveStats) === null || _a === void 0 ? void 0 : _a[0];
974
+ if (!stats) {
975
+ // 전체 통계의 평균값 사용 또는 기본값 반환
976
+ const defaultStats = this.kpiComprehensiveStats.length > 0 ? this.kpiComprehensiveStats[0] : null;
977
+ if (defaultStats) {
978
+ return {
979
+ min: defaultStats.minVal,
980
+ max: defaultStats.maxVal,
981
+ mean: (defaultStats.q1Val + defaultStats.q3Val) / 2,
982
+ median: defaultStats.medVal,
983
+ q1: defaultStats.q1Val,
984
+ q3: defaultStats.q3Val,
985
+ value: project.kpi || 0
986
+ };
987
+ }
988
+ // 완전한 기본값
989
+ return {
990
+ min: 0,
991
+ max: 100,
992
+ mean: 50,
993
+ median: 50,
994
+ q1: 25,
995
+ q3: 75,
996
+ value: project.kpi || 0
997
+ };
998
+ }
999
+ return {
1000
+ min: stats.minVal * 100,
1001
+ max: stats.maxVal * 100,
1002
+ mean: ((stats.q1Val + stats.q3Val) / 2) * 100, // 대략적 평균값
1003
+ median: stats.medVal * 100,
1004
+ q1: stats.q1Val * 100,
1005
+ q3: stats.q3Val * 100,
1006
+ value: project.kpi || 0
1007
+ };
1008
+ }
1009
+ };
1010
+ SvProjectDetailPage.styles = [
1011
+ ScrollbarStyles,
1012
+ css `
1013
+ :host {
1014
+ display: flex;
1015
+ flex-direction: column;
1016
+ overflow-y: auto;
1017
+
1018
+ width: 100%;
1019
+ height: 100%;
1020
+ background-color: var(--md-sys-color-background, #f6f6f6);
1021
+ }
1022
+
1023
+ /* content layout */
1024
+ div[content] {
1025
+ display: flex;
1026
+ gap: 35px;
1027
+ padding: 25px;
1028
+ }
1029
+ div[left] {
1030
+ flex: 1;
1031
+ display: flex;
1032
+ flex-direction: column;
1033
+ gap: 20px;
1034
+ }
1035
+ div[right] {
1036
+ flex: 1;
1037
+ display: flex;
1038
+ flex-direction: column;
1039
+ gap: 20px;
1040
+ padding: 0 1px;
1041
+ }
1042
+
1043
+ /* card */
1044
+ .card {
1045
+ background: #ffffff;
1046
+ border-radius: 10px;
1047
+ padding: 15px;
1048
+ box-shadow: 3px 3px 3px 0 rgba(0, 0, 0, 0.1);
1049
+ }
1050
+ .card-title {
1051
+ display: flex;
1052
+ align-items: center;
1053
+ gap: 5px;
1054
+ color: #35618e;
1055
+ font-weight: 700;
1056
+ }
1057
+ .triangle {
1058
+ width: 0;
1059
+ height: 0;
1060
+ border-left: 6px solid transparent;
1061
+ border-right: 6px solid transparent;
1062
+ border-top: 8px solid #35618e;
1063
+ }
1064
+
1065
+ /* left top info box */
1066
+ .bold {
1067
+ font-weight: bold;
1068
+ }
1069
+ .top-info {
1070
+ display: flex;
1071
+ gap: 10px;
1072
+ }
1073
+ .top-info img[pic] {
1074
+ width: 284px;
1075
+ height: 160px;
1076
+ object-fit: fill;
1077
+ background: #e5e7eb;
1078
+ }
1079
+ .top-info .info {
1080
+ display: flex;
1081
+ flex-direction: column;
1082
+ gap: 15px;
1083
+ padding: 10px 0;
1084
+ flex: 1;
1085
+ }
1086
+ .row {
1087
+ display: flex;
1088
+ align-items: center;
1089
+ gap: 10px;
1090
+ }
1091
+ .label {
1092
+ min-width: fit-content;
1093
+ color: #35618e;
1094
+ font-size: 16px;
1095
+ letter-spacing: -0.05em;
1096
+ }
1097
+ .value {
1098
+ color: #333;
1099
+ font-size: 16px;
1100
+ }
1101
+ .status-value {
1102
+ color: #4cbb49;
1103
+ font-weight: 700;
1104
+ }
1105
+
1106
+ .address {
1107
+ color: #35618e;
1108
+ font-size: 16px;
1109
+ letter-spacing: -0.05em;
1110
+ }
1111
+
1112
+ .detail-grid {
1113
+ display: grid;
1114
+ grid-template-columns: 284px 1fr;
1115
+ gap: 15px 10px;
1116
+ padding: 5px 0;
1117
+ }
1118
+ .detail-grid .grid-item .label {
1119
+ width: auto;
1120
+ }
1121
+
1122
+ /* left second card (requests) */
1123
+ .sub-desc {
1124
+ color: #35618e;
1125
+ font-size: 14px;
1126
+ letter-spacing: -0.05em;
1127
+ margin-bottom: 8px;
1128
+ }
1129
+ .list-block {
1130
+ display: flex;
1131
+ flex-direction: column;
1132
+ gap: 5px;
1133
+ padding: 5px 25px;
1134
+ }
1135
+ .list-title {
1136
+ color: #212529;
1137
+ font-weight: 700;
1138
+ font-size: 16px;
1139
+ letter-spacing: -0.05em;
1140
+ }
1141
+ .list-text {
1142
+ color: #35618e;
1143
+ font-size: 16px;
1144
+ letter-spacing: -0.05em;
1145
+ margin-left: 8px;
1146
+ }
1147
+ .list-text .warn {
1148
+ margin-left: 10px;
1149
+ color: #e13232;
1150
+
1151
+ md-icon {
1152
+ font-size: 17px;
1153
+ width: 13px;
1154
+ height: 13px;
1155
+ }
1156
+ }
1157
+
1158
+ /* right buttons */
1159
+ .button-line {
1160
+ display: flex;
1161
+ justify-content: flex-end;
1162
+ gap: 10px;
1163
+ }
1164
+ .ghost-btn {
1165
+ display: flex;
1166
+ align-items: center;
1167
+ gap: 3px;
1168
+ padding: 5px 10px;
1169
+ background: #35618e;
1170
+ color: #ffffff;
1171
+ border-radius: 5px;
1172
+ box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.1);
1173
+ cursor: pointer;
1174
+
1175
+ /* Material Symbols Outlined (stroke style) */
1176
+ md-icon {
1177
+ font-variation-settings:
1178
+ 'FILL' 0,
1179
+ 'wght' 300,
1180
+ 'GRAD' 0,
1181
+ 'opsz' 24;
1182
+ }
1183
+ }
1184
+
1185
+ /* right KPI box */
1186
+ .kpi-box {
1187
+ display: flex;
1188
+ flex-direction: column;
1189
+ gap: 10px;
1190
+ padding: 15px;
1191
+ max-height: 420px;
1192
+ min-width: 560px;
1193
+ }
1194
+ .kpi-header {
1195
+ display: flex;
1196
+ align-items: center;
1197
+ justify-content: space-between;
1198
+ color: #35618e;
1199
+ font-weight: 700;
1200
+ font-size: 20px;
1201
+ letter-spacing: -0.05em;
1202
+ }
1203
+ .kpi-header div {
1204
+ display: flex;
1205
+ align-items: center;
1206
+ gap: 5px;
1207
+ }
1208
+ .kpi-desc {
1209
+ color: #35618e;
1210
+ font-size: 13px;
1211
+ letter-spacing: -0.05em;
1212
+ }
1213
+ .kpi-summary {
1214
+ display: flex;
1215
+ align-items: center;
1216
+ padding: 0 30px;
1217
+ max-height: 360px;
1218
+ gap: 20px;
1219
+ }
1220
+ .mini-boxplot {
1221
+ flex: 1;
1222
+ display: flex;
1223
+ flex-direction: column;
1224
+ height: 100%;
1225
+ position: relative;
1226
+ min-width: 120px;
1227
+ }
1228
+ .boxplot-area {
1229
+ flex: 1;
1230
+ width: 100%;
1231
+ display: flex;
1232
+ flex-direction: column;
1233
+ align-items: center;
1234
+ background: #ffffff;
1235
+ }
1236
+
1237
+ .boxplot-point {
1238
+ display: flex;
1239
+ flex-direction: column;
1240
+ align-items: center;
1241
+ color: #35618e;
1242
+ }
1243
+ .boxplot-point .value {
1244
+ font-size: 42px;
1245
+ font-weight: 800;
1246
+ color: #35618e;
1247
+ border-radius: 6px;
1248
+ }
1249
+ .boxplot-point .label {
1250
+ font-size: 14px;
1251
+ font-weight: 300;
1252
+ width: auto;
1253
+ }
1254
+
1255
+ /* spider chart placeholder */
1256
+ .spider-area {
1257
+ flex: 5;
1258
+ display: flex;
1259
+ flex-direction: column;
1260
+ align-items: center;
1261
+ justify-content: center;
1262
+ gap: 10px;
1263
+ height: 100%;
1264
+ }
1265
+
1266
+ /* group distribution */
1267
+ .group-box .desc {
1268
+ color: #35618e;
1269
+ font-size: 13px;
1270
+ letter-spacing: -0.05em;
1271
+ margin-top: 4px;
1272
+ }
1273
+ .group-chart {
1274
+ height: 300px;
1275
+ margin-top: 25px;
1276
+ }
1277
+
1278
+ kpi-single-boxplot-chart {
1279
+ flex: 1;
1280
+ }
1281
+
1282
+ /* KPI 메트릭 데이터 카드 */
1283
+ .metrics-card {
1284
+ background: #ffffff;
1285
+ border-radius: 10px;
1286
+ padding: 20px;
1287
+ box-shadow: 3px 3px 3px 0 rgba(0, 0, 0, 0.1);
1288
+ max-width: 100%;
1289
+ overflow: hidden;
1290
+ }
1291
+ .metrics-header {
1292
+ display: flex;
1293
+ align-items: center;
1294
+ justify-content: space-between;
1295
+ }
1296
+ .metrics-header .title {
1297
+ display: flex;
1298
+ align-items: center;
1299
+ gap: 8px;
1300
+ color: #35618e;
1301
+ font-weight: 700;
1302
+ font-size: 18px;
1303
+ }
1304
+ .metrics-card .desc {
1305
+ color: #35618e;
1306
+ font-size: 13px;
1307
+ letter-spacing: -0.05em;
1308
+ margin-top: 4px;
1309
+ margin-bottom: 15px;
1310
+ }
1311
+ .metrics-content {
1312
+ display: flex;
1313
+ flex-direction: column;
1314
+ gap: 12px;
1315
+ }
1316
+ .metric-group {
1317
+ border-bottom: 1px dotted #ddd;
1318
+ padding-bottom: 12px;
1319
+ }
1320
+ .metric-group:last-child {
1321
+ border-bottom: none;
1322
+ padding-bottom: 0;
1323
+ }
1324
+ .metric-group-header {
1325
+ display: flex;
1326
+ align-items: center;
1327
+ gap: 8px;
1328
+ margin-bottom: 8px;
1329
+ color: #35618e;
1330
+ font-weight: 600;
1331
+ font-size: 16px;
1332
+ }
1333
+ .metric-group-icon {
1334
+ width: 20px;
1335
+ height: 20px;
1336
+ background: #35618e;
1337
+ border-radius: 3px;
1338
+ position: relative;
1339
+ }
1340
+ .metric-group-icon::before {
1341
+ content: '✓';
1342
+ position: absolute;
1343
+ top: 50%;
1344
+ left: 50%;
1345
+ transform: translate(-50%, -50%);
1346
+ color: white;
1347
+ font-size: 12px;
1348
+ font-weight: bold;
1349
+ }
1350
+ .metric-items {
1351
+ display: grid;
1352
+ grid-template-columns: 1fr 1fr 1fr;
1353
+ gap: 8px 16px;
1354
+ padding-left: 28px;
1355
+ }
1356
+ .metric-item {
1357
+ display: flex;
1358
+ justify-content: space-between;
1359
+ align-items: center;
1360
+ font-size: 14px;
1361
+ }
1362
+ .metric-label {
1363
+ color: #333;
1364
+ flex: 1;
1365
+ }
1366
+ .metric-value {
1367
+ color: #35618e;
1368
+ font-weight: 600;
1369
+ min-width: 40px;
1370
+ text-align: right;
1371
+ }
1372
+
1373
+ /* Popup overlay */
1374
+ .popup-overlay {
1375
+ position: fixed;
1376
+ top: 0;
1377
+ left: 0;
1378
+ right: 0;
1379
+ bottom: 0;
1380
+ background: rgba(0, 0, 0, 0.5);
1381
+ display: flex;
1382
+ align-items: center;
1383
+ justify-content: center;
1384
+ z-index: 1000;
1385
+ }
1386
+ .popup-content {
1387
+ background: white;
1388
+ border-radius: 12px;
1389
+ padding: 24px;
1390
+ max-width: 800px;
1391
+ width: 90%;
1392
+ max-height: 80vh;
1393
+ overflow-y: auto;
1394
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
1395
+ }
1396
+ .popup-header {
1397
+ display: flex;
1398
+ justify-content: space-between;
1399
+ align-items: center;
1400
+ margin-bottom: 20px;
1401
+ padding-bottom: 16px;
1402
+ border-bottom: 2px solid #e0e0e0;
1403
+ }
1404
+ .popup-title {
1405
+ font-size: 20px;
1406
+ font-weight: 700;
1407
+ color: #35618e;
1408
+ }
1409
+ .popup-score {
1410
+ display: flex;
1411
+ align-items: baseline;
1412
+ gap: 6px;
1413
+ margin-left: auto;
1414
+ margin-right: 16px;
1415
+ }
1416
+ .popup-score .score-value {
1417
+ font-size: 44px;
1418
+ font-weight: 800;
1419
+ color: #e53935;
1420
+ line-height: 1;
1421
+ }
1422
+ .popup-score .score-label {
1423
+ font-size: 14px;
1424
+ color: #888;
1425
+ }
1426
+ .popup-close {
1427
+ cursor: pointer;
1428
+ font-size: 24px;
1429
+ color: #999;
1430
+ background: none;
1431
+ border: none;
1432
+ padding: 4px 8px;
1433
+ }
1434
+ .popup-close:hover {
1435
+ color: #333;
1436
+ }
1437
+ .popup-chart-container {
1438
+ min-height: 400px;
1439
+ height: 500px;
1440
+ }
1441
+ .metric-label {
1442
+ cursor: pointer;
1443
+ }
1444
+ .metric-label:hover {
1445
+ opacity: 0.7;
1446
+ text-decoration: underline;
1447
+ }
1448
+ `
1449
+ ];
1450
+ __decorate([
1451
+ state(),
1452
+ __metadata("design:type", Object)
1453
+ ], SvProjectDetailPage.prototype, "project", void 0);
1454
+ __decorate([
1455
+ state(),
1456
+ __metadata("design:type", Array)
1457
+ ], SvProjectDetailPage.prototype, "kpiComprehensiveStats", void 0);
1458
+ __decorate([
1459
+ state(),
1460
+ __metadata("design:type", Array)
1461
+ ], SvProjectDetailPage.prototype, "kpiYComprehensiveStats", void 0);
1462
+ __decorate([
1463
+ state(),
1464
+ __metadata("design:type", Array)
1465
+ ], SvProjectDetailPage.prototype, "projectXKpiValues", void 0);
1466
+ __decorate([
1467
+ state(),
1468
+ __metadata("design:type", Boolean)
1469
+ ], SvProjectDetailPage.prototype, "showScoreDistribution", void 0);
1470
+ __decorate([
1471
+ state(),
1472
+ __metadata("design:type", Object)
1473
+ ], SvProjectDetailPage.prototype, "selectedKpi", void 0);
1474
+ __decorate([
1475
+ state(),
1476
+ __metadata("design:type", Array)
1477
+ ], SvProjectDetailPage.prototype, "pendingMetrics", void 0);
1478
+ __decorate([
1479
+ state(),
1480
+ __metadata("design:type", Array)
1481
+ ], SvProjectDetailPage.prototype, "allKpiMetricValues", void 0);
1482
+ SvProjectDetailPage = __decorate([
1483
+ customElement('sv-project-detail')
1484
+ ], SvProjectDetailPage);
1485
+ export { SvProjectDetailPage };
1486
+ //# sourceMappingURL=sv-project-detail.js.map