@dssp/supervision 0.0.32 → 0.0.33

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 (57) hide show
  1. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +1 -1
  2. package/client/pages/building-inspection/component/inspection-event-provider.ts +1 -1
  3. package/client/pages/checklist/checklist-view.ts +63 -7
  4. package/client/pages/checklist/comment-list-popup.ts +318 -0
  5. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
  6. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  7. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +1 -1
  8. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  9. package/dist-client/pages/checklist/checklist-view.d.ts +1 -0
  10. package/dist-client/pages/checklist/checklist-view.js +57 -7
  11. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  12. package/dist-client/pages/checklist/comment-list-popup.d.ts +2 -0
  13. package/dist-client/pages/checklist/comment-list-popup.js +343 -0
  14. package/dist-client/pages/checklist/comment-list-popup.js.map +1 -0
  15. package/dist-client/tsconfig.tsbuildinfo +1 -1
  16. package/dist-server/service/checklist-item/checklist-item-query.d.ts +3 -0
  17. package/dist-server/service/checklist-item/checklist-item-query.js +21 -0
  18. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
  19. package/dist-server/service/checklist-item/checklist-item.d.ts +2 -1
  20. package/dist-server/service/checklist-item/checklist-item.js +5 -4
  21. package/dist-server/service/checklist-item/checklist-item.js.map +1 -1
  22. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.d.ts +16 -0
  23. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js +83 -0
  24. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js.map +1 -0
  25. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.d.ts +7 -0
  26. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +69 -0
  27. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -0
  28. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.d.ts +7 -0
  29. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js +49 -0
  30. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js.map +1 -0
  31. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.d.ts +14 -0
  32. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js +53 -0
  33. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js.map +1 -0
  34. package/dist-server/service/checklist-item-comment/checklist-item-comment.d.ts +12 -0
  35. package/dist-server/service/checklist-item-comment/checklist-item-comment.js +57 -0
  36. package/dist-server/service/checklist-item-comment/checklist-item-comment.js.map +1 -0
  37. package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +7 -0
  38. package/dist-server/service/checklist-item-comment/event-subscriber.js +21 -0
  39. package/dist-server/service/checklist-item-comment/event-subscriber.js.map +1 -0
  40. package/dist-server/service/checklist-item-comment/index.d.ts +7 -0
  41. package/dist-server/service/checklist-item-comment/index.js +12 -0
  42. package/dist-server/service/checklist-item-comment/index.js.map +1 -0
  43. package/dist-server/service/index.d.ts +2 -1
  44. package/dist-server/service/index.js +6 -1
  45. package/dist-server/service/index.js.map +1 -1
  46. package/dist-server/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +5 -5
  48. package/server/service/checklist-item/checklist-item-query.ts +11 -0
  49. package/server/service/checklist-item/checklist-item.ts +6 -3
  50. package/server/service/checklist-item-comment/checklist-item-comment-history.ts +69 -0
  51. package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +60 -0
  52. package/server/service/checklist-item-comment/checklist-item-comment-query.ts +36 -0
  53. package/server/service/checklist-item-comment/checklist-item-comment-type.ts +32 -0
  54. package/server/service/checklist-item-comment/checklist-item-comment.ts +56 -0
  55. package/server/service/checklist-item-comment/event-subscriber.ts +17 -0
  56. package/server/service/checklist-item-comment/index.ts +9 -0
  57. package/server/service/index.ts +10 -1
@@ -141,7 +141,7 @@ export class BuildingInspectionDetailChecklist extends PageView {
141
141
  inspctionCriteria
142
142
  constructionConfirmStatus
143
143
  supervisoryConfirmStatus
144
- comment
144
+ checklistItemCommentCount
145
145
  }
146
146
  }
