@dssp/supervision 0.0.21 → 0.0.23

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 (21) hide show
  1. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +15 -0
  2. package/client/pages/building-inspection/building-inspection-list.ts +4 -30
  3. package/client/pages/building-inspection/component/inspection-event-provider.ts +54 -5
  4. package/client/pages/building-inspection/inspection-create-popup.ts +50 -23
  5. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +15 -0
  6. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  7. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +0 -1
  8. package/dist-client/pages/building-inspection/building-inspection-list.js +5 -29
  9. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  10. package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +4 -3
  11. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +50 -5
  12. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  13. package/dist-client/pages/building-inspection/inspection-create-popup.js +54 -27
  14. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  15. package/dist-client/tsconfig.tsbuildinfo +1 -1
  16. package/dist-server/service/building-inspection/building-inspection-query.d.ts +1 -1
  17. package/dist-server/service/building-inspection/building-inspection-query.js +6 -8
  18. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  19. package/dist-server/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +4 -4
  21. package/server/service/building-inspection/building-inspection-query.ts +3 -6
@@ -12,6 +12,8 @@ import { notify } from '@operato/layout'
12
12
  import gql from 'graphql-tag'
13
13
  import { openPopup } from '@operato/layout'
14
14
 
15
+ import { verifyBiometric } from '@things-factory/auth-base/client'
16
+
15
17
  import './component/building-inspection-detail-header'
16
18
  import '../checklist/checklist-view'
17
19
  import { ChecklistMode } from '../checklist/checklist-view'
@@ -198,6 +200,19 @@ export class BuildingInspectionDetailChecklist extends PageView {
198
200
  }
199
201
 
