@dssp/dkpi 1.0.0-alpha.7 → 1.0.0-alpha.71
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/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/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 +380 -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 +464 -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 +14 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js +339 -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 +21 -0
- package/dist-client/pages/sv-project-complete.js +213 -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 +46 -0
- package/dist-client/pages/sv-project-detail.js +1236 -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/route.d.ts +1 -1
- package/dist-client/route.js +35 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/shared/complete-api.d.ts +8 -0
- package/dist-client/shared/complete-api.js +177 -0
- package/dist-client/shared/complete-api.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/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 +289 -34
- 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 +74 -0
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +687 -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 +69 -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 +67 -55
- package/recalculate-batch.sh +64 -0
- package/recalculate-projects-range.sh +98 -0
- package/schema.graphql +2514 -455
- package/things-factory.config.js +11 -1
- package/views/auth-page.html +0 -1
- package/views/public/home.html +0 -1
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import { client } from '@operato/graphql';
|
|
5
|
+
import { gql } from '@apollo/client';
|
|
6
|
+
import { notify } from '@operato/layout';
|
|
7
|
+
import moment from 'moment-timezone';
|
|
8
|
+
const DATASET_ID = 'fd4092f5-11d0-488a-bbe8-21d2793e1e79';
|
|
9
|
+
// 월별 수집 대상 항목 (Dataset의 dataItems tag 기준)
|
|
10
|
+
const MONTHLY_ITEMS = [
|
|
11
|
+
{ tag: 'planned_progress', name: '계획공정율', unit: '%', type: 'number' },
|
|
12
|
+
{ tag: 'actual_progress', name: '실적공정율', unit: '%', type: 'number' },
|
|
13
|
+
{ tag: 'schedule_deviation', name: '일정 이탈 수준', unit: '', type: 'rating' },
|
|
14
|
+
{ tag: 'schedule_assessment', name: '일정성과 수준 평가', unit: '', type: 'rating' },
|
|
15
|
+
{ tag: 'cost_assessment', name: '비용성과 수준 평가', unit: '', type: 'rating' },
|
|
16
|
+
{ tag: 'quality_assessment', name: '품질성과 수준 평가', unit: '', type: 'rating' },
|
|
17
|
+
{ tag: 'safety_assessment', name: '안전성과 수준 평가', unit: '', type: 'rating' },
|
|
18
|
+
{ tag: 'environment_assessment', name: '환경성과 수준 평가', unit: '', type: 'rating' },
|
|
19
|
+
{ tag: 'productivity_assessment', name: '생산성성과 수준 평가', unit: '', type: 'rating' }
|
|
20
|
+
];
|
|
21
|
+
let SvProjectCompleteTab4Monthly = class SvProjectCompleteTab4Monthly extends LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.project = {};
|
|
25
|
+
// monthRows: { workDate: 'YYYY-MM', data: {tag: value}, sampleId?: string, dirty: boolean }[]
|
|
26
|
+
this.monthRows = [];
|
|
27
|
+
this.addYear = new Date().getFullYear();
|
|
28
|
+
this.addMonth = new Date().getMonth() + 1;
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
const years = this._getYearRange();
|
|
32
|
+
return html `
|
|
33
|
+
<div class="title">
|
|
34
|
+
프로젝트 수행 기간 동안의 월별 데이터를 입력합니다.<br />
|
|
35
|
+
공정률, 감리자 수준 평가(1~5) 등의 항목을 월 단위로 기록하여 성과 추세 분석에 활용합니다.
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="toolbar">
|
|
39
|
+
<select .value=${String(this.addYear)} @change=${(e) => (this.addYear = Number(e.target.value))}>
|
|
40
|
+
${years.map(y => html `<option value=${y} ?selected=${y === this.addYear}>${y}년</option>`)}
|
|
41
|
+
</select>
|
|
42
|
+
<select
|
|
43
|
+
.value=${String(this.addMonth)}
|
|
44
|
+
@change=${(e) => (this.addMonth = Number(e.target.value))}
|
|
45
|
+
>
|
|
46
|
+
${[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(m => html `<option value=${m} ?selected=${m === this.addMonth}>${m}월</option>`)}
|
|
47
|
+
</select>
|
|
48
|
+
<div class="add-btn" @click=${this._addMonth}>+ 월 추가</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
${this.monthRows.length === 0
|
|
52
|
+
? html `<div class="empty-msg">등록된 월별 데이터가 없습니다. 위에서 월을 추가해주세요.</div>`
|
|
53
|
+
: html `
|
|
54
|
+
<div class="grid-wrapper">
|
|
55
|
+
<table>
|
|
56
|
+
<thead>
|
|
57
|
+
<tr>
|
|
58
|
+
<th>월</th>
|
|
59
|
+
${MONTHLY_ITEMS.map(item => html `<th>${item.name}${item.unit ? ` (${item.unit})` : ''}</th>`)}
|
|
60
|
+
<th>상태</th>
|
|
61
|
+
<th></th>
|
|
62
|
+
</tr>
|
|
63
|
+
</thead>
|
|
64
|
+
<tbody>
|
|
65
|
+
${this.monthRows.map((row, rowIdx) => html `
|
|
66
|
+
<tr>
|
|
67
|
+
<td class="month-cell ${this._isCurrentMonth(row.workDate) ? 'current' : ''}">${row.workDate}</td>
|
|
68
|
+
${MONTHLY_ITEMS.map(item => {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
return item.type === 'rating'
|
|
71
|
+
? html `
|
|
72
|
+
<td>
|
|
73
|
+
<select
|
|
74
|
+
class="rating-select"
|
|
75
|
+
.value=${String((_a = row.data[item.tag]) !== null && _a !== void 0 ? _a : '')}
|
|
76
|
+
@change=${(e) => this._onCellChange(rowIdx, item.tag, e.target.value)}
|
|
77
|
+
>
|
|
78
|
+
<option value="">-</option>
|
|
79
|
+
${[1, 2, 3, 4, 5].map(v => html `<option value=${v} ?selected=${Number(row.data[item.tag]) === v}>${v}</option>`)}
|
|
80
|
+
</select>
|
|
81
|
+
</td>
|
|
82
|
+
`
|
|
83
|
+
: html `
|
|
84
|
+
<td>
|
|
85
|
+
<input
|
|
86
|
+
type="number"
|
|
87
|
+
.value=${(_b = row.data[item.tag]) !== null && _b !== void 0 ? _b : ''}
|
|
88
|
+
@input=${(e) => this._onCellChange(rowIdx, item.tag, e.target.value)}
|
|
89
|
+
/>
|
|
90
|
+
</td>
|
|
91
|
+
`;
|
|
92
|
+
})}
|
|
93
|
+
<td>
|
|
94
|
+
${row.sampleId
|
|
95
|
+
? row.dirty
|
|
96
|
+
? html `<span class="status-unsaved">수정됨</span>`
|
|
97
|
+
: html `<span class="status-saved">저장됨</span>`
|
|
98
|
+
: html `<span class="status-new">신규</span>`}
|
|
99
|
+
</td>
|
|
100
|
+
<td>
|
|
101
|
+
<span class="delete-btn" title="삭제" @click=${() => this._removeMonth(rowIdx)}>✕</span>
|
|
102
|
+
</td>
|
|
103
|
+
</tr>
|
|
104
|
+
`)}
|
|
105
|
+
</tbody>
|
|
106
|
+
</table>
|
|
107
|
+
</div>
|
|
108
|
+
`}
|
|
109
|
+
|
|
110
|
+
<div class="button-line">
|
|
111
|
+
<div class="ghost-btn" @click=${this._reset}>초기화</div>
|
|
112
|
+
<div class="ghost-btn secondary" @click=${this._save}>저장</div>
|
|
113
|
+
</div>
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
116
|
+
willUpdate(changedProperties) {
|
|
117
|
+
var _a;
|
|
118
|
+
super.willUpdate(changedProperties);
|
|
119
|
+
if (changedProperties.has('project') && ((_a = this.project) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
120
|
+
this._loadData();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
_getYearRange() {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
const startYear = ((_a = this.project) === null || _a === void 0 ? void 0 : _a.startDate) ? new Date(this.project.startDate).getFullYear() : new Date().getFullYear() - 2;
|
|
126
|
+
const endYear = ((_b = this.project) === null || _b === void 0 ? void 0 : _b.endDate)
|
|
127
|
+
? new Date(this.project.endDate).getFullYear() + 1
|
|
128
|
+
: new Date().getFullYear() + 1;
|
|
129
|
+
const years = [];
|
|
130
|
+
for (let y = startYear; y <= endYear; y++)
|
|
131
|
+
years.push(y);
|
|
132
|
+
return years;
|
|
133
|
+
}
|
|
134
|
+
_isCurrentMonth(workDate) {
|
|
135
|
+
return workDate === moment().tz('Asia/Seoul').format('YYYY-MM');
|
|
136
|
+
}
|
|
137
|
+
async _loadData() {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
try {
|
|
140
|
+
const response = await client.query({
|
|
141
|
+
query: gql `
|
|
142
|
+
query DataSamplesByDataSet($dataSetId: String!, $filters: [Filter!], $sortings: [Sorting!], $pagination: Pagination) {
|
|
143
|
+
dataSamplesByDataSet(dataSetId: $dataSetId, filters: $filters, sortings: $sortings, pagination: $pagination) {
|
|
144
|
+
items {
|
|
145
|
+
id
|
|
146
|
+
data
|
|
147
|
+
workDate
|
|
148
|
+
key01
|
|
149
|
+
}
|
|
150
|
+
total
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
`,
|
|
154
|
+
variables: {
|
|
155
|
+
dataSetId: DATASET_ID,
|
|
156
|
+
filters: [{ name: 'key01', operator: 'eq', value: this.project.id }],
|
|
157
|
+
sortings: [{ name: 'workDate', desc: false }],
|
|
158
|
+
pagination: { page: 1, limit: 120 }
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const items = ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.dataSamplesByDataSet) === null || _b === void 0 ? void 0 : _b.items) || [];
|
|
162
|
+
this.monthRows = items.map((sample) => {
|
|
163
|
+
var _a;
|
|
164
|
+
return ({
|
|
165
|
+
workDate: ((_a = sample.workDate) === null || _a === void 0 ? void 0 : _a.substring(0, 7)) || '', // YYYY-MM
|
|
166
|
+
data: sample.data || {},
|
|
167
|
+
sampleId: sample.id,
|
|
168
|
+
dirty: false
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
console.error('Failed to load monthly data:', e);
|
|
174
|
+
this.monthRows = [];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
_addMonth() {
|
|
178
|
+
const workDate = `${this.addYear}-${String(this.addMonth).padStart(2, '0')}`;
|
|
179
|
+
// 중복 체크
|
|
180
|
+
if (this.monthRows.some(r => r.workDate === workDate)) {
|
|
181
|
+
notify({ message: `${workDate}은 이미 존재합니다.` });
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const newRow = {
|
|
185
|
+
workDate,
|
|
186
|
+
data: {},
|
|
187
|
+
sampleId: null,
|
|
188
|
+
dirty: true
|
|
189
|
+
};
|
|
190
|
+
// 정렬된 위치에 삽입
|
|
191
|
+
const rows = [...this.monthRows, newRow];
|
|
192
|
+
rows.sort((a, b) => a.workDate.localeCompare(b.workDate));
|
|
193
|
+
this.monthRows = rows;
|
|
194
|
+
}
|
|
195
|
+
_removeMonth(rowIdx) {
|
|
196
|
+
this.monthRows = this.monthRows.filter((_, i) => i !== rowIdx);
|
|
197
|
+
}
|
|
198
|
+
_onCellChange(rowIdx, tag, rawValue) {
|
|
199
|
+
const value = rawValue === '' ? null : Number(rawValue);
|
|
200
|
+
this.monthRows = this.monthRows.map((row, i) => {
|
|
201
|
+
if (i !== rowIdx)
|
|
202
|
+
return row;
|
|
203
|
+
return Object.assign(Object.assign({}, row), { data: Object.assign(Object.assign({}, row.data), { [tag]: value }), dirty: true });
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
async _save() {
|
|
207
|
+
const dirtyRows = this.monthRows.filter(r => r.dirty);
|
|
208
|
+
if (dirtyRows.length === 0) {
|
|
209
|
+
notify({ message: '변경된 데이터가 없습니다.' });
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
let savedCount = 0;
|
|
213
|
+
let errorCount = 0;
|
|
214
|
+
for (const row of dirtyRows) {
|
|
215
|
+
try {
|
|
216
|
+
// data에 project_id 포함 (DataKeySet이 key01에 매핑)
|
|
217
|
+
const data = Object.assign(Object.assign({}, row.data), { project_id: this.project.id });
|
|
218
|
+
// null 값 제거
|
|
219
|
+
for (const key of Object.keys(data)) {
|
|
220
|
+
if (data[key] === null || data[key] === undefined)
|
|
221
|
+
delete data[key];
|
|
222
|
+
}
|
|
223
|
+
// collectedAt을 월 시작일 고정으로 설정 → 동일 key01+collectedAt이면 기존 레코드 업데이트
|
|
224
|
+
const collectedAt = new Date(`${row.workDate}-01T00:00:00Z`);
|
|
225
|
+
await client.mutate({
|
|
226
|
+
mutation: gql `
|
|
227
|
+
mutation CreateDataSample($dataSample: NewDataSample!) {
|
|
228
|
+
createDataSample(dataSample: $dataSample) {
|
|
229
|
+
id
|
|
230
|
+
data
|
|
231
|
+
workDate
|
|
232
|
+
key01
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
`,
|
|
236
|
+
variables: {
|
|
237
|
+
dataSample: {
|
|
238
|
+
dataSet: { id: DATASET_ID },
|
|
239
|
+
data,
|
|
240
|
+
workDate: `${row.workDate}-01`,
|
|
241
|
+
collectedAt: collectedAt.toISOString(),
|
|
242
|
+
source: 'project-complete'
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
savedCount++;
|
|
247
|
+
}
|
|
248
|
+
catch (e) {
|
|
249
|
+
console.error(`Failed to save ${row.workDate}:`, e);
|
|
250
|
+
errorCount++;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (errorCount > 0) {
|
|
254
|
+
notify({ message: `${savedCount}건 저장, ${errorCount}건 오류 발생` });
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
notify({ message: `${savedCount}건 저장되었습니다.` });
|
|
258
|
+
}
|
|
259
|
+
// 저장 후 다시 로드하여 sampleId 갱신
|
|
260
|
+
await this._loadData();
|
|
261
|
+
}
|
|
262
|
+
_reset() {
|
|
263
|
+
this._loadData();
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
SvProjectCompleteTab4Monthly.styles = [
|
|
267
|
+
css `
|
|
268
|
+
:host {
|
|
269
|
+
display: block;
|
|
270
|
+
}
|
|
271
|
+
.title {
|
|
272
|
+
color: #212529;
|
|
273
|
+
font-size: 13px;
|
|
274
|
+
font-weight: 400;
|
|
275
|
+
line-height: 24px;
|
|
276
|
+
text-align: center;
|
|
277
|
+
margin-bottom: 8px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.toolbar {
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
justify-content: center;
|
|
284
|
+
gap: 12px;
|
|
285
|
+
margin-bottom: 12px;
|
|
286
|
+
}
|
|
287
|
+
.toolbar select {
|
|
288
|
+
padding: 5px 8px;
|
|
289
|
+
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
290
|
+
border-radius: 5px;
|
|
291
|
+
font-size: 14px;
|
|
292
|
+
color: #212529;
|
|
293
|
+
}
|
|
294
|
+
.toolbar .add-btn {
|
|
295
|
+
display: inline-flex;
|
|
296
|
+
align-items: center;
|
|
297
|
+
gap: 4px;
|
|
298
|
+
padding: 5px 10px;
|
|
299
|
+
background: #35618e;
|
|
300
|
+
color: #fff;
|
|
301
|
+
border-radius: 5px;
|
|
302
|
+
cursor: pointer;
|
|
303
|
+
font-size: 13px;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.grid-wrapper {
|
|
307
|
+
overflow-x: auto;
|
|
308
|
+
padding: 0 6px;
|
|
309
|
+
}
|
|
310
|
+
table {
|
|
311
|
+
width: 100%;
|
|
312
|
+
border-collapse: collapse;
|
|
313
|
+
font-size: 13px;
|
|
314
|
+
}
|
|
315
|
+
thead th {
|
|
316
|
+
background: #f3f3fa;
|
|
317
|
+
border-top: 2px solid #0c4da2;
|
|
318
|
+
color: #212529;
|
|
319
|
+
text-align: center;
|
|
320
|
+
padding: 8px 6px;
|
|
321
|
+
white-space: nowrap;
|
|
322
|
+
font-weight: 500;
|
|
323
|
+
}
|
|
324
|
+
tbody td {
|
|
325
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
326
|
+
text-align: center;
|
|
327
|
+
padding: 6px 4px;
|
|
328
|
+
vertical-align: middle;
|
|
329
|
+
}
|
|
330
|
+
tbody tr:hover {
|
|
331
|
+
background: #f8fafc;
|
|
332
|
+
}
|
|
333
|
+
.month-cell {
|
|
334
|
+
color: #35618e;
|
|
335
|
+
font-weight: 600;
|
|
336
|
+
white-space: nowrap;
|
|
337
|
+
}
|
|
338
|
+
.month-cell.current {
|
|
339
|
+
color: #16a085;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
input[type='number'] {
|
|
343
|
+
width: 70px;
|
|
344
|
+
padding: 4px 6px;
|
|
345
|
+
border: 1px solid rgba(0, 0, 0, 0.12);
|
|
346
|
+
border-radius: 4px;
|
|
347
|
+
text-align: center;
|
|
348
|
+
font-size: 13px;
|
|
349
|
+
}
|
|
350
|
+
input[type='number']:focus {
|
|
351
|
+
outline: none;
|
|
352
|
+
border-color: #35618e;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.rating-select {
|
|
356
|
+
padding: 4px 6px;
|
|
357
|
+
border: 1px solid rgba(0, 0, 0, 0.12);
|
|
358
|
+
border-radius: 4px;
|
|
359
|
+
font-size: 13px;
|
|
360
|
+
text-align: center;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.status-saved {
|
|
364
|
+
color: #16a085;
|
|
365
|
+
font-size: 12px;
|
|
366
|
+
}
|
|
367
|
+
.status-unsaved {
|
|
368
|
+
color: #e67e22;
|
|
369
|
+
font-size: 12px;
|
|
370
|
+
}
|
|
371
|
+
.status-new {
|
|
372
|
+
color: #3498db;
|
|
373
|
+
font-size: 12px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.button-line {
|
|
377
|
+
display: flex;
|
|
378
|
+
justify-content: center;
|
|
379
|
+
gap: 10px;
|
|
380
|
+
margin-top: 16px;
|
|
381
|
+
}
|
|
382
|
+
.ghost-btn {
|
|
383
|
+
display: inline-flex;
|
|
384
|
+
align-items: center;
|
|
385
|
+
gap: 6px;
|
|
386
|
+
padding: 6px 10px;
|
|
387
|
+
background: #35618e;
|
|
388
|
+
color: #ffffff;
|
|
389
|
+
border-radius: 5px;
|
|
390
|
+
cursor: pointer;
|
|
391
|
+
}
|
|
392
|
+
.ghost-btn.secondary {
|
|
393
|
+
background: #24be7b;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.delete-btn {
|
|
397
|
+
cursor: pointer;
|
|
398
|
+
color: #999;
|
|
399
|
+
font-size: 18px;
|
|
400
|
+
}
|
|
401
|
+
.delete-btn:hover {
|
|
402
|
+
color: #e74c3c;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.empty-msg {
|
|
406
|
+
text-align: center;
|
|
407
|
+
color: #999;
|
|
408
|
+
padding: 40px 0;
|
|
409
|
+
font-size: 14px;
|
|
410
|
+
}
|
|
411
|
+
`
|
|
412
|
+
];
|
|
413
|
+
__decorate([
|
|
414
|
+
property({ type: Object }),
|
|
415
|
+
__metadata("design:type", Object)
|
|
416
|
+
], SvProjectCompleteTab4Monthly.prototype, "project", void 0);
|
|
417
|
+
__decorate([
|
|
418
|
+
state(),
|
|
419
|
+
__metadata("design:type", Array)
|
|
420
|
+
], SvProjectCompleteTab4Monthly.prototype, "monthRows", void 0);
|
|
421
|
+
__decorate([
|
|
422
|
+
state(),
|
|
423
|
+
__metadata("design:type", Number)
|
|
424
|
+
], SvProjectCompleteTab4Monthly.prototype, "addYear", void 0);
|
|
425
|
+
__decorate([
|
|
426
|
+
state(),
|
|
427
|
+
__metadata("design:type", Number)
|
|
428
|
+
], SvProjectCompleteTab4Monthly.prototype, "addMonth", void 0);
|
|
429
|
+
SvProjectCompleteTab4Monthly = __decorate([
|
|
430
|
+
customElement('sv-pc-tab4-monthly')
|
|
431
|
+
], SvProjectCompleteTab4Monthly);
|
|
432
|
+
export { SvProjectCompleteTab4Monthly };
|
|
433
|
+
//# sourceMappingURL=pc-tab4-monthly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pc-tab4-monthly.js","sourceRoot":"","sources":["../../../client/pages/project-complete-tabs/pc-tab4-monthly.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgJF;CACF,AAlJY,CAkJZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAkB;AAGpC;IAAR,KAAK,EAAE;;+DAAsB;AACrB;IAAR,KAAK,EAAE;;6DAA2C;AAC1C;IAAR,KAAK,EAAE;;8DAA6C;AA1J1C,4BAA4B;IADxC,aAAa,CAAC,oBAAoB,CAAC;GACvB,4BAA4B,CA0ZxC","sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { gql } from '@apollo/client'\nimport { notify } from '@operato/layout'\nimport moment from 'moment-timezone'\n\nconst DATASET_ID = 'fd4092f5-11d0-488a-bbe8-21d2793e1e79'\n\n// 월별 수집 대상 항목 (Dataset의 dataItems tag 기준)\nconst MONTHLY_ITEMS = [\n { tag: 'planned_progress', name: '계획공정율', unit: '%', type: 'number' },\n { tag: 'actual_progress', name: '실적공정율', unit: '%', type: 'number' },\n { tag: 'schedule_deviation', name: '일정 이탈 수준', unit: '', type: 'rating' },\n { tag: 'schedule_assessment', name: '일정성과 수준 평가', unit: '', type: 'rating' },\n { tag: 'cost_assessment', name: '비용성과 수준 평가', unit: '', type: 'rating' },\n { tag: 'quality_assessment', name: '품질성과 수준 평가', unit: '', type: 'rating' },\n { tag: 'safety_assessment', name: '안전성과 수준 평가', unit: '', type: 'rating' },\n { tag: 'environment_assessment', name: '환경성과 수준 평가', unit: '', type: 'rating' },\n { tag: 'productivity_assessment', name: '생산성성과 수준 평가', unit: '', type: 'rating' }\n]\n\n@customElement('sv-pc-tab4-monthly')\nexport class SvProjectCompleteTab4Monthly extends LitElement {\n static styles = [\n css`\n :host {\n display: block;\n }\n .title {\n color: #212529;\n font-size: 13px;\n font-weight: 400;\n line-height: 24px;\n text-align: center;\n margin-bottom: 8px;\n }\n\n .toolbar {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n margin-bottom: 12px;\n }\n .toolbar select {\n padding: 5px 8px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 5px;\n font-size: 14px;\n color: #212529;\n }\n .toolbar .add-btn {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 5px 10px;\n background: #35618e;\n color: #fff;\n border-radius: 5px;\n cursor: pointer;\n font-size: 13px;\n }\n\n .grid-wrapper {\n overflow-x: auto;\n padding: 0 6px;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n font-size: 13px;\n }\n thead th {\n background: #f3f3fa;\n border-top: 2px solid #0c4da2;\n color: #212529;\n text-align: center;\n padding: 8px 6px;\n white-space: nowrap;\n font-weight: 500;\n }\n tbody td {\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n text-align: center;\n padding: 6px 4px;\n vertical-align: middle;\n }\n tbody tr:hover {\n background: #f8fafc;\n }\n .month-cell {\n color: #35618e;\n font-weight: 600;\n white-space: nowrap;\n }\n .month-cell.current {\n color: #16a085;\n }\n\n input[type='number'] {\n width: 70px;\n padding: 4px 6px;\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 4px;\n text-align: center;\n font-size: 13px;\n }\n input[type='number']:focus {\n outline: none;\n border-color: #35618e;\n }\n\n .rating-select {\n padding: 4px 6px;\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 4px;\n font-size: 13px;\n text-align: center;\n }\n\n .status-saved {\n color: #16a085;\n font-size: 12px;\n }\n .status-unsaved {\n color: #e67e22;\n font-size: 12px;\n }\n .status-new {\n color: #3498db;\n font-size: 12px;\n }\n\n .button-line {\n display: flex;\n justify-content: center;\n gap: 10px;\n margin-top: 16px;\n }\n .ghost-btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 10px;\n background: #35618e;\n color: #ffffff;\n border-radius: 5px;\n cursor: pointer;\n }\n .ghost-btn.secondary {\n background: #24be7b;\n }\n\n .delete-btn {\n cursor: pointer;\n color: #999;\n font-size: 18px;\n }\n .delete-btn:hover {\n color: #e74c3c;\n }\n\n .empty-msg {\n text-align: center;\n color: #999;\n padding: 40px 0;\n font-size: 14px;\n }\n `\n ]\n\n @property({ type: Object }) project: any = {}\n\n // monthRows: { workDate: 'YYYY-MM', data: {tag: value}, sampleId?: string, dirty: boolean }[]\n @state() monthRows: any[] = []\n @state() addYear: number = new Date().getFullYear()\n @state() addMonth: number = new Date().getMonth() + 1\n\n render() {\n const years = this._getYearRange()\n\n return html`\n <div class=\"title\">\n 프로젝트 수행 기간 동안의 월별 데이터를 입력합니다.<br />\n 공정률, 감리자 수준 평가(1~5) 등의 항목을 월 단위로 기록하여 성과 추세 분석에 활용합니다.\n </div>\n\n <div class=\"toolbar\">\n <select .value=${String(this.addYear)} @change=${(e: Event) => (this.addYear = Number((e.target as HTMLSelectElement).value))}>\n ${years.map(y => html`<option value=${y} ?selected=${y === this.addYear}>${y}년</option>`)}\n </select>\n <select\n .value=${String(this.addMonth)}\n @change=${(e: Event) => (this.addMonth = Number((e.target as HTMLSelectElement).value))}\n >\n ${[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(\n m => html`<option value=${m} ?selected=${m === this.addMonth}>${m}월</option>`\n )}\n </select>\n <div class=\"add-btn\" @click=${this._addMonth}>+ 월 추가</div>\n </div>\n\n ${this.monthRows.length === 0\n ? html`<div class=\"empty-msg\">등록된 월별 데이터가 없습니다. 위에서 월을 추가해주세요.</div>`\n : html`\n <div class=\"grid-wrapper\">\n <table>\n <thead>\n <tr>\n <th>월</th>\n ${MONTHLY_ITEMS.map(item => html`<th>${item.name}${item.unit ? ` (${item.unit})` : ''}</th>`)}\n <th>상태</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n ${this.monthRows.map(\n (row, rowIdx) => html`\n <tr>\n <td class=\"month-cell ${this._isCurrentMonth(row.workDate) ? 'current' : ''}\">${row.workDate}</td>\n ${MONTHLY_ITEMS.map(item =>\n item.type === 'rating'\n ? html`\n <td>\n <select\n class=\"rating-select\"\n .value=${String(row.data[item.tag] ?? '')}\n @change=${(e: Event) => this._onCellChange(rowIdx, item.tag, (e.target as HTMLSelectElement).value)}\n >\n <option value=\"\">-</option>\n ${[1, 2, 3, 4, 5].map(\n v =>\n html`<option value=${v} ?selected=${Number(row.data[item.tag]) === v}>${v}</option>`\n )}\n </select>\n </td>\n `\n : html`\n <td>\n <input\n type=\"number\"\n .value=${row.data[item.tag] ?? ''}\n @input=${(e: InputEvent) => this._onCellChange(rowIdx, item.tag, (e.target as HTMLInputElement).value)}\n />\n </td>\n `\n )}\n <td>\n ${row.sampleId\n ? row.dirty\n ? html`<span class=\"status-unsaved\">수정됨</span>`\n : html`<span class=\"status-saved\">저장됨</span>`\n : html`<span class=\"status-new\">신규</span>`}\n </td>\n <td>\n <span class=\"delete-btn\" title=\"삭제\" @click=${() => this._removeMonth(rowIdx)}>✕</span>\n </td>\n </tr>\n `\n )}\n </tbody>\n </table>\n </div>\n `}\n\n <div class=\"button-line\">\n <div class=\"ghost-btn\" @click=${this._reset}>초기화</div>\n <div class=\"ghost-btn secondary\" @click=${this._save}>저장</div>\n </div>\n `\n }\n\n willUpdate(changedProperties: Map<string, any>) {\n super.willUpdate(changedProperties)\n if (changedProperties.has('project') && this.project?.id) {\n this._loadData()\n }\n }\n\n private _getYearRange(): number[] {\n const startYear = this.project?.startDate ? new Date(this.project.startDate).getFullYear() : new Date().getFullYear() - 2\n const endYear = this.project?.endDate\n ? new Date(this.project.endDate).getFullYear() + 1\n : new Date().getFullYear() + 1\n const years: number[] = []\n for (let y = startYear; y <= endYear; y++) years.push(y)\n return years\n }\n\n private _isCurrentMonth(workDate: string): boolean {\n return workDate === moment().tz('Asia/Seoul').format('YYYY-MM')\n }\n\n private async _loadData() {\n try {\n const response = await client.query({\n query: gql`\n query DataSamplesByDataSet($dataSetId: String!, $filters: [Filter!], $sortings: [Sorting!], $pagination: Pagination) {\n dataSamplesByDataSet(dataSetId: $dataSetId, filters: $filters, sortings: $sortings, pagination: $pagination) {\n items {\n id\n data\n workDate\n key01\n }\n total\n }\n }\n `,\n variables: {\n dataSetId: DATASET_ID,\n filters: [{ name: 'key01', operator: 'eq', value: this.project.id }],\n sortings: [{ name: 'workDate', desc: false }],\n pagination: { page: 1, limit: 120 }\n }\n })\n\n const items = response.data?.dataSamplesByDataSet?.items || []\n this.monthRows = items.map((sample: any) => ({\n workDate: sample.workDate?.substring(0, 7) || '', // YYYY-MM\n data: sample.data || {},\n sampleId: sample.id,\n dirty: false\n }))\n } catch (e) {\n console.error('Failed to load monthly data:', e)\n this.monthRows = []\n }\n }\n\n private _addMonth() {\n const workDate = `${this.addYear}-${String(this.addMonth).padStart(2, '0')}`\n\n // 중복 체크\n if (this.monthRows.some(r => r.workDate === workDate)) {\n notify({ message: `${workDate}은 이미 존재합니다.` })\n return\n }\n\n const newRow = {\n workDate,\n data: {},\n sampleId: null,\n dirty: true\n }\n\n // 정렬된 위치에 삽입\n const rows = [...this.monthRows, newRow]\n rows.sort((a, b) => a.workDate.localeCompare(b.workDate))\n this.monthRows = rows\n }\n\n private _removeMonth(rowIdx: number) {\n this.monthRows = this.monthRows.filter((_, i) => i !== rowIdx)\n }\n\n private _onCellChange(rowIdx: number, tag: string, rawValue: string) {\n const value = rawValue === '' ? null : Number(rawValue)\n this.monthRows = this.monthRows.map((row, i) => {\n if (i !== rowIdx) return row\n return {\n ...row,\n data: { ...row.data, [tag]: value },\n dirty: true\n }\n })\n }\n\n private async _save() {\n const dirtyRows = this.monthRows.filter(r => r.dirty)\n if (dirtyRows.length === 0) {\n notify({ message: '변경된 데이터가 없습니다.' })\n return\n }\n\n let savedCount = 0\n let errorCount = 0\n\n for (const row of dirtyRows) {\n try {\n // data에 project_id 포함 (DataKeySet이 key01에 매핑)\n const data = { ...row.data, project_id: this.project.id }\n // null 값 제거\n for (const key of Object.keys(data)) {\n if (data[key] === null || data[key] === undefined) delete data[key]\n }\n\n // collectedAt을 월 시작일 고정으로 설정 → 동일 key01+collectedAt이면 기존 레코드 업데이트\n const collectedAt = new Date(`${row.workDate}-01T00:00:00Z`)\n\n await client.mutate({\n mutation: gql`\n mutation CreateDataSample($dataSample: NewDataSample!) {\n createDataSample(dataSample: $dataSample) {\n id\n data\n workDate\n key01\n }\n }\n `,\n variables: {\n dataSample: {\n dataSet: { id: DATASET_ID },\n data,\n workDate: `${row.workDate}-01`,\n collectedAt: collectedAt.toISOString(),\n source: 'project-complete'\n }\n }\n })\n\n savedCount++\n } catch (e) {\n console.error(`Failed to save ${row.workDate}:`, e)\n errorCount++\n }\n }\n\n if (errorCount > 0) {\n notify({ message: `${savedCount}건 저장, ${errorCount}건 오류 발생` })\n } else {\n notify({ message: `${savedCount}건 저장되었습니다.` })\n }\n\n // 저장 후 다시 로드하여 sampleId 갱신\n await this._loadData()\n }\n\n private _reset() {\n this._loadData()\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import { PageView } from '@operato/shell';
|
|
3
|
+
import './project-complete-tabs/pc-tab1-plan';
|
|
4
|
+
import './project-complete-tabs/pc-tab2-rating';
|
|
5
|
+
import './project-complete-tabs/pc-tab3-upload';
|
|
6
|
+
import './project-complete-tabs/pc-tab4-monthly';
|
|
7
|
+
declare const SvProjectCompletePage_base: typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
8
|
+
export declare class SvProjectCompletePage extends SvProjectCompletePage_base {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
get context(): {
|
|
11
|
+
title: string;
|
|
12
|
+
};
|
|
13
|
+
private activeTab;
|
|
14
|
+
private projectId;
|
|
15
|
+
private project;
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
|
18
|
+
private _onTabClick;
|
|
19
|
+
private _onComplete;
|
|
20
|
+
}
|
|
21
|
+
export {};
|