@dssp/dkpi 1.0.0-alpha.8 → 1.0.0-alpha.81

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 (252) hide show
  1. package/KPI-STATISTICS-SERVICE.md +233 -0
  2. package/_index.html +0 -5
  3. package/assets/favicon.ico +0 -0
  4. package/assets/images/project-image.png +0 -0
  5. package/assets/manifest/apple-1024.png +0 -0
  6. package/assets/manifest/apple-120.png +0 -0
  7. package/assets/manifest/apple-152.png +0 -0
  8. package/assets/manifest/apple-167.png +0 -0
  9. package/assets/manifest/apple-180.png +0 -0
  10. package/assets/manifest/apple-touch-icon.png +0 -0
  11. package/assets/manifest/badge-128x128.png +0 -0
  12. package/assets/manifest/chrome-splashscreen-icon-384x384.png +0 -0
  13. package/assets/manifest/chrome-touch-icon-192x192.png +0 -0
  14. package/assets/manifest/icon-128x128.png +0 -0
  15. package/assets/manifest/icon-192x192.png +0 -0
  16. package/assets/manifest/icon-512x512.png +0 -0
  17. package/assets/manifest/icon-72x72.png +0 -0
  18. package/assets/manifest/icon-96x96.png +0 -0
  19. package/assets/manifest/image-metaog.png +0 -0
  20. package/assets/manifest/maskable_icon.png +0 -0
  21. package/assets/manifest/ms-icon-144x144.png +0 -0
  22. package/assets/manifest/ms-touch-icon-144x144-precomposed.png +0 -0
  23. package/assets/videos/intro.mp4 +0 -0
  24. package/config/config.development.js +2 -1
  25. package/config/config.production.js +2 -1
  26. package/dist-client/bootstrap.d.ts +1 -0
  27. package/dist-client/bootstrap.js +75 -4
  28. package/dist-client/bootstrap.js.map +1 -1
  29. package/dist-client/components/kpi-2d-lookup-chart.d.ts +43 -0
  30. package/dist-client/components/kpi-2d-lookup-chart.js +253 -0
  31. package/dist-client/components/kpi-2d-lookup-chart.js.map +1 -0
  32. package/dist-client/components/kpi-boxplot-chart.d.ts +24 -0
  33. package/dist-client/components/kpi-boxplot-chart.js +291 -0
  34. package/dist-client/components/kpi-boxplot-chart.js.map +1 -0
  35. package/dist-client/components/kpi-lookup-chart.d.ts +53 -0
  36. package/dist-client/components/kpi-lookup-chart.js +430 -0
  37. package/dist-client/components/kpi-lookup-chart.js.map +1 -0
  38. package/dist-client/components/kpi-mini-trend-chart.d.ts +14 -0
  39. package/dist-client/components/kpi-mini-trend-chart.js +148 -0
  40. package/dist-client/components/kpi-mini-trend-chart.js.map +1 -0
  41. package/dist-client/components/kpi-radar-chart.d.ts +17 -0
  42. package/dist-client/components/kpi-radar-chart.js +259 -0
  43. package/dist-client/components/kpi-radar-chart.js.map +1 -0
  44. package/dist-client/components/kpi-single-boxplot-chart.d.ts +25 -0
  45. package/dist-client/components/kpi-single-boxplot-chart.js +398 -0
  46. package/dist-client/components/kpi-single-boxplot-chart.js.map +1 -0
  47. package/dist-client/components/kpi-trend-chart.d.ts +25 -0
  48. package/dist-client/components/kpi-trend-chart.js +220 -0
  49. package/dist-client/components/kpi-trend-chart.js.map +1 -0
  50. package/dist-client/components/sv-pagenation-control.d.ts +18 -0
  51. package/dist-client/components/sv-pagenation-control.js +142 -0
  52. package/dist-client/components/sv-pagenation-control.js.map +1 -0
  53. package/dist-client/entries/auth/checkin.d.ts +38 -0
  54. package/dist-client/entries/auth/checkin.js +546 -0
  55. package/dist-client/entries/auth/checkin.js.map +1 -0
  56. package/dist-client/google-map/common-google-map.d.ts +35 -0
  57. package/dist-client/google-map/common-google-map.js +345 -0
  58. package/dist-client/google-map/common-google-map.js.map +1 -0
  59. package/dist-client/google-map/google-map-loader.d.ts +6 -0
  60. package/dist-client/google-map/google-map-loader.js +23 -0
  61. package/dist-client/google-map/google-map-loader.js.map +1 -0
  62. package/dist-client/icons/menu-icons.d.ts +6 -0
  63. package/dist-client/icons/menu-icons.js +42 -0
  64. package/dist-client/icons/menu-icons.js.map +1 -1
  65. package/dist-client/pages/component/project-update-header.d.ts +1 -0
  66. package/dist-client/pages/component/project-update-header.js +127 -0
  67. package/dist-client/pages/component/project-update-header.js.map +1 -0
  68. package/dist-client/pages/kpi-admin/dssp-kpi-list-page.d.ts +22 -0
  69. package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js +57 -0
  70. package/dist-client/pages/kpi-admin/dssp-kpi-list-page.js.map +1 -0
  71. package/dist-client/pages/kpi-admin/dssp-kpi-overview.d.ts +46 -0
  72. package/dist-client/pages/kpi-admin/dssp-kpi-overview.js +378 -0
  73. package/dist-client/pages/kpi-admin/dssp-kpi-overview.js.map +1 -0
  74. package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.d.ts +20 -0
  75. package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js +445 -0
  76. package/dist-client/pages/kpi-admin/kpi-grade-2d-editor.js.map +1 -0
  77. package/dist-client/pages/kpi-admin/kpi-system-guide.d.ts +18 -0
  78. package/dist-client/pages/kpi-admin/kpi-system-guide.js +535 -0
  79. package/dist-client/pages/kpi-admin/kpi-system-guide.js.map +1 -0
  80. package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.d.ts +18 -0
  81. package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +259 -0
  82. package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -0
  83. package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.d.ts +22 -0
  84. package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +346 -0
  85. package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -0
  86. package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.d.ts +26 -0
  87. package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +433 -0
  88. package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -0
  89. package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.d.ts +8 -0
  90. package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js +78 -0
  91. package/dist-client/pages/kpi-dashboard/components/kpi-chart-toggle.js.map +1 -0
  92. package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +38 -0
  93. package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +851 -0
  94. package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -0
  95. package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +42 -0
  96. package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +316 -0
  97. package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -0
  98. package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.d.ts +28 -0
  99. package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +497 -0
  100. package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -0
  101. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
  102. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +131 -0
  103. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
  104. package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.d.ts +52 -0
  105. package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +798 -0
  106. package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -0
  107. package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +63 -0
  108. package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +1089 -0
  109. package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
  110. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
  111. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
  112. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
  113. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
  114. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
  115. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
  116. package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
  117. package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
  118. package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
  119. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
  120. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +147 -0
  121. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
  122. package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
  123. package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
  124. package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
  125. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +57 -0
  126. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +719 -0
  127. package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -0
  128. package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.d.ts +23 -0
  129. package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js +76 -0
  130. package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js.map +1 -0
  131. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +68 -0
  132. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +394 -0
  133. package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -0
  134. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.d.ts +12 -0
  135. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +174 -0
  136. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -0
  137. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +40 -0
  138. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +190 -0
  139. package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -0
  140. package/dist-client/pages/kpi-value/kpi-value-importer.d.ts +23 -0
  141. package/dist-client/pages/kpi-value/kpi-value-importer.js +93 -0
  142. package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -0
  143. package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +71 -0
  144. package/dist-client/pages/kpi-value/kpi-value-list-page.js +454 -0
  145. package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -0
  146. package/dist-client/pages/project-complete-tabs/pc-tab1-plan.d.ts +61 -0
  147. package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js +766 -0
  148. package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js.map +1 -0
  149. package/dist-client/pages/project-complete-tabs/pc-tab2-rating.d.ts +16 -0
  150. package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js +341 -0
  151. package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js.map +1 -0
  152. package/dist-client/pages/project-complete-tabs/pc-tab3-upload.d.ts +21 -0
  153. package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js +335 -0
  154. package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js.map +1 -0
  155. package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.d.ts +42 -0
  156. package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js +641 -0
  157. package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js.map +1 -0
  158. package/dist-client/pages/sv-project-complete.d.ts +25 -0
  159. package/dist-client/pages/sv-project-complete.js +263 -0
  160. package/dist-client/pages/sv-project-complete.js.map +1 -0
  161. package/dist-client/pages/sv-project-completed-list.d.ts +27 -0
  162. package/dist-client/pages/sv-project-completed-list.js +416 -0
  163. package/dist-client/pages/sv-project-completed-list.js.map +1 -0
  164. package/dist-client/pages/sv-project-detail.d.ts +58 -0
  165. package/dist-client/pages/sv-project-detail.js +1418 -0
  166. package/dist-client/pages/sv-project-detail.js.map +1 -0
  167. package/dist-client/pages/sv-project-list.d.ts +174 -0
  168. package/dist-client/pages/sv-project-list.js +578 -0
  169. package/dist-client/pages/sv-project-list.js.map +1 -0
  170. package/dist-client/pages/sv-project-update.d.ts +86 -0
  171. package/dist-client/pages/sv-project-update.js +1331 -0
  172. package/dist-client/pages/sv-project-update.js.map +1 -0
  173. package/dist-client/pages/sv-user-management.d.ts +1 -0
  174. package/dist-client/pages/sv-user-management.js +5 -0
  175. package/dist-client/pages/sv-user-management.js.map +1 -1
  176. package/dist-client/route.d.ts +1 -1
  177. package/dist-client/route.js +50 -2
  178. package/dist-client/route.js.map +1 -1
  179. package/dist-client/shared/complete-api.d.ts +37 -0
  180. package/dist-client/shared/complete-api.js +224 -0
  181. package/dist-client/shared/complete-api.js.map +1 -0
  182. package/dist-client/shared/func.d.ts +2 -0
  183. package/dist-client/shared/func.js +22 -0
  184. package/dist-client/shared/func.js.map +1 -0
  185. package/dist-client/shared/integration-fetch.d.ts +35 -0
  186. package/dist-client/shared/integration-fetch.js +53 -0
  187. package/dist-client/shared/integration-fetch.js.map +1 -0
  188. package/dist-client/themes/dark.css +24 -24
  189. package/dist-client/themes/light.css +23 -23
  190. package/dist-client/tsconfig.tsbuildinfo +1 -1
  191. package/dist-client/viewparts/menu-tools.d.ts +40 -5
  192. package/dist-client/viewparts/menu-tools.js +292 -43
  193. package/dist-client/viewparts/menu-tools.js.map +1 -1
  194. package/dist-server/index.d.ts +2 -0
  195. package/dist-server/index.js +5 -0
  196. package/dist-server/index.js.map +1 -1
  197. package/dist-server/migrations/index.d.ts +1 -0
  198. package/dist-server/migrations/index.js +12 -0
  199. package/dist-server/migrations/index.js.map +1 -0
  200. package/dist-server/scripts/calculate-kpi-scores.d.ts +10 -0
  201. package/dist-server/scripts/calculate-kpi-scores.js +333 -0
  202. package/dist-server/scripts/calculate-kpi-scores.js.map +1 -0
  203. package/dist-server/scripts/load-grade-data-migration.d.ts +14 -0
  204. package/dist-server/scripts/load-grade-data-migration.js +279 -0
  205. package/dist-server/scripts/load-grade-data-migration.js.map +1 -0
  206. package/dist-server/scripts/propagate-parent-kpi-values.d.ts +14 -0
  207. package/dist-server/scripts/propagate-parent-kpi-values.js +786 -0
  208. package/dist-server/scripts/propagate-parent-kpi-values.js.map +1 -0
  209. package/dist-server/scripts/recalculate-by-project-name.d.ts +2 -0
  210. package/dist-server/scripts/recalculate-by-project-name.js +72 -0
  211. package/dist-server/scripts/recalculate-by-project-name.js.map +1 -0
  212. package/dist-server/service/index.d.ts +4 -0
  213. package/dist-server/service/index.js +20 -0
  214. package/dist-server/service/index.js.map +1 -0
  215. package/dist-server/service/kpi-metric-value/index.d.ts +4 -0
  216. package/dist-server/service/kpi-metric-value/index.js +8 -0
  217. package/dist-server/service/kpi-metric-value/index.js.map +1 -0
  218. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +166 -0
  219. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +951 -0
  220. package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -0
  221. package/dist-server/service/kpi-metric-value/kpi-metric-value-query.d.ts +7 -0
  222. package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +59 -0
  223. package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +1 -0
  224. package/dist-server/service/kpi-stat/index.d.ts +4 -0
  225. package/dist-server/service/kpi-stat/index.js +8 -0
  226. package/dist-server/service/kpi-stat/index.js.map +1 -0
  227. package/dist-server/service/kpi-stat/kpi-stat-query.d.ts +12 -0
  228. package/dist-server/service/kpi-stat/kpi-stat-query.js +663 -0
  229. package/dist-server/service/kpi-stat/kpi-stat-query.js.map +1 -0
  230. package/dist-server/service/kpi-stat/kpi-stat-types.d.ts +32 -0
  231. package/dist-server/service/kpi-stat/kpi-stat-types.js +180 -0
  232. package/dist-server/service/kpi-stat/kpi-stat-types.js.map +1 -0
  233. package/dist-server/service/kpi-value/index.d.ts +3 -0
  234. package/dist-server/service/kpi-value/index.js +7 -0
  235. package/dist-server/service/kpi-value/index.js.map +1 -0
  236. package/dist-server/service/kpi-value/kpi-value-query.d.ts +8 -0
  237. package/dist-server/service/kpi-value/kpi-value-query.js +63 -0
  238. package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -0
  239. package/dist-server/tsconfig.tsbuildinfo +1 -1
  240. package/kpi-module-service-tests.md +1286 -0
  241. package/kpi-module-test-report.md +676 -0
  242. package/kpi-module-unit-test-detailed-report.md +925 -0
  243. package/kpi-module-unit-tests-detailed.md +1452 -0
  244. package/package.json +69 -55
  245. package/recalculate-batch.sh +64 -0
  246. package/recalculate-projects-range.sh +98 -0
  247. package/schema.graphql +3423 -462
  248. package/things-factory.config.js +12 -1
  249. package/translations/en.json +5 -1
  250. package/translations/ko.json +5 -1
  251. package/views/auth-page.html +0 -1
  252. package/views/public/home.html +0 -1
