@dssp/supervision 0.0.18 → 0.0.20

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 (70) hide show
  1. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +16 -10
  2. package/client/pages/building-inspection/building-inspection-detail-drawing.ts +17 -5
  3. package/client/pages/building-inspection/building-inspection-list.ts +152 -48
  4. package/client/pages/building-inspection/component/building-inspection-detail-header.ts +4 -1
  5. package/client/pages/building-inspection/component/inspection-event-provider.ts +32 -0
  6. package/client/pages/building-inspection/inspection-create-popup.ts +186 -124
  7. package/client/pages/checklist/checklist-view.ts +13 -29
  8. package/client/pages/checklist-template/checklist-template-list.ts +106 -9
  9. package/client/pages/checklist-template/checklist-type-management.ts +34 -14
  10. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +1 -3
  11. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +12 -8
  12. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  13. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +1 -0
  14. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +21 -10
  15. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
  16. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +5 -1
  17. package/dist-client/pages/building-inspection/building-inspection-list.js +151 -47
  18. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  19. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +4 -1
  20. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
  21. package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +6 -0
  22. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +26 -0
  23. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -0
  24. package/dist-client/pages/building-inspection/inspection-create-popup.js +162 -97
  25. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  26. package/dist-client/pages/checklist/checklist-view.js +9 -38
  27. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  28. package/dist-client/pages/checklist-template/checklist-template-list.d.ts +10 -1
  29. package/dist-client/pages/checklist-template/checklist-template-list.js +99 -9
  30. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  31. package/dist-client/pages/checklist-template/checklist-type-management.d.ts +8 -1
  32. package/dist-client/pages/checklist-template/checklist-type-management.js +35 -14
  33. package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -1
  34. package/dist-client/route.d.ts +1 -1
  35. package/dist-client/tsconfig.tsbuildinfo +1 -1
  36. package/dist-server/service/building-inspection/building-inspection-history.d.ts +1 -1
  37. package/dist-server/service/building-inspection/building-inspection-history.js +3 -5
  38. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
  39. package/dist-server/service/building-inspection/building-inspection-mutation.js +0 -1
  40. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  41. package/dist-server/service/building-inspection/building-inspection-query.d.ts +1 -0
  42. package/dist-server/service/building-inspection/building-inspection-query.js +32 -4
  43. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  44. package/dist-server/service/building-inspection/building-inspection-type.d.ts +1 -0
  45. package/dist-server/service/building-inspection/building-inspection-type.js +4 -0
  46. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  47. package/dist-server/service/building-inspection/building-inspection.d.ts +1 -1
  48. package/dist-server/service/building-inspection/building-inspection.js +3 -3
  49. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  50. package/dist-server/service/checklist/checklist-query.d.ts +2 -0
  51. package/dist-server/service/checklist/checklist-query.js +11 -0
  52. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  53. package/dist-server/service/checklist-template-item/checklist-template-item-query.d.ts +1 -0
  54. package/dist-server/service/checklist-template-item/checklist-template-item-query.js +12 -0
  55. package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -1
  56. package/dist-server/service/checklist-template-item/checklist-template-item.js +2 -1
  57. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  58. package/dist-server/service/checklist-type/checklist-type-query.js +1 -1
  59. package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -1
  60. package/dist-server/tsconfig.tsbuildinfo +1 -1
  61. package/package.json +4 -4
  62. package/server/service/building-inspection/building-inspection-history.ts +3 -5
  63. package/server/service/building-inspection/building-inspection-mutation.ts +0 -1
  64. package/server/service/building-inspection/building-inspection-query.ts +31 -4
  65. package/server/service/building-inspection/building-inspection-type.ts +3 -0
  66. package/server/service/building-inspection/building-inspection.ts +3 -4
  67. package/server/service/checklist/checklist-query.ts +6 -0
  68. package/server/service/checklist-template-item/checklist-template-item-query.ts +8 -3
  69. package/server/service/checklist-template-item/checklist-template-item.ts +2 -1
  70. package/server/service/checklist-type/checklist-type-query.ts +1 -1
