@dssp/supervision 0.0.36 → 1.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
  2. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  3. package/dist-client/pages/checklist/checklist-view.js +2 -5
  4. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  5. package/dist-client/route.d.ts +1 -1
  6. package/dist-client/tsconfig.tsbuildinfo +1 -1
  7. package/dist-server/service/index.d.ts +1 -1
  8. package/dist-server/tsconfig.tsbuildinfo +1 -1
  9. package/package.json +13 -13
  10. package/client/bootstrap.ts +0 -1
  11. package/client/index.ts +0 -0
  12. package/client/pages/action-plan/action-plan-importer.ts +0 -94
  13. package/client/pages/action-plan/action-plan-list-page.ts +0 -340
  14. package/client/pages/building-inspection/building-inspection-detail-camera.ts +0 -277
  15. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +0 -258
  16. package/client/pages/building-inspection/building-inspection-detail-drawing.ts +0 -288
  17. package/client/pages/building-inspection/building-inspection-list.ts +0 -565
  18. package/client/pages/building-inspection/component/building-inspection-detail-header.ts +0 -123
  19. package/client/pages/building-inspection/component/inspection-event-provider.ts +0 -81
  20. package/client/pages/building-inspection/inspection-create-popup.ts +0 -785
  21. package/client/pages/checklist/attachment-list-popup.ts +0 -301
  22. package/client/pages/checklist/checklist-view.ts +0 -581
  23. package/client/pages/checklist/comment-list-popup.ts +0 -328
  24. package/client/pages/checklist/file-preview-popup.ts +0 -70
  25. package/client/pages/checklist-template/checklist-template-item.ts +0 -240
  26. package/client/pages/checklist-template/checklist-template-list.ts +0 -368
  27. package/client/pages/checklist-template/checklist-type-management.ts +0 -262
  28. package/client/pages/issue/issue-importer.ts +0 -94
  29. package/client/pages/issue/issue-list-page.ts +0 -340
  30. package/client/pages/project-report/project-report-importer.ts +0 -94
  31. package/client/pages/project-report/project-report-list-page.ts +0 -340
  32. package/client/pages/supervisor/supervisor-importer.ts +0 -94
  33. package/client/pages/supervisor/supervisor-list-page.ts +0 -340
  34. package/client/route.ts +0 -27
  35. package/client/tsconfig.json +0 -11
  36. package/dist-client/pages/checklist/comment-list-popup copy.d.ts +0 -2
  37. package/dist-client/pages/checklist/comment-list-popup copy.js +0 -344
  38. package/dist-client/pages/checklist/comment-list-popup copy.js.map +0 -1
  39. package/server/controllers/index.ts +0 -0
  40. package/server/index.ts +0 -4
  41. package/server/middlewares/index.ts +0 -3
  42. package/server/migrations/index.ts +0 -9
  43. package/server/routes.ts +0 -28
  44. package/server/service/action-plan/action-plan-mutation.ts +0 -198
  45. package/server/service/action-plan/action-plan-query.ts +0 -62
  46. package/server/service/action-plan/action-plan-type.ts +0 -61
  47. package/server/service/action-plan/action-plan.ts +0 -103
  48. package/server/service/action-plan/index.ts +0 -7
  49. package/server/service/building-inspection/building-inspection-history.ts +0 -72
  50. package/server/service/building-inspection/building-inspection-mutation.ts +0 -276
  51. package/server/service/building-inspection/building-inspection-query.ts +0 -242
  52. package/server/service/building-inspection/building-inspection-type.ts +0 -145
  53. package/server/service/building-inspection/building-inspection.ts +0 -108
  54. package/server/service/building-inspection/event-subscriber.ts +0 -20
  55. package/server/service/building-inspection/index.ts +0 -11
  56. package/server/service/checklist/checklist-history.ts +0 -96
  57. package/server/service/checklist/checklist-mutation.ts +0 -103
  58. package/server/service/checklist/checklist-query.ts +0 -58
  59. package/server/service/checklist/checklist-type.ts +0 -49
  60. package/server/service/checklist/checklist.ts +0 -127
  61. package/server/service/checklist/event-subscriber.ts +0 -17
  62. package/server/service/checklist/index.ts +0 -9
  63. package/server/service/checklist-item/checklist-item-mutation.ts +0 -5
  64. package/server/service/checklist-item/checklist-item-query.ts +0 -84
  65. package/server/service/checklist-item/checklist-item-type.ts +0 -12
  66. package/server/service/checklist-item/checklist-item.ts +0 -103
  67. package/server/service/checklist-item/index.ts +0 -7
  68. package/server/service/checklist-item-comment/checklist-item-comment-history.ts +0 -69
  69. package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +0 -80
  70. package/server/service/checklist-item-comment/checklist-item-comment-query.ts +0 -36
  71. package/server/service/checklist-item-comment/checklist-item-comment-type.ts +0 -32
  72. package/server/service/checklist-item-comment/checklist-item-comment.ts +0 -56
  73. package/server/service/checklist-item-comment/event-subscriber.ts +0 -17
  74. package/server/service/checklist-item-comment/index.ts +0 -9
  75. package/server/service/checklist-template/checklist-template-mutation.ts +0 -66
  76. package/server/service/checklist-template/checklist-template-query.ts +0 -39
  77. package/server/service/checklist-template/checklist-template-type.ts +0 -23
  78. package/server/service/checklist-template/checklist-template.ts +0 -71
  79. package/server/service/checklist-template/index.ts +0 -6
  80. package/server/service/checklist-template-item/checklist-template-item-mutation.ts +0 -64
  81. package/server/service/checklist-template-item/checklist-template-item-query.ts +0 -44
  82. package/server/service/checklist-template-item/checklist-template-item-type.ts +0 -39
  83. package/server/service/checklist-template-item/checklist-template-item.ts +0 -68
  84. package/server/service/checklist-template-item/index.ts +0 -6
  85. package/server/service/checklist-type/checklist-type-mutation.ts +0 -66
  86. package/server/service/checklist-type/checklist-type-query.ts +0 -39
  87. package/server/service/checklist-type/checklist-type-type.ts +0 -26
  88. package/server/service/checklist-type/checklist-type.ts +0 -64
  89. package/server/service/checklist-type/index.ts +0 -6
  90. package/server/service/index.ts +0 -88
  91. package/server/service/issue/index.ts +0 -7
  92. package/server/service/issue/issue-mutation.ts +0 -198
  93. package/server/service/issue/issue-query.ts +0 -62
  94. package/server/service/issue/issue-type.ts +0 -61
  95. package/server/service/issue/issue.ts +0 -100
  96. package/server/service/project-report/index.ts +0 -7
  97. package/server/service/project-report/project-report-mutation.ts +0 -198
  98. package/server/service/project-report/project-report-query.ts +0 -62
  99. package/server/service/project-report/project-report-type.ts +0 -61
  100. package/server/service/project-report/project-report.ts +0 -113
  101. package/server/service/supervisor/index.ts +0 -7
  102. package/server/service/supervisor/supervisor-mutation.ts +0 -198
  103. package/server/service/supervisor/supervisor-query.ts +0 -62
  104. package/server/service/supervisor/supervisor-type.ts +0 -61
  105. package/server/service/supervisor/supervisor.ts +0 -108
  106. package/server/tsconfig.json +0 -10
