@dssp/supervision 1.0.0-alpha.23 → 1.0.0-alpha.25
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.js +17 -0
- package/dist-client/graphql/building-inspection.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +4 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +50 -3
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-list.d.ts +4 -0
- package/dist-client/pages/building-inspection/building-inspection-list.js +22 -2
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- 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 +21 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js +473 -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/photo-album-popup.d.ts +27 -0
- package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js +401 -0
- package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +4 -0
- 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 +6 -1
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -1
- package/dist-client/pages/checklist/attachment-list-popup.d.ts +1 -0
- package/dist-client/pages/checklist/attachment-list-popup.js +250 -68
- 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 +54 -13
- package/dist-client/pages/checklist/checklist-view.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 +3 -0
- package/dist-client/pages/checklist/inspection-info-popup.js +144 -23
- package/dist-client/pages/checklist/inspection-info-popup.js.map +1 -1
- package/dist-client/pages/checklist/inspection-tab-popup.d.ts +1 -0
- package/dist-client/pages/checklist/inspection-tab-popup.js +8 -1
- package/dist-client/pages/checklist/inspection-tab-popup.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/building-inspection/building-inspection-history.d.ts +1 -0
- package/dist-server/service/building-inspection/building-inspection-history.js +5 -0
- package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.js +9 -3
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +1 -0
- package/dist-server/service/building-inspection/building-inspection-type.js +4 -0
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection.js +1 -1
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
- package/dist-server/service/building-inspection/index.d.ts +1 -1
- package/dist-server/service/checklist/checklist-query.d.ts +4 -0
- package/dist-server/service/checklist/checklist-query.js +52 -0
- package/dist-server/service/checklist/checklist-query.js.map +1 -1
- 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/index.d.ts +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -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,7 +11,9 @@ 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);
|
|
@@ -25,31 +27,72 @@ let AttachmentListPopup = class AttachmentListPopup extends connect(store)(LitEl
|
|
|
25
27
|
}
|
|
26
28
|
render() {
|
|
27
29
|
return html `
|
|
28
|
-
<
|
|
29
|
-
<h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>
|
|
30
|
+
<h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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>
|
|
48
94
|
</div>
|
|
49
|
-
|
|
50
|
-
</div>
|
|
51
|
-
`;
|
|
52
|
-
})}
|
|
95
|
+
`}
|
|
53
96
|
</div>
|
|
54
97
|
|
|
55
98
|
<ox-input-file
|
|
@@ -166,7 +209,7 @@ let AttachmentListPopup = class AttachmentListPopup extends connect(store)(LitEl
|
|
|
166
209
|
`,
|
|
167
210
|
variables: {
|
|
168
211
|
attachments: files.map(file => {
|
|
169
|
-
return { file, refBy: checklistItemId, refType: 'ChecklistItem' };
|
|
212
|
+
return { file, refBy: checklistItemId, refType: 'ChecklistItem', description: this.status };
|
|
170
213
|
})
|
|
171
214
|
},
|
|
172
215
|
context: {
|
|
@@ -184,14 +227,69 @@ let AttachmentListPopup = class AttachmentListPopup extends connect(store)(LitEl
|
|
|
184
227
|
const day = String(_date.getDate()).padStart(2, '0');
|
|
185
228
|
const hours = String(_date.getHours()).padStart(2, '0');
|
|
186
229
|
const minutes = String(_date.getMinutes()).padStart(2, '0');
|
|
187
|
-
|
|
188
|
-
return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`;
|
|
230
|
+
return `${year}.${month}.${day} ${hours}:${minutes}`;
|
|
189
231
|
}
|
|
190
232
|
// 첨부 자료 변경 이벤트 디스패치
|
|
191
233
|
_dispatchEvent() {
|
|
192
234
|
this.dispatchEvent(new CustomEvent('change-attachment', { detail: { checklistItemId: this.checklistItemId } }));
|
|
193
235
|
}
|
|
194
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 `
|
|
263
|
+
<image-preview-popup
|
|
264
|
+
.images=${imageData}
|
|
265
|
+
.currentIndex=${Math.max(0, currentIndex)}
|
|
266
|
+
.title=${'이미지 미리보기'}
|
|
267
|
+
></image-preview-popup>
|
|
268
|
+
`, { backdrop: true, size: 'large', title: '[이미지 미리보기]' });
|
|
269
|
+
}
|
|
270
|
+
_openPdfPreview(filepath) {
|
|
271
|
+
openPopup(html `
|
|
272
|
+
<div style="display: flex; flex-direction: column;">
|
|
273
|
+
<div style="flex: 1; overflow: hidden; touch-action: pan-x pan-y;">
|
|
274
|
+
<iframe
|
|
275
|
+
src="${filepath}#toolbar=1&navpanes=0&scrollbar=1&zoom=page-fit"
|
|
276
|
+
style="
|
|
277
|
+
width: 100%;
|
|
278
|
+
height: 100%;
|
|
279
|
+
border: none;
|
|
280
|
+
touch-action: pan-x pan-y;
|
|
281
|
+
"
|
|
282
|
+
@error=${() => {
|
|
283
|
+
// PDF 로드 실패시 새 탭에서 열기
|
|
284
|
+
window.open(filepath, '_blank');
|
|
285
|
+
}}
|
|
286
|
+
></iframe>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
`, { backdrop: true, size: 'large', title: '[PDF 미리보기]' });
|
|
290
|
+
}
|
|
291
|
+
// 기타 파일 타입은 기존 방식 사용
|
|
292
|
+
_openGenericPreview(filepath) {
|
|
195
293
|
openPopup(html ` <file-preview-popup .filepath=${filepath}></file-preview-popup> `, {
|
|
196
294
|
backdrop: true,
|
|
197
295
|
size: 'large',
|
|
@@ -206,60 +304,155 @@ AttachmentListPopup.styles = [
|
|
|
206
304
|
:host {
|
|
207
305
|
display: flex;
|
|
208
306
|
flex-direction: column;
|
|
209
|
-
|
|
210
|
-
|
|
307
|
+
background-color: #fff;
|
|
308
|
+
width: 100%;
|
|
309
|
+
max-height: 80vh;
|
|
211
310
|
}
|
|
212
311
|
|
|
213
312
|
div[body] {
|
|
214
|
-
height: 100%;
|
|
215
|
-
display: flex;
|
|
216
|
-
flex-direction: column;
|
|
217
|
-
gap: 12px;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
div[attachment-container] {
|
|
221
|
-
overflow-y: auto;
|
|
222
|
-
gap: 10px;
|
|
223
|
-
display: flex;
|
|
224
|
-
flex-direction: column;
|
|
225
313
|
flex: 1;
|
|
314
|
+
overflow-y: auto;
|
|
315
|
+
padding: 20px;
|
|
226
316
|
|
|
227
|
-
div[
|
|
317
|
+
div[file-list-container] {
|
|
228
318
|
display: flex;
|
|
229
319
|
flex-direction: column;
|
|
320
|
+
gap: 15px;
|
|
321
|
+
background-color: #f7f7f7;
|
|
322
|
+
padding: 20px;
|
|
323
|
+
border-radius: 8px;
|
|
324
|
+
margin-bottom: 20px;
|
|
230
325
|
|
|
231
|
-
div[
|
|
326
|
+
div[file-item] {
|
|
232
327
|
display: flex;
|
|
233
|
-
|
|
328
|
+
align-items: center;
|
|
329
|
+
gap: 12px;
|
|
330
|
+
padding: 12px;
|
|
331
|
+
background-color: #fff;
|
|
332
|
+
border-radius: 6px;
|
|
333
|
+
border: 1px solid #ddd;
|
|
334
|
+
cursor: pointer;
|
|
335
|
+
transition: all 0.2s ease;
|
|
234
336
|
|
|
235
|
-
|
|
236
|
-
|
|
337
|
+
&:hover {
|
|
338
|
+
background-color: #e3f2fd;
|
|
339
|
+
border-color: #2196f3;
|
|
340
|
+
transform: translateY(-1px);
|
|
341
|
+
box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
div[file-info] {
|
|
345
|
+
flex: 1;
|
|
237
346
|
display: flex;
|
|
238
347
|
align-items: center;
|
|
239
|
-
gap:
|
|
348
|
+
gap: 12px;
|
|
349
|
+
|
|
350
|
+
div[file-icon] {
|
|
351
|
+
display: flex;
|
|
352
|
+
align-items: center;
|
|
353
|
+
justify-content: center;
|
|
354
|
+
width: 40px;
|
|
355
|
+
height: 40px;
|
|
356
|
+
border-radius: 8px;
|
|
357
|
+
|
|
358
|
+
md-icon {
|
|
359
|
+
--md-icon-size: 24px;
|
|
360
|
+
color: #666;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
div[file-details] {
|
|
365
|
+
flex: 1;
|
|
366
|
+
display: flex;
|
|
367
|
+
flex-direction: column;
|
|
368
|
+
gap: 4px;
|
|
369
|
+
|
|
370
|
+
span[file-name] {
|
|
371
|
+
font-size: 14px;
|
|
372
|
+
font-weight: 500;
|
|
373
|
+
color: #333;
|
|
374
|
+
line-height: 1.2;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
div[file-meta] {
|
|
378
|
+
display: flex;
|
|
379
|
+
gap: 15px;
|
|
380
|
+
margin-top: 2px;
|
|
381
|
+
|
|
382
|
+
span[file-creator] {
|
|
383
|
+
font-size: 11px;
|
|
384
|
+
color: #666;
|
|
385
|
+
display: flex;
|
|
386
|
+
align-items: center;
|
|
387
|
+
gap: 3px;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
span[file-date] {
|
|
391
|
+
font-size: 11px;
|
|
392
|
+
color: #666;
|
|
393
|
+
display: flex;
|
|
394
|
+
align-items: center;
|
|
395
|
+
gap: 3px;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
240
399
|
}
|
|
241
|
-
|
|
400
|
+
|
|
401
|
+
div[action-buttons] {
|
|
242
402
|
display: flex;
|
|
403
|
+
gap: 8px;
|
|
243
404
|
align-items: center;
|
|
244
|
-
gap: 3px;
|
|
245
405
|
|
|
246
|
-
md-icon
|
|
406
|
+
md-icon {
|
|
407
|
+
--md-icon-size: 20px;
|
|
408
|
+
color: #2196f3;
|
|
247
409
|
cursor: pointer;
|
|
410
|
+
padding: 4px;
|
|
411
|
+
border-radius: 4px;
|
|
412
|
+
transition: background-color 0.2s;
|
|
413
|
+
|
|
414
|
+
&:hover {
|
|
415
|
+
background-color: rgba(33, 150, 243, 0.1);
|
|
416
|
+
}
|
|
248
417
|
}
|
|
249
418
|
|
|
250
|
-
|
|
419
|
+
md-icon[delete] {
|
|
420
|
+
color: #f44336;
|
|
421
|
+
|
|
422
|
+
&:hover {
|
|
423
|
+
background-color: rgba(244, 67, 54, 0.1);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
a {
|
|
428
|
+
text-decoration: none;
|
|
429
|
+
color: inherit;
|
|
251
430
|
display: flex;
|
|
252
|
-
|
|
431
|
+
align-items: center;
|
|
253
432
|
}
|
|
254
433
|
}
|
|
255
434
|
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
div[empty-state] {
|
|
438
|
+
text-align: center;
|
|
439
|
+
color: #666;
|
|
440
|
+
padding: 40px;
|
|
256
441
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
442
|
+
md-icon {
|
|
443
|
+
--md-icon-size: 48px;
|
|
444
|
+
color: #ccc;
|
|
445
|
+
margin-bottom: 16px;
|
|
261
446
|
}
|
|
262
447
|
}
|
|
448
|
+
|
|
449
|
+
div[button-container] {
|
|
450
|
+
display: flex;
|
|
451
|
+
align-items: center;
|
|
452
|
+
justify-content: center;
|
|
453
|
+
gap: 10px;
|
|
454
|
+
margin-top: 20px;
|
|
455
|
+
}
|
|
263
456
|
}
|
|
264
457
|
|
|
265
458
|
h3 {
|
|
@@ -267,15 +460,8 @@ AttachmentListPopup.styles = [
|
|
|
267
460
|
color: rgb(5, 149, 229);
|
|
268
461
|
font-size: 17px;
|
|
269
462
|
font-weight: 700;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
margin-bottom: 5px;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
div[button-container] {
|
|
276
|
-
display: flex;
|
|
277
|
-
justify-content: flex-end;
|
|
278
|
-
gap: 10px;
|
|
463
|
+
margin: 0px 20px 10px 20px;
|
|
464
|
+
padding-top: 20px;
|
|
279
465
|
}
|
|
280
466
|
`
|
|
281
467
|
];
|
|
@@ -307,10 +493,6 @@ __decorate([
|
|
|
307
493
|
state(),
|
|
308
494
|
__metadata("design:type", User)
|
|
309
495
|
], AttachmentListPopup.prototype, "user", void 0);
|
|
310
|
-
__decorate([
|
|
311
|
-
query('div[attachment-container]'),
|
|
312
|
-
__metadata("design:type", HTMLDivElement)
|
|
313
|
-
], AttachmentListPopup.prototype, "attachmentContainer", void 0);
|
|
314
496
|
AttachmentListPopup = __decorate([
|
|
315
497
|
customElement('attachment-list-popup')
|
|
316
498
|
], 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,CA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AAA;IACJ,CAAC;;AA9RM,0BAAM,GAAG;IACd,qBAAqB;IACrB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2EF;CACF,AA/EY,CA+EZ;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;AACY;IAAnC,KAAK,CAAC,2BAA2B,CAAC;8BAAuB,cAAc;gEAAA;AA1FpE,mBAAmB;IADxB,aAAa,CAAC,uBAAuB,CAAC;GACjC,mBAAmB,CAgSxB","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, 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'\nimport { ChecklistMode } from './checklist-view'\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 @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 @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 &&\n this.status != BuildingInspectionStatus.PASS &&\n this.mode == ChecklistMode.EDITOR\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 || 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' }\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,CAAA;AAGxD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAA5D;;QA0K8B,oBAAe,GAAW,EAAE,CAAA;QAC5B,WAAM,GAA6B,wBAAwB,CAAC,IAAI,CAAA;QAChE,SAAI,uCAAsC;QAE7D,SAAI,GAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;QACxB,6BAAwB,GAAQ,EAAE,CAAA;QAClC,iCAA4B,GAAW,CAAC,CAAA;QACxC,SAAI,GAAS,EAAE,CAA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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,CAgexB","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`\n <image-preview-popup\n .images=${imageData}\n .currentIndex=${Math.max(0, currentIndex)}\n .title=${'이미지 미리보기'}\n ></image-preview-popup>\n `,\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"
|
|
@@ -20,6 +20,7 @@ let ChecklistView = class ChecklistView extends connect(store)(LitElement) {
|
|
|
20
20
|
super(...arguments);
|
|
21
21
|
this.mode = "VIEWER" /* ChecklistMode.VIEWER */;
|
|
22
22
|
this.checklist = {};
|
|
23
|
+
this.manager = {};
|
|
23
24
|
this.buildingComplex = {
|
|
24
25
|
id: '',
|
|
25
26
|
taskConstructorEmails: [],
|
|
@@ -28,6 +29,7 @@ let ChecklistView = class ChecklistView extends connect(store)(LitElement) {
|
|
|
28
29
|
overallSupervisoryEmails: []
|
|
29
30
|
};
|
|
30
31
|
this.status = BuildingInspectionStatus.WAIT;
|
|
32
|
+
this.projectType = "DSSP" /* ProjectType.DSSP */;
|
|
31
33
|
this.isListening = false;
|
|
32
34
|
this._onToggleSTT = () => {
|
|
33
35
|
const stt = this.renderRoot.querySelector('#stt');
|
|
@@ -76,7 +78,7 @@ let ChecklistView = class ChecklistView extends connect(store)(LitElement) {
|
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
render() {
|
|
79
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
81
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
80
82
|
const today = this._getDate(new Date());
|
|
81
83
|
// 시공자 스탭 여부
|
|
82
84
|
const isConstructorStep = this.status == BuildingInspectionStatus.WAIT ||
|
|
@@ -125,16 +127,20 @@ let ChecklistView = class ChecklistView extends connect(store)(LitElement) {
|
|
|
125
127
|
<speech-to-text id="stt"></speech-to-text>
|
|
126
128
|
<div title-row>
|
|
127
129
|
<div name>${this.checklist.name}</div>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
${this.mode == "EDITOR" /* ChecklistMode.EDITOR */
|
|
131
|
+
? html `
|
|
132
|
+
<md-fab
|
|
133
|
+
class="stt-fab"
|
|
134
|
+
?active=${this.isListening}
|
|
135
|
+
@click=${this._onToggleSTT}
|
|
136
|
+
?disabled=${false}
|
|
137
|
+
style="position:absolute;top:0;right:0;z-index:10;"
|
|
138
|
+
.label=${this.isListening ? '음성 인식 중지' : '음성 인식 시작'}
|
|
139
|
+
>
|
|
140
|
+
<md-icon slot="icon">mic</md-icon>
|
|
141
|
+
</md-fab>
|
|
142
|
+
`
|
|
143
|
+
: ''}
|
|
138
144
|
</div>
|
|
139
145
|
<table header>
|
|
140
146
|
<tr>
|
|
@@ -150,8 +156,16 @@ let ChecklistView = class ChecklistView extends connect(store)(LitElement) {
|
|
|
150
156
|
<td>${this.checklist.location}</td>
|
|
151
157
|
</tr>
|
|
152
158
|
<tr>
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
${this.projectType == "DSSP" /* ProjectType.DSSP */
|
|
160
|
+
? html `
|
|
161
|
+
<th>담당자</th>
|
|
162
|
+
<td>${((_k = this.manager) === null || _k === void 0 ? void 0 : _k.name) || ''}</td>
|
|
163
|
+
`
|
|
164
|
+
: html `
|
|
165
|
+
<th>검측 부위</th>
|
|
166
|
+
<td>${((_m = (_l = this.checklist) === null || _l === void 0 ? void 0 : _l.inspectionParts) === null || _m === void 0 ? void 0 : _m.join(', ')) || ''}</td>
|
|
167
|
+
`}
|
|
168
|
+
|
|
155
169
|
<th>검측 상태</th>
|
|
156
170
|
<td>${BUILDING_INSPECTION_STATUS_DISPLAY[this.status]}</td>
|
|
157
171
|
</tr>
|
|
@@ -333,8 +347,27 @@ let ChecklistView = class ChecklistView extends connect(store)(LitElement) {
|
|
|
333
347
|
this.checklist.checklistItems = (_b = (_a = this.checklist) === null || _a === void 0 ? void 0 : _a.checklistItems) === null || _b === void 0 ? void 0 : _b.map(item => item.id == itemId ? Object.assign(Object.assign({}, item), { [name]: value }) : item);
|
|
334
348
|
}
|
|
335
349
|
_onChangeSignature(e) {
|
|
350
|
+
var _a;
|
|
336
351
|
const target = e.target;
|
|
352
|
+
const { name: userName } = (_a = store.getState().auth) === null || _a === void 0 ? void 0 : _a.user;
|
|
337
353
|
this.checklist[target.name] = target.value;
|
|
354
|
+
// 서명할 때 해당 사용자 ID도 업데이트
|
|
355
|
+
if (userName) {
|
|
356
|
+
switch (target.name) {
|
|
357
|
+
case 'taskConstructorSignature':
|
|
358
|
+
this.checklist.taskConstructor = { name: userName };
|
|
359
|
+
break;
|
|
360
|
+
case 'overallConstructorSignature':
|
|
361
|
+
this.checklist.overallConstructor = { name: userName };
|
|
362
|
+
break;
|
|
363
|
+
case 'taskSupervisorySignature':
|
|
364
|
+
this.checklist.taskSupervisory = { name: userName };
|
|
365
|
+
break;
|
|
366
|
+
case 'overallSupervisorySignature':
|
|
367
|
+
this.checklist.overallSupervisory = { name: userName };
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
338
371
|
}
|
|
339
372
|
_getDate(date) {
|
|
340
373
|
if (!date)
|
|
@@ -649,6 +682,10 @@ __decorate([
|
|
|
649
682
|
property({ type: Object }),
|
|
650
683
|
__metadata("design:type", Object)
|
|
651
684
|
], ChecklistView.prototype, "checklist", void 0);
|
|
685
|
+
__decorate([
|
|
686
|
+
property({ type: Object }),
|
|
687
|
+
__metadata("design:type", Object)
|
|
688
|
+
], ChecklistView.prototype, "manager", void 0);
|
|
652
689
|
__decorate([
|
|
653
690
|
property({ type: Object }),
|
|
654
691
|
__metadata("design:type", Object)
|
|
@@ -657,6 +694,10 @@ __decorate([
|
|
|
657
694
|
property({ type: String }),
|
|
658
695
|
__metadata("design:type", String)
|
|
659
696
|
], ChecklistView.prototype, "status", void 0);
|
|
697
|
+
__decorate([
|
|
698
|
+
property({ type: String }),
|
|
699
|
+
__metadata("design:type", String)
|
|
700
|
+
], ChecklistView.prototype, "projectType", void 0);
|
|
660
701
|
ChecklistView = __decorate([
|
|
661
702
|
customElement('checklist-view')
|
|
662
703
|
], ChecklistView);
|