@@ -4,9 +4,9 @@ import '@operato/data-grist'
4
4
  import { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
5
5
  import { PageView } from '@operato/shell'
6
6
  import { css, html } from 'lit'
7
+ import { customElement, state } from 'lit/decorators.js'
8
+ import { keyed } from 'lit/directives/keyed.js'
7
9
  import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
8
- import { customElement, query, state } from 'lit/decorators.js'
9
- import { ScopedElementsMixin } from '@open-wc/scoped-elements'
10
10
  import { client } from '@operato/graphql'
11
11
  import { notify } from '@operato/layout'
12
12
  import gql from 'graphql-tag'
@@ -17,7 +17,7 @@ import '../checklist/checklist-view'
17
17
  import { ChecklistMode } from '../checklist/checklist-view'
18
18
 
19
19
  @customElement('building-inspection-detail-checklist')
20
- export class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageView) {
20
+ export class BuildingInspectionDetailChecklist extends PageView {
21
21
  static styles = [
22
22
  ScrollbarStyles,
23
23
  CommonGristStyles,
@@ -77,11 +77,16 @@ export class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageV
77
77
  ></building-inspection-detail-header>
78
78
 
79
79
  <div body>
80
- <checklist-view
81
- .mode=${ChecklistMode.EDITOR}
82
- status=${this.buildingInspection.status}
83
- .checklist=${this.buildingInspection.checklist || {}}
84
- ></checklist-view>
80
+ ${keyed(
81
+ this.buildingInspection.id,
82
+ html`
83
+ <checklist-view
84
+ .mode=${ChecklistMode.EDITOR}
85
+ status=${this.buildingInspection.status}
86
+ .checklist=${this.buildingInspection.checklist || {}}
87
+ ></checklist-view>
88
+ `
89
+ )}
85
90
 
86
91
  <div button-container>
87
92
  <md-elevated-button @click=${this._onClickModifyChecklist}>
@@ -121,6 +126,9 @@ export class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageV
121
126
  taskConstructorSignature
122
127
  overallSupervisorySignature
123
128
  taskSupervisorySignature
129
+ buildingInspection {
130
+ status
131
+ }
124
132
  checklistItems {
125
133
  id
126
134
  name
@@ -186,8 +194,6 @@ export class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageV
186
194
  }
187
195
 
188
196
  private _onClickModifyChecklist() {
189
- console.log('checklist : ', this.buildingInspection.checklist)
190
-
191
197
  this.validateChecklist(this.buildingInspection.checklist)
192
198
  }
193
199
 
@@ -10,6 +10,8 @@ import { notify } from '@operato/layout'
10
10
  import gql from 'graphql-tag'
11
11
  import './component/building-inspection-detail-header'
12
12
  import '@operato/image-marker/ox-image-marker.js'
13
+ import '@operato/image-marker/ox-image-marker-view.js'
14
+ import { BuildingInspectionStatus } from './building-inspection-list'
13
15
 
14
16
  @customElement('building-inspection-detail-drawing')
15
17
  export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageView) {
@@ -33,6 +35,10 @@ export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageVie
33
35
  div[body] {
34
36
  display: flex;
35
37
  justify-content: center;
38
+
39
+ ox-image-marker-view {
40
+ width: 100%;
41
+ }
36
42
  }
37
43
  `
38
44
  ]
@@ -48,6 +54,9 @@ export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageVie
48
54
  }
49
55
 
50
56
  render() {
57
+ const imageUrl = this.buildingInspection?.buildingLevel?.mainDrawingImage || '/assets/images/img-drawing-default.png'
58
+ const shapes = JSON.parse(this.buildingInspection?.drawingMarker || null) || []
59
+
51
60
  return html`
52
61
  <building-inspection-detail-header
53
62
  .buildingInspectionId=${this.buildingInspection?.id}
@@ -58,11 +67,14 @@ export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageVie
58
67
  ></building-inspection-detail-header>
59
68
 
60
69
  <div body>
61
- <ox-image-marker
62
- .imageUrl=${this.buildingInspection?.buildingLevel?.mainDrawingImage || '/assets/images/img-drawing-default.png'}
63
- .shapes=${JSON.parse(this.buildingInspection?.drawingMarker || null) || []}
64
- @shapes-changed=${this.onClickMarkerSave}
65
- ></ox-image-marker>
70
+ ${this.buildingInspection?.status == BuildingInspectionStatus.PASS
71
+ ? html`<ox-image-marker-view .imageUrl=${imageUrl} .shapes=${shapes}></ox-image-marker-view>`
72
+ : html` <ox-image-marker
73
+ .imageUrl=${imageUrl}
74
+ .shapes=${shapes}
75
+ @shapes-changed=${this.onClickMarkerSave}
76
+ .currentMode=${'view'}
77
+ ></ox-image-marker>`}
66
78
  </div>
67
79
  `
68
80
  }
@@ -3,7 +3,7 @@ import '@operato/data-grist'
3
3
 
4
4
  import { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
5
5
  import { PageView, navigate } from '@operato/shell'
6
- import { css, html } from 'lit'
6
+ import { css, html, TemplateResult } from 'lit'
7
7
  import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
8
8
  import { customElement, query, state } from 'lit/decorators.js'
9
9
  import { ScopedElementsMixin } from '@open-wc/scoped-elements'
@@ -14,6 +14,8 @@ import gql from 'graphql-tag'
14
14
  import { openPopup } from '@operato/layout'
15
15
  import './inspection-create-popup'
16
16
  import '@operato/event-view/ox-event-view.js'
17
+ import { InspectionEventProvider } from './component/inspection-event-provider'
18
+ import { EventProvider } from '@operato/event-view'
17
19
 
18
20
  export enum ChecklistTypeMainType {
19
21
  BASIC = '10',
@@ -100,7 +102,6 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
100
102
  div[body] > div {
101
103
  display: flex;
102
104
  gap: 10px;
103
- padding: 15px;
104
105
  border-radius: 5px;
105
106
  }
106
107
 
@@ -108,30 +109,77 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
108
109
  flex: 1;
109
110
 
110
111
  display: flex;
111
- background-color: #ffffff;
112
- border: 1px solid #cccccc80;
112
+ background-color: #f7f7f7;
113
113
  }
114
114
 
115
- img[drawing] {
116
- width: 400px;
115
+ div[drawing] {
116
+ flex: 0.4;
117
+ border: 1px solid #cccccc80;
118
+ background-color: #fff;
119
+ padding: 10px;
120
+ border-radius: 5px;
121
+
122
+ img {
123
+ width: 100%;
117
124
 
118
- display: block;
119
- object-fit: contain; /* 이미지 비율 유지하고 컨테이너에 맞춰서 축소/확대 */
120
- object-position: center; /* 이미지를 중앙에 배치 */
125
+ display: block;
126
+ object-fit: contain;
127
+ object-position: center;
128
+ }
121
129
  }
122
130
 
123
- div[status] {
124
- flex: 1;
131
+ div[inspection-container] {
132
+ flex: 0.6;
133
+ gap: 5px;
125
134
 
126
135
  display: flex;
127
136
  flex-direction: column;
128
- }
129
-
130
- div[inspection-data] {
131
- flex: 1;
132
137
 
133
- display: flex;
134
- gap: 10px;
138
+ div[inspection] {
139
+ display: grid;
140
+ grid-template-columns: 120px 0.9fr 0.9fr 0.9fr 0.9fr;
141
+ margin-top: 5px;
142
+ background: #ebc8321a;
143
+ border-radius: 7px;
144
+ padding: 7px 0px;
145
+
146
+ & > span {
147
+ display: flex;
148
+ flex-direction: column;
149
+ align-items: center;
150
+ justify-content: center;
151
+
152
+ div[status='wait'] {
153
+ color: #4e5055;
154
+ }
155
+ div[status='request'] {
156
+ color: #3395f1;
157
+ }
158
+ div[status='pass'] {
159
+ color: #1bb401;
160
+ }
161
+ div[status='fail'] {
162
+ color: #ff4444;
163
+ }
164
+ span[dot] {
165
+ font-size: 1.3em;
166
+ }
167
+ }
168
+ & > span[name] {
169
+ flex-direction: row;
170
+ text-align: right;
171
+ gap: 10px;
172
+ border-right: 2px dotted #ccc;
173
+
174
+ md-icon {
175
+ width: 40px;
176
+ height: 40px;
177
+ border-radius: 7px;
178
+ color: #fff;
179
+ background: #f16154;
180
+ }
181
+ }
182
+ }
135
183
  }
136
184
 
137
185
  ox-event-view {
@@ -167,6 +215,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
167
215
  @state() building: any = {}
168
216
  @state() drawingImage: string = ''
169
217
  @state() buildingInspectionSummary: any = {}
218
+ @state() calendarData?: EventProvider
170
219
 
171
220
  @query('ox-grist') private grist!: DataGrist
172
221
  @query('ox-event-view') private eventView!: HTMLElement
@@ -192,22 +241,44 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
192
241
  render() {
193
242
  return html`
194
243
  <div header>
195
- <h2>${this.project.name} ${this.location}</h2>
244
+ <h2>${this.project.name}</h2>
196
245
  </div>
197
246
 
198
247
  <div body>
199
248
  <div top>
200
- <img drawing src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />
201
- <div status>
202
- <h3>${this.location} 검측 현황</h3>
203
- <div inspection-data>
204
- <div>
205
- ${Object.entries(BUILDING_INSPECTION_STATUS).map(
206
- status => html` <div>${status[1]} ${this.buildingInspectionSummary[status[0].toLowerCase()]}건</div> `
207
- )}
208
- </div>
209
- <ox-event-view mode=${'monthly'}> </ox-event-view>
249
+ <div drawing>
250
+ <h3>도면: ${this.location}</h3>
251
+ <img src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />
252
+ </div>
253
+
254
+ <div inspection-container>
255
+ <div inspection>
256
+ <span name bold>
257
+ <md-icon slot="icon">fact_check</md-icon>
258
+ 검측<br />현황
259
+ </span>
260
+
261
+ ${Object.entries(BUILDING_INSPECTION_STATUS).map(inspectionStatus => {
262
+ const displayName = inspectionStatus[1]
263
+ const status = inspectionStatus[0].toLowerCase()
264
+
265
+ return html`
266
+ <span>
267
+ <div>${displayName}</div>
268
+ <div bold status=${status}><span dot>●</span> ${this.buildingInspectionSummary[status]}</div>
269
+ </span>
270
+ `
271
+ })}
210
272
  </div>
273
+
274
+ <ox-event-view
275
+ .mode=${'monthly'}
276
+ .eventProvider=${this.calendarData}
277
+ @select-date=${(e: CustomEvent) => {
278
+ console.log('select-date', e.detail)
279
+ }}
280
+ >
281
+ </ox-event-view>
211
282
  </div>
212
283
  </div>
213
284
 
@@ -230,7 +301,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
230
301
  async initProject(buildingLevelId: string = '') {
231
302
  const response = await client.query({
232
303
  query: gql`
233
- query ProjectByBuildingLevelId($buildingLevelId: String!) {
304
+ query ProjectByBuildingLevelId($buildingLevelId: String!, $yearMonth: String!) {
234
305
  projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {
235
306
  id
236
307
  name
@@ -257,10 +328,19 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
257
328
  pass
258
329
  fail
259
330
  }
331
+
332
+ buildingInspectionDateSummaryOfLevelAndMonth(buildingLevelId: $buildingLevelId, yearMonth: $yearMonth) {
333
+ requestDate
334
+ wait
335
+ request
336
+ pass
337
+ fail
338
+ }
260
339
  }
261
340
  `,
262
341
  variables: {
263
- buildingLevelId
342
+ buildingLevelId,
343
+ yearMonth: '2024-10'
264
344
  }
265
345
  })
266
346
 
@@ -269,6 +349,9 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
269
349
  this.project = response.data?.projectByBuildingLevelId
270
350
  this.buildingInspectionSummary = response.data?.buildingInspectionSummaryOfBuildingLevel
271
351
 
352
+ const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndMonth)
353
+ this.calendarData = new InspectionEventProvider(calendarData)
354
+
272
355
  // 캘린더 최소 높이 속성 수정
273
356
  this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px')
274
357
  }
@@ -346,25 +429,12 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
346
429
 
347
430
  const response = await client.query({
348
431
  query: gql`
349
- query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!) {
432
+ query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!, $buildingLevelId: String!) {
350
433
  buildingInspectionsOfBuildingLevel(params: $params) {
351
434
  items {
352
435
  id
353
436
  status
354
437
  requestDate
355
- buildingLevel {
356
- floor
357
- building {
358
- id
359
- name
360
- }
361
- mainDrawing {
362
- id
363
- name
364
- fullpath
365
- }
366
- mainDrawingImage
367
- }
368
438
  checklist {
369
439
  checklistId: id
370
440
  name
@@ -376,13 +446,29 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
376
446
  }
377
447
  total
378
448
  }
449
+
450
+ buildingLevel(id: $buildingLevelId) {
451
+ id
452
+ floor
453
+ building {
454
+ id
455
+ name
456
+ }
457
+ mainDrawing {
458
+ id
459
+ name
460
+ fullpath
461
+ }
462
+ mainDrawingImage
463
+ }
379
464
  }
380
465
  `,
381
466
  variables: {
382
467
  params: {
383
468
  buildingLevelId: this.buildingLevelId,
384
469
  limit: 0
385
- }
470
+ },
471
+ buildingLevelId: this.buildingLevelId
386
472
  }
387
473
  })
388
474
 
@@ -392,10 +478,11 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
392
478
  ...item.checklist,
393
479
  requestDate: this._formatDate(item.requestDate)
394
480
  }))