200
202
  private async validateChecklist(checklist: any) {
203
+ try {
204
+ const result = await verifyBiometric()
205
+ if (result.verified) {
206
+ console.log('Verification successful. Proceeding with sensitive action.')
207
+ } else {
208
+ notify({ message: 'Verification failed:' + result.message })
209
+ return
210
+ }
211
+ } catch (error) {
212
+ notify({ message: 'Error during biometric verification:' + error })
213
+ return
214
+ }
215
+
201
216
  const response = await client.mutate({
202
217
  mutation: gql`
203
218
  mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {
@@ -91,6 +91,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
91
91
  margin: 0px 25px 0px 25px;
92
92
  gap: 10px;
93
93
  min-height: fit-content;
94
+ overflow-x: hidden;
94
95
  }
95
96
 
96
97
  div[body] h3 {
@@ -301,7 +302,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
301
302
  async initProject(buildingLevelId: string = '') {
302
303
  const response = await client.query({
303
304
  query: gql`
304
- query ProjectByBuildingLevelId($buildingLevelId: String!, $yearMonth: String!) {
305
+ query ProjectByBuildingLevelId($buildingLevelId: String!) {
305
306
  projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {
306
307
  id
307
308
  name
@@ -328,19 +329,10 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
328
329
  pass
329
330
  fail
330
331
  }
331
-
332
- buildingInspectionDateSummaryOfLevelAndMonth(buildingLevelId: $buildingLevelId, yearMonth: $yearMonth) {
333
- requestDate
334
- wait
335
- request
336
- pass
337
- fail
338
- }
339
332
  }
340
333
  `,
341
334
  variables: {
342
- buildingLevelId,
343
- yearMonth: '2024-10'
335
+ buildingLevelId
344
336
  }
345
337
  })
346
338
 
@@ -349,8 +341,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
349
341
  this.project = response.data?.projectByBuildingLevelId
350
342
  this.buildingInspectionSummary = response.data?.buildingInspectionSummaryOfBuildingLevel
351
343
 
352
- const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndMonth)
353
- this.calendarData = new InspectionEventProvider(calendarData)
344
+ this.calendarData = new InspectionEventProvider(buildingLevelId)
354
345
 
355
346
  // 캘린더 최소 높이 속성 수정
356
347
  this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px')
@@ -541,21 +532,4 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
541
532
  }).format(new Date(date))
542
533
  : ''
543
534
  }
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
- }
561
535
  }
@@ -1,18 +1,50 @@
1
1
  import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view'
2
+ import { html, TemplateResult } from 'lit'
3
+ import gql from 'graphql-tag'
4
+ import { client } from '@operato/graphql'
2
5
 
3
6
  export class InspectionEventProvider implements EventProvider {
4
- calendarData = {}
7
+ buildingLevelId = {}
5
8
 
6
- constructor(calendarData = {}) {
7
- this.calendarData = calendarData
9
+ constructor(buildingLevelId: string = '') {
10
+ this.buildingLevelId = buildingLevelId
8
11
  }
9
12
 
10
- fetchEventsForCalendar(calendar: CALENDAR) {
13
+ async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {
11
14
  const result = new Map<Date, BizEvent[]>()
15
+ const startDate = calendar[0]['date'].toISOString().split('T')[0]
16
+ const endDate = calendar.at(-1)?.['date'].toISOString().split('T')[0]
17
+
18
+ const response = await client.query({
19
+ query: gql`
20
+ query BuildingInspectionDateSummaryOfLevelAndPeriod($buildingLevelId: String!, $startDate: String!, $endDate: String!) {
21
+ buildingInspectionDateSummaryOfLevelAndPeriod(
22
+ buildingLevelId: $buildingLevelId
23
+ startDate: $startDate
24
+ endDate: $endDate
25
+ ) {
26
+ requestDate
27
+ wait
28
+ request
29
+ pass
30
+ fail
31
+ }
32
+ }
33
+ `,
34
+ variables: {
35
+ buildingLevelId: this.buildingLevelId,
36
+ startDate,
37
+ endDate
38
+ }
39
+ })
40
+
41
+ // if (response.errors) return null
42
+
43
+ const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndPeriod)
12
44
 
13
45
  calendar.forEach(({ date }) => {
14
46
  const formattedDate = date.toISOString().split('T')[0]
15
- const template = this.calendarData[formattedDate]
47
+ const template = calendarData[formattedDate]
16
48
 
17
49
  if (!template) return
18
50
 
@@ -29,4 +61,21 @@ export class InspectionEventProvider implements EventProvider {
29
61
 
30
62
  return result
31
63
  }
64
+
65
+ // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기
66
+ private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {
67
+ const template = {}
68
+ for (let date of inspectionData) {
69
+ template[date.requestDate] = html`
70
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;">
71
+ ${date.wait !== 0 ? html`<div><span style="font-size: 1.3em; color: #4e5055">●</span> ${date.wait}</div>` : ''}
72
+ ${date.request !== 0 ? html`<div><span style="font-size: 1.3em; color: #3395f1">●</span> ${date.request}</div>` : ''}
73
+ ${date.pass !== 0 ? html`<div><span style="font-size: 1.3em; color: #1bb401">●</span> ${date.pass}</div>` : ''}
74
+ ${date.fail !== 0 ? html`<div><span style="font-size: 1.3em; color: #ff4444">●</span> ${date.fail}</div>` : ''}
75
+ </div>
76
+ `
77
+ }
78
+
79
+ return template
80
+ }
32
81
  }
@@ -76,12 +76,27 @@ class InspectionCreatePopup extends LitElement {
76
76
  gap: 15px;
77
77
  margin-bottom: 11px;
78
78
 
79
- label {
79
+ & > label {
80
80
  display: flex;
81
81
  justify-content: flex-end;
82
82
  align-items: center;
83
83
  font-size: 15px;
84
84
  }
85
+
86
+ div[inspection-parts] {
87
+ display: block;
88
+ margin-top: 7px;
89
+
90
+ & > span {
91
+ display: inline-block;
92
+ margin-right: 5px;
93
+ margin-bottom: 5px;
94
+
95
+ & > md-checkbox {
96
+ margin-top: 2px;
97
+ }
98
+ }
99
+ }
85
100
  }
86
101
  }
87
102
 
@@ -89,7 +104,6 @@ class InspectionCreatePopup extends LitElement {
89
104
  display: flex;
90
105
  overflow-y: auto;
91
106
  overflow-x: hidden;
92
- max-width: calc(40% - 15px);
93
107
  }
94
108
  }
95
109
 
@@ -104,6 +118,7 @@ class InspectionCreatePopup extends LitElement {
104
118
  border-top: none;
105
119
  border-radius: 0px 0px 8px 8px;
106
120
  margin-right: -2px;
121
+ cursor: pointer;
107
122
 
108
123
  &[active] {
109
124
  color: var(--button-color, var(--md-sys-color-on-secondary-container));
@@ -115,9 +130,19 @@ class InspectionCreatePopup extends LitElement {
115
130
  div[button-container] {
116
131
  display: flex;
117
132
  justify-content: flex-end;
118
-
119
- md-elevated-button {
120
- --md-filled-button-container-color: #0595e5;
133
+ gap: 10px;
134
+
135
+ md-elevated-button[blue] {
136
+ --md-elevated-button-container-color: #0595e5;
137
+
138
+ --md-elevated-button-label-text-color: #fff;
139
+ --md-elevated-button-hover-label-text-color: #fff;
140
+ --md-elevated-button-pressed-label-text-color: #fff;
141
+ --md-elevated-button-focus-label-text-color: #fff;
142
+ --md-elevated-button-icon-color: #fff;
143
+ --md-elevated-button-hover-icon-color: #fff;
144
+ --md-elevated-button-pressed-icon-color: #fff;
145
+ --md-elevated-button-focus-icon-color: #fff;
121
146
  }
122
147
  }
123
148
  `
@@ -155,7 +180,7 @@ class InspectionCreatePopup extends LitElement {
155
180
  @query('md-filled-select[inspectionPart]') htmlSelectInspectionPart
156
181
  @query('md-filled-select[checklistTemplate]') htmlSelectChecklistTemplate
157
182
  @query('ox-grist') grist!: DataGrist
158
- @query('div[right]') checklistViewContainer!: HTMLDivElement
183
+ @query('div[preview]') checklistViewContainer!: HTMLDivElement
159
184
  @query('checklist-view') checklistView!: HTMLElement
160
185
 
161
186
  render() {
@@ -167,7 +192,7 @@ class InspectionCreatePopup extends LitElement {
167
192
 
168
193
  <div data-row>
169
194
  <label>공종</label>
170
- <md-filled-select label="공종" constructionType @change=${this._onSelectConstructionType}>
195
+ <md-filled-select constructionType @change=${this._onSelectConstructionType}>
171
196
  ${this.constructionTypes?.map(constructionType => {
172
197
  const selected = constructionType.id === this.selectedConstructionType?.id
173
198
  return html`<md-select-option ?selected=${selected} .value=${constructionType.id}>
@@ -179,7 +204,7 @@ class InspectionCreatePopup extends LitElement {
179
204
  <div partition></div>
180
205
 
181
206
  <label>세부 공종</label>
182
- <md-filled-select label="세부 공종" constructionDetailType @change=${this._onSelectConstructionDetailType}>
207
+ <md-filled-select constructionDetailType @change=${this._onSelectConstructionDetailType}>
183
208
  ${this.selectedConstructionType?.constructionDetailTypes?.map(constructionDetailType => {
184
209
  const selected = constructionDetailType.id === this.selectedConstructionDetailType.id
185
210
  return html`<md-select-option ?selected=${selected} .value=${constructionDetailType.id}>
@@ -191,7 +216,7 @@ class InspectionCreatePopup extends LitElement {
191
216
 
192
217
  <div data-row>
193
218
  <label>동</label>
194
- <md-filled-select label="동" building @change=${this._onSelectBuilding}>
219
+ <md-filled-select building @change=${this._onSelectBuilding}>
195
220
  ${this.buildings?.map(building => {
196
221
  return html` <md-select-option .value=${building.id}>
197
222
  <div slot="headline">${building.name}</div>
@@ -202,7 +227,7 @@ class InspectionCreatePopup extends LitElement {
202
227
  <div partition></div>
203
228
 
204
229
  <label>층</label>
205
- <md-filled-select label="층" level @change=${this._onSelectBuildingLevel}>
230
+ <md-filled-select level @change=${this._onSelectBuildingLevel}>
206
231
  ${this.selectedBuilding?.buildingLevels?.map(level => {
207
232
  return html`<md-select-option .value=${level.id}>
208
233
  <div slot="headline">${level.floor}</div>
@@ -213,7 +238,7 @@ class InspectionCreatePopup extends LitElement {
213
238
 
214
239
  <div data-row>
215
240
  <label>검측 도면</label>
216
- <md-filled-select label="검측 도면" inspectionDrawingType @change=${this._onSelectInspectionDrawingType}>
241
+ <md-filled-select inspectionDrawingType @change=${this._onSelectInspectionDrawingType}>
217
242
  ${this.inspectionDrawingTypes?.map(inspectionDrawingType => {
218
243
  return html` <md-select-option .value=${inspectionDrawingType.id}>
219
244
  <div slot="headline">${inspectionDrawingType.name}</div>
@@ -224,18 +249,20 @@ class InspectionCreatePopup extends LitElement {
224
249
  <div partition></div>
225
250
 
226
251
  <label>검측 부위</label>
227
- <md-filled-select label="검측 부위" inspectionParts>
228
- <div slot="label">${this.selectedInspectionParts?.join(', ') || ''}</div>
229
-
252
+ <div inspection-parts>
230
253
  ${this.selectedInspectionDrawingType?.inspectionParts?.map(inspectionPart => {
231
254
  return html`
232
- <md-list-option @click=${() => this._onSelectInspectionPart(inspectionPart)}>
233
- <md-checkbox ?checked="${this.isSelected(inspectionPart)}"></md-checkbox>
234
- ${inspectionPart.name}
235
- </md-list-option>
255
+ <span>
256
+ <md-checkbox
257
+ id=${'check_' + inspectionPart.id}
258
+ ?checked="${this.isSelected(inspectionPart)}"
259
+ @click=${() => this._onSelectInspectionPart(inspectionPart)}
260
+ ></md-checkbox>
261
+ <label>${inspectionPart.name}</label>
262
+ </span>
236
263
  `
237
264
  })}
238
- </md-filled-select>
265
+ </div>
239
266
  </div>
240
267
  </div>
241
268
 
@@ -247,7 +274,6 @@ class InspectionCreatePopup extends LitElement {
247
274
  <md-filled-text-field
248
275
  name="checklistName"
249
276
  type="text"
250
- label="체크리스트 이름"
251
277
  .value=${this.checklist?.name || ''}
252
278
  @input=${this._onInputChange}
253
279
  >
@@ -256,7 +282,7 @@ class InspectionCreatePopup extends LitElement {
256
282
  <div partition></div>
257
283
 
258
284
  <label>템플릿</label>
259
- <md-filled-select label="템플릿" checklistTemplate @change=${this._onSelectChecklistTemplate}>
285
+ <md-filled-select checklistTemplate @change=${this._onSelectChecklistTemplate}>
260
286
  <md-select-option></md-select-option>
261
287
  ${this.checklistTemplates?.map((checklistTemplate, idx) => {
262
288
  return html` <md-select-option .value=${checklistTemplate.id}>
@@ -287,9 +313,10 @@ class InspectionCreatePopup extends LitElement {
287
313
  </div>
288
314
 
289
315
  <div button-container>
290
- <md-elevated-button @click=${this._createInspection}>
291
- <md-icon slot="icon">add</md-icon>검측 요청서 등록
316
+ <md-elevated-button blue @click=${this._createInspection}>
317
+ <md-icon slot="icon">task</md-icon>검측 요청서 등록
292
318
  </md-elevated-button>
319
+ <md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소</md-elevated-button>
293
320
  </div>
294
321
  `
295
322
  }
@@ -9,6 +9,7 @@ import { keyed } from 'lit/directives/keyed.js';
9
9
  import { client } from '@operato/graphql';
10
10
  import { notify } from '@operato/layout';
11
11
  import gql from 'graphql-tag';
12
+ import { verifyBiometric } from '@things-factory/auth-base/client';
12
13
  import './component/building-inspection-detail-header';
13
14
  import '../checklist/checklist-view';
14
15
  let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist extends PageView {
@@ -146,6 +147,20 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
146
147
  }
147
148
  async validateChecklist(checklist) {
148
149
  var _a, _b;
150
+ try {
151
+ const result = await verifyBiometric();
152
+ if (result.verified) {
153
+ console.log('Verification successful. Proceeding with sensitive action.');
154
+ }
155
+ else {
156
+ notify({ message: 'Verification failed:' + result.message });
157
+ return;
158
+ }
159
+ }
160
+ catch (error) {
161
+ notify({ message: 'Error during biometric verification:' + error });
162
+ return;
163
+ }
149
164
  const response = await client.mutate({
150
165
  mutation: gql `
151
166
  mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {
@@ -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,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,+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;IA4KvC,CAAC;IA1KC,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,kBAAk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,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;;AAnNM,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,CAqN7C;SArNY,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 './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 ></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 }\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 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,g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AkB,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;;AAhOM,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,CAkO7C;SAlOY,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 ></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 }\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"]}
@@ -66,6 +66,5 @@ export declare class BuildingInspectionList extends BuildingInspectionList_base
66
66
  private _deleteChecklistType;
67
67
  private _openCreateInspection;
68
68
  private _formatDate;
69
- private getCalendarTemplate;
70
69
  }
71
70
  export {};
@@ -118,10 +118,10 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
118
118
  }
119
119
  }
120
120
  async initProject(buildingLevelId = '') {
121
- var _a, _b, _c;
121
+ var _a, _b;
122
122
  const response = await client.query({
123
123
  query: gql `
124
- query ProjectByBuildingLevelId($buildingLevelId: String!, $yearMonth: String!) {
124
+ query ProjectByBuildingLevelId($buildingLevelId: String!) {
125
125
  projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {
126
126
  id
127
127
  name
@@ -148,27 +148,17 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
148
148
  pass
149
149
  fail
150
150
  }
151
-
152
- buildingInspectionDateSummaryOfLevelAndMonth(buildingLevelId: $buildingLevelId, yearMonth: $yearMonth) {
153
- requestDate
154
- wait
155
- request
156
- pass
157
- fail
158
- }
159
151
  }
160
152
  `,
161
153
  variables: {
162
- buildingLevelId,
163
- yearMonth: '2024-10'
154
+ buildingLevelId
164
155
  }
165
156
  });
166
157
  if (response.errors)
167
158
  return;
168
159
  this.project = (_a = response.data) === null || _a === void 0 ? void 0 : _a.projectByBuildingLevelId;
169
160
  this.buildingInspectionSummary = (_b = response.data) === null || _b === void 0 ? void 0 : _b.buildingInspectionSummaryOfBuildingLevel;
170
- const calendarData = this.getCalendarTemplate((_c = response.data) === null || _c === void 0 ? void 0 : _c.buildingInspectionDateSummaryOfLevelAndMonth);
171
- this.calendarData = new InspectionEventProvider(calendarData);
161
+ this.calendarData = new InspectionEventProvider(buildingLevelId);
172
162
  // 캘린더 최소 높이 속성 수정
173
163
  this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px');
174
164
  }
@@ -343,21 +333,6 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
343
333
  }).format(new Date(date))
344
334
  : '';
345
335
  }
346
- // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기
347
- getCalendarTemplate(inspectionData = []) {
348
- const template = {};
349
- for (let date of inspectionData) {
350
- template[date.requestDate] = html `
351
- <div style="display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;">
352
- ${date.wait !== 0 ? html `<div><span style="font-size: 1.3em; color: #4e5055">●</span> ${date.wait}</div>` : ''}
353
- ${date.request !== 0 ? html `<div><span style="font-size: 1.3em; color: #3395f1">●</span> ${date.request}</div>` : ''}
354
- ${date.pass !== 0 ? html `<div><span style="font-size: 1.3em; color: #1bb401">●</span> ${date.pass}</div>` : ''}
355
- ${date.fail !== 0 ? html `<div><span style="font-size: 1.3em; color: #ff4444">●</span> ${date.fail}</div>` : ''}
356
- </div>
357
- `;
358
- }
359
- return template;
360
- }
361
336
  };
362
337
  BuildingInspectionList.styles = [
363
338
  ScrollbarStyles,
@@ -409,6 +384,7 @@ BuildingInspectionList.styles = [
409
384
  margin: 0px 25px 0px 25px;
410
385
  gap: 10px;
411
386
  min-height: fit-content;
387
+ overflow-x: hidden;
412
388
  }
413
389
 
414
390
  div[body] h3 {
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection-list.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAq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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0JF;CACF,CAAA;AASD;IAAC,KAAK,EAAE;;2DAAyB;AACjC;IAAC,KAAK,EAAE;;+DAA6B;AACrC;IAAC,KAAK,EAAE;;uDAA0C;AAClD;IAAC,KAAK,EAAE;;wDAAsB;AAC9B;IAAC,KAAK,EAAE;;wDAAmB;AAC3B;IAAC,KAAK,EAAE;;4DAA0B;AAClC;IAAC,KAAK,EAAE;;yEAAoC;AAC5C;IAAC,KAAK,EAAE;;4DAA6B;AAErC;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;qDAAA;AAC5C;IAAC,KAAK,CAAC,eAAe,CAAC;8BAAqB,WAAW;yDAAA;AAlL5C,sBAAsB;IADlC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,sBAAsB,CAsgBlC;SAtgBY,sBAAsB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, navigate } from '@operato/shell'\nimport { css, html, TemplateResult } from 'lit'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\nimport './inspection-create-popup'\nimport '@operato/event-view/ox-event-view.js'\nimport { InspectionEventProvider } from './component/inspection-event-provider'\nimport { EventProvider } from '@operato/event-view'\n\nexport enum ChecklistTypeMainType {\n BASIC = '10',\n NON_BASIC = '20'\n}\nexport const CHECKLIST_MAIN_TYPE_LIST = {\n [ChecklistTypeMainType.BASIC]: '기본 업무',\n [ChecklistTypeMainType.NON_BASIC]: '기본 외 업무'\n}\n\nexport enum BuildingInspectionStatus {\n WAIT = 'WAIT',\n REQUEST = 'REQUEST',\n PASS = 'PASS',\n FAIL = 'FAIL'\n}\nexport const BUILDING_INSPECTION_STATUS = {\n [BuildingInspectionStatus.WAIT]: '검측 대기',\n [BuildingInspectionStatus.REQUEST]: '검측 요청',\n [BuildingInspectionStatus.PASS]: '합격',\n [BuildingInspectionStatus.FAIL]: '불합격'\n}\n\n@customElement('building-inspection-list')\nexport class BuildingInspectionList extends ScopedElementsMixin(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 md-filled-button {\n --md-filled-button-container-color: #0595e5;\n --md-filled-button-container-height: 30px;\n --md-filled-button-trailing-space: 15px;\n --md-filled-button-leading-space: 15px;\n }\n\n md-outlined-button {\n --md-outlined-button-container-height: 30px;\n --md-outlined-button-trailing-space: 15px;\n --md-outlined-button-leading-space: 15px;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[header] {\n display: flex;\n margin: 0px 20px;\n }\n\n div[header] h2 {\n flex: 0.5;\n color: #3f71a0;\n }\n\n div[body] {\n display: flex;\n flex-direction: column;\n margin: 0px 25px 0px 25px;\n gap: 10px;\n min-height: fit-content;\n }\n\n div[body] h3 {\n color: #2e79be;\n font-size: 18px;\n margin: 0px;\n }\n\n div[body] > div {\n display: flex;\n gap: 10px;\n border-radius: 5px;\n }\n\n div[top] {\n flex: 1;\n\n display: flex;\n background-color: #f7f7f7;\n }\n\n div[drawing] {\n flex: 0.4;\n border: 1px solid #cccccc80;\n background-color: #fff;\n padding: 10px;\n border-radius: 5px;\n\n img {\n width: 100%;\n\n display: block;\n object-fit: contain;\n object-position: center;\n }\n }\n\n div[inspection-container] {\n flex: 0.6;\n gap: 5px;\n\n display: flex;\n flex-direction: column;\n\n div[inspection] {\n display: grid;\n grid-template-columns: 120px 0.9fr 0.9fr 0.9fr 0.9fr;\n margin-top: 5px;\n background: #ebc8321a;\n border-radius: 7px;\n padding: 7px 0px;\n\n & > span {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n div[status='wait'] {\n color: #4e5055;\n }\n div[status='request'] {\n color: #3395f1;\n }\n div[status='pass'] {\n color: #1bb401;\n }\n div[status='fail'] {\n color: #ff4444;\n }\n span[dot] {\n font-size: 1.3em;\n }\n }\n & > span[name] {\n flex-direction: row;\n text-align: right;\n gap: 10px;\n border-right: 2px dotted #ccc;\n\n md-icon {\n width: 40px;\n height: 40px;\n border-radius: 7px;\n color: #fff;\n background: #f16154;\n }\n }\n }\n }\n\n ox-event-view {\n flex: 1;\n }\n\n div[bottom] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n private defaultProject = {\n name: '',\n buildingComplex: {\n buildings: []\n }\n }\n\n @state() private gristConfig: any\n @state() buildingLevelId: string = ''\n @state() project: any = { ...this.defaultProject }\n @state() location: string = ''\n @state() building: any = {}\n @state() drawingImage: string = ''\n @state() buildingInspectionSummary: any = {}\n @state() calendarData?: EventProvider\n\n @query('ox-grist') private grist!: DataGrist\n @query('ox-event-view') private eventView!: HTMLElement\n\n get context() {\n return {\n title: '검측 관리',\n actions: [\n {\n title: '검측 등록',\n action: this._openCreateInspection.bind(this),\n ...CommonButtonStyles.submit\n },\n {\n title: '삭제',\n action: this._deleteChecklistType.bind(this),\n ...CommonButtonStyles.delete\n }\n ]\n }\n }\n\n render() {\n return html`\n <div header>\n <h2>${this.project.name}</h2>\n </div>\n\n <div body>\n <div top>\n <div drawing>\n <h3>도면: ${this.location}</h3>\n <img src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />\n </div>\n\n <div inspection-container>\n <div inspection>\n <span name bold>\n <md-icon slot=\"icon\">fact_check</md-icon>\n 검측<br />현황\n </span>\n\n ${Object.entries(BUILDING_INSPECTION_STATUS).map(inspectionStatus => {\n const displayName = inspectionStatus[1]\n const status = inspectionStatus[0].toLowerCase()\n\n return html`\n <span>\n <div>${displayName}</div>\n <div bold status=${status}><span dot>●</span> ${this.buildingInspectionSummary[status]}</div>\n </span>\n `\n })}\n </div>\n\n <ox-event-view\n .mode=${'monthly'}\n .eventProvider=${this.calendarData}\n @select-date=${(e: CustomEvent) => {\n console.log('select-date', e.detail)\n }}\n >\n </ox-event-view>\n </div>\n </div>\n\n <div bottom>\n <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingLevelId = lifecycle.resourceId || ''\n\n await this.initProject(this.buildingLevelId)\n this.grist.fetch()\n }\n }\n\n async initProject(buildingLevelId: string = '') {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingLevelId($buildingLevelId: String!, $yearMonth: String!) {\n projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {\n id\n name\n mainPhoto {\n fullpath\n }\n buildingComplex {\n id\n drawing {\n id\n name\n fullpath\n }\n buildings {\n id\n name\n }\n }\n }\n\n buildingInspectionSummaryOfBuildingLevel(buildingLevelId: $buildingLevelId) {\n wait\n request\n pass\n fail\n }\n\n buildingInspectionDateSummaryOfLevelAndMonth(buildingLevelId: $buildingLevelId, yearMonth: $yearMonth) {\n requestDate\n wait\n request\n pass\n fail\n }\n }\n `,\n variables: {\n buildingLevelId,\n yearMonth: '2024-10'\n }\n })\n\n if (response.errors) return\n\n this.project = response.data?.projectByBuildingLevelId\n this.buildingInspectionSummary = response.data?.buildingInspectionSummaryOfBuildingLevel\n\n const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndMonth)\n this.calendarData = new InspectionEventProvider(calendarData)\n\n // 캘린더 최소 높이 속성 수정\n this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px')\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'location',\n header: '위치',\n width: 150\n },\n {\n type: 'string',\n name: 'constructionType',\n header: '공종',\n width: 120\n },\n {\n type: 'string',\n name: 'inspectionParts',\n header: '검측 부위',\n record: {\n renderer: value => value?.join(', ') || ''\n },\n width: 200\n },\n {\n type: 'string',\n name: 'requestDate',\n header: '검측 요청일',\n width: 120\n },\n {\n type: 'string',\n name: 'status',\n header: '검측 결과',\n record: {\n renderer: value => BUILDING_INSPECTION_STATUS[value]\n },\n width: 120\n },\n {\n type: 'datetime',\n name: '',\n header: '검측 결과 데이터',\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n appendable: false,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n navigate(`building-inspection-detail-drawing/${record.id}`)\n }\n }\n },\n sorters: [{ name: 'requestDate' }]\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n if (!this.buildingLevelId) return\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!, $buildingLevelId: String!) {\n buildingInspectionsOfBuildingLevel(params: $params) {\n items {\n id\n status\n requestDate\n checklist {\n checklistId: id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n }\n }\n total\n }\n\n buildingLevel(id: $buildingLevelId) {\n id\n floor\n building {\n id\n name\n }\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n }\n }\n `,\n variables: {\n params: {\n buildingLevelId: this.buildingLevelId,\n limit: 0\n },\n buildingLevelId: this.buildingLevelId\n }\n })\n\n let items = response.data?.buildingInspectionsOfBuildingLevel?.items || []\n items = items.map(item => ({\n ...item,\n ...item.checklist,\n requestDate: this._formatDate(item.requestDate)\n }))\n const buildingLevel = response.data?.buildingLevel\n\n this.location = `${buildingLevel.building.name} ${buildingLevel.floor}층` || ''\n this.drawingImage = buildingLevel?.mainDrawingImage || ''\n this.building = buildingLevel?.building || {}\n\n return {\n total: response.data?.buildingInspectionsOfBuildingLevel?.total || 0,\n records: items\n }\n }\n\n private async _deleteChecklistType() {\n if (confirm('삭제하시겠습니까?')) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteBuildingInspections(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '삭제되었습니다.' })\n }\n }\n }\n }\n\n private _openCreateInspection() {\n openPopup(\n html`\n <inspection-create-popup\n .projectId=${this.project.id}\n .selectedBuildingId=${this.building.id}\n .selectedBuildingLevelId=${this.buildingLevelId}\n @requestRefresh=\"${() => this.grist.fetch()}\"\n ></inspection-create-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: '검측 요청서 등록'\n }\n )\n }\n\n private _formatDate(date: Date | undefined) {\n return date\n ? new Intl.DateTimeFormat('en-CA', {\n timeZone: 'Asia/Seoul',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit'\n }).format(new Date(date))\n : ''\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":"building-inspection-list.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,2BAA2B,CAAA;AAClC,OAAO,sCAAsC,CAAA;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAA;AAG/E,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,qCAAY,CAAA;IACZ,yCAAgB,CAAA;AAClB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AACD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,OAAO;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+DAA6B;AACrC;IAAC,KAAK,EAAE;;uDAA0C;AAClD;IAAC,KAAK,EAAE;;wDAAsB;AAC9B;IAAC,KAAK,EAAE;;wDAAmB;AAC3B;IAAC,KAAK,EAAE;;4DAA0B;AAClC;IAAC,KAAK,EAAE;;yEAAoC;AAC5C;IAAC,KAAK,EAAE;;4DAA6B;AAErC;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;qDAAA;AAC5C;IAAC,KAAK,CAAC,eAAe,CAAC;8BAAqB,WAAW;yDAAA;AAnL5C,sBAAsB;IADlC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,sBAAsB,CA4elC;SA5eY,sBAAsB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, navigate } from '@operato/shell'\nimport { css, html, TemplateResult } from 'lit'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\nimport './inspection-create-popup'\nimport '@operato/event-view/ox-event-view.js'\nimport { InspectionEventProvider } from './component/inspection-event-provider'\nimport { EventProvider } from '@operato/event-view'\n\nexport enum ChecklistTypeMainType {\n BASIC = '10',\n NON_BASIC = '20'\n}\nexport const CHECKLIST_MAIN_TYPE_LIST = {\n [ChecklistTypeMainType.BASIC]: '기본 업무',\n [ChecklistTypeMainType.NON_BASIC]: '기본 외 업무'\n}\n\nexport enum BuildingInspectionStatus {\n WAIT = 'WAIT',\n REQUEST = 'REQUEST',\n PASS = 'PASS',\n FAIL = 'FAIL'\n}\nexport const BUILDING_INSPECTION_STATUS = {\n [BuildingInspectionStatus.WAIT]: '검측 대기',\n [BuildingInspectionStatus.REQUEST]: '검측 요청',\n [BuildingInspectionStatus.PASS]: '합격',\n [BuildingInspectionStatus.FAIL]: '불합격'\n}\n\n@customElement('building-inspection-list')\nexport class BuildingInspectionList extends ScopedElementsMixin(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 md-filled-button {\n --md-filled-button-container-color: #0595e5;\n --md-filled-button-container-height: 30px;\n --md-filled-button-trailing-space: 15px;\n --md-filled-button-leading-space: 15px;\n }\n\n md-outlined-button {\n --md-outlined-button-container-height: 30px;\n --md-outlined-button-trailing-space: 15px;\n --md-outlined-button-leading-space: 15px;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[header] {\n display: flex;\n margin: 0px 20px;\n }\n\n div[header] h2 {\n flex: 0.5;\n color: #3f71a0;\n }\n\n div[body] {\n display: flex;\n flex-direction: column;\n margin: 0px 25px 0px 25px;\n gap: 10px;\n min-height: fit-content;\n overflow-x: hidden;\n }\n\n div[body] h3 {\n color: #2e79be;\n font-size: 18px;\n margin: 0px;\n }\n\n div[body] > div {\n display: flex;\n gap: 10px;\n border-radius: 5px;\n }\n\n div[top] {\n flex: 1;\n\n display: flex;\n background-color: #f7f7f7;\n }\n\n div[drawing] {\n flex: 0.4;\n border: 1px solid #cccccc80;\n background-color: #fff;\n padding: 10px;\n border-radius: 5px;\n\n img {\n width: 100%;\n\n display: block;\n object-fit: contain;\n object-position: center;\n }\n }\n\n div[inspection-container] {\n flex: 0.6;\n gap: 5px;\n\n display: flex;\n flex-direction: column;\n\n div[inspection] {\n display: grid;\n grid-template-columns: 120px 0.9fr 0.9fr 0.9fr 0.9fr;\n margin-top: 5px;\n background: #ebc8321a;\n border-radius: 7px;\n padding: 7px 0px;\n\n & > span {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n div[status='wait'] {\n color: #4e5055;\n }\n div[status='request'] {\n color: #3395f1;\n }\n div[status='pass'] {\n color: #1bb401;\n }\n div[status='fail'] {\n color: #ff4444;\n }\n span[dot] {\n font-size: 1.3em;\n }\n }\n & > span[name] {\n flex-direction: row;\n text-align: right;\n gap: 10px;\n border-right: 2px dotted #ccc;\n\n md-icon {\n width: 40px;\n height: 40px;\n border-radius: 7px;\n color: #fff;\n background: #f16154;\n }\n }\n }\n }\n\n ox-event-view {\n flex: 1;\n }\n\n div[bottom] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n private defaultProject = {\n name: '',\n buildingComplex: {\n buildings: []\n }\n }\n\n @state() private gristConfig: any\n @state() buildingLevelId: string = ''\n @state() project: any = { ...this.defaultProject }\n @state() location: string = ''\n @state() building: any = {}\n @state() drawingImage: string = ''\n @state() buildingInspectionSummary: any = {}\n @state() calendarData?: EventProvider\n\n @query('ox-grist') private grist!: DataGrist\n @query('ox-event-view') private eventView!: HTMLElement\n\n get context() {\n return {\n title: '검측 관리',\n actions: [\n {\n title: '검측 등록',\n action: this._openCreateInspection.bind(this),\n ...CommonButtonStyles.submit\n },\n {\n title: '삭제',\n action: this._deleteChecklistType.bind(this),\n ...CommonButtonStyles.delete\n }\n ]\n }\n }\n\n render() {\n return html`\n <div header>\n <h2>${this.project.name}</h2>\n </div>\n\n <div body>\n <div top>\n <div drawing>\n <h3>도면: ${this.location}</h3>\n <img src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />\n </div>\n\n <div inspection-container>\n <div inspection>\n <span name bold>\n <md-icon slot=\"icon\">fact_check</md-icon>\n 검측<br />현황\n </span>\n\n ${Object.entries(BUILDING_INSPECTION_STATUS).map(inspectionStatus => {\n const displayName = inspectionStatus[1]\n const status = inspectionStatus[0].toLowerCase()\n\n return html`\n <span>\n <div>${displayName}</div>\n <div bold status=${status}><span dot>●</span> ${this.buildingInspectionSummary[status]}</div>\n </span>\n `\n })}\n </div>\n\n <ox-event-view\n .mode=${'monthly'}\n .eventProvider=${this.calendarData}\n @select-date=${(e: CustomEvent) => {\n console.log('select-date', e.detail)\n }}\n >\n </ox-event-view>\n </div>\n </div>\n\n <div bottom>\n <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingLevelId = lifecycle.resourceId || ''\n\n await this.initProject(this.buildingLevelId)\n this.grist.fetch()\n }\n }\n\n async initProject(buildingLevelId: string = '') {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingLevelId($buildingLevelId: String!) {\n projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {\n id\n name\n mainPhoto {\n fullpath\n }\n buildingComplex {\n id\n drawing {\n id\n name\n fullpath\n }\n buildings {\n id\n name\n }\n }\n }\n\n buildingInspectionSummaryOfBuildingLevel(buildingLevelId: $buildingLevelId) {\n wait\n request\n pass\n fail\n }\n }\n `,\n variables: {\n buildingLevelId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data?.projectByBuildingLevelId\n this.buildingInspectionSummary = response.data?.buildingInspectionSummaryOfBuildingLevel\n\n this.calendarData = new InspectionEventProvider(buildingLevelId)\n\n // 캘린더 최소 높이 속성 수정\n this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px')\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'location',\n header: '위치',\n width: 150\n },\n {\n type: 'string',\n name: 'constructionType',\n header: '공종',\n width: 120\n },\n {\n type: 'string',\n name: 'inspectionParts',\n header: '검측 부위',\n record: {\n renderer: value => value?.join(', ') || ''\n },\n width: 200\n },\n {\n type: 'string',\n name: 'requestDate',\n header: '검측 요청일',\n width: 120\n },\n {\n type: 'string',\n name: 'status',\n header: '검측 결과',\n record: {\n renderer: value => BUILDING_INSPECTION_STATUS[value]\n },\n width: 120\n },\n {\n type: 'datetime',\n name: '',\n header: '검측 결과 데이터',\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n appendable: false,\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n navigate(`building-inspection-detail-drawing/${record.id}`)\n }\n }\n },\n sorters: [{ name: 'requestDate' }]\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n if (!this.buildingLevelId) return\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!, $buildingLevelId: String!) {\n buildingInspectionsOfBuildingLevel(params: $params) {\n items {\n id\n status\n requestDate\n checklist {\n checklistId: id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n }\n }\n total\n }\n\n buildingLevel(id: $buildingLevelId) {\n id\n floor\n building {\n id\n name\n }\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n }\n }\n `,\n variables: {\n params: {\n buildingLevelId: this.buildingLevelId,\n limit: 0\n },\n buildingLevelId: this.buildingLevelId\n }\n })\n\n let items = response.data?.buildingInspectionsOfBuildingLevel?.items || []\n items = items.map(item => ({\n ...item,\n ...item.checklist,\n requestDate: this._formatDate(item.requestDate)\n }))\n const buildingLevel = response.data?.buildingLevel\n\n this.location = `${buildingLevel.building.name} ${buildingLevel.floor}층` || ''\n this.drawingImage = buildingLevel?.mainDrawingImage || ''\n this.building = buildingLevel?.building || {}\n\n return {\n total: response.data?.buildingInspectionsOfBuildingLevel?.total || 0,\n records: items\n }\n }\n\n private async _deleteChecklistType() {\n if (confirm('삭제하시겠습니까?')) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteBuildingInspections(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({ message: '삭제되었습니다.' })\n }\n }\n }\n }\n\n private _openCreateInspection() {\n openPopup(\n html`\n <inspection-create-popup\n .projectId=${this.project.id}\n .selectedBuildingId=${this.building.id}\n .selectedBuildingLevelId=${this.buildingLevelId}\n @requestRefresh=\"${() => this.grist.fetch()}\"\n ></inspection-create-popup>\n `,\n {\n backdrop: true,\n size: 'large',\n title: '검측 요청서 등록'\n }\n )\n }\n\n private _formatDate(date: Date | undefined) {\n return date\n ? new Intl.DateTimeFormat('en-CA', {\n timeZone: 'Asia/Seoul',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit'\n }).format(new Date(date))\n : ''\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view';
2
2
  export declare class InspectionEventProvider implements EventProvider {
3
- calendarData: {};
4
- constructor(calendarData?: {});
5
- fetchEventsForCalendar(calendar: CALENDAR): Map<Date, BizEvent[]>;
3
+ buildingLevelId: {};
4
+ constructor(buildingLevelId?: string);
5
+ fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>>;
6
+ private getCalendarTemplate;
6
7
  }