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

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