481
+ const buildingLevel = response.data?.buildingLevel
395
482
 
396
- this.location = items[0]?.checklist?.location || ''
397
- this.drawingImage = items[0]?.buildingLevel?.mainDrawingImage || ''
398
- this.building = items[0]?.buildingLevel?.building || {}
483
+ this.location = `${buildingLevel.building.name} ${buildingLevel.floor}층` || ''
484
+ this.drawingImage = buildingLevel?.mainDrawingImage || ''
485
+ this.building = buildingLevel?.building || {}
399
486
 
400
487
  return {
401
488
  total: response.data?.buildingInspectionsOfBuildingLevel?.total || 0,
@@ -454,4 +541,21 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
454
541
  }).format(new Date(date))
455
542
  : ''
456
543
  }
544
+
545
+ // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기
546
+ private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {
547
+ const template = {}
548
+ for (let date of inspectionData) {
549
+ template[date.requestDate] = html`
550
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;">
551
+ ${date.wait !== 0 ? html`<div><span style="font-size: 1.3em; color: #4e5055">●</span> ${date.wait}</div>` : ''}
552
+ ${date.request !== 0 ? html`<div><span style="font-size: 1.3em; color: #3395f1">●</span> ${date.request}</div>` : ''}
553
+ ${date.pass !== 0 ? html`<div><span style="font-size: 1.3em; color: #1bb401">●</span> ${date.pass}</div>` : ''}
554
+ ${date.fail !== 0 ? html`<div><span style="font-size: 1.3em; color: #ff4444">●</span> ${date.fail}</div>` : ''}
555
+ </div>
556
+ `
557
+ }
558
+
559
+ return template
560
+ }
457
561
  }
