@dssp/supervision 1.0.0-alpha.5 → 1.0.0-alpha.50
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/dist-client/graphql/building-inspection.d.ts +1 -0
- package/dist-client/graphql/building-inspection.js +100 -0
- package/dist-client/graphql/building-inspection.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-defect.d.ts +22 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-defect.js +169 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-defect.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.d.ts +57 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.js +825 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.d.ts +8 -6
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js +115 -65
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +9 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +130 -72
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +77 -14
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-list.d.ts +18 -2
- package/dist-client/pages/building-inspection/building-inspection-list.js +360 -28
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.d.ts +3 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +104 -17
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/pages/building-inspection/component/daily-worklog-popup.d.ts +27 -0
- package/dist-client/pages/building-inspection/component/daily-worklog-popup.js +542 -0
- package/dist-client/pages/building-inspection/component/daily-worklog-popup.js.map +1 -0
- package/dist-client/pages/building-inspection/component/image-preview-popup.d.ts +15 -0
- package/dist-client/pages/building-inspection/component/image-preview-popup.js +351 -0
- package/dist-client/pages/building-inspection/component/image-preview-popup.js.map +1 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.d.ts +20 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js +432 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js.map +1 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.d.ts +30 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js +479 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js.map +1 -0
- package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.d.ts +27 -0
- package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js +416 -0
- package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js.map +1 -0
- package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +2 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js +39 -17
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
- package/dist-client/pages/building-inspection/inspection-create-popup.js +22 -9
- package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +20 -0
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +433 -57
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -1
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +131 -17
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -1
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.d.ts +19 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.js +205 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +15 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js +430 -0
- package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js.map +1 -0
- package/dist-client/pages/checklist/attachment-list-popup.d.ts +1 -0
- package/dist-client/pages/checklist/attachment-list-popup.js +250 -67
- package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.d.ts +5 -0
- package/dist-client/pages/checklist/checklist-view.js +99 -29
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/pages/checklist/comment-list-popup.js +14 -3
- package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/file-preview-popup.js +0 -1
- package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
- package/dist-client/pages/checklist/inspection-info-popup.d.ts +50 -0
- package/dist-client/pages/checklist/inspection-info-popup.js +684 -0
- package/dist-client/pages/checklist/inspection-info-popup.js.map +1 -0
- package/dist-client/pages/checklist/inspection-tab-popup.d.ts +18 -0
- package/dist-client/pages/checklist/inspection-tab-popup.js +196 -0
- package/dist-client/pages/checklist/inspection-tab-popup.js.map +1 -0
- package/dist-client/pages/checklist-template/checklist-template-item.js +14 -3
- package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
- package/dist-client/pages/checklist-template/checklist-template-list.js +1 -1
- package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +6 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +3 -3
- package/dist-server/service/building-inspection/building-inspection-mutation.js +128 -32
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-query.d.ts +3 -5
- package/dist-server/service/building-inspection/building-inspection-query.js +16 -29
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +23 -7
- package/dist-server/service/building-inspection/building-inspection-type.js +80 -13
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection.d.ts +4 -0
- package/dist-server/service/building-inspection/building-inspection.js +17 -2
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
- package/dist-server/service/building-inspection/index.d.ts +3 -4
- package/dist-server/service/building-inspection/index.js +10 -3
- package/dist-server/service/building-inspection/index.js.map +1 -1
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.d.ts +6 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js +56 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js.map +1 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.d.ts +16 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js +171 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js.map +1 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.d.ts +23 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js +90 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js.map +1 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.d.ts +33 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js +132 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js.map +1 -0
- package/dist-server/service/building-inspection-daily-worklog/index.d.ts +5 -0
- package/dist-server/service/building-inspection-daily-worklog/index.js +9 -0
- package/dist-server/service/building-inspection-daily-worklog/index.js.map +1 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-query.d.ts +16 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-query.js +120 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-query.js.map +1 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-type.d.ts +5 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-type.js +21 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-type.js.map +1 -0
- package/dist-server/service/building-inspection-history/building-inspection-history.d.ts +34 -0
- package/dist-server/service/building-inspection-history/building-inspection-history.js +157 -0
- package/dist-server/service/building-inspection-history/building-inspection-history.js.map +1 -0
- package/dist-server/service/building-inspection-history/event-subscriber.d.ts +7 -0
- package/dist-server/service/building-inspection-history/event-subscriber.js +21 -0
- package/dist-server/service/building-inspection-history/event-subscriber.js.map +1 -0
- package/dist-server/service/building-inspection-history/index.d.ts +6 -0
- package/dist-server/service/building-inspection-history/index.js +10 -0
- package/dist-server/service/building-inspection-history/index.js.map +1 -0
- package/dist-server/service/checklist/checklist-mutation.d.ts +0 -5
- package/dist-server/service/checklist/checklist-mutation.js +1 -67
- package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
- package/dist-server/service/checklist/checklist-query.d.ts +7 -0
- package/dist-server/service/checklist/checklist-query.js +83 -0
- package/dist-server/service/checklist/checklist-query.js.map +1 -1
- package/dist-server/service/checklist/checklist-type.d.ts +0 -13
- package/dist-server/service/checklist/checklist-type.js +1 -49
- package/dist-server/service/checklist/checklist-type.js.map +1 -1
- package/dist-server/service/checklist/checklist.d.ts +28 -3
- package/dist-server/service/checklist/checklist.js +89 -15
- package/dist-server/service/checklist/checklist.js.map +1 -1
- package/dist-server/service/checklist/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist/event-subscriber.js +21 -0
- package/dist-server/service/checklist/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist/index.d.ts +1 -2
- package/dist-server/service/checklist/index.js +1 -2
- package/dist-server/service/checklist/index.js.map +1 -1
- package/dist-server/service/checklist-history/checklist-history-query.d.ts +11 -0
- package/dist-server/service/checklist-history/checklist-history-query.js +77 -0
- package/dist-server/service/checklist-history/checklist-history-query.js.map +1 -0
- package/dist-server/service/checklist-history/checklist-history-type.d.ts +5 -0
- package/dist-server/service/checklist-history/checklist-history-type.js +21 -0
- package/dist-server/service/checklist-history/checklist-history-type.js.map +1 -0
- package/dist-server/service/{checklist → checklist-history}/checklist-history.d.ts +19 -1
- package/dist-server/service/{checklist → checklist-history}/checklist-history.js +97 -14
- package/dist-server/service/checklist-history/checklist-history.js.map +1 -0
- package/dist-server/service/checklist-history/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist-history/event-subscriber.js +21 -0
- package/dist-server/service/checklist-history/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist-history/index.d.ts +6 -0
- package/dist-server/service/checklist-history/index.js +10 -0
- package/dist-server/service/checklist-history/index.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item-query.d.ts +1 -1
- package/dist-server/service/checklist-item/checklist-item-query.js +5 -3
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
- package/dist-server/service/checklist-item/index.d.ts +0 -1
- package/dist-server/service/checklist-item/index.js +1 -2
- package/dist-server/service/checklist-item/index.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.d.ts +1 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +33 -6
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
- package/dist-server/service/checklist-item-history/checklist-item-history-query.d.ts +16 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-query.js +123 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-query.js.map +1 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-type.d.ts +5 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-type.js +21 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-type.js.map +1 -0
- package/dist-server/service/checklist-item-history/checklist-item-history.d.ts +25 -0
- package/dist-server/service/checklist-item-history/checklist-item-history.js +123 -0
- package/dist-server/service/checklist-item-history/checklist-item-history.js.map +1 -0
- package/dist-server/service/checklist-item-history/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist-item-history/event-subscriber.js +21 -0
- package/dist-server/service/checklist-item-history/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist-item-history/index.d.ts +6 -0
- package/dist-server/service/checklist-item-history/index.js +10 -0
- package/dist-server/service/checklist-item-history/index.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +4 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-type.d.ts +2 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js +5 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item.d.ts +6 -0
- package/dist-server/service/checklist-template-item/checklist-template-item.js +16 -1
- package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
- package/dist-server/service/checklist-template-item/spec-matching-service.d.ts +2 -0
- package/dist-server/service/checklist-template-item/spec-matching-service.js +50 -0
- package/dist-server/service/checklist-template-item/spec-matching-service.js.map +1 -0
- package/dist-server/service/index.d.ts +4 -1
- package/dist-server/service/index.js +22 -3
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/project-report/project-report.d.ts +0 -2
- package/dist-server/service/project-report/project-report.js +0 -6
- package/dist-server/service/project-report/project-report.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/things-factory.config.js +2 -0
- package/dist-server/service/building-inspection/building-inspection-history.d.ts +0 -17
- package/dist-server/service/building-inspection/building-inspection-history.js +0 -86
- package/dist-server/service/building-inspection/building-inspection-history.js.map +0 -1
- package/dist-server/service/checklist/checklist-history.js.map +0 -1
|
@@ -3,7 +3,7 @@ import '@material/web/icon/icon.js';
|
|
|
3
3
|
import gql from 'graphql-tag';
|
|
4
4
|
import { client } from '@operato/graphql';
|
|
5
5
|
import { css, html, LitElement } from 'lit';
|
|
6
|
-
import { customElement, property,
|
|
6
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
7
|
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
|
8
8
|
import { notify } from '@operato/layout';
|
|
9
9
|
import { store, User } from '@operato/shell';
|
|
@@ -11,12 +11,15 @@ import { connect } from 'pwa-helpers/connect-mixin.js';
|
|
|
11
11
|
import { OxPrompt } from '@operato/popup/ox-prompt.js';
|
|
12
12
|
import { openPopup } from '@operato/layout';
|
|
13
13
|
import './file-preview-popup';
|
|
14
|
+
import '../building-inspection/component/image-preview-popup';
|
|
14
15
|
import { BuildingInspectionStatus } from '../building-inspection/building-inspection-list';
|
|
16
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
15
17
|
let AttachmentListPopup = class AttachmentListPopup extends connect(store)(LitElement) {
|
|
16
18
|
constructor() {
|
|
17
19
|
super(...arguments);
|
|
18
20
|
this.checklistItemId = '';
|
|
19
21
|
this.status = BuildingInspectionStatus.WAIT;
|
|
22
|
+
this.mode = "VIEWER" /* ChecklistMode.VIEWER */;
|
|
20
23
|
this.item = { count: 0 };
|
|
21
24
|
this.checklistItemAttachments = [];
|
|
22
25
|
this.checklistItemAttachmentCount = 0;
|
|
@@ -24,36 +27,79 @@ let AttachmentListPopup = class AttachmentListPopup extends connect(store)(LitEl
|
|
|
24
27
|
}
|
|
25
28
|
render() {
|
|
26
29
|
return html `
|
|
27
|
-
<
|
|
28
|
-
<h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>
|
|
30
|
+
<h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
<div body>
|
|
33
|
+
<div file-list-container>
|
|
34
|
+
${this.checklistItemAttachments.length > 0
|
|
35
|
+
? this.checklistItemAttachments.map(attachment => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
return html `
|
|
38
|
+
<div file-item @click=${() => this._onClickPreview(attachment.fullpath)}>
|
|
39
|
+
<div file-info>
|
|
40
|
+
<div file-icon>
|
|
41
|
+
<md-icon>description</md-icon>
|
|
42
|
+
</div>
|
|
43
|
+
<div file-details>
|
|
44
|
+
<span file-name>${attachment.name || ''}</span>
|
|
45
|
+
<div file-meta>
|
|
46
|
+
<span file-creator>
|
|
47
|
+
<md-icon style="--md-icon-size: 12px;">account_circle</md-icon>
|
|
48
|
+
${((_a = attachment.creator) === null || _a === void 0 ? void 0 : _a.name) || ''}
|
|
49
|
+
</span>
|
|
50
|
+
<span file-date>
|
|
51
|
+
<md-icon style="--md-icon-size: 12px;">schedule</md-icon>
|
|
52
|
+
${this._formatDate(attachment.createdAt)}
|
|
53
|
+
</span>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div action-buttons>
|
|
58
|
+
<md-icon
|
|
59
|
+
title="미리보기"
|
|
60
|
+
@click=${(e) => {
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
this._onClickPreview(attachment.fullpath);
|
|
63
|
+
}}
|
|
64
|
+
>visibility</md-icon
|
|
65
|
+
>
|
|
66
|
+
<a
|
|
67
|
+
href=${ifDefined(attachment.fullpath)}
|
|
68
|
+
download=${ifDefined(attachment.name)}
|
|
69
|
+
@click=${(e) => e.stopPropagation()}
|
|
70
|
+
>
|
|
71
|
+
<md-icon title="다운로드" style="color: #2196f3;">download</md-icon>
|
|
72
|
+
</a>
|
|
73
|
+
${((_b = attachment.creator) === null || _b === void 0 ? void 0 : _b.email) === this.user.email &&
|
|
74
|
+
this.status != BuildingInspectionStatus.PASS &&
|
|
75
|
+
this.mode == "EDITOR" /* ChecklistMode.EDITOR */
|
|
76
|
+
? html `<md-icon
|
|
77
|
+
delete
|
|
78
|
+
title="삭제"
|
|
79
|
+
@click=${(e) => {
|
|
80
|
+
e.stopPropagation();
|
|
81
|
+
this._deleteAttachment(attachment.id);
|
|
82
|
+
}}
|
|
83
|
+
>delete</md-icon
|
|
84
|
+
>`
|
|
85
|
+
: ''}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
`;
|
|
89
|
+
})
|
|
90
|
+
: html `
|
|
91
|
+
<div empty-state>
|
|
92
|
+
<md-icon>insert_drive_file</md-icon>
|
|
93
|
+
<div>첨부된 파일이 없습니다.</div>
|
|
45
94
|
</div>
|
|
46
|
-
|
|
47
|
-
</div>
|
|
48
|
-
`;
|
|
49
|
-
})}
|
|
95
|
+
`}
|
|
50
96
|
</div>
|
|
51
97
|
|
|
52
98
|
<ox-input-file
|
|
53
99
|
accept="*/*"
|
|
54
100
|
multiple="true"
|
|
55
101
|
hide-filelist
|
|
56
|
-
?disabled=${this.status == BuildingInspectionStatus.PASS}
|
|
102
|
+
?disabled=${this.status == BuildingInspectionStatus.PASS || this.mode == "VIEWER" /* ChecklistMode.VIEWER */}
|
|
57
103
|
@change=${this.onCreateAttachment.bind(this)}
|
|
58
104
|
></ox-input-file>
|
|
59
105
|
|
|
@@ -163,7 +209,7 @@ let AttachmentListPopup = class AttachmentListPopup extends connect(store)(LitEl
|
|
|
163
209
|
`,
|
|
164
210
|
variables: {
|
|
165
211
|
attachments: files.map(file => {
|
|
166
|
-
return { file, refBy: checklistItemId, refType: 'ChecklistItem' };
|
|
212
|
+
return { file, refBy: checklistItemId, refType: 'ChecklistItem', description: this.status };
|
|
167
213
|
})
|
|
168
214
|
},
|
|
169
215
|
context: {
|
|
@@ -181,14 +227,63 @@ let AttachmentListPopup = class AttachmentListPopup extends connect(store)(LitEl
|
|
|
181
227
|
const day = String(_date.getDate()).padStart(2, '0');
|
|
182
228
|
const hours = String(_date.getHours()).padStart(2, '0');
|
|
183
229
|
const minutes = String(_date.getMinutes()).padStart(2, '0');
|
|
184
|
-
|
|
185
|
-
return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`;
|
|
230
|
+
return `${year}.${month}.${day} ${hours}:${minutes}`;
|
|
186
231
|
}
|
|
187
232
|
// 첨부 자료 변경 이벤트 디스패치
|
|
188
233
|
_dispatchEvent() {
|
|
189
234
|
this.dispatchEvent(new CustomEvent('change-attachment', { detail: { checklistItemId: this.checklistItemId } }));
|
|
190
235
|
}
|
|
191
236
|
_onClickPreview(filepath) {
|
|
237
|
+
if (!filepath) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
// 파일 확장자로 타입 판단
|
|
241
|
+
const fileExtension = filepath.toLowerCase().split('.').pop();
|
|
242
|
+
const isImage = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(fileExtension || '');
|
|
243
|
+
const isPdf = fileExtension === 'pdf';
|
|
244
|
+
if (isImage) {
|
|
245
|
+
this._openImagePreview(filepath);
|
|
246
|
+
}
|
|
247
|
+
else if (isPdf) {
|
|
248
|
+
this._openPdfPreview(filepath);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
// 기타 파일은 기존 file-preview-popup 사용
|
|
252
|
+
this._openGenericPreview(filepath);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
_openImagePreview(filepath) {
|
|
256
|
+
const imageData = this.checklistItemAttachments.filter(attachment => {
|
|
257
|
+
var _a;
|
|
258
|
+
const fileExtension = (_a = attachment.fullpath) === null || _a === void 0 ? void 0 : _a.toLowerCase().split('.').pop();
|
|
259
|
+
return ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(fileExtension || '');
|
|
260
|
+
});
|
|
261
|
+
const currentIndex = imageData.findIndex(attachment => attachment.fullpath === filepath);
|
|
262
|
+
openPopup(html ` <image-preview-popup .images=${imageData} .currentIndex=${Math.max(0, currentIndex)}></image-preview-popup> `, { backdrop: true, size: 'large', title: '이미지 미리보기' });
|
|
263
|
+
}
|
|
264
|
+
_openPdfPreview(filepath) {
|
|
265
|
+
openPopup(html `
|
|
266
|
+
<div style="display: flex; flex-direction: column;">
|
|
267
|
+
<div style="flex: 1; overflow: hidden; touch-action: pan-x pan-y;">
|
|
268
|
+
<iframe
|
|
269
|
+
src="${filepath}#toolbar=1&navpanes=0&scrollbar=1&zoom=page-fit"
|
|
270
|
+
style="
|
|
271
|
+
width: 100%;
|
|
272
|
+
height: 100%;
|
|
273
|
+
border: none;
|
|
274
|
+
touch-action: pan-x pan-y;
|
|
275
|
+
"
|
|
276
|
+
@error=${() => {
|
|
277
|
+
// PDF 로드 실패시 새 탭에서 열기
|
|
278
|
+
window.open(filepath, '_blank');
|
|
279
|
+
}}
|
|
280
|
+
></iframe>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
`, { backdrop: true, size: 'large', title: '[PDF 미리보기]' });
|
|
284
|
+
}
|
|
285
|
+
// 기타 파일 타입은 기존 방식 사용
|
|
286
|
+
_openGenericPreview(filepath) {
|
|
192
287
|
openPopup(html ` <file-preview-popup .filepath=${filepath}></file-preview-popup> `, {
|
|
193
288
|
backdrop: true,
|
|
194
289
|
size: 'large',
|
|
@@ -203,60 +298,155 @@ AttachmentListPopup.styles = [
|
|
|
203
298
|
:host {
|
|
204
299
|
display: flex;
|
|
205
300
|
flex-direction: column;
|
|
206
|
-
|
|
207
|
-
|
|
301
|
+
background-color: #fff;
|
|
302
|
+
width: 100%;
|
|
303
|
+
max-height: 80vh;
|
|
208
304
|
}
|
|
209
305
|
|
|
210
306
|
div[body] {
|
|
211
|
-
height: 100%;
|
|
212
|
-
display: flex;
|
|
213
|
-
flex-direction: column;
|
|
214
|
-
gap: 12px;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
div[attachment-container] {
|
|
218
|
-
overflow-y: auto;
|
|
219
|
-
gap: 10px;
|
|
220
|
-
display: flex;
|
|
221
|
-
flex-direction: column;
|
|
222
307
|
flex: 1;
|
|
308
|
+
overflow-y: auto;
|
|
309
|
+
padding: 20px;
|
|
223
310
|
|
|
224
|
-
div[
|
|
311
|
+
div[file-list-container] {
|
|
225
312
|
display: flex;
|
|
226
313
|
flex-direction: column;
|
|
314
|
+
gap: 15px;
|
|
315
|
+
background-color: #f7f7f7;
|
|
316
|
+
padding: 20px;
|
|
317
|
+
border-radius: 8px;
|
|
318
|
+
margin-bottom: 20px;
|
|
227
319
|
|
|
228
|
-
div[
|
|
320
|
+
div[file-item] {
|
|
229
321
|
display: flex;
|
|
230
|
-
|
|
322
|
+
align-items: center;
|
|
323
|
+
gap: 12px;
|
|
324
|
+
padding: 12px;
|
|
325
|
+
background-color: #fff;
|
|
326
|
+
border-radius: 6px;
|
|
327
|
+
border: 1px solid #ddd;
|
|
328
|
+
cursor: pointer;
|
|
329
|
+
transition: all 0.2s ease;
|
|
330
|
+
|
|
331
|
+
&:hover {
|
|
332
|
+
background-color: #e3f2fd;
|
|
333
|
+
border-color: #2196f3;
|
|
334
|
+
transform: translateY(-1px);
|
|
335
|
+
box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
|
|
336
|
+
}
|
|
231
337
|
|
|
232
|
-
|
|
233
|
-
|
|
338
|
+
div[file-info] {
|
|
339
|
+
flex: 1;
|
|
234
340
|
display: flex;
|
|
235
341
|
align-items: center;
|
|
236
|
-
gap:
|
|
342
|
+
gap: 12px;
|
|
343
|
+
|
|
344
|
+
div[file-icon] {
|
|
345
|
+
display: flex;
|
|
346
|
+
align-items: center;
|
|
347
|
+
justify-content: center;
|
|
348
|
+
width: 40px;
|
|
349
|
+
height: 40px;
|
|
350
|
+
border-radius: 8px;
|
|
351
|
+
|
|
352
|
+
md-icon {
|
|
353
|
+
--md-icon-size: 24px;
|
|
354
|
+
color: #666;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
div[file-details] {
|
|
359
|
+
flex: 1;
|
|
360
|
+
display: flex;
|
|
361
|
+
flex-direction: column;
|
|
362
|
+
gap: 4px;
|
|
363
|
+
|
|
364
|
+
span[file-name] {
|
|
365
|
+
font-size: 14px;
|
|
366
|
+
font-weight: 500;
|
|
367
|
+
color: #333;
|
|
368
|
+
line-height: 1.2;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
div[file-meta] {
|
|
372
|
+
display: flex;
|
|
373
|
+
gap: 15px;
|
|
374
|
+
margin-top: 2px;
|
|
375
|
+
|
|
376
|
+
span[file-creator] {
|
|
377
|
+
font-size: 11px;
|
|
378
|
+
color: #666;
|
|
379
|
+
display: flex;
|
|
380
|
+
align-items: center;
|
|
381
|
+
gap: 3px;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
span[file-date] {
|
|
385
|
+
font-size: 11px;
|
|
386
|
+
color: #666;
|
|
387
|
+
display: flex;
|
|
388
|
+
align-items: center;
|
|
389
|
+
gap: 3px;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
237
393
|
}
|
|
238
|
-
|
|
394
|
+
|
|
395
|
+
div[action-buttons] {
|
|
239
396
|
display: flex;
|
|
397
|
+
gap: 8px;
|
|
240
398
|
align-items: center;
|
|
241
|
-
gap: 3px;
|
|
242
399
|
|
|
243
|
-
md-icon
|
|
400
|
+
md-icon {
|
|
401
|
+
--md-icon-size: 20px;
|
|
402
|
+
color: #2196f3;
|
|
244
403
|
cursor: pointer;
|
|
404
|
+
padding: 4px;
|
|
405
|
+
border-radius: 4px;
|
|
406
|
+
transition: background-color 0.2s;
|
|
407
|
+
|
|
408
|
+
&:hover {
|
|
409
|
+
background-color: rgba(33, 150, 243, 0.1);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
md-icon[delete] {
|
|
414
|
+
color: #f44336;
|
|
415
|
+
|
|
416
|
+
&:hover {
|
|
417
|
+
background-color: rgba(244, 67, 54, 0.1);
|
|
418
|
+
}
|
|
245
419
|
}
|
|
246
420
|
|
|
247
|
-
a
|
|
421
|
+
a {
|
|
422
|
+
text-decoration: none;
|
|
423
|
+
color: inherit;
|
|
248
424
|
display: flex;
|
|
249
|
-
|
|
425
|
+
align-items: center;
|
|
250
426
|
}
|
|
251
427
|
}
|
|
252
428
|
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
div[empty-state] {
|
|
432
|
+
text-align: center;
|
|
433
|
+
color: #666;
|
|
434
|
+
padding: 40px;
|
|
253
435
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
436
|
+
md-icon {
|
|
437
|
+
--md-icon-size: 48px;
|
|
438
|
+
color: #ccc;
|
|
439
|
+
margin-bottom: 16px;
|
|
258
440
|
}
|
|
259
441
|
}
|
|
442
|
+
|
|
443
|
+
div[button-container] {
|
|
444
|
+
display: flex;
|
|
445
|
+
align-items: center;
|
|
446
|
+
justify-content: center;
|
|
447
|
+
gap: 10px;
|
|
448
|
+
margin-top: 20px;
|
|
449
|
+
}
|
|
260
450
|
}
|
|
261
451
|
|
|
262
452
|
h3 {
|
|
@@ -264,15 +454,8 @@ AttachmentListPopup.styles = [
|
|
|
264
454
|
color: rgb(5, 149, 229);
|
|
265
455
|
font-size: 17px;
|
|
266
456
|
font-weight: 700;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
margin-bottom: 5px;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
div[button-container] {
|
|
273
|
-
display: flex;
|
|
274
|
-
justify-content: flex-end;
|
|
275
|
-
gap: 10px;
|
|
457
|
+
margin: 0px 20px 10px 20px;
|
|
458
|
+
padding-top: 20px;
|
|
276
459
|
}
|
|
277
460
|
`
|
|
278
461
|
];
|
|
@@ -284,6 +467,10 @@ __decorate([
|
|
|
284
467
|
property({ type: String }),
|
|
285
468
|
__metadata("design:type", String)
|
|
286
469
|
], AttachmentListPopup.prototype, "status", void 0);
|
|
470
|
+
__decorate([
|
|
471
|
+
property({ type: String }),
|
|
472
|
+
__metadata("design:type", String)
|
|
473
|
+
], AttachmentListPopup.prototype, "mode", void 0);
|
|
287
474
|
__decorate([
|
|
288
475
|
state(),
|
|
289
476
|
__metadata("design:type", Object)
|
|
@@ -300,10 +487,6 @@ __decorate([
|
|
|
300
487
|
state(),
|
|
301
488
|
__metadata("design:type", User)
|
|
302
489
|
], AttachmentListPopup.prototype, "user", void 0);
|
|
303
|
-
__decorate([
|
|
304
|
-
query('div[attachment-container]'),
|
|
305
|
-
__metadata("design:type", HTMLDivElement)
|
|
306
|
-
], AttachmentListPopup.prototype, "attachmentContainer", void 0);
|
|
307
490
|
AttachmentListPopup = __decorate([
|
|
308
491
|
customElement('attachment-list-popup')
|
|
309
492
|
], AttachmentListPopup);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-list-popup.js","sourceRoot":"","sources":["../../../client/pages/checklist/attachment-list-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,sBAAsB,CAAA;AAC7B,OAAO,EAAE,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ato/graphql'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport { notify } from '@operato/layout'\nimport { store, User } from '@operato/shell'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\nimport { openPopup } from '@operato/layout'\nimport './file-preview-popup'\nimport { BuildingInspectionStatus } from '../building-inspection/building-inspection-list'\n\n@customElement('attachment-list-popup')\nclass AttachmentListPopup extends connect(store)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n padding: 15px 20px;\n background-color: var(--md-sys-color-surface);\n }\n\n div[body] {\n height: 100%;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n div[attachment-container] {\n overflow-y: auto;\n gap: 10px;\n display: flex;\n flex-direction: column;\n flex: 1;\n\n div[attachment-row] {\n display: flex;\n flex-direction: column;\n\n div[creator-container] {\n display: flex;\n justify-content: space-between;\n\n span[creator] {\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 3px;\n }\n span[createdAt] {\n display: flex;\n align-items: center;\n gap: 3px;\n\n md-icon[delete] {\n cursor: pointer;\n }\n\n a[button-download] {\n display: flex;\n color: #000;\n }\n }\n }\n\n a[attachment] {\n margin-left: 20px;\n text-decoration: none;\n color: #000;\n }\n }\n }\n\n h3 {\n position: relative;\n color: rgb(5, 149, 229);\n font-size: 17px;\n font-weight: 700;\n background-color: var(--md-sys-color-surface);\n margin-top: 0px;\n margin-bottom: 5px;\n }\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n }\n `\n ]\n\n @property({ type: String }) checklistItemId: string = ''\n @property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT\n\n @state() item: any = { count: 0 }\n @state() checklistItemAttachments: any = []\n @state() checklistItemAttachmentCount: number = 0\n @state() user: User = {}\n @query('div[attachment-container]') attachmentContainer!: HTMLDivElement\n\n render() {\n return html`\n <div body>\n <h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>\n\n <div attachment-container>\n ${this.checklistItemAttachments.map(attachment => {\n return html`\n <div attachment-row>\n <div creator-container>\n <span creator><md-icon slot=\"icon\">account_circle</md-icon> ${attachment.creator.name}</span>\n <span createdAt>\n <md-icon slot=\"icon\">schedule</md-icon> ${this._formatDate(attachment.createdAt)}\n ${attachment.creator.email === this.user.email && this.status != BuildingInspectionStatus.PASS\n ? html` <md-icon delete slot=\"icon\" @click=${() => this._deleteAttachment(attachment.id)}>delete</md-icon>`\n : ''}\n <a button-download href=${attachment.fullpath} download=${attachment.name}>\n <md-icon slot=\"icon\">download</md-icon></a\n >\n </span>\n </div>\n <a attachment @click=${() => this._onClickPreview(attachment.fullpath)}>${attachment.name}</a>\n </div>\n `\n })}\n </div>\n\n <ox-input-file\n accept=\"*/*\"\n multiple=\"true\"\n hide-filelist\n ?disabled=${this.status == BuildingInspectionStatus.PASS}\n @change=${this.onCreateAttachment.bind(this)}\n ></ox-input-file>\n\n <div button-container>\n <md-elevated-button @click=${this._close}> <md-icon slot=\"icon\">cancel</md-icon>취소 </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async firstUpdated() {\n this.user = (store.getState() as any).auth?.user\n\n await this._loadAttachments()\n }\n\n private async _loadAttachments() {\n const response = await client.query({\n query: gql`\n query ChecklistItem($id: String!) {\n checklistItem(id: $id) {\n id\n checklistItemAttachmentCount\n checklistItemAttachments {\n id\n name\n fullpath\n creator {\n id\n name\n email\n }\n createdAt\n }\n }\n }\n `,\n variables: {\n id: this.checklistItemId\n }\n })\n\n if (response.errors) return\n\n this.checklistItemAttachments = response.data.checklistItem.checklistItemAttachments || []\n this.checklistItemAttachmentCount = response.data.checklistItem.checklistItemAttachmentCount\n }\n\n private async _deleteAttachment(attachmentId: string) {\n if (this.status == BuildingInspectionStatus.PASS) {\n notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })\n return\n }\n\n if (\n await OxPrompt.open({\n title: '첨부 자료를 삭제',\n text: '첨부 자료를 삭제 하시겠습니까?',\n confirmButton: { text: '삭제' },\n cancelButton: { text: '취소' }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation DeleteAttachment($deleteAttachmentId: String!) {\n deleteAttachment(id: $deleteAttachmentId)\n }\n `,\n variables: {\n deleteAttachmentId: attachmentId\n }\n })\n\n if (!response.errors) {\n this.checklistItemAttachments = [...this.checklistItemAttachments.filter(attachment => attachment.id != attachmentId)]\n notify({ message: '첨부 자료를 삭제하였습니다.', level: 'info' })\n } else {\n notify({ message: response.errors?.[0]?.message || '첨부 자료 삭제에 실패하였습니다.', level: 'error' })\n }\n\n this._dispatchEvent()\n }\n }\n\n private _close() {\n history.back()\n }\n\n // 파일 변경 시 파일을 저장할 핸들러\n private async onCreateAttachment(e: CustomEvent) {\n if (this.status == BuildingInspectionStatus.PASS) {\n notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })\n return\n }\n\n const files = e.detail\n\n await this._createAttachments(files)\n\n this._dispatchEvent()\n }\n\n async _createAttachments(files: File[]) {\n const checklistItemId = this.checklistItemId\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n name\n fullpath\n creator {\n id\n name\n email\n }\n createdAt\n }\n }\n `,\n variables: {\n attachments: files.map(file => {\n return { file, refBy: checklistItemId, refType: 'ChecklistItem' }\n })\n },\n context: {\n hasUpload: true\n }\n })\n\n const attachments = response.data.createAttachments\n\n this.checklistItemAttachments = [...attachments, ...this.checklistItemAttachments]\n this.checklistItemAttachmentCount = this.checklistItemAttachmentCount + attachments.length\n }\n\n private _formatDate(date) {\n const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }))\n\n const year = _date.getFullYear()\n const month = String(_date.getMonth() + 1).padStart(2, '0')\n const day = String(_date.getDate()).padStart(2, '0')\n const hours = String(_date.getHours()).padStart(2, '0')\n const minutes = String(_date.getMinutes()).padStart(2, '0')\n const seconds = String(_date.getSeconds()).padStart(2, '0')\n\n return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`\n }\n\n // 첨부 자료 변경 이벤트 디스패치\n _dispatchEvent() {\n this.dispatchEvent(new CustomEvent('change-attachment', { detail: { checklistItemId: this.checklistItemId } }))\n }\n\n private _onClickPreview(filepath: string) {\n openPopup(html` <file-preview-popup .filepath=${filepath}></file-preview-popup> `, {\n backdrop: true,\n size: 'large',\n title: '미리보기'\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"attachment-list-popup.js","sourceRoot":"","sources":["../../../client/pages/checklist/attachment-list-popup.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,sBAAsB,CAAA;AAC7B,OAAO,sDAAsD,CAAA;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAA;AAE1F,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CA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D,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CACvD,CAAA;IACH,CAAC;IAED,qBAAqB;IACb,mBAAmB,CAAC,QAAgB;QAC1C,SAAS,CAAC,IAAI,CAAA,kCAAkC,QAAQ,yBAAyB,EAAE;YACjF,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,MAAM;SACd,CAAC,CAAA;IACJ,CAAC;;AAxdM,0BAAM,GAAG;IACd,qBAAqB;IACrB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmKF;CACF,AAvKY,CAuKZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DAA6B;AAC5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAAiE;AAChE;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAA2C;AAE7D;IAAR,KAAK,EAAE;;iDAAyB;AACxB;IAAR,KAAK,EAAE;;qEAAmC;AAClC;IAAR,KAAK,EAAE;;yEAAyC;AACxC;IAAR,KAAK,EAAE;8BAAO,IAAI;iDAAK;AAjLpB,mBAAmB;IADxB,aAAa,CAAC,uBAAuB,CAAC;GACjC,mBAAmB,CA0dxB","sourcesContent":["import '@material/web/icon/icon.js'\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport { notify } from '@operato/layout'\nimport { store, User } from '@operato/shell'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\nimport { openPopup } from '@operato/layout'\nimport './file-preview-popup'\nimport '../building-inspection/component/image-preview-popup'\nimport { BuildingInspectionStatus } from '../building-inspection/building-inspection-list'\nimport { ChecklistMode } from './checklist-view'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\n@customElement('attachment-list-popup')\nclass AttachmentListPopup extends connect(store)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: #fff;\n width: 100%;\n max-height: 80vh;\n }\n\n div[body] {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n\n div[file-list-container] {\n display: flex;\n flex-direction: column;\n gap: 15px;\n background-color: #f7f7f7;\n padding: 20px;\n border-radius: 8px;\n margin-bottom: 20px;\n\n div[file-item] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px;\n background-color: #fff;\n border-radius: 6px;\n border: 1px solid #ddd;\n cursor: pointer;\n transition: all 0.2s ease;\n\n &:hover {\n background-color: #e3f2fd;\n border-color: #2196f3;\n transform: translateY(-1px);\n box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);\n }\n\n div[file-info] {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 12px;\n\n div[file-icon] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 8px;\n\n md-icon {\n --md-icon-size: 24px;\n color: #666;\n }\n }\n\n div[file-details] {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n span[file-name] {\n font-size: 14px;\n font-weight: 500;\n color: #333;\n line-height: 1.2;\n }\n\n div[file-meta] {\n display: flex;\n gap: 15px;\n margin-top: 2px;\n\n span[file-creator] {\n font-size: 11px;\n color: #666;\n display: flex;\n align-items: center;\n gap: 3px;\n }\n\n span[file-date] {\n font-size: 11px;\n color: #666;\n display: flex;\n align-items: center;\n gap: 3px;\n }\n }\n }\n }\n\n div[action-buttons] {\n display: flex;\n gap: 8px;\n align-items: center;\n\n md-icon {\n --md-icon-size: 20px;\n color: #2196f3;\n cursor: pointer;\n padding: 4px;\n border-radius: 4px;\n transition: background-color 0.2s;\n\n &:hover {\n background-color: rgba(33, 150, 243, 0.1);\n }\n }\n\n md-icon[delete] {\n color: #f44336;\n\n &:hover {\n background-color: rgba(244, 67, 54, 0.1);\n }\n }\n\n a {\n text-decoration: none;\n color: inherit;\n display: flex;\n align-items: center;\n }\n }\n }\n }\n\n div[empty-state] {\n text-align: center;\n color: #666;\n padding: 40px;\n\n md-icon {\n --md-icon-size: 48px;\n color: #ccc;\n margin-bottom: 16px;\n }\n }\n\n div[button-container] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n margin-top: 20px;\n }\n }\n\n h3 {\n position: relative;\n color: rgb(5, 149, 229);\n font-size: 17px;\n font-weight: 700;\n margin: 0px 20px 10px 20px;\n padding-top: 20px;\n }\n `\n ]\n\n @property({ type: String }) checklistItemId: string = ''\n @property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT\n @property({ type: String }) mode: ChecklistMode = ChecklistMode.VIEWER\n\n @state() item: any = { count: 0 }\n @state() checklistItemAttachments: any = []\n @state() checklistItemAttachmentCount: number = 0\n @state() user: User = {}\n\n render() {\n return html`\n <h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>\n\n <div body>\n <div file-list-container>\n ${this.checklistItemAttachments.length > 0\n ? this.checklistItemAttachments.map(\n attachment => html`\n <div file-item @click=${() => this._onClickPreview(attachment.fullpath)}>\n <div file-info>\n <div file-icon>\n <md-icon>description</md-icon>\n </div>\n <div file-details>\n <span file-name>${attachment.name || ''}</span>\n <div file-meta>\n <span file-creator>\n <md-icon style=\"--md-icon-size: 12px;\">account_circle</md-icon>\n ${attachment.creator?.name || ''}\n </span>\n <span file-date>\n <md-icon style=\"--md-icon-size: 12px;\">schedule</md-icon>\n ${this._formatDate(attachment.createdAt)}\n </span>\n </div>\n </div>\n </div>\n <div action-buttons>\n <md-icon\n title=\"미리보기\"\n @click=${(e: Event) => {\n e.stopPropagation()\n this._onClickPreview(attachment.fullpath)\n }}\n >visibility</md-icon\n >\n <a\n href=${ifDefined(attachment.fullpath)}\n download=${ifDefined(attachment.name)}\n @click=${(e: Event) => e.stopPropagation()}\n >\n <md-icon title=\"다운로드\" style=\"color: #2196f3;\">download</md-icon>\n </a>\n ${attachment.creator?.email === this.user.email &&\n this.status != BuildingInspectionStatus.PASS &&\n this.mode == ChecklistMode.EDITOR\n ? html`<md-icon\n delete\n title=\"삭제\"\n @click=${(e: Event) => {\n e.stopPropagation()\n this._deleteAttachment(attachment.id)\n }}\n >delete</md-icon\n >`\n : ''}\n </div>\n </div>\n `\n )\n : html`\n <div empty-state>\n <md-icon>insert_drive_file</md-icon>\n <div>첨부된 파일이 없습니다.</div>\n </div>\n `}\n </div>\n\n <ox-input-file\n accept=\"*/*\"\n multiple=\"true\"\n hide-filelist\n ?disabled=${this.status == BuildingInspectionStatus.PASS || this.mode == ChecklistMode.VIEWER}\n @change=${this.onCreateAttachment.bind(this)}\n ></ox-input-file>\n\n <div button-container>\n <md-elevated-button @click=${this._close}> <md-icon slot=\"icon\">cancel</md-icon>취소 </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async firstUpdated() {\n this.user = (store.getState() as any).auth?.user\n\n await this._loadAttachments()\n }\n\n private async _loadAttachments() {\n const response = await client.query({\n query: gql`\n query ChecklistItem($id: String!) {\n checklistItem(id: $id) {\n id\n checklistItemAttachmentCount\n checklistItemAttachments {\n id\n name\n fullpath\n creator {\n id\n name\n email\n }\n createdAt\n }\n }\n }\n `,\n variables: {\n id: this.checklistItemId\n }\n })\n\n if (response.errors) return\n\n this.checklistItemAttachments = response.data.checklistItem.checklistItemAttachments || []\n this.checklistItemAttachmentCount = response.data.checklistItem.checklistItemAttachmentCount\n }\n\n private async _deleteAttachment(attachmentId: string) {\n if (this.status == BuildingInspectionStatus.PASS) {\n notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })\n return\n }\n\n if (\n await OxPrompt.open({\n title: '첨부 자료를 삭제',\n text: '첨부 자료를 삭제 하시겠습니까?',\n confirmButton: { text: '삭제' },\n cancelButton: { text: '취소' }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation DeleteAttachment($deleteAttachmentId: String!) {\n deleteAttachment(id: $deleteAttachmentId)\n }\n `,\n variables: {\n deleteAttachmentId: attachmentId\n }\n })\n\n if (!response.errors) {\n this.checklistItemAttachments = [...this.checklistItemAttachments.filter(attachment => attachment.id != attachmentId)]\n notify({ message: '첨부 자료를 삭제하였습니다.', level: 'info' })\n } else {\n notify({ message: response.errors?.[0]?.message || '첨부 자료 삭제에 실패하였습니다.', level: 'error' })\n }\n\n this._dispatchEvent()\n }\n }\n\n private _close() {\n history.back()\n }\n\n // 파일 변경 시 파일을 저장할 핸들러\n private async onCreateAttachment(e: CustomEvent) {\n if (this.status == BuildingInspectionStatus.PASS) {\n notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })\n return\n }\n\n const files = e.detail\n\n await this._createAttachments(files)\n\n this._dispatchEvent()\n }\n\n async _createAttachments(files: File[]) {\n const checklistItemId = this.checklistItemId\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n name\n fullpath\n creator {\n id\n name\n email\n }\n createdAt\n }\n }\n `,\n variables: {\n attachments: files.map(file => {\n return { file, refBy: checklistItemId, refType: 'ChecklistItem', description: this.status }\n })\n },\n context: {\n hasUpload: true\n }\n })\n\n const attachments = response.data.createAttachments\n\n this.checklistItemAttachments = [...attachments, ...this.checklistItemAttachments]\n this.checklistItemAttachmentCount = this.checklistItemAttachmentCount + attachments.length\n }\n\n private _formatDate(date) {\n const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }))\n\n const year = _date.getFullYear()\n const month = String(_date.getMonth() + 1).padStart(2, '0')\n const day = String(_date.getDate()).padStart(2, '0')\n const hours = String(_date.getHours()).padStart(2, '0')\n const minutes = String(_date.getMinutes()).padStart(2, '0')\n\n return `${year}.${month}.${day} ${hours}:${minutes}`\n }\n\n // 첨부 자료 변경 이벤트 디스패치\n _dispatchEvent() {\n this.dispatchEvent(new CustomEvent('change-attachment', { detail: { checklistItemId: this.checklistItemId } }))\n }\n\n private _onClickPreview(filepath: string) {\n if (!filepath) {\n return\n }\n\n // 파일 확장자로 타입 판단\n const fileExtension = filepath.toLowerCase().split('.').pop()\n const isImage = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(fileExtension || '')\n const isPdf = fileExtension === 'pdf'\n\n if (isImage) {\n this._openImagePreview(filepath)\n } else if (isPdf) {\n this._openPdfPreview(filepath)\n } else {\n // 기타 파일은 기존 file-preview-popup 사용\n this._openGenericPreview(filepath)\n }\n }\n\n private _openImagePreview(filepath: string) {\n const imageData = this.checklistItemAttachments.filter(attachment => {\n const fileExtension = attachment.fullpath?.toLowerCase().split('.').pop()\n return ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(fileExtension || '')\n })\n\n const currentIndex = imageData.findIndex(attachment => attachment.fullpath === filepath)\n\n openPopup(\n html` <image-preview-popup .images=${imageData} .currentIndex=${Math.max(0, currentIndex)}></image-preview-popup> `,\n { backdrop: true, size: 'large', title: '이미지 미리보기' }\n )\n }\n\n private _openPdfPreview(filepath: string) {\n openPopup(\n html`\n <div style=\"display: flex; flex-direction: column;\">\n <div style=\"flex: 1; overflow: hidden; touch-action: pan-x pan-y;\">\n <iframe\n src=\"${filepath}#toolbar=1&navpanes=0&scrollbar=1&zoom=page-fit\"\n style=\"\n width: 100%; \n height: 100%; \n border: none; \n touch-action: pan-x pan-y;\n \"\n @error=${() => {\n // PDF 로드 실패시 새 탭에서 열기\n window.open(filepath, '_blank')\n }}\n ></iframe>\n </div>\n </div>\n `,\n { backdrop: true, size: 'large', title: '[PDF 미리보기]' }\n )\n }\n\n // 기타 파일 타입은 기존 방식 사용\n private _openGenericPreview(filepath: string) {\n openPopup(html` <file-preview-popup .filepath=${filepath}></file-preview-popup> `, {\n backdrop: true,\n size: 'large',\n title: '미리보기'\n })\n }\n}\n"]}
|
|
@@ -4,6 +4,11 @@ import '@operato/input/ox-input-signature.js';
|
|
|
4
4
|
import './comment-list-popup';
|
|
5
5
|
import './attachment-list-popup';
|
|
6
6
|
import '../../stt/speech-to-text';
|
|
7
|
+
export declare const enum ProjectType {
|
|
8
|
+
DSSP = "DSSP",
|
|
9
|
+
DCSP = "DCSP",
|
|
10
|
+
DKPI = "DKPI"
|
|
11
|
+
}
|
|
7
12
|
export declare const enum ChecklistMode {
|
|
8
13
|
VIEWER = "VIEWER",
|
|
9
14
|
EDITOR = "EDITOR"
|