@@ -0,0 +1,766 @@
1
+ var SvProjectCompleteTab1Plan_1;
2
+ import { __decorate, __metadata } from "tslib";
3
+ import { css, html, LitElement } from 'lit';
4
+ import { customElement, property, state } from 'lit/decorators.js';
5
+ import { calcDiff, calcDateDiff } from '../../shared/func';
6
+ import { getKpiMetricValues, getKpiMetrics, updateProjectCompleteStep1, collectProjectExternalData } from '../../shared/complete-api';
7
+ import { INTEGRATION_SOURCES } from '../../shared/integration-fetch';
8
+ import moment from 'moment-timezone';
9
+ import { notify } from '@operato/layout';
10
+ import { hasPrivilege } from '@things-factory/auth-base/dist-client';
11
+ const KPI_METRIC_KEY_MAPPING = [
12
+ { label: '공사기간', projectKey: 'constructionPeriod' },
13
+ { label: '총 근로자수', projectKey: 'totalWorkerCount' },
14
+ { label: '연간 근로자 수', projectKey: 'annualWorkerCount' },
15
+ { label: '투입인력', projectKey: 'workerCount' },
16
+ { label: '재해 건수', projectKey: 'accidentCount' },
17
+ { label: '일정 이탈 수준', projectKey: 'scheduleDeviationLevel' },
18
+ { label: '총 건설 폐기물 발생량', projectKey: 'totalConstructionWasteAmount' },
19
+ { label: '용적율', projectKey: 'floorAreaRatio' },
20
+ { label: '총 설계 변경 건', projectKey: 'designChangeCount' },
21
+ { label: '공사비', projectKey: 'constructionCost' },
22
+ { label: '연면적', projectKey: 'area' },
23
+ { label: '지상층수', projectKey: 'upperFloorCount' },
24
+ { label: '지하층수', projectKey: 'lowerFloorCount' }
25
+ ];
26
+ // 계획값이 없는 것들 (실제값으로 표시할 필드)
27
+ const NO_PLAN_FIELDS = ['workerCount', 'area', 'floorAreaRatio', 'designChangeCount', 'upperFloorCount', 'lowerFloorCount'];
28
+ let SvProjectCompleteTab1Plan = SvProjectCompleteTab1Plan_1 = class SvProjectCompleteTab1Plan extends LitElement {
29
+ constructor() {
30
+ super(...arguments);
31
+ this.kpiMetricValues = [];
32
+ this.kpiMetrics = [];
33
+ this.project = {};
34
+ /** 연동 진행 상태: source → 'idle' | 'collecting' | 'done' */
35
+ this.collectStatus = {};
36
+ this.collectError = {};
37
+ /** 자동 수집한 실제값의 출처: metricId → 시스템 라벨 */
38
+ this.valueSources = {};
39
+ /** 자동 수집한 계획값: projectKey → 값 (키스콘이 제공하는 계획공사기간/계획공사비) */
40
+ this.collectedPlan = {};
41
+ /** 계획값 출처: projectKey → 시스템 라벨 */
42
+ this.planSources = {};
43
+ /** 시스템별 수집 요약 (카드 표시용): 라벨 → [{label, text}] */
44
+ this.collectedSummary = {};
45
+ /** 방금 채워진 셀 강조용 (metricId 또는 plan:projectKey) */
46
+ this.justFilled = {};
47
+ this.collecting = false;
48
+ /** kpi:input — Step1 계획값 입력/저장 권한 */
49
+ this.canSave = false;
50
+ /** kpi:auto-collect — 외부 시스템 자동 수집 권한 */
51
+ this.canAutoCollect = false;
52
+ }
53
+ render() {
54
+ // 전월 (last month) YYYY-MM. 월별 metric 의 "전월 데이터 입력" 검사 기준.
55
+ const lastMonth = moment().tz('Asia/Seoul').subtract(1, 'month').format('YYYY-MM');
56
+ return html `
57
+ <div class="title">
58
+ <div>
59
+ 당초 계획 대비 실제 진행 과정에서 변동된 공사비, 공기(공사기간), 면적, 기타 주요 항목을 현실에 맞게 수정·입력합니다.
60
+ <br />이 정보는 성과 분석, KPI 평가, 통계 산출 등에 기준값으로 사용되므로, 가능한 한 실제 값 기준으로 정확히
61
+ 입력해주시기 바랍니다.
62
+ </div>
63
+ </div>
64
+
65
+ ${this._renderCollectPanel()}
66
+
67
+ <div class="rows">
68
+ <div class="row header">
69
+ <div class="header-label">기본정보</div>
70
+ <div class="header-label">계획</div>
71
+ <div class="header-label">실제</div>
72
+ <div class="header-label">편차</div>
73
+ </div>
74
+
75
+ ${this.kpiMetrics.map(metric => {
76
+ var _a, _b, _c, _d, _e;
77
+ // 상수로 정의된 매핑 정보에서 metric.name으로 projectKey를 찾음
78
+ const projectKey = ((_a = KPI_METRIC_KEY_MAPPING.find(item => item.label === metric.name)) === null || _a === void 0 ? void 0 : _a.projectKey) || '';
79
+ const isMonthly = metric.periodType === 'MONTH';
80
+ // 현재값 lookup:
81
+ // MONTH → 전월 row (단일 진실원)
82
+ // ALLTIME → 단일 ALLTIME row
83
+ // 그 외 → metricId+periodType 매칭
84
+ const kpiMetricValue = isMonthly
85
+ ? this.kpiMetricValues.find((item) => item.metricId === metric.id &&
86
+ item.periodType === 'MONTH' &&
87
+ (item.valueDate || '').startsWith(lastMonth)) || {}
88
+ : this.kpiMetricValues.find((item) => item.metricId === metric.id && item.periodType === metric.periodType) || {};
89
+ const isDisplayInput = projectKey === 'constructionPeriod' || projectKey === 'constructionCost'; // 유효한 계획 필드
90
+ // planValue는 project에서 찾고 없으면 buildingComplex의 값에서 찾음
91
+ const basePlanValue = this.project[projectKey] || ((_c = (_b = this.project) === null || _b === void 0 ? void 0 : _b.buildingComplex) === null || _c === void 0 ? void 0 : _c[projectKey]) || 0;
92
+ let planValue = basePlanValue;
93
+ const unit = kpiMetricValue.unit || metric.unit || '';
94
+ // 2. 계획 값 처리
95
+ // 공사기간은 기간을 일 단위로 계산
96
+ if (projectKey === 'constructionPeriod') {
97
+ planValue = Math.ceil(calcDateDiff(this.project.startDate, this.project.endDate) / 30);
98
+ }
99
+ else if (!isDisplayInput) {
100
+ planValue = 0;
101
+ }
102
+ // 1. 실제 값 처리 kpi값을 찾고, 없으면 (NO_PLAN_FIELDS에 해당하는 필드는 원래 계획값 사용)
103
+ const actualValue = (_d = kpiMetricValue.value) !== null && _d !== void 0 ? _d : (NO_PLAN_FIELDS.includes(projectKey) ? basePlanValue : 0);
104
+ const diffValue = calcDiff(planValue, actualValue);
105
+ const diffClass = diffValue === 0 ? '' : diffValue > 0 ? 'plus' : 'minus';
106
+ const diffSign = diffValue === 0 ? '' : diffValue > 0 ? '+' : '-';
107
+ const src = this.valueSources[metric.id];
108
+ // 계획값: 키스콘 수집값이 있으면 그것을, 없으면 계산된 planValue
109
+ const planSrc = this.planSources[projectKey];
110
+ const shownPlan = (_e = this.collectedPlan[projectKey]) !== null && _e !== void 0 ? _e : planValue;
111
+ const planFilled = this.justFilled[`plan:${projectKey}`];
112
+ // 계획값이 키스콘에서 들어왔으면 편차도 그 기준으로 재계산
113
+ const effDiff = calcDiff(shownPlan, actualValue);
114
+ const effDiffClass = effDiff === 0 ? '' : effDiff > 0 ? 'plus' : 'minus';
115
+ const effDiffSign = effDiff === 0 ? '' : effDiff > 0 ? '+' : '-';
116
+ // periodType 무관하게 값 없으면 pending. 메시지는 MONTH 만 "전월 데이터 입력 필요".
117
+ const isPending = kpiMetricValue.value === undefined || kpiMetricValue.value === null;
118
+ return html `<div class="row">
119
+ <div class="label ${isPending ? 'pending' : ''}"
120
+ title=${isPending
121
+ ? isMonthly
122
+ ? '전월 데이터 입력 필요'
123
+ : '아직 입력되지 않은 항목'
124
+ : ''}>• ${metric.name}</div>
125
+ <div class="cell ${planFilled ? 'just-filled' : ''}">
126
+ ${isDisplayInput
127
+ ? html `<input .value=${shownPlan} disabled /> ${unit}
128
+ ${planSrc ? html `<span class="src-chip">🔗 ${planSrc}</span>` : ''}`
129
+ : html `-`}
130
+ </div>
131
+ <div class="cell ${this.justFilled[metric.id] ? 'just-filled' : ''} ${isPending ? 'pending' : ''}">
132
+ <input numeric .value=${actualValue !== null && actualValue !== void 0 ? actualValue : 0} @input=${(e) => this._onInputChange(e, metric)} />
133
+ ${unit}
134
+ ${src ? html `<span class="src-chip">🔗 ${src}</span>` : ''}
135
+ </div>
136
+ <div class="unit ${isDisplayInput ? effDiffClass : diffClass}">
137
+ ${isDisplayInput ? effDiffSign : diffSign}
138
+ ${Math.abs(isDisplayInput ? effDiff : diffValue).toLocaleString()} ${unit}
139
+ </div>
140
+ </div>`;
141
+ })}
142
+
143
+ <div class="button-line">
144
+ <div class="ghost-btn" @click=${this._reset}>초기화</div>
145
+ <div
146
+ class="ghost-btn secondary ${this.canSave ? '' : 'disabled'}"
147
+ title=${this.canSave ? '' : 'kpi:input 권한 필요'}
148
+ @click=${() => this.canSave && this._save()}
149
+ >
150
+ 저장
151
+ </div>
152
+ </div>
153
+ </div>
154
+ `;
155
+ }
156
+ _renderCollectPanel() {
157
+ return html `
158
+ <div class="collect-panel">
159
+ <div class="collect-head">
160
+ <div class="ttl">시스템 연동 자동 수집 <small>외부 시스템에서 기본정보를 가져옵니다</small></div>
161
+ <div
162
+ class="collect-btn ${this.canAutoCollect ? '' : 'disabled'}"
163
+ ?disabled=${this.collecting}
164
+ title=${this.canAutoCollect ? '' : 'kpi:auto-collect 권한 필요'}
165
+ @click=${() => this.canAutoCollect && !this.collecting ? this._autoCollect() : null}
166
+ >
167
+ ${this.collecting ? '수집 중…' : '⟳ 자동 수집'}
168
+ </div>
169
+ </div>
170
+ <div class="source-list">
171
+ ${INTEGRATION_SOURCES.map(meta => {
172
+ const status = this.collectStatus[meta.source] || 'idle';
173
+ const errMsg = this.collectError[meta.source];
174
+ // 카드 안의 수집 필드 summary — 실제/계획 무관 collectedSummary 기준으로 통일.
175
+ // (valueSources 만 보면 키스콘처럼 계획값만 채우는 시스템은 표시 안 됨)
176
+ const collectedFields = this._collectedFieldsOf(meta.label);
177
+ const statusText = status === 'collecting'
178
+ ? '연동 중…'
179
+ : status === 'done'
180
+ ? '완료 ✓'
181
+ : status === 'error'
182
+ ? '정보 없음 ⓘ'
183
+ : '대기';
184
+ return html `
185
+ <div class="source-card ${status}">
186
+ <div class="sc-head">
187
+ <span class="sys-icon">${meta.icon}</span>
188
+ <span>${meta.label}</span>
189
+ <span class="sc-status ${status}">${statusText}</span>
190
+ </div>
191
+ <div class="sc-desc">${meta.desc}</div>
192
+ ${status === 'error' && errMsg ? html `<div class="sc-error-msg">${errMsg}</div>` : ''}
193
+ ${status === 'done' && collectedFields.length
194
+ ? html `<div class="sc-fields">
195
+ ${collectedFields.map(f => html `<div class="sc-field"><span>${f.label}</span><b>${f.text}</b></div>`)}
196
+ </div>`
197
+ : ''}
198
+ </div>
199
+ `;
200
+ })}
201
+ </div>
202
+ </div>
203
+ `;
204
+ }
205
+ /** 패널 카드에 표시할, 해당 시스템에서 수집한 값 요약 */
206
+ _collectedFieldsOf(sourceLabel) {
207
+ return this.collectedSummary[sourceLabel] || [];
208
+ }
209
+ /** 자동 수집 — 백엔드의 collectProjectExternalData mutation 1번 호출.
210
+ * 서버가 시나리오 3종 (세움터/올바로/키스콘) 을 순차 실행하고 시스템별 ok/메시지를 반환.
211
+ * 성공/실패와 무관하게 시나리오 step 이 KPI Value 를 DB 에 적재하므로 호출 후
212
+ * KPI Metric Values 를 재조회해 form 을 자동 갱신.
213
+ *
214
+ * 운영 현실: 키스콘·올바로는 시공사 자격증명 미확보가 많아 오류 빈도 높음.
215
+ * 세움터는 공공데이터 서비스키만으로 동작 가능. 시스템별로 카드에 독립 표시.
216
+ */
217
+ async _autoCollect() {
218
+ var _a;
219
+ if (!((_a = this.project) === null || _a === void 0 ? void 0 : _a.id)) {
220
+ notify({ message: '프로젝트 정보가 없습니다.' });
221
+ return;
222
+ }
223
+ this.collecting = true;
224
+ this.collectStatus = {};
225
+ this.collectError = {};
226
+ this.collectedSummary = {};
227
+ this.collectedPlan = {};
228
+ this.planSources = {};
229
+ this.valueSources = {};
230
+ // 모든 카드를 collecting 상태로 표시
231
+ const collecting = {};
232
+ for (const meta of INTEGRATION_SOURCES)
233
+ collecting[meta.source] = 'collecting';
234
+ this.collectStatus = collecting;
235
+ try {
236
+ const results = await collectProjectExternalData(this.project.id);
237
+ // 시스템별 status / error 메시지 업데이트 + result data 를 form 에 매핑
238
+ const status = {};
239
+ const errors = {};
240
+ for (const r of results) {
241
+ status[r.source] = r.ok ? 'done' : 'error';
242
+ if (!r.ok) {
243
+ errors[r.source] = r.message;
244
+ continue;
245
+ }
246
+ // 시나리오 result 객체 = { projectKey: value, ... }.
247
+ // KPI_METRIC_KEY_MAPPING 매칭 키 → form 채움. 미매칭 키 (siteType,
248
+ // structureType 등 프로젝트/BuildingComplex 기본 속성) → 카드 요약만.
249
+ const summary = [];
250
+ // KPI_METRIC_KEY_MAPPING 에 없는 키들의 한글 라벨. BuildingComplex/Project 직접 속성용.
251
+ const NON_KPI_LABEL = {
252
+ siteType: '건축현장유형',
253
+ structureType: '구조형태',
254
+ coverageRatio: '건폐율',
255
+ householdCount: '세대수',
256
+ buildingCount: '동수',
257
+ startDate: '착공일',
258
+ endDate: '준공일',
259
+ permitDate: '건축허가일',
260
+ bldNm: '건물명'
261
+ };
262
+ for (const [projectKey, rawValue] of Object.entries(r.data || {})) {
263
+ if (rawValue === null || rawValue === undefined || rawValue === '')
264
+ continue;
265
+ // 비-primitive (객체/배열) 값은 시나리오 측 return 형태 오류 — form 매핑/표시
266
+ // 모두 skip 하고 console 에 진단 로그만 남김. 흔한 원인은 시나리오 마지막 step 이
267
+ // `return { result: { ... } }` 처럼 wrap 한 케이스.
268
+ if (typeof rawValue === 'object') {
269
+ console.warn(`[자동수집] '${r.label}'.${projectKey} 가 object — 시나리오 return 형태 점검`, rawValue);
270
+ continue;
271
+ }
272
+ const mapping = KPI_METRIC_KEY_MAPPING.find(x => x.projectKey === projectKey);
273
+ const label = (mapping === null || mapping === void 0 ? void 0 : mapping.label) || NON_KPI_LABEL[projectKey] || projectKey;
274
+ const isPlan = SvProjectCompleteTab1Plan_1.PLAN_KEYS.includes(projectKey);
275
+ // summary 카드 표시용 — string 값은 그대로, number 는 toLocaleString
276
+ const numericValue = typeof rawValue === 'number' ? rawValue : Number(rawValue);
277
+ const isNumeric = Number.isFinite(numericValue) && typeof rawValue !== 'string';
278
+ const valueText = isNumeric ? numericValue.toLocaleString() : String(rawValue);
279
+ summary.push({ label, text: valueText });
280
+ // KPI 매핑이 없는 키 (siteType/structureType 등) 는 form 채움 skip — 단지 노출만.
281
+ if (!mapping)
282
+ continue;
283
+ if (isPlan) {
284
+ // 계획값 (키스콘) — 계획 칼럼에 반영
285
+ this.collectedPlan = Object.assign(Object.assign({}, this.collectedPlan), { [projectKey]: numericValue });
286
+ this.planSources = Object.assign(Object.assign({}, this.planSources), { [projectKey]: r.label });
287
+ this.justFilled = Object.assign(Object.assign({}, this.justFilled), { [`plan:${projectKey}`]: true });
288
+ }
289
+ else {
290
+ // 실제값 (세움터/올바로/기타) — 매칭되는 metric 의 실제 칼럼에 반영
291
+ const metric = this.kpiMetrics.find((m) => { var _a; return ((_a = KPI_METRIC_KEY_MAPPING.find(x => x.label === m.name)) === null || _a === void 0 ? void 0 : _a.projectKey) === projectKey; });
292
+ if (!metric)
293
+ continue;
294
+ this._setMetricValue(metric, numericValue);
295
+ this.valueSources = Object.assign(Object.assign({}, this.valueSources), { [metric.id]: r.label });
296
+ this.justFilled = Object.assign(Object.assign({}, this.justFilled), { [metric.id]: true });
297
+ }
298
+ }
299
+ this.collectedSummary = Object.assign(Object.assign({}, this.collectedSummary), { [r.label]: summary });
300
+ }
301
+ this.collectStatus = status;
302
+ this.collectError = errors;
303
+ // 재조회 안 함 — 시나리오는 fetch + result 반환만 책임 (DB 적재 X). 직전에
304
+ // _setMetricValue 가 memory 에 채운 값들을 DB 의 옛 값으로 덮어쓰면 자동수집
305
+ // 결과가 폼에 반영되지 않음. 사용자가 [저장] 버튼 누르면 그제서야 DB 반영.
306
+ this.requestUpdate();
307
+ setTimeout(() => (this.justFilled = {}), 1300);
308
+ const okCount = results.filter(r => r.ok).length;
309
+ if (okCount === results.length) {
310
+ notify({ message: `외부 시스템 ${okCount}건 모두 수집 완료. 검토 후 [저장]을 눌러주세요.` });
311
+ }
312
+ else if (okCount === 0) {
313
+ notify({ message: '외부 시스템에서 가져올 정보가 없습니다.' });
314
+ }
315
+ else {
316
+ notify({ message: `외부 시스템 수집 — ${okCount}건 완료, 나머지는 정보 없음.` });
317
+ }
318
+ }
319
+ catch (e) {
320
+ // mutation 자체 실패 (네트워크/권한 등) — 모든 카드를 정보 없음 으로
321
+ const msg = e instanceof Error ? e.message : String(e);
322
+ console.warn('[자동수집] 전체 호출 실패', e);
323
+ const status = {};
324
+ const errors = {};
325
+ for (const meta of INTEGRATION_SOURCES) {
326
+ status[meta.source] = 'error';
327
+ errors[meta.source] = '업데이트할 정보가 없습니다';
328
+ }
329
+ this.collectStatus = status;
330
+ this.collectError = errors;
331
+ notify({ message: '외부 시스템 연동이 일시적으로 안 됩니다.' });
332
+ }
333
+ finally {
334
+ this.collecting = false;
335
+ }
336
+ }
337
+ /**
338
+ * 메트릭의 실제값 set/add — _onInputChange 와 동일하게 periodType 별 row upsert.
339
+ */
340
+ _setMetricValue(metric, value) {
341
+ this.kpiMetricValues = this._upsertValueForMetric(this.kpiMetricValues, metric, value);
342
+ }
343
+ async connectedCallback() {
344
+ super.connectedCallback();
345
+ const [canSave, canAutoCollect] = await Promise.all([
346
+ hasPrivilege({ category: 'kpi', privilege: 'input', domainOwnerGranted: true, superUserGranted: true }),
347
+ hasPrivilege({ category: 'kpi', privilege: 'auto-collect', domainOwnerGranted: true, superUserGranted: true })
348
+ ]);
349
+ this.canSave = canSave;
350
+ this.canAutoCollect = canAutoCollect;
351
+ }
352
+ willUpdate(changedProperties) {
353
+ var _a;
354
+ super.willUpdate(changedProperties);
355
+ // project가 변경되고, project.id가 존재하면 데이터 로드
356
+ if (changedProperties.has('project') && ((_a = this.project) === null || _a === void 0 ? void 0 : _a.id)) {
357
+ this._getInitData();
358
+ }
359
+ }
360
+ async _getInitData() {
361
+ var _a, _b;
362
+ const kpiMetrics = await getKpiMetrics((_a = this.project) === null || _a === void 0 ? void 0 : _a.code);
363
+ this.kpiMetrics = kpiMetrics.filter(item => !item.name.includes('평가')) || []; // 평가 텍스트가 들어간건 제외
364
+ this.kpiMetricValues = await getKpiMetricValues(this.project.id, (_b = this.project) === null || _b === void 0 ? void 0 : _b.code);
365
+ }
366
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
367
+ _onInputChange(event, metric) {
368
+ const target = event.target;
369
+ let inputVal = target.value;
370
+ // 숫자 타입은 다른 문자 입력 제거
371
+ if (target.hasAttribute('numeric')) {
372
+ inputVal = Number(inputVal.replace(/[^\d.]/g, ''));
373
+ }
374
+ this.kpiMetricValues = this._upsertValueForMetric(this.kpiMetricValues, metric, inputVal);
375
+ }
376
+ /**
377
+ * metric.periodType 에 따라 적절한 row 를 upsert.
378
+ * - MONTH : 전월 row (YYYY-MM-01). "오늘 입력 = 지난달 데이터" 운영 원칙.
379
+ * - ALLTIME : 단일 row (valueDate sentinel 무관).
380
+ * - 그 외 (DAY/WEEK/QUARTER/YEAR/RANGE) : metric.periodType 그대로, valueDate=today.
381
+ * 매칭은 (metricId, periodType) 기준 — MONTH 만 추가로 valueDate prefix.
382
+ */
383
+ _upsertValueForMetric(values, metric, value) {
384
+ const today = moment().tz('Asia/Seoul');
385
+ const todayYmd = today.format('YYYY-MM-DD');
386
+ const periodType = metric.periodType;
387
+ let updated = [...values];
388
+ if (periodType === 'MONTH') {
389
+ const lastMonth = today.clone().subtract(1, 'month');
390
+ const lastMonth1 = lastMonth.format('YYYY-MM-01');
391
+ const lastMonthYm = lastMonth.format('YYYY-MM');
392
+ const idx = updated.findIndex((i) => i.metricId === metric.id &&
393
+ i.periodType === 'MONTH' &&
394
+ (i.valueDate || '').startsWith(lastMonthYm));
395
+ if (idx !== -1) {
396
+ updated[idx] = Object.assign(Object.assign({}, updated[idx]), { value });
397
+ }
398
+ else {
399
+ updated.push({
400
+ id: crypto.randomUUID(),
401
+ value,
402
+ metricId: metric.id,
403
+ unit: metric.unit || '',
404
+ org: this.project.id,
405
+ periodType: 'MONTH',
406
+ valueDate: lastMonth1
407
+ });
408
+ }
409
+ }
410
+ else {
411
+ // ALLTIME / DAY / WEEK / QUARTER / YEAR / RANGE — metric.periodType 그대로 단일 row upsert.
412
+ const idx = updated.findIndex((i) => i.metricId === metric.id && i.periodType === periodType);
413
+ if (idx !== -1) {
414
+ updated[idx] = Object.assign(Object.assign({}, updated[idx]), { value });
415
+ }
416
+ else {
417
+ updated.push({
418
+ id: crypto.randomUUID(),
419
+ value,
420
+ metricId: metric.id,
421
+ unit: metric.unit || '',
422
+ org: this.project.id,
423
+ periodType,
424
+ valueDate: todayYmd
425
+ });
426
+ }
427
+ }
428
+ return updated;
429
+ }
430
+ async _save() {
431
+ var _a;
432
+ // 사용자가 실제 편집한 row 만 저장. 자동 산정 metric (계획/실제 공사비·공기) 는
433
+ // 별도의 데이터 출처(project 정보, 키스콘 수집, 다른 metric 의 전월 row 등)에서
434
+ // 도출돼야 하므로 이 화면에서 하드코딩 derive 하지 않음.
435
+ const response = await updateProjectCompleteStep1(this.kpiMetricValues, (_a = this.project) === null || _a === void 0 ? void 0 : _a.code);
436
+ if (!response.errors) {
437
+ notify({ message: '저장되었습니다.' });
438
+ }
439
+ }
440
+ _reset() {
441
+ this._getInitData();
442
+ }
443
+ };
444
+ SvProjectCompleteTab1Plan.styles = [
445
+ css `
446
+ :host {
447
+ display: block;
448
+ }
449
+ .title {
450
+ color: #212529;
451
+ font-size: 13px;
452
+ font-weight: 400;
453
+ line-height: 24px;
454
+ text-align: center;
455
+ }
456
+
457
+ .rows {
458
+ display: flex;
459
+ flex-direction: column;
460
+ padding: 8px 6px;
461
+ }
462
+ .row.header {
463
+ min-height: 35px;
464
+ background: #f3f3fa;
465
+ border-top: 2px #0c4da2 solid;
466
+ grid-template-columns: 220px 1fr 1fr 200px;
467
+ padding: 0px 25px;
468
+
469
+ .header-label {
470
+ color: #212529;
471
+ text-align: center;
472
+ }
473
+ }
474
+ .row {
475
+ display: grid;
476
+ grid-template-columns: 220px 1fr 1fr 200px;
477
+ gap: 6px 10px;
478
+ align-items: center;
479
+ padding: 8px 25px;
480
+ border-bottom: 1px rgba(0, 0, 0, 0.1) solid;
481
+
482
+ .cell {
483
+ display: flex;
484
+ align-items: center;
485
+ justify-content: center;
486
+ }
487
+ }
488
+ .label {
489
+ color: #35618e;
490
+ font-size: 16px;
491
+ letter-spacing: -0.05em;
492
+ white-space: nowrap;
493
+ display: flex;
494
+ justify-content: center;
495
+ }
496
+ input {
497
+ padding: 6px 8px;
498
+ border: 1px solid rgba(0, 0, 0, 0.1);
499
+ border-radius: 5px;
500
+ background: #ffffff;
501
+ color: #212529;
502
+ font-size: 16px;
503
+ margin-right: 5px;
504
+
505
+ &:disabled {
506
+ background: #f6f6f6;
507
+ }
508
+ }
509
+ .unit {
510
+ text-align: center;
511
+ color: #212529;
512
+ }
513
+ .plus {
514
+ color: #e13232;
515
+ font-weight: 700;
516
+ }
517
+ .minus {
518
+ color: #1e88e5;
519
+ font-weight: 700;
520
+ }
521
+ .button-line {
522
+ display: flex;
523
+ justify-content: center;
524
+ gap: 10px;
525
+ margin-top: 16px;
526
+ }
527
+ .ghost-btn {
528
+ display: inline-flex;
529
+ align-items: center;
530
+ gap: 6px;
531
+ padding: 6px 10px;
532
+ background: #35618e;
533
+ color: #ffffff;
534
+ border-radius: 5px;
535
+ cursor: pointer;
536
+ }
537
+ .ghost-btn.secondary {
538
+ background: #24be7b;
539
+ }
540
+ .ghost-btn.disabled,
541
+ .collect-btn.disabled {
542
+ opacity: 0.45;
543
+ cursor: not-allowed;
544
+ }
545
+
546
+ /* ── 자동 수집 패널 ── */
547
+ .collect-panel {
548
+ margin: 4px 6px 14px;
549
+ border: 1px solid #d7e3f2;
550
+ border-radius: 8px;
551
+ background: linear-gradient(180deg, #f7fafe 0%, #ffffff 100%);
552
+ overflow: hidden;
553
+ }
554
+ .collect-head {
555
+ display: flex;
556
+ align-items: center;
557
+ justify-content: space-between;
558
+ padding: 10px 16px;
559
+ background: #eaf2fb;
560
+ border-bottom: 1px solid #d7e3f2;
561
+ }
562
+ .collect-head .ttl {
563
+ color: #0c4da2;
564
+ font-weight: 700;
565
+ font-size: 14px;
566
+ letter-spacing: -0.03em;
567
+ }
568
+ .collect-head .ttl small {
569
+ color: #5a7da6;
570
+ font-weight: 400;
571
+ margin-left: 8px;
572
+ }
573
+ .collect-btn {
574
+ display: inline-flex;
575
+ align-items: center;
576
+ gap: 6px;
577
+ padding: 7px 14px;
578
+ background: #0c4da2;
579
+ color: #fff;
580
+ border-radius: 6px;
581
+ cursor: pointer;
582
+ font-size: 13px;
583
+ font-weight: 600;
584
+ }
585
+ .collect-btn[disabled] {
586
+ background: #9bb4d2;
587
+ cursor: default;
588
+ }
589
+ .source-list {
590
+ display: flex;
591
+ gap: 10px;
592
+ padding: 12px 16px;
593
+ flex-wrap: wrap;
594
+ }
595
+ .source-card {
596
+ flex: 1 1 200px;
597
+ border: 1px solid #e3e9f0;
598
+ border-radius: 7px;
599
+ padding: 10px 12px;
600
+ background: #fff;
601
+ transition: border-color 0.2s, box-shadow 0.2s;
602
+ }
603
+ .source-card.collecting {
604
+ border-color: #2e79be;
605
+ box-shadow: 0 0 0 3px rgba(46, 121, 190, 0.12);
606
+ }
607
+ .source-card.done {
608
+ border-color: #24be7b;
609
+ }
610
+ .source-card .sc-head {
611
+ display: flex;
612
+ align-items: center;
613
+ gap: 8px;
614
+ font-weight: 600;
615
+ color: #212529;
616
+ font-size: 13px;
617
+ }
618
+ .source-card .sc-head .sys-icon {
619
+ font-size: 16px;
620
+ }
621
+ .source-card .sc-status {
622
+ margin-left: auto;
623
+ font-size: 12px;
624
+ }
625
+ .sc-status.idle {
626
+ color: #aab4c0;
627
+ }
628
+ .sc-status.collecting {
629
+ color: #2e79be;
630
+ }
631
+ .sc-status.done {
632
+ color: #24be7b;
633
+ font-weight: 700;
634
+ }
635
+ .sc-status.error {
636
+ color: #8a8a8a;
637
+ font-weight: 600;
638
+ }
639
+ .source-card.error {
640
+ background: #fafafa;
641
+ border-color: #e0e0e0;
642
+ }
643
+ .source-card .sc-error-msg {
644
+ margin-top: 6px;
645
+ padding: 6px 8px;
646
+ border-radius: 4px;
647
+ background: #f3f4f6;
648
+ color: #6b7280;
649
+ font-size: 12px;
650
+ line-height: 1.4;
651
+ word-break: break-word;
652
+ }
653
+ .source-card .sc-fields {
654
+ margin-top: 8px;
655
+ display: flex;
656
+ flex-direction: column;
657
+ gap: 3px;
658
+ }
659
+ .sc-field {
660
+ font-size: 12px;
661
+ color: #5a6b7b;
662
+ display: flex;
663
+ justify-content: space-between;
664
+ }
665
+ .sc-field b {
666
+ color: #0c4da2;
667
+ }
668
+ .sc-desc {
669
+ font-size: 11px;
670
+ color: #9aa7b4;
671
+ margin-top: 2px;
672
+ }
673
+ /* 가져온 값 출처 칩 */
674
+ .src-chip {
675
+ display: inline-flex;
676
+ align-items: center;
677
+ margin-left: 6px;
678
+ padding: 1px 7px;
679
+ font-size: 11px;
680
+ border-radius: 10px;
681
+ background: #e7f3ec;
682
+ color: #1d9c63;
683
+ white-space: nowrap;
684
+ }
685
+ .cell.just-filled input {
686
+ animation: flash 1.1s ease;
687
+ }
688
+ /* 미입력 — kpiMetricValue 가 비어있는 metric 행 */
689
+ .label.pending::before {
690
+ content: '⚠';
691
+ color: #e74c3c;
692
+ margin-right: 4px;
693
+ }
694
+ .cell.pending input {
695
+ border-color: #e74c3c;
696
+ background-color: #fff5f5;
697
+ }
698
+ @keyframes flash {
699
+ 0% {
700
+ background: #fff7cc;
701
+ }
702
+ 100% {
703
+ background: #ffffff;
704
+ }
705
+ }
706
+ `
707
+ ];
708
+ /** 계획 칼럼을 갖는 항목 (키스콘이 계획값을 제공) */
709
+ SvProjectCompleteTab1Plan.PLAN_KEYS = ['constructionPeriod', 'constructionCost'];
710
+ __decorate([
711
+ state(),
712
+ __metadata("design:type", Object)
713
+ ], SvProjectCompleteTab1Plan.prototype, "kpiMetricValues", void 0);
714
+ __decorate([
715
+ state(),
716
+ __metadata("design:type", Object)
717
+ ], SvProjectCompleteTab1Plan.prototype, "kpiMetrics", void 0);
718
+ __decorate([
719
+ property({ type: Object }),
720
+ __metadata("design:type", Object)
721
+ ], SvProjectCompleteTab1Plan.prototype, "project", void 0);
722
+ __decorate([
723
+ state(),
724
+ __metadata("design:type", Object)
725
+ ], SvProjectCompleteTab1Plan.prototype, "collectStatus", void 0);
726
+ __decorate([
727
+ state(),
728
+ __metadata("design:type", Object)
729
+ ], SvProjectCompleteTab1Plan.prototype, "collectError", void 0);
730
+ __decorate([
731
+ state(),
732
+ __metadata("design:type", Object)
733
+ ], SvProjectCompleteTab1Plan.prototype, "valueSources", void 0);
734
+ __decorate([
735
+ state(),
736
+ __metadata("design:type", Object)
737
+ ], SvProjectCompleteTab1Plan.prototype, "collectedPlan", void 0);
738
+ __decorate([
739
+ state(),
740
+ __metadata("design:type", Object)
741
+ ], SvProjectCompleteTab1Plan.prototype, "planSources", void 0);
742
+ __decorate([
743
+ state(),
744
+ __metadata("design:type", Object)
745
+ ], SvProjectCompleteTab1Plan.prototype, "collectedSummary", void 0);
746
+ __decorate([
747
+ state(),
748
+ __metadata("design:type", Object)
749
+ ], SvProjectCompleteTab1Plan.prototype, "justFilled", void 0);
750
+ __decorate([
751
+ state(),
752
+ __metadata("design:type", Object)
753
+ ], SvProjectCompleteTab1Plan.prototype, "collecting", void 0);
754
+ __decorate([
755
+ state(),
756
+ __metadata("design:type", Object)
757
+ ], SvProjectCompleteTab1Plan.prototype, "canSave", void 0);
758
+ __decorate([
759
+ state(),
760
+ __metadata("design:type", Object)
761
+ ], SvProjectCompleteTab1Plan.prototype, "canAutoCollect", void 0);
762
+ SvProjectCompleteTab1Plan = SvProjectCompleteTab1Plan_1 = __decorate([
763
+ customElement('sv-pc-tab1-plan')
764
+ ], SvProjectCompleteTab1Plan);
765
+ export { SvProjectCompleteTab1Plan };
766
+ //# sourceMappingURL=pc-tab1-plan.js.map