@@ -1,581 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import gql from 'graphql-tag'
3
- import { client } from '@operato/graphql'
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property } from 'lit/decorators.js'
6
- import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
7
- import {
8
- CHECKLIST_MAIN_TYPE_LIST,
9
- BuildingInspectionStatus,
10
- BUILDING_INSPECTION_STATUS_DISPLAY
11
- } from '../building-inspection/building-inspection-list'
12
- import '@operato/input/ox-input-signature.js'
13
- import { store } from '@operato/shell'
14
- import { connect } from 'pwa-helpers/connect-mixin.js'
15
- import { openPopup } from '@operato/layout'
16
- import './comment-list-popup'
17
- import './attachment-list-popup'
18
-
19
- export const enum ChecklistMode {
20
- VIEWER = 'VIEWER',
21
- EDITOR = 'EDITOR'
22
- }
23
-
24
- @customElement('checklist-view')
25
- class ChecklistView extends connect(store)(LitElement) {
26
- static styles = [
27
- ButtonContainerStyles,
28
- ScrollbarStyles,
29
- css`
30
- :host {
31
- display: flex;
32
- flex-direction: column;
33
- padding: var(--spacing-large, 12px);
34
- padding-top: 0;
35
- font-size: 14px;
36
- min-width: 800px;
37
- }
38
-
39
- [bold] {
40
- font-weight: bold;
41
- }
42
-
43
- div[name] {
44
- display: flex;
45
- color: #586878;
46
- font-size: 24px;
47
- align-items: center;
48
- justify-content: center;
49
- }
50
-
51
- table {
52
- width: 100%;
53
- font-size: 15px;
54
- color: #586878;
55
- text-align: left;
56
- border-collapse: collapse;
57
- td,
58
- th {
59
- border: 1px rgba(51, 51, 51, 0.2) solid;
60
- padding-inline: var(--spacing-medium, 8px);
61
- vertical-align: middle;
62
- }
63
- th {
64
- background-color: #efefef;
65
- font-weight: bold;
66
- }
67
- td {
68
- height: 33px;
69
- background-color: var(--md-sys-color-on-primary);
70
- &[radio] {
71
- text-align: center;
72
- width: 50px;
73
- }
74
- }
75
- }
76
-
77
- table[header] {
78
- margin-top: var(--spacing-small, 4px);
79
-
80
- td {
81
- min-width: 180px;
82
- border-left: none;
83
- }
84
- th {
85
- width: 110px;
86
- border-right: none;
87
- }
88
- }
89
-
90
- table[body] {
91
- border: 2px solid var(--md-sys-color-on-primary-container);
92
- border-bottom: none;
93
- margin-top: var(--spacing-medium, 8px);
94
-
95
- th {
96
- text-align: center;
97
-
98
- &[type] {
99
- min-width: 150px;
100
- }
101
- &[inspection-name] {
102
- min-width: 250px;
103
- }
104
- &[result] {
105
- width: 270px;
106
- }
107
- &[criteria] {
108
- width: 90px;
109
- }
110
- &[small] {
111
- width: 60px;
112
- }
113
- }
114
- td {
115
- &[main-type] {
116
- width: 50px;
117
- text-align: center;
118
- word-break: keep-all;
119
- }
120
-
121
- &[attachment] {
122
- text-align: center;
123
- cursor: pointer;
124
-
125
- * {
126
- vertical-align: middle;
127
- }
128
- }
129
- &[comment] {
130
- cursor: pointer;
131
- text-align: center;
132
-
133
- * {
134
- vertical-align: middle;
135
- }
136
- }
137
- &[disabled] * {
138
- opacity: 0.6;
139
- }
140
- }
141
- }
142
-
143
- table[tail] {
144
- border: 2px solid var(--md-sys-color-on-primary-container);
145
- border-top: none;
146
- margin-top: -1px;
147
-
148
- td {
149
- width: 25%;
150
- border-left: none;
151
- text-align: center;
152
- position: relative;
153
- background-color: var(--md-sys-color-on-primary);
154
- font-size: 14px;
155
- }
156
- th {
157
- width: 25%;
158
- border-right: none;
159
- }
160
-
161
- span[sign-text] {
162
- position: absolute;
163
- top: 50%;
164
- left: 50%;
165
- transform: translate(-50%, -50%);
166
- pointer-events: none;
167
- }
168
- ox-input-signature {
169
- margin: var(--spacing-medium, 8px);
170
-
171
- &[disabled] {
172
- background: #eee;
173
- }
174
- }
175
- }
176
-
177
- div[footer] {
178
- display: flex;
179
- flex-direction: column;
180
- gap: var(--spacing-tiny, 2px);
181
- font-size: 12px;
182
- margin-top: var(--spacing-medium, 8px);
183
- color: #586878;
184
- text-indent: -9px;
185
- padding-left: var(--spacing-medium, 8px);
186
- }
187
- `
188
- ]
189
-
190
- @property({ type: String }) mode: ChecklistMode = ChecklistMode.VIEWER
191
- @property({ type: Object }) checklist: any = {}
192
- @property({ type: Object }) buildingComplex = {
193
- id: '',
194
- taskConstructorEmails: [] as string[],
195
- overallConstructorEmails: [] as string[],
196
- taskSupervisoryEmails: [] as string[],
197
- overallSupervisoryEmails: [] as string[]
198
- }
199
- @property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT
200
-
201
- render() {
202
- const today = this._getDate(new Date())
203
-
204
- // 시공자 스탭 여부
205
- const isConstructorStep =
206
- this.status == BuildingInspectionStatus.WAIT ||
207
- this.status == BuildingInspectionStatus.OVERALL_WAIT ||
208
- this.status == BuildingInspectionStatus.FAIL
209
-
210
- // 감리자 스탭 여부
211
- const isSupervisoryStep =
212
- this.status == BuildingInspectionStatus.REQUEST || this.status == BuildingInspectionStatus.OVERALL_REQUEST
213
-
214
- // 현재 스탭에 해당하는 계정인지 체크 (편집모드만)
215
- let havePermissionByStatus: boolean = false
216
- let isTaskConstructor: boolean = false
217
- let isOverallConstructor: boolean = false
218
- let isTaskSupervisory: boolean = false
219
- let isOverallSupervisory: boolean = false
220
-
221
- if (this.mode == ChecklistMode.EDITOR && this.status) {
222
- const email = (store.getState() as any).auth?.user?.email
223
- // 현재 유저가 "공종별 시공 관리자" 인지 체크
224
- isTaskConstructor = this.buildingComplex.taskConstructorEmails?.includes(email) || false
225
- // 현재 유저가 "총괄 시공 책임자" 인지 체크
226
- isOverallConstructor = this.buildingComplex.overallConstructorEmails?.includes(email) || false
227
- // 현재 유저가 "공종별 감리 책임자" 인지 체크
228
- isTaskSupervisory = this.buildingComplex.taskSupervisoryEmails?.includes(email) || false
229
- // 현재 유저가 "총괄 감리 책임자" 인지 체크
230
- isOverallSupervisory = this.buildingComplex.overallSupervisoryEmails?.includes(email) || false
231
- // 스탭이 시공자 스탭일때에 내가 시공자 권한이 있는지 체크
232
- havePermissionByStatus = isConstructorStep
233
- ? isTaskConstructor || isOverallConstructor
234
- : isTaskSupervisory || isOverallSupervisory
235
- }
236
-
237
- // 체크리스트 아이템 정렬
238
- this.checklist?.checklistItems?.sort((a, b) => {
239
- // 1순위: mainType 오름차순
240
- if (a.mainType < b.mainType) return -1
241
- if (a.mainType > b.mainType) return 1
242
-
243
- // 2순위: detailType 오름차순
244
- if (a.detailType < b.detailType) return -1
245
- if (a.detailType > b.detailType) return 1
246
-
247
- // 3순위: sequence 오름차순
248
- return a.sequence - b.sequence
249
- })
250
-
251
- const processedItems = this.drawChecklistItems(this.checklist?.checklistItems || [])
252
-
253
- return html`
254
- <div wrapper>
255
- <div name bold>${this.checklist.name}</div>
256
-
257
- <table header>
258
- <tr>
259
- <th>공종</th>
260
- <td>${this.checklist.constructionType}</td>
261
- <th>문서 번호</th>
262
- <td>${this.checklist.documentNo}</td>
263
- </tr>
264
- <tr>
265
- <th>세부 공종</th>
266
- <td>${this.checklist.constructionDetailType}</td>
267
- <th>위치 및 부위</th>
268
- <td>${this.checklist.location}</td>
269
- </tr>
270
- <tr>
271
- <th>검측 부위</th>
272
- <td>${this.checklist?.inspectionParts?.join(', ') || ''}</td>
273
- <th>검측 상태</th>
274
- <td>${BUILDING_INSPECTION_STATUS_DISPLAY[this.checklist?.buildingInspection?.status]}</td>
275
- </tr>
276
- </table>
277
-
278
- <table body>
279
- <thead>
280
- <tr>
281
- <th colspan="2" rowspan="3" type>구분</th>
282
- <th rowspan="3" inspection-name>검사항목</th>
283
- <th rowspan="3" criteria>검사기준</th>
284
- <th colspan="4" result>검사결과</th>
285
- <th rowspan="3" small>첨부자료</th>
286
- <th rowspan="3" small>조치사항</th>
287
- </tr>
288
- <tr>
289
- <th colspan="2">시공자</th>
290
- <th colspan="2">감리자</th>
291
- </tr>
292
- <tr>
293
- <th>적합</th>
294
- <th>부적합</th>
295
- <th>적합</th>
296
- <th>부적합</th>
297
- </tr>
298
- </thead>
299
- <tbody>
300
- ${processedItems.map(({ item, showMainTypeCell, mainTypeRowspan, showDetailTypeCell, detailTypeRowspan }, idx) => {
301
- return html` <tr>
302
- ${showMainTypeCell
303
- ? html`<td main-type bold rowspan="${mainTypeRowspan}">${CHECKLIST_MAIN_TYPE_LIST[item.mainType]}</td>`
304
- : ''}
305
- ${showDetailTypeCell ? html` <td bold rowspan="${detailTypeRowspan}">${item.detailType}</td> ` : ''}
306
-
307
- <td>${idx + 1}. ${item.name}</td>
308
- <td>${item.inspctionCriteria}</td>
309
- <td radio>
310
- <md-radio
311
- item-id=${item.id}
312
- item-name="constructionConfirmStatus"
313
- name=${'radio-construction-' + item.id}
314
- value="T"
315
- .checked=${item.constructionConfirmStatus === 'T'}
316
- ?disabled=${!isConstructorStep || !havePermissionByStatus}
317
- @change=${this._onChangeConfirmStatus}
318
- ></md-radio>
319
- </td>
320
- <td radio>
321
- <md-radio
322
- item-id=${item.id}
323
- item-name="constructionConfirmStatus"
324
- name=${'radio-construction-' + item.id}
325
- value="F"
326
- .checked=${item.constructionConfirmStatus === 'F'}
327
- ?disabled=${!isConstructorStep || !havePermissionByStatus}
328
- @change=${this._onChangeConfirmStatus}
329
- ></md-radio>
330
- </td>
331
- <td radio>
332
- <md-radio
333
- item-id=${item.id}
334
- item-name="supervisoryConfirmStatus"
335
- name=${'radio-supervisory-' + item.id}
336
- value="T"
337
- .checked=${item.supervisoryConfirmStatus === 'T'}
338
- ?disabled=${!isSupervisoryStep || !havePermissionByStatus}
339
- @change=${this._onChangeConfirmStatus}
340
- ></md-radio>
341
- </td>
342
- <td radio>
343
- <md-radio
344
- item-id=${item.id}
345
- item-name="supervisoryConfirmStatus"
346
- name=${'radio-supervisory-' + item.id}
347
- value="F"
348
- .checked=${item.supervisoryConfirmStatus === 'F'}
349
- ?disabled=${!isSupervisoryStep || !havePermissionByStatus}
350
- @change=${this._onChangeConfirmStatus}
351
- ></md-radio>
352
- </td>
353
- <td
354
- attachment
355
- ?disabled=${this.status == BuildingInspectionStatus.PASS}
356
- @click=${() => this._onClickAttachment(item.id)}
357
- >
358
- <md-icon slot="icon">attach_file</md-icon>
359
- <span>${item?.checklistItemAttachmentCount || ''}</span>
360
- </td>
361
- <td
362
- comment
363
- ?disabled=${this.status == BuildingInspectionStatus.PASS}
364
- @click=${() => this._onClickComment(item.id)}
365
- >
366
- <md-icon slot="icon">chat</md-icon>
367
- <span>${item?.checklistItemCommentCount || ''}</span>
368
- </td>
369
- </tr>`
370
- })}
371
- </tbody>
372
- </table>
373
-
374
- <table tail>
375
- <tbody>
376
- <tr first>
377
- <th rowspan="2">시공자 점검일</th>
378
- <td rowspan="2">
379
- ${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.constructionInspectionDate)}
380
- </td>
381
- <th>공종별 시공 관리자</th>
382
- <td>
383
- <span sign-text>(인)</span>
384
- <ox-input-signature
385
- .value=${this.checklist.taskConstructorSignature}
386
- name="taskConstructorSignature"
387
- @change=${this._onChangeSignature}
388
- ?disabled=${(this.status != BuildingInspectionStatus.WAIT && this.status != BuildingInspectionStatus.FAIL) ||
389
- !isTaskConstructor}
390
- >
391
- </ox-input-signature>
392
- </td>
393
- </tr>
394
- <tr>
395
- <th>총괄 시공 책임자</th>
396
- <td>
397
- <span sign-text>(인)</span>
398
- <ox-input-signature
399
- .value=${this.checklist.overallConstructorSignature}
400
- name="overallConstructorSignature"
401
- @change=${this._onChangeSignature}
402
- ?disabled=${this.status != BuildingInspectionStatus.OVERALL_WAIT || !isOverallConstructor}
403
- >
404
- </ox-input-signature>
405
- </td>
406
- </tr>
407
- <tr>
408
- <th rowspan="2">감리자 점검일</th>
409
- <td rowspan="2">
410
- ${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.supervisorInspectionDate)}
411
- </td>
412
- <th>공종별 감리 책임자</th>
413
- <td>
414
- <span sign-text>(인)</span>
415
- <ox-input-signature
416
- .value=${this.checklist.taskSupervisorySignature}
417
- name="taskSupervisorySignature"
418
- @change=${this._onChangeSignature}
419
- ?disabled=${this.status != BuildingInspectionStatus.REQUEST || !isTaskSupervisory}
420
- >
421
- </ox-input-signature>
422
- </td>
423
- </tr>
424
- <tr>
425
- <th>총괄 감리 책임자</th>
426
- <td>
427
- <span sign-text>(인)</span>
428
- <ox-input-signature
429
- .value=${this.checklist.overallSupervisorySignature}
430
- name="overallSupervisorySignature"
431
- @change=${this._onChangeSignature}
432
- ?disabled=${this.status != BuildingInspectionStatus.OVERALL_REQUEST || !isOverallSupervisory}
433
- >
434
- </ox-input-signature>
435
- </td>
436
- </tr>
437
- </tbody>
438
- </table>
439
-
440
- <div footer>
441
- <div>
442
- - 검사결과는 1차, 2차로 구분 재검측시 2차에 기록하고 검사기준도 검사결과와 비교될 수 있도록 시방서 또는 도면 등에 있는
443
- 수치를 작성하며, 수치가 없는 검사항목은 시방서 또는 설계도서에 있는 내용과 검사한 내용으로 작성함
444
- </div>
445
- <div>- 검사항목 및 검사기준은 각 공종별로 감리원과 협의하여 작성할 것</div>
446
- </div>
447
- </div>
448
- `
449
- }
450
-
451
- private _onChangeConfirmStatus(e: Event) {
452
- const target = e.target as HTMLInputElement
453
- const itemId = target.getAttribute('item-id')
454
- const name = target.getAttribute('item-name') || ''
455
- const value = target.value
456
-
457
- this.checklist.checklistItems = this.checklist?.checklistItems?.map(item =>
458
- item.id == itemId ? { ...item, [name]: value } : item
459
- )
460
- }
461
-
462
- private _onChangeSignature(e: Event) {
463
- const target = e.target as HTMLInputElement
464
-
465
- this.checklist[target.name] = target.value
466
- }
467
-
468
- private _getDate(date) {
469
- if (!date) return ' 년 월 일'
470
-
471
- const _date = new Date(date) || new Date()
472
- return _date.toLocaleDateString('ko-KR', {
473
- timeZone: 'Asia/Seoul',
474
- year: 'numeric',
475
- month: 'long',
476
- day: 'numeric'
477
- })
478
- }
479
-
480
- private drawChecklistItems(checklistItems) {
481
- const mainTypeRowspans = {}
482
- const detailTypeRowspans = {}
483
- let previousMainType = null
484
- let previousDetailType = null
485
-
486
- return checklistItems.map((item, index) => {
487
- const mainType = item.mainType
488
- const detailType = item.detailType
489
-
490
- // mainType이 변경되면 rowspan을 계산
491
- if (mainType !== previousMainType) {
492
- mainTypeRowspans[mainType] = checklistItems.filter(i => i.mainType === mainType).length
493
- previousDetailType = null // detailType 초기화
494
- }
495
-
496
- // detailType이 변경되면 rowspan을 계산
497
- if (detailType !== previousDetailType) {
498
- detailTypeRowspans[`${mainType}-${detailType}`] = checklistItems.filter(
499
- i => i.mainType === mainType && i.detailType === detailType
500
- ).length
501
- }
502
-
503
- const showMainTypeCell = mainType !== previousMainType
504
- const showDetailTypeCell = detailType !== previousDetailType
505
-
506
- const mainTypeRowspan = mainTypeRowspans[mainType]
507
- const detailTypeRowspan = detailTypeRowspans[`${mainType}-${detailType}`]
508
-
509
- // 이전 값을 업데이트
510
- previousMainType = mainType
511
- previousDetailType = detailType
512
-
513
- return {
514
- item,
515
- showMainTypeCell,
516
- mainTypeRowspan,
517
- showDetailTypeCell,
518
- detailTypeRowspan
519
- }
520
- })
521
- }
522
-
523
- private _onClickComment(checklistItemId: string) {
524
- openPopup(
525
- html`
526
- <comment-list-popup
527
- .checklistItemId=${checklistItemId}
528
- .status=${this.status}
529
- @change-comment=${this._refreshItem.bind(this)}
530
- ></comment-list-popup>
531
- `,
532
- {
533
- backdrop: true,
534
- size: 'medium',
535
- title: '조치 사항'
536
- }
537
- )
538
- }
539
-
540
- private _onClickAttachment(checklistItemId: string) {
541
- openPopup(
542
- html`
543
- <attachment-list-popup
544
- .checklistItemId=${checklistItemId}
545
- .status=${this.status}
546
- @change-attachment=${this._refreshItem.bind(this)}
547
- ></attachment-list-popup>
548
- `,
549
- {
550
- backdrop: true,
551
- size: 'medium',
552
- title: '첨부 자료'
553
- }
554
- )
555
- }
556
-
557
- private async _refreshItem(e) {
558
- const { checklistItemId } = e.detail
559
- const response = await client.query({
560
- query: gql`
561
- query ChecklistItem($checklistItemId: String!) {
562
- checklistItem(id: $checklistItemId) {
563
- id
564
- checklistItemCommentCount
565
- checklistItemAttachmentCount
566
- }
567
- }
568
- `,
569
- variables: {
570
- checklistItemId: checklistItemId
571
- }
572
- })
573
-
574
- const checklistItem = response.data?.checklistItem || []
575
- this.checklist.checklistItems = this.checklist.checklistItems.map(item => {
576
- return item.id != checklistItemId ? item : { ...item, ...checklistItem }
577
- })
578
-
579
- this.requestUpdate()
580
- }
581
- }