147
147
  buildingLevel {
@@ -43,7 +43,7 @@ export class InspectionEventProvider implements EventProvider {
43
43
  const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndPeriod)
44
44
 
45
45
  calendar.forEach(({ date }) => {
46
- const formattedDate = date.toISOString().split('T')[0]
46
+ const formattedDate = date.toLocaleDateString('en-CA') // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.
47
47
  const template = calendarData[formattedDate]
48
48
 
49
49
  if (!template) return
@@ -1,4 +1,6 @@
1
1
  import '@material/web/icon/icon.js'
2
+ import gql from 'graphql-tag'
3
+ import { client } from '@operato/graphql'
2
4
  import { css, html, LitElement } from 'lit'
3
5
  import { customElement, property } from 'lit/decorators.js'
4
6
  import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
@@ -8,9 +10,10 @@ import {
8
10
  BUILDING_INSPECTION_STATUS_DISPLAY
9
11
  } from '../building-inspection/building-inspection-list'
10
12
  import '@operato/input/ox-input-signature.js'
11
- // import { BuildingComplex } from '@dssp/building-complex'
12
13
  import { store } from '@operato/shell'
13
14
  import { connect } from 'pwa-helpers/connect-mixin.js'
15
+ import { openPopup } from '@operato/layout'
16
+ import './comment-list-popup'
14
17
 
15
18
  export const enum ChecklistMode {
16
19
  VIEWER = 'VIEWER',
@@ -56,6 +59,7 @@ class ChecklistView extends connect(store)(LitElement) {
56
59
  th {
57
60
  border: 1px #999999 solid;
58
61
  padding-inline: 8px;
62
+ vertical-align: middle;
59
63
  }
60
64
  th {
61
65
  background-color: #efefef;
@@ -65,12 +69,8 @@ class ChecklistView extends connect(store)(LitElement) {
65
69
  height: 35px;
66
70
  &[radio] {
67
71
  text-align: center;
68
- vertical-align: middle;
69
72
  width: 55px;
70
73
  }
71
- &[attachment] {
72
- width: 90px;
73
- }
74
74
  }
75
75
  }
76
76
 
@@ -117,6 +117,19 @@ class ChecklistView extends connect(store)(LitElement) {
117
117
  text-align: center;
118
118
  word-break: keep-all;
119
119
  }
120
+
121
+ &[attachment] {
122
+ width: 90px;
123
+ text-align: center;
124
+ }
125
+ &[comment] {
126
+ cursor: pointer;
127
+ text-align: center;
128
+
129
+ * {
130
+ vertical-align: middle;
131
+ }
132
+ }
120
133
  }
121
134
  }
122
135
 
@@ -331,8 +344,11 @@ class ChecklistView extends connect(store)(LitElement) {
331
344
  @change=${this._onChangeConfirmStatus}
332
345
  ></md-radio>
333
346
  </td>
334
- <td attachment></td>
335
- <td></td>
347
+ <td attachment><md-icon slot="icon">attach_file</md-icon></td>
348
+ <td comment @click=${() => this._onClickComment(item.id)}>
349
+ <md-icon slot="icon">chat</md-icon>
350
+ <span>${item?.checklistItemCommentCount || ''}</span>
351
+ </td>
336
352
  </tr>`
337
353
  })}
338
354
  </tbody>
@@ -486,4 +502,44 @@ class ChecklistView extends connect(store)(LitElement) {
486
502
  }
487
503
  })
488
504
  }
505
+
506
+ private _onClickComment(checklistItemId: string) {
507
+ openPopup(
508
+ html`
509
+ <comment-list-popup
510
+ .checklistItemId=${checklistItemId}
511
+ @change-comment=${this._refreshComment.bind(this)}
512
+ ></comment-list-popup>
513
+ `,
514
+ {
515
+ backdrop: true,
516
+ size: 'medium',
517
+ title: '조치사항'
518
+ }
519
+ )
520
+ }
521
+
522
+ private async _refreshComment(e) {
523
+ const { checklistItemId } = e.detail
524
+ const response = await client.query({
525
+ query: gql`
526
+ query ChecklistItem($checklistItemId: String!) {
527
+ checklistItem(id: $checklistItemId) {
528
+ id
529
+ checklistItemCommentCount
530
+ }
531
+ }
532
+ `,
533
+ variables: {
534
+ checklistItemId: checklistItemId
535
+ }
536
+ })
537
+
538
+ const checklistItemCommentCount = response.data?.checklistItem?.checklistItemCommentCount || []
539
+ this.checklist.checklistItems = this.checklist.checklistItems.map(item => {
540
+ return item.id != checklistItemId ? item : { ...item, checklistItemCommentCount: checklistItemCommentCount }
541
+ })
542
+
543
+ this.requestUpdate()
544
+ }
489
545
  }
@@ -0,0 +1,318 @@
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, query, state } from 'lit/decorators.js'
6
+ import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
7
+ import { notify } from '@operato/layout'
8
+ import { store, User } from '@operato/shell'
9
+ import { connect } from 'pwa-helpers/connect-mixin.js'
10
+ import { OxPrompt } from '@operato/popup/ox-prompt.js'
11
+ import './checklist-view'
12
+
13
+ @customElement('comment-list-popup')
14
+ class CommentListPopup extends connect(store)(LitElement) {
15
+ static styles = [
16
+ ButtonContainerStyles,
17
+ ScrollbarStyles,
18
+ css`
19
+ :host {
20
+ display: flex;
21
+ flex-direction: column;
22
+ padding: 15px 20px;
23
+ background-color: var(--md-sys-color-surface);
24
+ }
25
+
26
+ div[body] {
27
+ height: 100%;
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: 12px;
31
+ }
32
+
33
+ div[comments-container] {
34
+ overflow-y: auto;
35
+ gap: 10px;
36
+ display: flex;
37
+ flex-direction: column;
38
+ flex: 1;
39
+
40
+ div[comment-row] {
41
+ display: flex;
42
+ flex-direction: column;
43
+
44
+ div[creator-container] {
45
+ display: flex;
46
+ justify-content: space-between;
47
+
48
+ span[creator] {
49
+ font-weight: 600;
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 3px;
53
+ }
54
+ span[createdAt] {
55
+ display: flex;
56
+ align-items: center;
57
+ gap: 3px;
58
+
59
+ md-icon[delete] {
60
+ cursor: pointer;
61
+ }
62
+ }
63
+ }
64
+
65
+ div[comment] {
66
+ margin-left: 20px;
67
+ }
68
+ }
69
+ }
70
+
71
+ h3 {
72
+ position: relative;
73
+ color: rgb(5, 149, 229);
74
+ font-size: 17px;
75
+ font-weight: 700;
76
+ background-color: var(--md-sys-color-surface);
77
+ margin-top: 0px;
78
+ margin-bottom: 5px;
79
+ }
80
+
81
+ textarea {
82
+ height: 75px;
83
+ }
84
+
85
+ div[button-container] {
86
+ display: flex;
87
+ justify-content: flex-end;
88
+ gap: 10px;
89
+
90
+ md-elevated-button[blue] {
91
+ --md-elevated-button-container-color: #0595e5;
92
+
93
+ --md-elevated-button-label-text-color: #fff;
94
+ --md-elevated-button-hover-label-text-color: #fff;
95
+ --md-elevated-button-pressed-label-text-color: #fff;
96
+ --md-elevated-button-focus-label-text-color: #fff;
97
+ --md-elevated-button-icon-color: #fff;
98
+ --md-elevated-button-hover-icon-color: #fff;
99
+ --md-elevated-button-pressed-icon-color: #fff;
100
+ --md-elevated-button-focus-icon-color: #fff;
101
+ }
102
+ }
103
+ `
104
+ ]
105
+
106
+ @property({ type: String }) checklistItemId: string = ''
107
+
108
+ @state() item: any = { count: 0 }
109
+ @state() checklistItemComments: any = []
110
+ @state() comment: string = ''
111
+ @state() checklistItemCommentCount: number = 0
112
+ @state() user: User = {}
113
+ @state() page: number = 1
114
+ @state() loading: boolean = false
115
+ @state() hasMoreComments: boolean = true
116
+
117
+ @query('div[comments-container]') commentsContainer!: HTMLDivElement
118
+
119
+ render() {
120
+ return html`
121
+ <div body>
122
+ <h3>제품검사에 대한 확인: ${this.checklistItemCommentCount || 0}건</h3>
123
+
124
+ <div comments-container @scroll=${this._onScroll}>
125
+ ${this.checklistItemComments.map(comment => {
126
+ return html`
127
+ <div comment-row>
128
+ <div creator-container>
129
+ <span creator><md-icon slot="icon">account_circle</md-icon> ${comment.creator.name}</span>
130
+ <span createdAt>
131
+ <md-icon slot="icon">schedule</md-icon> ${this._formatDate(comment.createdAt)}
132
+ ${comment.creator.email === this.user.email
133
+ ? html` <md-icon delete slot="icon" @click=${() => this._deleteComment(comment.id)}>delete</md-icon>`
134
+ : ''}
135
+ </span>
136
+ </div>
137
+ <div comment>${comment.comment}</div>
138
+ </div>
139
+ `
140
+ })}
141
+ </div>
142
+
143
+ <textarea .value=${this.comment || ''} @input=${this._onInputChange}></textarea>
144
+
145
+ <div button-container>
146
+ <md-elevated-button blue @click=${this._createComment}> <md-icon slot="icon">task</md-icon>저장 </md-elevated-button>
147
+ <md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소 </md-elevated-button>
148
+ </div>
149
+ </div>
150
+ `
151
+ }
152
+
153
+ async firstUpdated() {
154
+ this.user = (store.getState() as any).auth?.user
155
+ this.comment = ''
156
+ this.page = 1
157
+ await this._loadComments()
158
+ this._scrollBottom()
159
+ }
160
+
161
+ private async _loadComments() {
162
+ if (this.loading || !this.hasMoreComments) return
163
+
164
+ this.loading = true
165
+
166
+ const response = await client.query({
167
+ query: gql`
168
+ query ChecklistItemComments($pagination: Pagination!, $checklistItemId: String!) {
169
+ checklistItemComments(pagination: $pagination, checklistItemId: $checklistItemId) {
170
+ id
171
+ comment
172
+ creator {
173
+ id
174
+ email
175
+ }
176
+ createdAt
177
+ }
178
+
179
+ checklistItem(id: $checklistItemId) {
180
+ id
181
+ checklistItemCommentCount
182
+ }
183
+ }
184
+ `,
185
+ variables: {
186
+ checklistItemId: this.checklistItemId,
187
+ pagination: {
188
+ page: this.page,
189
+ limit: 10
190
+ }
191
+ }
192
+ })
193
+
194
+ if (response.errors) return
195
+
196
+ const items = response.data.checklistItemComments
197
+ if (items.length < 10) this.hasMoreComments = false
198
+
199
+ this.checklistItemComments = [...items.reverse(), ...this.checklistItemComments]
200
+ this.page += 1
201
+ this.checklistItemCommentCount = response.data.checklistItem.checklistItemCommentCount
202
+ this.loading = false
203
+ }
204
+
205
+ // 스크롤이 맨 위에 가까울 때 데이터 요청
206
+ private _onScroll() {
207
+ const { scrollTop } = this.commentsContainer
208
+ if (scrollTop <= 5) {
209
+ this._loadComments()
210
+ }
211
+ }
212
+
213
+ private async _createComment() {
214
+ if (!this.comment) {
215
+ notify({ message: '조치사항을 입력해주세요.', level: 'warn' })
216
+ return
217
+ }
218
+
219
+ const response = await client.mutate({
220
+ mutation: gql`
221
+ mutation CreateChecklistItemComment($checklistItemComment: NewChecklistItemComment!) {
222
+ createChecklistItemComment(checklistItemComment: $checklistItemComment) {
223
+ id
224
+ comment
225
+ creator {
226
+ id
227
+ email
228
+ }
229
+ createdAt
230
+ }
231
+ }
232
+ `,
233
+ variables: {
234
+ checklistItemComment: {
235
+ comment: this.comment,
236
+ checklistItemId: this.checklistItemId
237
+ }
238
+ }
239
+ })
240
+
241
+ if (!response.errors) {
242
+ this.comment = ''
243
+ this.checklistItemComments = [...this.checklistItemComments, { ...response.data.createChecklistItemComment }]
244
+ this._scrollBottom()
245
+ this.checklistItemCommentCount++
246
+ } else {
247
+ notify({ message: response.errors?.[0]?.message || '조치사항 등록에 실패하였습니다.', level: 'error' })
248
+ }
249
+
250
+ this._dispatchEvent()
251
+ }
252
+
253
+ private async _deleteComment(commentId: string) {
254
+ if (
255
+ await OxPrompt.open({
256
+ title: '조치 사항을 삭제',
257
+ text: '조치 사항을 삭제 하시겠습니까?',
258
+ confirmButton: { text: '삭제' },
259
+ cancelButton: { text: '취소' }
260
+ })
261
+ ) {
262
+ const response = await client.mutate({
263
+ mutation: gql`
264
+ mutation DeleteChecklistItemComment($id: String!) {
265
+ deleteChecklistItemComment(id: $id)
266
+ }
267
+ `,
268
+ variables: {
269
+ id: commentId
270
+ }
271
+ })
272
+
273
+ if (!response.errors) {
274
+ this.checklistItemComments = [...this.checklistItemComments.filter(comment => comment.id != commentId)]
275
+ notify({ message: '조치사항을 삭제하였습니다.', level: 'info' })
276
+ } else {
277
+ notify({ message: response.errors?.[0]?.message || '조치사항 삭제에 실패하였습니다.', level: 'error' })
278
+ }
279
+
280
+ this._dispatchEvent()
281
+ }
282
+ }
283
+
284
+ private _close() {
285
+ history.back()
286
+ }
287
+
288
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
289
+ private _onInputChange(event: InputEvent) {
290
+ const target = event.target as HTMLInputElement
291
+ this.comment = target.value
292
+ }
293
+
294
+ private _formatDate(date) {
295
+ const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }))
296
+
297
+ const year = _date.getFullYear()
298
+ const month = String(_date.getMonth() + 1).padStart(2, '0')
299
+ const day = String(_date.getDate()).padStart(2, '0')
300
+ const hours = String(_date.getHours()).padStart(2, '0')
301
+ const minutes = String(_date.getMinutes()).padStart(2, '0')
302
+ const seconds = String(_date.getSeconds()).padStart(2, '0')
303
+
304
+ return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`
305
+ }
306
+
307
+ // 댓글 스크롤 맨 밑으로
308
+ private async _scrollBottom() {
309
+ setTimeout(() => {
310
+ this.commentsContainer.scrollTop = this.commentsContainer.scrollHeight
311
+ }, 100)
312
+ }
313
+
314
+ // 조치사항 변경 이벤트 디스패치
315
+ _dispatchEvent() {
316
+ this.dispatchEvent(new CustomEvent('change-comment', { detail: { checklistItemId: this.checklistItemId } }))
317
+ }
318
+ }
@@ -93,7 +93,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
93
93
  inspctionCriteria
94
94
  constructionConfirmStatus
95
95
  supervisoryConfirmStatus
96
- comment
96
+ checklistItemCommentCount
97
97
  }
98
98
  }
