@dssp/supervision 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/building-inspection/building-inspection-list.ts +4 -30
- package/client/pages/building-inspection/component/inspection-event-provider.ts +54 -5
- package/client/pages/building-inspection/inspection-create-popup.ts +50 -23
- package/dist-client/pages/building-inspection/building-inspection-list.d.ts +0 -1
- package/dist-client/pages/building-inspection/building-inspection-list.js +5 -29
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +4 -3
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js +50 -5
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
- package/dist-client/pages/building-inspection/inspection-create-popup.js +54 -27
- package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/building-inspection/building-inspection-query.d.ts +1 -1
- package/dist-server/service/building-inspection/building-inspection-query.js +6 -8
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/server/service/building-inspection/building-inspection-query.ts +3 -6
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
7
|
+
buildingLevelId = {}
|
|
5
8
|
|
|
6
|
-
constructor(
|
|
7
|
-
this.
|
|
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 =
|
|
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
|
-
|
|
120
|
-
|
|
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[
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
<
|
|
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
|
-
<
|
|
233
|
-
<md-checkbox
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
</
|
|
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
|
|
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">
|
|
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
|
}
|
|
@@ -118,10 +118,10 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
async initProject(buildingLevelId = '') {
|
|
121
|
-
var _a, _b
|
|
121
|
+
var _a, _b;
|
|
122
122
|
const response = await client.query({
|
|
123
123
|
query: gql `
|
|
124
|
-
query ProjectByBuildingLevelId($buildingLevelId: 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
|
-
|
|
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,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;IACtC,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,SAAS;CAC7C,CAAA;AAED,MAAM,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ourcesContent":["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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AW,CAAC,IAAsB;QACxC,OAAO,IAAI;YACT,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;gBAC/B,QAAQ,EAAE,YAAY;gBACtB,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;gBAChB,GAAG,EAAE,SAAS;aACf,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;;AA1eM,6BAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2JF;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;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
|
-
|
|
4
|
-
constructor(
|
|
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
|
}
|
|
@@ -1,13 +1,43 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import gql from 'graphql-tag';
|
|
3
|
+
import { client } from '@operato/graphql';
|
|
1
4
|
export class InspectionEventProvider {
|
|
2
|
-
constructor(
|
|
3
|
-
this.
|
|
4
|
-
this.
|
|
5
|
+
constructor(buildingLevelId = '') {
|
|
6
|
+
this.buildingLevelId = {};
|
|
7
|
+
this.buildingLevelId = buildingLevelId;
|
|
5
8
|
}
|
|
6
|
-
fetchEventsForCalendar(calendar) {
|
|
9
|
+
async fetchEventsForCalendar(calendar) {
|
|
10
|
+
var _a, _b;
|
|
7
11
|
const result = new Map();
|
|
12
|
+
const startDate = calendar[0]['date'].toISOString().split('T')[0];
|
|
13
|
+
const endDate = (_a = calendar.at(-1)) === null || _a === void 0 ? void 0 : _a['date'].toISOString().split('T')[0];
|
|
14
|
+
const response = await client.query({
|
|
15
|
+
query: gql `
|
|
16
|
+
query BuildingInspectionDateSummaryOfLevelAndPeriod($buildingLevelId: String!, $startDate: String!, $endDate: String!) {
|
|
17
|
+
buildingInspectionDateSummaryOfLevelAndPeriod(
|
|
18
|
+
buildingLevelId: $buildingLevelId
|
|
19
|
+
startDate: $startDate
|
|
20
|
+
endDate: $endDate
|
|
21
|
+
) {
|
|
22
|
+
requestDate
|
|
23
|
+
wait
|
|
24
|
+
request
|
|
25
|
+
pass
|
|
26
|
+
fail
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
variables: {
|
|
31
|
+
buildingLevelId: this.buildingLevelId,
|
|
32
|
+
startDate,
|
|
33
|
+
endDate
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
// if (response.errors) return null
|
|
37
|
+
const calendarData = this.getCalendarTemplate((_b = response.data) === null || _b === void 0 ? void 0 : _b.buildingInspectionDateSummaryOfLevelAndPeriod);
|
|
8
38
|
calendar.forEach(({ date }) => {
|
|
9
39
|
const formattedDate = date.toISOString().split('T')[0];
|
|
10
|
-
const template =
|
|
40
|
+
const template = calendarData[formattedDate];
|
|
11
41
|
if (!template)
|
|
12
42
|
return;
|
|
13
43
|
result.set(date, [
|
|
@@ -22,5 +52,20 @@ export class InspectionEventProvider {
|
|
|
22
52
|
});
|
|
23
53
|
return result;
|
|
24
54
|
}
|
|
55
|
+
// 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기
|
|
56
|
+
getCalendarTemplate(inspectionData = []) {
|
|
57
|
+
const template = {};
|
|
58
|
+
for (let date of inspectionData) {
|
|
59
|
+
template[date.requestDate] = html `
|
|
60
|
+
<div style="display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;">
|
|
61
|
+
${date.wait !== 0 ? html `<div><span style="font-size: 1.3em; color: #4e5055">●</span> ${date.wait}</div>` : ''}
|
|
62
|
+
${date.request !== 0 ? html `<div><span style="font-size: 1.3em; color: #3395f1">●</span> ${date.request}</div>` : ''}
|
|
63
|
+
${date.pass !== 0 ? html `<div><span style="font-size: 1.3em; color: #1bb401">●</span> ${date.pass}</div>` : ''}
|
|
64
|
+
${date.fail !== 0 ? html `<div><span style="font-size: 1.3em; color: #ff4444">●</span> ${date.fail}</div>` : ''}
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
return template;
|
|
69
|
+
}
|
|
25
70
|
}
|
|
26
71
|
//# sourceMappingURL=inspection-event-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspection-event-provider.js","sourceRoot":"","sources":["../../../../client/pages/building-inspection/component/inspection-event-provider.ts"],"names":[],"mappings":"
|
|
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,sBAAsB,CAAC,QAAkB;;QAC7C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAA;QAC1C,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACjE,MAAM,OAAO,GAAG,MAAA,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,0CAAG,MAAM,EAAE,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QAErE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;OAcT;YACD,SAAS,EAAE;gBACT,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,SAAS;gBACT,OAAO;aACR;SACF,CAAC,CAAA;QAEF,mCAAmC;QAEnC,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAA,QAAQ,CAAC,IAAI,0CAAE,6CAA6C,CAAC,CAAA;QAE3G,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;YAC5B,MAAM,aAAa,GAAG,IA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,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"]}
|