@dssp/dkpi 1.0.0-y.0 → 1.0.1
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 +4 -9
- package/assets/helps/index.md +1 -1
- package/assets/images/project-image.png +0 -0
- package/assets/manifest.json +2 -2
- package/config/config.development.js +2 -1
- package/config/config.production.js +2 -1
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +15 -0
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/kpi-2d-lookup-chart.d.ts +50 -0
- package/dist-client/components/kpi-2d-lookup-chart.js +263 -0
- package/dist-client/components/kpi-2d-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-boxplot-chart.d.ts +31 -0
- package/dist-client/components/kpi-boxplot-chart.js +306 -0
- package/dist-client/components/kpi-boxplot-chart.js.map +1 -0
- package/dist-client/components/kpi-lookup-chart.d.ts +58 -0
- package/dist-client/components/kpi-lookup-chart.js +464 -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 +180 -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 +14 -2
- package/dist-client/components/kpi-single-boxplot-chart.js +237 -137
- package/dist-client/components/kpi-single-boxplot-chart.js.map +1 -1
- package/dist-client/components/kpi-step-lookup-chart.d.ts +33 -0
- package/dist-client/components/kpi-step-lookup-chart.js +181 -0
- package/dist-client/components/kpi-step-lookup-chart.js.map +1 -0
- package/dist-client/components/kpi-trend-chart.d.ts +25 -0
- package/dist-client/components/kpi-trend-chart.js +241 -0
- package/dist-client/components/kpi-trend-chart.js.map +1 -0
- package/dist-client/entries/auth/checkin.d.ts +38 -0
- package/dist-client/entries/auth/checkin.js +551 -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 +349 -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/pages/component/project-update-header.d.ts +1 -0
- package/dist-client/pages/component/project-update-header.js +127 -0
- package/dist-client/pages/component/project-update-header.js.map +1 -0
- 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 +47 -0
- package/dist-client/pages/kpi-admin/dssp-kpi-overview.js +393 -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 +696 -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 +46 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +945 -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 +34 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +238 -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 +37 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +689 -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 +57 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +866 -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 +1097 -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 +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +1 -13
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +20 -11
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.d.ts +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +1 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +1 -2
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +22 -33
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.d.ts +56 -0
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js +609 -67
- package/dist-client/pages/project-complete-tabs/pc-tab1-plan.js.map +1 -1
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.d.ts +15 -3
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js +180 -65
- package/dist-client/pages/project-complete-tabs/pc-tab2-rating.js.map +1 -1
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.d.ts +13 -4
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js +213 -91
- package/dist-client/pages/project-complete-tabs/pc-tab3-upload.js.map +1 -1
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.d.ts +51 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js +693 -0
- package/dist-client/pages/project-complete-tabs/pc-tab4-monthly.js.map +1 -0
- package/dist-client/pages/sv-project-complete.d.ts +12 -3
- package/dist-client/pages/sv-project-complete.js +175 -29
- package/dist-client/pages/sv-project-complete.js.map +1 -1
- package/dist-client/pages/sv-project-completed-list.d.ts +3 -0
- package/dist-client/pages/sv-project-completed-list.js +81 -22
- package/dist-client/pages/sv-project-completed-list.js.map +1 -1
- package/dist-client/pages/sv-project-detail.d.ts +60 -0
- package/dist-client/pages/sv-project-detail.js +1092 -85
- package/dist-client/pages/sv-project-detail.js.map +1 -1
- package/dist-client/pages/sv-project-list.d.ts +20 -2
- package/dist-client/pages/sv-project-list.js +180 -30
- package/dist-client/pages/sv-project-list.js.map +1 -1
- package/dist-client/pages/sv-project-update.d.ts +91 -0
- package/dist-client/pages/sv-project-update.js +1150 -0
- package/dist-client/pages/sv-project-update.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 +29 -2
- package/dist-client/route.js.map +1 -1
- package/dist-client/shared/complete-api.d.ts +45 -5
- package/dist-client/shared/complete-api.js +177 -28
- package/dist-client/shared/complete-api.js.map +1 -1
- package/dist-client/shared/func.d.ts +1 -1
- package/dist-client/shared/func.js.map +1 -1
- package/dist-client/shared/geo-group-mapping.d.ts +25 -0
- package/dist-client/shared/geo-group-mapping.js +189 -0
- package/dist-client/shared/geo-group-mapping.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/shared/kpi-project-sync.d.ts +16 -0
- package/dist-client/shared/kpi-project-sync.js +129 -0
- package/dist-client/shared/kpi-project-sync.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/menu-tools.d.ts +11 -3
- package/dist-client/viewparts/menu-tools.js +126 -75
- package/dist-client/viewparts/menu-tools.js.map +1 -1
- package/dist-server/scripts/calculate-kpi-scores.js +65 -3
- package/dist-server/scripts/calculate-kpi-scores.js.map +1 -1
- package/dist-server/scripts/load-grade-data-migration.d.ts +4 -0
- package/dist-server/scripts/load-grade-data-migration.js +95 -10
- package/dist-server/scripts/load-grade-data-migration.js.map +1 -1
- package/dist-server/scripts/propagate-parent-kpi-values.d.ts +4 -0
- package/dist-server/scripts/propagate-parent-kpi-values.js +423 -77
- package/dist-server/scripts/propagate-parent-kpi-values.js.map +1 -1
- 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 +1 -3
- package/dist-server/service/index.js +3 -4
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +192 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +993 -38
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.d.ts +9 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js +33 -8
- package/dist-server/service/kpi-metric-value/kpi-metric-value-query.js.map +1 -1
- 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 +13 -0
- package/dist-server/service/kpi-stat/kpi-stat-query.js +751 -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/kpi-value-query.d.ts +2 -1
- package/dist-server/service/kpi-value/kpi-value-query.js +49 -6
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
- 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/openapi/unstable.yaml +2 -2
- package/package.json +58 -54
- package/recalculate-batch.sh +64 -0
- package/recalculate-projects-range.sh +98 -0
- package/schema.graphql +1159 -55
- package/things-factory.config.js +6 -1
- package/translations/en.json +5 -1
- package/translations/ko.json +5 -1
- package/views/auth-page.html +4 -5
- package/views/public/home.html +5 -6
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { css, html, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import { getProject, updateProjectCompleteStep3, getKpiMetrics, getKpiMetricValues } from '../../shared/complete-api';
|
|
5
|
+
import { notify } from '@operato/layout';
|
|
6
|
+
import { hasPrivilege } from '@things-factory/auth-base/dist-client';
|
|
6
7
|
let SvProjectCompleteTab3Upload = class SvProjectCompleteTab3Upload extends LitElement {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments);
|
|
9
|
-
this.data = [];
|
|
10
10
|
this.project = {};
|
|
11
|
+
this.attachment = {};
|
|
12
|
+
this.pendingFile = null;
|
|
13
|
+
this.slpaData = [];
|
|
14
|
+
/** kpi:sentiment — Step3 보고서 첨부/저장 권한 */
|
|
15
|
+
this.canSave = false;
|
|
16
|
+
}
|
|
17
|
+
async connectedCallback() {
|
|
18
|
+
super.connectedCallback();
|
|
19
|
+
this.canSave = await hasPrivilege({
|
|
20
|
+
category: 'kpi',
|
|
21
|
+
privilege: 'sentiment',
|
|
22
|
+
domainOwnerGranted: true,
|
|
23
|
+
superUserGranted: true
|
|
24
|
+
});
|
|
11
25
|
}
|
|
12
26
|
render() {
|
|
13
27
|
var _a, _b;
|
|
@@ -22,83 +36,125 @@ let SvProjectCompleteTab3Upload = class SvProjectCompleteTab3Upload extends LitE
|
|
|
22
36
|
</div>
|
|
23
37
|
|
|
24
38
|
<div class="rows">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
${this._getCurrentFile()
|
|
40
|
+
? html `
|
|
41
|
+
<div class="attachment-list">
|
|
42
|
+
<div class="attachment-row">
|
|
43
|
+
<md-icon class="file-icon">picture_as_pdf</md-icon>
|
|
44
|
+
<div class="attachment-name" title="${(_a = this._getCurrentFile()) === null || _a === void 0 ? void 0 : _a.name}">${(_b = this._getCurrentFile()) === null || _b === void 0 ? void 0 : _b.name}</div>
|
|
45
|
+
<md-icon class="delete-icon" @click=${this._removeFile}>delete</md-icon>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
`
|
|
49
|
+
: html `
|
|
50
|
+
<div class="upload-controls">
|
|
51
|
+
<ox-input-file accept="application/pdf,.pdf" hide-filelist @change=${this._onFileSelect}> </ox-input-file>
|
|
52
|
+
</div>
|
|
53
|
+
`}
|
|
54
|
+
${this.slpaData.length > 0
|
|
55
|
+
? html `
|
|
56
|
+
<div class="slpa-results">
|
|
57
|
+
<div class="slpa-title">AI 분석 결과 (SL-PA 관련 항목)</div>
|
|
58
|
+
${this.slpaData.map(item => html `
|
|
59
|
+
<div class="slpa-item">
|
|
60
|
+
<div class="slpa-label">${item.name}</div>
|
|
61
|
+
<div class="slpa-value">${item.value.toFixed(2)} ${item.unit || ''}</div>
|
|
62
|
+
</div>
|
|
63
|
+
`)}
|
|
64
|
+
</div>
|
|
65
|
+
`
|
|
66
|
+
: ''}
|
|
38
67
|
|
|
39
68
|
<div class="button-line">
|
|
40
69
|
<div class="ghost-btn " @click=${this._reset}>초기화</div>
|
|
41
|
-
<div
|
|
70
|
+
<div
|
|
71
|
+
class="ghost-btn secondary ${this.canSave ? '' : 'disabled'}"
|
|
72
|
+
title=${this.canSave ? '' : 'kpi:sentiment 권한 필요'}
|
|
73
|
+
@click=${() => this.canSave && this._save()}
|
|
74
|
+
>
|
|
75
|
+
저장
|
|
76
|
+
</div>
|
|
42
77
|
</div>
|
|
43
78
|
</div>
|
|
44
79
|
`;
|
|
45
80
|
}
|
|
46
|
-
|
|
47
|
-
|
|
81
|
+
willUpdate(changedProperties) {
|
|
82
|
+
var _a;
|
|
83
|
+
super.willUpdate(changedProperties);
|
|
84
|
+
// project가 변경되고, project.id가 존재하면 데이터 로드
|
|
85
|
+
if (changedProperties.has('project') && ((_a = this.project) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
86
|
+
this._getProjectData();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
_getCurrentFile() {
|
|
90
|
+
var _a;
|
|
91
|
+
return this.pendingFile || (((_a = this.attachment) === null || _a === void 0 ? void 0 : _a.id) ? this.attachment : null);
|
|
48
92
|
}
|
|
49
|
-
async
|
|
93
|
+
async _save() {
|
|
50
94
|
var _a;
|
|
51
|
-
|
|
52
|
-
this.
|
|
95
|
+
// 대기 중인 파일이 있으면 업로드
|
|
96
|
+
if (this.pendingFile) {
|
|
97
|
+
await this._uploadFile(this.pendingFile);
|
|
98
|
+
this.pendingFile = null;
|
|
99
|
+
}
|
|
100
|
+
else if (!this.pendingFile && !((_a = this.attachment) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
101
|
+
notify({ message: '파일은 필수입니다.' });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
_removeFile() {
|
|
105
|
+
this.pendingFile = null;
|
|
106
|
+
this.attachment = {};
|
|
107
|
+
this.slpaData = []; // SL-PA 데이터도 초기화
|
|
53
108
|
}
|
|
54
109
|
async _onFileSelect(e) {
|
|
55
110
|
const files = e.detail;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
async _uploadFiles(files) {
|
|
59
|
-
const response = await client.mutate({
|
|
60
|
-
mutation: gql `
|
|
61
|
-
mutation ($attachments: [NewAttachment!]!) {
|
|
62
|
-
createAttachments(attachments: $attachments) {
|
|
63
|
-
id
|
|
64
|
-
name
|
|
65
|
-
fullpath
|
|
66
|
-
}
|
|
111
|
+
if (files.length > 0) {
|
|
112
|
+
this.pendingFile = files[0];
|
|
67
113
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return ({
|
|
73
|
-
file,
|
|
74
|
-
refBy: (_a = this.project) === null || _a === void 0 ? void 0 : _a.id,
|
|
75
|
-
refType: 'ProjectCompleteReport'
|
|
76
|
-
});
|
|
77
|
-
})
|
|
78
|
-
},
|
|
79
|
-
context: {
|
|
80
|
-
hasUpload: true
|
|
81
|
-
}
|
|
82
|
-
});
|
|
114
|
+
}
|
|
115
|
+
async _uploadFile(file) {
|
|
116
|
+
var _a;
|
|
117
|
+
const response = await updateProjectCompleteStep3(file, this.project.id, (_a = this.project) === null || _a === void 0 ? void 0 : _a.code);
|
|
83
118
|
if (!response.errors) {
|
|
84
|
-
const uploaded = response.data.
|
|
85
|
-
this.
|
|
86
|
-
|
|
119
|
+
const uploaded = response.data.updateKpiMetricValuesSentiment;
|
|
120
|
+
this.attachment = uploaded;
|
|
121
|
+
notify({ message: '저장되었습니다.' });
|
|
122
|
+
// PDF 업로드 후 SL-PA 관련 데이터를 가져와서 표시
|
|
123
|
+
await this._loadSlpaData();
|
|
87
124
|
}
|
|
88
125
|
}
|
|
89
|
-
async
|
|
90
|
-
var _a;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
126
|
+
async _loadSlpaData() {
|
|
127
|
+
var _a, _b;
|
|
128
|
+
// KPI 메트릭들 가져오기
|
|
129
|
+
const kpiMetrics = await getKpiMetrics((_a = this.project) === null || _a === void 0 ? void 0 : _a.code);
|
|
130
|
+
// "SL-PA"가 포함된 메트릭들만 필터링
|
|
131
|
+
const slpaMetrics = kpiMetrics.filter(metric => metric.name.includes('SL-PA'));
|
|
132
|
+
if (slpaMetrics.length > 0) {
|
|
133
|
+
// 해당 프로젝트의 KPI 값들 가져오기
|
|
134
|
+
const kpiMetricValues = await getKpiMetricValues(this.project.id, (_b = this.project) === null || _b === void 0 ? void 0 : _b.code);
|
|
135
|
+
// SL-PA 메트릭들과 해당 값들을 매칭하여 표시용 데이터 생성
|
|
136
|
+
this.slpaData = slpaMetrics.map(metric => {
|
|
137
|
+
const metricValue = kpiMetricValues.find((item) => item.metricId === metric.id);
|
|
138
|
+
return {
|
|
139
|
+
name: metric.name,
|
|
140
|
+
value: (metricValue === null || metricValue === void 0 ? void 0 : metricValue.value) || 0,
|
|
141
|
+
unit: (metricValue === null || metricValue === void 0 ? void 0 : metricValue.unit) || metric.unit || ''
|
|
142
|
+
};
|
|
143
|
+
});
|
|
95
144
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
145
|
+
}
|
|
146
|
+
_reset() {
|
|
147
|
+
this.pendingFile = null;
|
|
148
|
+
this.slpaData = []; // SL-PA 데이터도 초기화
|
|
149
|
+
this._getProjectData();
|
|
150
|
+
}
|
|
151
|
+
async _getProjectData() {
|
|
152
|
+
var _a;
|
|
153
|
+
const project = await getProject(this.project.id);
|
|
154
|
+
this.attachment = project.completeReport;
|
|
155
|
+
// 기존에 PDF가 업로드되어 있다면 SL-PA 데이터도 로드
|
|
156
|
+
if ((_a = this.attachment) === null || _a === void 0 ? void 0 : _a.id) {
|
|
157
|
+
await this._loadSlpaData();
|
|
102
158
|
}
|
|
103
159
|
}
|
|
104
160
|
};
|
|
@@ -136,45 +192,58 @@ SvProjectCompleteTab3Upload.styles = [
|
|
|
136
192
|
}
|
|
137
193
|
|
|
138
194
|
.attachment-list {
|
|
139
|
-
position: relative;
|
|
140
|
-
z-index: 1;
|
|
141
195
|
display: flex;
|
|
142
|
-
min-height: 80px;
|
|
143
196
|
justify-content: center;
|
|
144
|
-
flex-direction: column;
|
|
145
|
-
gap: 8px;
|
|
146
|
-
border: 1px solid #eee;
|
|
147
|
-
border-radius: 8px;
|
|
148
|
-
padding: 12px;
|
|
149
197
|
margin-top: 8px;
|
|
150
198
|
}
|
|
151
199
|
|
|
152
200
|
.attachment-row {
|
|
153
|
-
display:
|
|
154
|
-
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
155
203
|
align-items: center;
|
|
156
|
-
gap:
|
|
157
|
-
padding:
|
|
158
|
-
border:
|
|
159
|
-
border-radius:
|
|
160
|
-
background: #
|
|
204
|
+
gap: 16px;
|
|
205
|
+
padding: 24px 20px;
|
|
206
|
+
border: 2px solid #e3f2fd;
|
|
207
|
+
border-radius: 12px;
|
|
208
|
+
background: linear-gradient(135deg, #f8fbff 0%, #e3f2fd 100%);
|
|
209
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
210
|
+
min-width: 300px;
|
|
211
|
+
max-width: 400px;
|
|
161
212
|
}
|
|
162
213
|
|
|
163
|
-
.
|
|
164
|
-
font-size:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
214
|
+
.file-icon {
|
|
215
|
+
font-size: 40px;
|
|
216
|
+
color: #d32f2f;
|
|
217
|
+
line-height: 1;
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
width: auto;
|
|
222
|
+
height: 48px;
|
|
168
223
|
}
|
|
169
224
|
|
|
170
|
-
.
|
|
225
|
+
.attachment-name {
|
|
226
|
+
font-size: 16px;
|
|
227
|
+
font-weight: 500;
|
|
228
|
+
color: #1976d2;
|
|
171
229
|
text-align: center;
|
|
172
|
-
|
|
173
|
-
|
|
230
|
+
word-break: break-word;
|
|
231
|
+
line-height: 1.4;
|
|
174
232
|
}
|
|
175
233
|
|
|
176
234
|
.delete-icon {
|
|
177
235
|
cursor: pointer;
|
|
236
|
+
color: #757575;
|
|
237
|
+
background: rgba(117, 117, 117, 0.1);
|
|
238
|
+
border-radius: 50%;
|
|
239
|
+
padding: 8px;
|
|
240
|
+
transition: all 0.2s ease;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.delete-icon:hover {
|
|
244
|
+
color: #e57373;
|
|
245
|
+
background: rgba(229, 115, 115, 0.15);
|
|
246
|
+
transform: scale(1.1);
|
|
178
247
|
}
|
|
179
248
|
|
|
180
249
|
.button-line {
|
|
@@ -196,16 +265,69 @@ SvProjectCompleteTab3Upload.styles = [
|
|
|
196
265
|
.ghost-btn.secondary {
|
|
197
266
|
background: #24be7b;
|
|
198
267
|
}
|
|
268
|
+
.ghost-btn.disabled {
|
|
269
|
+
opacity: 0.45;
|
|
270
|
+
cursor: not-allowed;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.slpa-results {
|
|
274
|
+
margin-top: 20px;
|
|
275
|
+
padding: 16px;
|
|
276
|
+
border: 1px solid #e0e0e0;
|
|
277
|
+
border-radius: 8px;
|
|
278
|
+
background: #f8f9fa;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.slpa-title {
|
|
282
|
+
font-size: 16px;
|
|
283
|
+
font-weight: 600;
|
|
284
|
+
color: #35618e;
|
|
285
|
+
margin-bottom: 12px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.slpa-item {
|
|
289
|
+
display: flex;
|
|
290
|
+
justify-content: space-between;
|
|
291
|
+
align-items: center;
|
|
292
|
+
padding: 8px 0;
|
|
293
|
+
border-bottom: 1px solid #e0e0e0;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.slpa-item:last-child {
|
|
297
|
+
border-bottom: none;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.slpa-label {
|
|
301
|
+
font-weight: 500;
|
|
302
|
+
color: #333;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.slpa-value {
|
|
306
|
+
font-weight: 600;
|
|
307
|
+
color: #1976d2;
|
|
308
|
+
}
|
|
199
309
|
`
|
|
200
310
|
];
|
|
201
|
-
__decorate([
|
|
202
|
-
property({ type: Array }),
|
|
203
|
-
__metadata("design:type", Object)
|
|
204
|
-
], SvProjectCompleteTab3Upload.prototype, "data", void 0);
|
|
205
311
|
__decorate([
|
|
206
312
|
property({ type: Object }),
|
|
207
313
|
__metadata("design:type", Object)
|
|
208
314
|
], SvProjectCompleteTab3Upload.prototype, "project", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
state(),
|
|
317
|
+
__metadata("design:type", Object)
|
|
318
|
+
], SvProjectCompleteTab3Upload.prototype, "attachment", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
state(),
|
|
321
|
+
__metadata("design:type", Object)
|
|
322
|
+
], SvProjectCompleteTab3Upload.prototype, "pendingFile", void 0);
|
|
323
|
+
__decorate([
|
|
324
|
+
state(),
|
|
325
|
+
__metadata("design:type", Array)
|
|
326
|
+
], SvProjectCompleteTab3Upload.prototype, "slpaData", void 0);
|
|
327
|
+
__decorate([
|
|
328
|
+
state(),
|
|
329
|
+
__metadata("design:type", Object)
|
|
330
|
+
], SvProjectCompleteTab3Upload.prototype, "canSave", void 0);
|
|
209
331
|
SvProjectCompleteTab3Upload = __decorate([
|
|
210
332
|
customElement('sv-pc-tab3-upload')
|
|
211
333
|
], SvProjectCompleteTab3Upload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pc-tab3-upload.js","sourceRoot":"","sources":["../../../client/pages/project-complete-tabs/pc-tab3-upload.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAG7B,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,UAAU;IAApD;;QAkGsB,SAAI,GAAQ,EAAE,CAAA;QACb,YAAO,GAAQ,EAAE,CAAA;IAkG/C,CAAC;IAhGC,MAAM;;QACJ,OAAO,IAAI,CAAA;;;;;;;;;;;;+EAYgE,IAAI,CAAC,aAAa;;;;;YAKrF,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAA;YAClB,CAAC,CAAC,IAAI,CAAA,+CAA+C;YACrD,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAE,GAAG,CACZ,IAAI,CAAC,EAAE,CACL,IAAI,CAAA;0DACoC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;0DACvB,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;yBACtE,CACV;;;;2CAI4B,IAAI,CAAC,MAAM;oDACF,GAAG,EAAE,CAAC,IAAI,CAAC,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A2B;IADvC,aAAa,CAAC,mBAAmB,CAAC;GACtB,2BAA2B,CAqMvC","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'\n\n@customElement('sv-pc-tab3-upload')\nexport class SvProjectCompleteTab3Upload 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 }\n\n .rows {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 8px 6px;\n }\n\n .upload-controls {\n display: flex;\n gap: 8px;\n justify-content: center;\n margin-bottom: 16px;\n\n ox-input-file {\n flex: 1;\n max-width: 500px;\n height: 210px;\n }\n }\n\n .attachment-list {\n position: relative;\n z-index: 1;\n display: flex;\n min-height: 80px;\n justify-content: center;\n flex-direction: column;\n gap: 8px;\n border: 1px solid #eee;\n border-radius: 8px;\n padding: 12px;\n margin-top: 8px;\n }\n\n .attachment-row {\n display: grid;\n grid-template-columns: 1fr auto;\n align-items: center;\n gap: 8px;\n padding: 8px 10px;\n border: 1px solid #ddd;\n border-radius: 6px;\n background: #fafafa;\n }\n\n .attachment-name {\n font-size: 14px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n .empty-state {\n text-align: center;\n color: #666;\n font-style: italic;\n }\n\n .delete-icon {\n cursor: pointer;\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 ]\n\n @property({ type: Array }) data: any = []\n @property({ type: Object }) project: any = {}\n\n render() {\n return html`\n <div class=\"title\">\n <div>\n 감리 최종 감리보고서의 종합의견서(PDF 형식)를 시스템에 업로드해 주세요.\n <br />\n 보고서에 포함된 텍스트와 평가 내용을 기반으로 기계 판독 및 AI 기반 프로젝트 평가가 자동으로 진행되므로, 반드시 최종\n 확정된 원본 파일을 제출해 주시기 바랍니다.\n </div>\n </div>\n\n <div class=\"rows\">\n <div class=\"upload-controls\">\n <ox-input-file accept=\"application/pdf,.pdf\" hide-filelist @change=${this._onFileSelect} multiple=\"true\">\n </ox-input-file>\n </div>\n\n <div class=\"attachment-list\">\n ${!this.data?.length\n ? html`<div class=\"empty-state\">업로드된 파일이 없습니다.</div>`\n : this.data?.map(\n file =>\n html`<div class=\"attachment-row\">\n <div class=\"attachment-name\" title=\"${file.name}\">${file.name}</div>\n <md-icon class=\"delete-icon\" @click=${() => this._deleteAttachment(file.id)}>delete</md-icon>\n </div>`\n )}\n </div>\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 </div>\n `\n }\n\n private _save() {\n this.dispatchEvent(new CustomEvent('complete-tab-save', { detail: { data: this.data } }))\n }\n\n private async _reset() {\n await this.data?.forEach(attachment => this._deleteAttachment(attachment.id))\n this.dispatchEvent(new CustomEvent('complete-tab-reset', { detail: { tab: 3 } }))\n }\n\n private async _onFileSelect(e: CustomEvent) {\n const files = e.detail as File[]\n await this._uploadFiles(files)\n }\n\n private async _uploadFiles(files: File[]) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n name\n fullpath\n }\n }\n `,\n variables: {\n attachments: files.map(file => ({\n file,\n refBy: this.project?.id,\n refType: 'ProjectCompleteReport'\n }))\n },\n context: {\n hasUpload: true\n }\n })\n\n if (!response.errors) {\n const uploaded = response.data.createAttachments\n this.data = [...this.data, ...uploaded]\n this.dispatchEvent(new CustomEvent('complete-data-change', { detail: { tab: 3, data: this.data } }))\n }\n }\n\n private async _deleteAttachment(attachmentId: string) {\n const response = await client.mutate({\n mutation: gql`\n mutation DeleteAttachment($deleteAttachmentId: String!) {\n deleteAttachment(id: $deleteAttachmentId)\n }\n `,\n variables: { deleteAttachmentId: attachmentId }\n })\n\n if (!response.errors) {\n this.data = this.data?.filter(a => a.id !== attachmentId) || []\n this.dispatchEvent(new CustomEvent('complete-data-change', { detail: { tab: 3, data: this.data } }))\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pc-tab3-upload.js","sourceRoot":"","sources":["../../../client/pages/project-complete-tabs/pc-tab3-upload.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;AAGlE,OAAO,EAAE,UAAU,EAAE,0BAA0B,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACrH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAG7D,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,UAAU;IAApD;;QAwJuB,YAAO,GAAQ,EAAE,CAAA;QACpC,eAAU,GAAQ,EAAE,CAAA;QACZ,gBAAW,GAAgB,IAAI,CAAA;QACvC,aAAQ,GAAU,EAAE,CAAA;QAC7B,yCAAyC;QAChC,YAAO,GAAG,KAAK,CAAA;IA2J1B,CAAC;IAzJC,KAAK,CAAC,iBAAiB;QACrB,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,YAAY,CAAC;YAChC,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,WAAW;YACtB,kBAAkB,EAAE,IAAI;YACxB,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAA;IACJ,CAAC;IAED,MAAM;;QACJ,OAAO,IAAI,CAAA;;;;;;;;;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iBAAiB;QACpC,IAAI,CAAC,eAAe,EAAE,CAAA;IACxB,CAAC;IAEO,KAAK,CAAC,eAAe;;QAC3B,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACjD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,cAAc,CAAA;QAExC,mCAAmC;QACnC,IAAI,MAAA,IAAI,CAAC,UAAU,0CAAE,EAAE,EAAE,CAAC;YACxB,MAAM,IAAI,CAAC,aAAa,EAAE,CAAA;QAC5B,CAAC;IACH,CAAC;;AAtTM,kCAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmJF;CACF,AArJY,CAqJZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DAAkB;AACpC;IAAR,KAAK,EAAE;;+DAAqB;AACZ;IAAhB,KAAK,EAAE;;gEAAwC;AACvC;IAAR,KAAK,EAAE;;6DAAqB;AAEpB;IAAR,KAAK,EAAE;;4DAAgB;AA7Jb,2BAA2B;IADvC,aAAa,CAAC,mBAAmB,CAAC;GACtB,2BAA2B,CAwTvC","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 { getProject, updateProjectCompleteStep3, getKpiMetrics, getKpiMetricValues } from '../../shared/complete-api'\nimport { notify } from '@operato/layout'\nimport { hasPrivilege } from '@things-factory/auth-base/dist-client'\n\n@customElement('sv-pc-tab3-upload')\nexport class SvProjectCompleteTab3Upload 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 }\n\n .rows {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 8px 6px;\n }\n\n .upload-controls {\n display: flex;\n gap: 8px;\n justify-content: center;\n margin-bottom: 16px;\n\n ox-input-file {\n flex: 1;\n max-width: 500px;\n height: 210px;\n }\n }\n\n .attachment-list {\n display: flex;\n justify-content: center;\n margin-top: 8px;\n }\n\n .attachment-row {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n padding: 24px 20px;\n border: 2px solid #e3f2fd;\n border-radius: 12px;\n background: linear-gradient(135deg, #f8fbff 0%, #e3f2fd 100%);\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n min-width: 300px;\n max-width: 400px;\n }\n\n .file-icon {\n font-size: 40px;\n color: #d32f2f;\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: auto;\n height: 48px;\n }\n\n .attachment-name {\n font-size: 16px;\n font-weight: 500;\n color: #1976d2;\n text-align: center;\n word-break: break-word;\n line-height: 1.4;\n }\n\n .delete-icon {\n cursor: pointer;\n color: #757575;\n background: rgba(117, 117, 117, 0.1);\n border-radius: 50%;\n padding: 8px;\n transition: all 0.2s ease;\n }\n\n .delete-icon:hover {\n color: #e57373;\n background: rgba(229, 115, 115, 0.15);\n transform: scale(1.1);\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 .ghost-btn.disabled {\n opacity: 0.45;\n cursor: not-allowed;\n }\n\n .slpa-results {\n margin-top: 20px;\n padding: 16px;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n background: #f8f9fa;\n }\n\n .slpa-title {\n font-size: 16px;\n font-weight: 600;\n color: #35618e;\n margin-bottom: 12px;\n }\n\n .slpa-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 0;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .slpa-item:last-child {\n border-bottom: none;\n }\n\n .slpa-label {\n font-weight: 500;\n color: #333;\n }\n\n .slpa-value {\n font-weight: 600;\n color: #1976d2;\n }\n `\n ]\n\n @property({ type: Object }) project: any = {}\n @state() attachment: any = {}\n @state() private pendingFile: File | null = null\n @state() slpaData: any[] = []\n /** kpi:sentiment — Step3 보고서 첨부/저장 권한 */\n @state() canSave = false\n\n async connectedCallback() {\n super.connectedCallback()\n this.canSave = await hasPrivilege({\n category: 'kpi',\n privilege: 'sentiment',\n domainOwnerGranted: true,\n superUserGranted: true\n })\n }\n\n render() {\n return html`\n <div class=\"title\">\n <div>\n 감리 최종 감리보고서의 종합의견서(PDF 형식)를 시스템에 업로드해 주세요.\n <br />\n 보고서에 포함된 텍스트와 평가 내용을 기반으로 기계 판독 및 AI 기반 프로젝트 평가가 자동으로 진행되므로, 반드시 최종\n 확정된 원본 파일을 제출해 주시기 바랍니다.\n </div>\n </div>\n\n <div class=\"rows\">\n ${this._getCurrentFile()\n ? html`\n <div class=\"attachment-list\">\n <div class=\"attachment-row\">\n <md-icon class=\"file-icon\">picture_as_pdf</md-icon>\n <div class=\"attachment-name\" title=\"${this._getCurrentFile()?.name}\">${this._getCurrentFile()?.name}</div>\n <md-icon class=\"delete-icon\" @click=${this._removeFile}>delete</md-icon>\n </div>\n </div>\n `\n : html`\n <div class=\"upload-controls\">\n <ox-input-file accept=\"application/pdf,.pdf\" hide-filelist @change=${this._onFileSelect}> </ox-input-file>\n </div>\n `}\n ${this.slpaData.length > 0\n ? html`\n <div class=\"slpa-results\">\n <div class=\"slpa-title\">AI 분석 결과 (SL-PA 관련 항목)</div>\n ${this.slpaData.map(\n item => html`\n <div class=\"slpa-item\">\n <div class=\"slpa-label\">${item.name}</div>\n <div class=\"slpa-value\">${item.value.toFixed(2)} ${item.unit || ''}</div>\n </div>\n `\n )}\n </div>\n `\n : ''}\n\n <div class=\"button-line\">\n <div class=\"ghost-btn \" @click=${this._reset}>초기화</div>\n <div\n class=\"ghost-btn secondary ${this.canSave ? '' : 'disabled'}\"\n title=${this.canSave ? '' : 'kpi:sentiment 권한 필요'}\n @click=${() => this.canSave && this._save()}\n >\n 저장\n </div>\n </div>\n </div>\n `\n }\n\n willUpdate(changedProperties: Map<string, any>) {\n super.willUpdate(changedProperties)\n\n // project가 변경되고, project.id가 존재하면 데이터 로드\n if (changedProperties.has('project') && this.project?.id) {\n this._getProjectData()\n }\n }\n\n private _getCurrentFile() {\n return this.pendingFile || (this.attachment?.id ? this.attachment : null)\n }\n\n private async _save() {\n // 대기 중인 파일이 있으면 업로드\n if (this.pendingFile) {\n await this._uploadFile(this.pendingFile)\n this.pendingFile = null\n } else if (!this.pendingFile && !this.attachment?.id) {\n notify({ message: '파일은 필수입니다.' })\n }\n }\n\n private _removeFile() {\n this.pendingFile = null\n this.attachment = {}\n this.slpaData = [] // SL-PA 데이터도 초기화\n }\n\n private async _onFileSelect(e: CustomEvent) {\n const files = e.detail as File[]\n if (files.length > 0) {\n this.pendingFile = files[0]\n }\n }\n\n private async _uploadFile(file: File | null) {\n const response = await updateProjectCompleteStep3(file, this.project.id, this.project?.code)\n if (!response.errors) {\n const uploaded = response.data.updateKpiMetricValuesSentiment\n this.attachment = uploaded\n notify({ message: '저장되었습니다.' })\n\n // PDF 업로드 후 SL-PA 관련 데이터를 가져와서 표시\n await this._loadSlpaData()\n }\n }\n\n private async _loadSlpaData() {\n // KPI 메트릭들 가져오기\n const kpiMetrics = await getKpiMetrics(this.project?.code)\n\n // \"SL-PA\"가 포함된 메트릭들만 필터링\n const slpaMetrics = kpiMetrics.filter(metric => metric.name.includes('SL-PA'))\n\n if (slpaMetrics.length > 0) {\n // 해당 프로젝트의 KPI 값들 가져오기\n const kpiMetricValues = await getKpiMetricValues(this.project.id, this.project?.code)\n\n // SL-PA 메트릭들과 해당 값들을 매칭하여 표시용 데이터 생성\n this.slpaData = slpaMetrics.map(metric => {\n const metricValue = kpiMetricValues.find((item: any) => item.metricId === metric.id)\n return {\n name: metric.name,\n value: metricValue?.value || 0,\n unit: metricValue?.unit || metric.unit || ''\n }\n })\n }\n }\n\n private _reset() {\n this.pendingFile = null\n this.slpaData = [] // SL-PA 데이터도 초기화\n this._getProjectData()\n }\n\n private async _getProjectData() {\n const project = await getProject(this.project.id)\n this.attachment = project.completeReport\n\n // 기존에 PDF가 업로드되어 있다면 SL-PA 데이터도 로드\n if (this.attachment?.id) {\n await this._loadSlpaData()\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@things-factory/kpi/dist-client/viewparts/kpi-metric-input';
|
|
3
|
+
export declare class SvProjectCompleteTab4Monthly extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
project: any;
|
|
6
|
+
/** 월별 metric 목록 (periodType=MONTH). KpiMetric admin 에 등록된 것 기준. */
|
|
7
|
+
monthlyMetrics: any[];
|
|
8
|
+
/** monthRows: { workDate:'YYYY-MM', values:{[metricId]:value}, originalValues, dirty }[] */
|
|
9
|
+
monthRows: any[];
|
|
10
|
+
addYear: number;
|
|
11
|
+
addMonth: number;
|
|
12
|
+
/** kpi:input — Step4 월별 데이터 저장 권한 (cumulative 와 같은 권한) */
|
|
13
|
+
canSave: boolean;
|
|
14
|
+
connectedCallback(): Promise<void>;
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
willUpdate(changedProperties: Map<string, any>): void;
|
|
17
|
+
private _getYearRange;
|
|
18
|
+
private _isCurrentMonth;
|
|
19
|
+
/**
|
|
20
|
+
* 월별 metric 정의 + 그 프로젝트의 월별 KpiMetricValue 들을 조회해 그리드 row 구성.
|
|
21
|
+
*
|
|
22
|
+
* 1) KpiMetric where periodType=MONTH → monthlyMetrics
|
|
23
|
+
* 2) KpiMetricValue where org=projectId → 월별로 그룹핑하여 monthRows
|
|
24
|
+
*/
|
|
25
|
+
private _loadData;
|
|
26
|
+
/** project.startDate (YYYY-MM) ~ **전월** (YYYY-MM) 까지 매월 문자열 배열.
|
|
27
|
+
* 현재월은 의도적으로 제외 — 운영 원칙상 "이번달 데이터는 아직 입력 대상이 아님". */
|
|
28
|
+
private _generateExpectedMonths;
|
|
29
|
+
/** 셀 미입력 여부 — 값 없음 AND 그 월이 **전월** (직전 한 달) 인 경우만 pending.
|
|
30
|
+
* 과월 전체가 아니라 전월 한 달에 한해서만 강조 — 사용자 입력 흐름(이번 달에 지난달 데이터)과 일치. */
|
|
31
|
+
private _isCellPending;
|
|
32
|
+
/** metric 컬럼이 전 row 통틀어 한 번도 값이 없으면 헤더 강조. */
|
|
33
|
+
private _isMetricNeverEntered;
|
|
34
|
+
/** 종료(COMPLETED) 프로젝트 — 신규 월 추가 금지, 기존 월만 수정 가능. */
|
|
35
|
+
private get isCompleted();
|
|
36
|
+
private _addMonth;
|
|
37
|
+
private _removeMonth;
|
|
38
|
+
/**
|
|
39
|
+
* metric 입력 힌트 결정: DB 선언(meta.input) 우선. 없으면 전환용 파생(DB meta 미도입 동안).
|
|
40
|
+
* 향후 metric.meta.input 이 채워지면 이 파생 분기(및 isRating)는 제거한다.
|
|
41
|
+
*/
|
|
42
|
+
private _withInputHint;
|
|
43
|
+
/** <kpi-metric-input> 이 방출하는 (이미 타입된) 값을 그대로 저장. */
|
|
44
|
+
private _setCell;
|
|
45
|
+
/**
|
|
46
|
+
* 저장 — dirty row 들 안의 변경된 cell 들을 KpiMetricValuePatch 로 모아
|
|
47
|
+
* updateKpiMetricValuesCumulative 한 번 호출 (backend upsert 가 unique 조합 처리).
|
|
48
|
+
*/
|
|
49
|
+
private _save;
|
|
50
|
+
private _reset;
|
|
51
|
+
}
|