99
99
  buildingLevel {
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-checklist.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAA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L,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA,MAAA,MAAA,QAAQ,CAAC,MAAM,0CAAG,CAAC,CAAC,0CAAE,OAAO,KAAI,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;SAC5F;IACH,CAAC;;AArOM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;kEAAkB;AAC1B;IAAC,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CAuO7C;SAvOY,iCAAiC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\n\nimport { verifyBiometric } from '@things-factory/auth-base/client'\n\nimport './component/building-inspection-detail-header'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n this.buildingInspection.id,\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button @click=${this._onClickModifyChecklist}>\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n buildingInspection {\n status\n }\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n comment\n }\n }\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n overallConstructorEmails\n taskConstructorEmails\n overallSupervisoryEmails\n taskSupervisoryEmails\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n try {\n const result = await verifyBiometric()\n if (result.verified) {\n console.log('Verification successful. Proceeding with sensitive action.')\n } else {\n notify({ message: 'Verification failed:' + result.message })\n return\n }\n } catch (error) {\n notify({ message: 'Error during biometric verification:' + error })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n}\n"]}
1
+ {"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-checklist.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,+CAA+C,CAAA;AACtD,OAAO,6BAA6B,CAAA;AAI7B,IAAM,iCAAiC,GAAvC,MAAM,iCAAkC,SAAQ,QAAQ;IAAxD;;QAwCI,YAAO,GAAQ,EAAE,CAAA;QACjB,uBAAkB,GAAQ,EAAE,CAAA;IA8LvC,CAAC;IA5LC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,qBAAqB;SAC7B,CAAA;IACH,CAAC;IAED,MAAM;;QACJ,OAAO,IAAI,CAAA;;gCAEiB,MAAA,IAAI,CAAC,kBAAkB,0CAAE,EAAE;2BAChC,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,0CAAE,EAAE;uBAC9C,IAAI,CAAC,OAAO,CAAC,IAAI;wBAChB,MAAA,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,0CAAE,QAAQ,0CAAE,IAAI;8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oBACD,aAAa,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBACnD,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,yBAAyB,EAAE,IAAI,CAAC,yBAAyB;wBACzD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;qBACxD,CAAC,CAAC;iBACJ;aACF;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,MAAM,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAA;YACtC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAA;SACxD;aAAM;YACL,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA,MAAA,MAAA,QAAQ,CAAC,MAAM,0CAAG,CAAC,CAAC,0CAAE,OAAO,KAAI,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;SAC5F;IACH,CAAC;;AArOM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;kEAAkB;AAC1B;IAAC,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CAuO7C;SAvOY,iCAAiC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\n\nimport { verifyBiometric } from '@things-factory/auth-base/client'\n\nimport './component/building-inspection-detail-header'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n this.buildingInspection.id,\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button @click=${this._onClickModifyChecklist}>\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n buildingInspection {\n status\n }\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n checklistItemCommentCount\n }\n }\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n overallConstructorEmails\n taskConstructorEmails\n overallSupervisoryEmails\n taskSupervisoryEmails\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n try {\n const result = await verifyBiometric()\n if (result.verified) {\n console.log('Verification successful. Proceeding with sensitive action.')\n } else {\n notify({ message: 'Verification failed:' + result.message })\n return\n }\n } catch (error) {\n notify({ message: 'Error during biometric verification:' + error })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n}\n"]}
@@ -36,7 +36,7 @@ export class InspectionEventProvider {
36
36
  // if (response.errors) return null
37
37
  const calendarData = this.getCalendarTemplate((_b = response.data) === null || _b === void 0 ? void 0 : _b.buildingInspectionDateSummaryOfLevelAndPeriod);
38
38
  calendar.forEach(({ date }) => {
39
- const formattedDate = date.toISOString().split('T')[0];
39
+ const formattedDate = date.toLocaleDateString('en-CA'); // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.
40
40
  const template = calendarData[formattedDate];
41
41
  if (!template)
42
42
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"inspection-event-provider.js","sourceRoot":"","sources":["../../../../client/pages/building-inspection/component/inspection-event-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,OAAO,uBAAuB;IAGlC,YAAY,kBAA0B,EAAE;QAFxC,oBAAe,GAAG,EAAE,CAAA;QAGlB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;IACxC,CAAC;IAED,KAAK,CAAC,sBAA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CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAED,+BAA+B;IACvB,mBAAmB,CAAC,iBAAwB,EAAE;QACpD,MAAM,QAAQ,GAAG,EAAE,CAAA;QACnB,KAAK,IAAI,IAAI,IAAI,cAAc,EAAE;YAC/B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;;YAE3B,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC5G,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE;YAClH,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC5G,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;;OAEjH,CAAA;SACF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF","sourcesContent":["import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view'\nimport { html, TemplateResult } from 'lit'\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\n\nexport class InspectionEventProvider implements EventProvider {\n buildingLevelId = {}\n\n constructor(buildingLevelId: string = '') {\n this.buildingLevelId = buildingLevelId\n }\n\n async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {\n const result = new Map<Date, BizEvent[]>()\n const startDate = calendar[0]['date'].toISOString().split('T')[0]\n const endDate = calendar.at(-1)?.['date'].toISOString().split('T')[0]\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfLevelAndPeriod($buildingLevelId: String!, $startDate: String!, $endDate: String!) {\n buildingInspectionDateSummaryOfLevelAndPeriod(\n buildingLevelId: $buildingLevelId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n }\n }\n `,\n variables: {\n buildingLevelId: this.buildingLevelId,\n startDate,\n endDate\n }\n })\n\n // if (response.errors) return null\n\n const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndPeriod)\n\n calendar.forEach(({ date }) => {\n const formattedDate = date.toISOString().split('T')[0]\n const template = calendarData[formattedDate]\n\n if (!template) return\n\n result.set(date, [\n {\n due: formattedDate,\n template: template,\n title: '',\n color: '',\n clickEvent: e => console.log('e :', e, template)\n }\n ])\n })\n\n return result\n }\n\n // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기\n private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {\n const template = {}\n for (let date of inspectionData) {\n template[date.requestDate] = html`\n <div style=\"display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;\">\n ${date.wait !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #4e5055\">●</span> ${date.wait}</div>` : ''}\n ${date.request !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #3395f1\">●</span> ${date.request}</div>` : ''}\n ${date.pass !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #1bb401\">●</span> ${date.pass}</div>` : ''}\n ${date.fail !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #ff4444\">●</span> ${date.fail}</div>` : ''}\n </div>\n `\n }\n\n return template\n }\n}\n"]}
1
+ {"version":3,"file":"inspection-event-provider.js","sourceRoot":"","sources":["../../../../client/pages/building-inspection/component/inspection-event-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,OAA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T,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC;iBACjD;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAED,+BAA+B;IACvB,mBAAmB,CAAC,iBAAwB,EAAE;QACpD,MAAM,QAAQ,GAAG,EAAE,CAAA;QACnB,KAAK,IAAI,IAAI,IAAI,cAAc,EAAE;YAC/B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;;YAE3B,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC5G,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE;YAClH,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC5G,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;;OAEjH,CAAA;SACF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF","sourcesContent":["import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view'\nimport { html, TemplateResult } from 'lit'\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\n\nexport class InspectionEventProvider implements EventProvider {\n buildingLevelId = {}\n\n constructor(buildingLevelId: string = '') {\n this.buildingLevelId = buildingLevelId\n }\n\n async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {\n const result = new Map<Date, BizEvent[]>()\n const startDate = calendar[0]['date'].toISOString().split('T')[0]\n const endDate = calendar.at(-1)?.['date'].toISOString().split('T')[0]\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfLevelAndPeriod($buildingLevelId: String!, $startDate: String!, $endDate: String!) {\n buildingInspectionDateSummaryOfLevelAndPeriod(\n buildingLevelId: $buildingLevelId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n }\n }\n `,\n variables: {\n buildingLevelId: this.buildingLevelId,\n startDate,\n endDate\n }\n })\n\n // if (response.errors) return null\n\n const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndPeriod)\n\n calendar.forEach(({ date }) => {\n const formattedDate = date.toLocaleDateString('en-CA') // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.\n const template = calendarData[formattedDate]\n\n if (!template) return\n\n result.set(date, [\n {\n due: formattedDate,\n template: template,\n title: '',\n color: '',\n clickEvent: e => console.log('e :', e, template)\n }\n ])\n })\n\n return result\n }\n\n // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기\n private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {\n const template = {}\n for (let date of inspectionData) {\n template[date.requestDate] = html`\n <div style=\"display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;\">\n ${date.wait !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #4e5055\">●</span> ${date.wait}</div>` : ''}\n ${date.request !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #3395f1\">●</span> ${date.request}</div>` : ''}\n ${date.pass !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #1bb401\">●</span> ${date.pass}</div>` : ''}\n ${date.fail !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #ff4444\">●</span> ${date.fail}</div>` : ''}\n </div>\n `\n }\n\n return template\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import '@operato/input/ox-input-signature.js';
3
+ import './comment-list-popup';
3
4
  export declare const enum ChecklistMode {
4
5
  VIEWER = "VIEWER",
5
6
  EDITOR = "EDITOR"