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