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