@@ -81,9 +81,12 @@ class buildingInspectionDetailHeader extends LitElement {
81
81
  <md-elevated-button href=${`building-inspection-detail-checklist/${this.buildingInspectionId}`}>
82
82
  <md-icon slot="icon">description</md-icon>검측 체크리스트
83
83
  </md-elevated-button>
84
- <md-elevated-button href=${`building-inspection-detail-photo/${this.buildingInspectionId}`}>
84
+ <md-elevated-button href=${`building-inspection-detail-photo/${this.buildingInspectionId}`} disabled>
85
85
  <md-icon slot="icon">description</md-icon>사진촬영
86
86
  </md-elevated-button>
87
+ <md-elevated-button href=${`building-inspection-detail-history/${this.buildingInspectionId}`} disabled>
88
+ <md-icon slot="icon">description</md-icon>감리이력
89
+ </md-elevated-button>
87
90
  </div>
88
91
  </div>
89
92
  `
@@ -0,0 +1,32 @@
1
+ import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view'
2
+
3
+ export class InspectionEventProvider implements EventProvider {
4
+ calendarData = {}
5
+
6
+ constructor(calendarData = {}) {
7
+ this.calendarData = calendarData
8
+ }
9
+
10
+ fetchEventsForCalendar(calendar: CALENDAR) {
11
+ const result = new Map<Date, BizEvent[]>()
12
+
13
+ calendar.forEach(({ date }) => {
14
+ const formattedDate = date.toISOString().split('T')[0]
15
+ const template = this.calendarData[formattedDate]
16
+
17
+ if (!template) return
18
+
19
+ result.set(date, [
20
+ {
21
+ due: formattedDate,
22
+ template: template,
23
+ title: '',
24
+ color: '',
25
+ clickEvent: e => console.log('e :', e, template)
26
+ }
27
+ ])
28
+ })
29
+
30
+ return result
31
+ }
32
+ }