@dssp/supervision 0.0.24 → 0.0.25
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 +5 -0
- package/client/pages/building-inspection/building-inspection-list.ts +6 -3
- package/client/pages/building-inspection/component/building-inspection-detail-header.ts +24 -5
- package/client/pages/checklist/checklist-view.ts +69 -27
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +6 -1
- 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 +3 -1
- package/dist-client/pages/building-inspection/building-inspection-list.js +6 -3
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +23 -5
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.js +71 -31
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/building-inspection/building-inspection-history.js +4 -1
- package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-query.js +8 -8
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection.d.ts +2 -0
- package/dist-server/service/building-inspection/building-inspection.js +4 -2
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/server/service/building-inspection/building-inspection-history.ts +5 -1
- package/server/service/building-inspection/building-inspection-query.ts +24 -8
- package/server/service/building-inspection/building-inspection-type.ts +2 -2
- package/server/service/building-inspection/building-inspection.ts +5 -2
|
@@ -86,6 +86,7 @@ export class BuildingInspectionDetailChecklist extends PageView {
|
|
|
86
86
|
.mode=${ChecklistMode.EDITOR}
|
|
87
87
|
status=${this.buildingInspection.status}
|
|
88
88
|
.checklist=${this.buildingInspection.checklist || {}}
|
|
89
|
+
.buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}
|
|
89
90
|
></checklist-view>
|
|
90
91
|
`
|
|
91
92
|
)}
|
|
@@ -157,6 +158,10 @@ export class BuildingInspectionDetailChecklist extends PageView {
|
|
|
157
158
|
name
|
|
158
159
|
buildingComplex {
|
|
159
160
|
id
|
|
161
|
+
overallConstructorEmails
|
|
162
|
+
taskConstructorEmails
|
|
163
|
+
overallSupervisoryEmails
|
|
164
|
+
taskSupervisoryEmails
|
|
160
165
|
}
|
|
161
166
|
}
|
|
162
167
|
}
|
|
@@ -28,11 +28,13 @@ export const CHECKLIST_MAIN_TYPE_LIST = {
|
|
|
28
28
|
|
|
29
29
|
export enum BuildingInspectionStatus {
|
|
30
30
|
WAIT = 'WAIT',
|
|
31
|
+
OVERALL_WAIT = 'OVERALL_WAIT',
|
|
31
32
|
REQUEST = 'REQUEST',
|
|
33
|
+
OVERALL_REQUEST = 'OVERALL_REQUEST',
|
|
32
34
|
PASS = 'PASS',
|
|
33
35
|
FAIL = 'FAIL'
|
|
34
36
|
}
|
|
35
|
-
export const
|
|
37
|
+
export const BUILDING_INSPECTION_STATUS_DISPLAY = {
|
|
36
38
|
[BuildingInspectionStatus.WAIT]: '검측 대기',
|
|
37
39
|
[BuildingInspectionStatus.REQUEST]: '검측 요청',
|
|
38
40
|
[BuildingInspectionStatus.PASS]: '합격',
|
|
@@ -193,6 +195,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
193
195
|
display: flex;
|
|
194
196
|
flex-direction: column;
|
|
195
197
|
overflow: hidden;
|
|
198
|
+
min-height: 300px;
|
|
196
199
|
}
|
|
197
200
|
|
|
198
201
|
ox-grist {
|
|
@@ -259,7 +262,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
259
262
|
검측<br />현황
|
|
260
263
|
</span>
|
|
261
264
|
|
|
262
|
-
${Object.entries(
|
|
265
|
+
${Object.entries(BUILDING_INSPECTION_STATUS_DISPLAY).map(inspectionStatus => {
|
|
263
266
|
const displayName = inspectionStatus[1]
|
|
264
267
|
const status = inspectionStatus[0].toLowerCase()
|
|
265
268
|
|
|
@@ -389,7 +392,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
389
392
|
name: 'status',
|
|
390
393
|
header: '검측 결과',
|
|
391
394
|
record: {
|
|
392
|
-
renderer: value =>
|
|
395
|
+
renderer: value => BUILDING_INSPECTION_STATUS_DISPLAY[value]
|
|
393
396
|
},
|
|
394
397
|
width: 120
|
|
395
398
|
},
|
|
@@ -68,23 +68,42 @@ class buildingInspectionDetailHeader extends LitElement {
|
|
|
68
68
|
@property({ type: String }) buildingLevelFloor: string = ''
|
|
69
69
|
|
|
70
70
|
render() {
|
|
71
|
+
const path = window.location.pathname
|
|
72
|
+
|
|
71
73
|
return html`
|
|
72
74
|
<div header>
|
|
73
75
|
<h2>${this.projectName || ''} ${this.buildingName || ''} ${this.buildingLevelFloor || ''}층</h2>
|
|
74
76
|
<div button-container>
|
|
75
|
-
<md-elevated-button
|
|
77
|
+
<md-elevated-button
|
|
78
|
+
?disabled=${path.includes('building-inspection-list/')}
|
|
79
|
+
href=${`building-inspection-list/${this.buildingLevelId}`}
|
|
80
|
+
>
|
|
76
81
|
<md-icon slot="icon">assignment</md-icon>검측 리스트
|
|
77
82
|
</md-elevated-button>
|
|
78
|
-
<md-elevated-button
|
|
83
|
+
<md-elevated-button
|
|
84
|
+
?disabled=${path.includes('building-inspection-detail-drawing/')}
|
|
85
|
+
href=${`building-inspection-detail-drawing/${this.buildingInspectionId}`}
|
|
86
|
+
>
|
|
79
87
|
<md-icon slot="icon">assignment</md-icon>검측도면
|
|
80
88
|
</md-elevated-button>
|
|
81
|
-
<md-elevated-button
|
|
89
|
+
<md-elevated-button
|
|
90
|
+
?disabled=${path.includes('building-inspection-detail-checklist/')}
|
|
91
|
+
href=${`building-inspection-detail-checklist/${this.buildingInspectionId}`}
|
|
92
|
+
>
|
|
82
93
|
<md-icon slot="icon">description</md-icon>검측 체크리스트
|
|
83
94
|
</md-elevated-button>
|
|
84
|
-
<md-elevated-button
|
|
95
|
+
<md-elevated-button
|
|
96
|
+
?disabled=${path.includes('building-inspection-detail-photo/')}
|
|
97
|
+
href=${`building-inspection-detail-photo/${this.buildingInspectionId}`}
|
|
98
|
+
disabled
|
|
99
|
+
>
|
|
85
100
|
<md-icon slot="icon">description</md-icon>사진촬영
|
|
86
101
|
</md-elevated-button>
|
|
87
|
-
<md-elevated-button
|
|
102
|
+
<md-elevated-button
|
|
103
|
+
?disabled=${path.includes('building-inspection-detail-history/')}
|
|
104
|
+
href=${`building-inspection-detail-history/${this.buildingInspectionId}`}
|
|
105
|
+
disabled
|
|
106
|
+
>
|
|
88
107
|
<md-icon slot="icon">description</md-icon>감리이력
|
|
89
108
|
</md-elevated-button>
|
|
90
109
|
</div>
|
|
@@ -5,9 +5,12 @@ import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
|
|
5
5
|
import {
|
|
6
6
|
CHECKLIST_MAIN_TYPE_LIST,
|
|
7
7
|
BuildingInspectionStatus,
|
|
8
|
-
|
|
8
|
+
BUILDING_INSPECTION_STATUS_DISPLAY
|
|
9
9
|
} from '../building-inspection/building-inspection-list'
|
|
10
10
|
import '@operato/input/ox-input-signature.js'
|
|
11
|
+
// import { BuildingComplex } from '@dssp/building-complex'
|
|
12
|
+
import { store } from '@operato/shell'
|
|
13
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
11
14
|
|
|
12
15
|
export const enum ChecklistMode {
|
|
13
16
|
VIEWER = 'VIEWER',
|
|
@@ -15,7 +18,7 @@ export const enum ChecklistMode {
|
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
@customElement('checklist-view')
|
|
18
|
-
class ChecklistView extends LitElement {
|
|
21
|
+
class ChecklistView extends connect(store)(LitElement) {
|
|
19
22
|
static styles = [
|
|
20
23
|
ButtonContainerStyles,
|
|
21
24
|
ScrollbarStyles,
|
|
@@ -167,12 +170,50 @@ class ChecklistView extends LitElement {
|
|
|
167
170
|
|
|
168
171
|
@property({ type: String }) mode: ChecklistMode = ChecklistMode.VIEWER
|
|
169
172
|
@property({ type: Object }) checklist: any = {}
|
|
173
|
+
@property({ type: Object }) buildingComplex = {
|
|
174
|
+
id: '',
|
|
175
|
+
taskConstructorEmails: [] as string[],
|
|
176
|
+
overallConstructorEmails: [] as string[],
|
|
177
|
+
taskSupervisoryEmails: [] as string[],
|
|
178
|
+
overallSupervisoryEmails: [] as string[]
|
|
179
|
+
}
|
|
170
180
|
@property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT
|
|
171
181
|
|
|
172
182
|
render() {
|
|
173
183
|
const today = this._getDate(new Date())
|
|
174
|
-
|
|
175
|
-
|
|
184
|
+
|
|
185
|
+
// 시공자 스탭 여부
|
|
186
|
+
const isConstructorStep =
|
|
187
|
+
this.status == BuildingInspectionStatus.WAIT ||
|
|
188
|
+
this.status == BuildingInspectionStatus.OVERALL_WAIT ||
|
|
189
|
+
this.status == BuildingInspectionStatus.FAIL
|
|
190
|
+
|
|
191
|
+
// 감리자 스탭 여부
|
|
192
|
+
const isSupervisoryStep =
|
|
193
|
+
this.status == BuildingInspectionStatus.REQUEST || this.status == BuildingInspectionStatus.OVERALL_REQUEST
|
|
194
|
+
|
|
195
|
+
// 현재 스탭에 해당하는 계정인지 체크 (편집모드만)
|
|
196
|
+
let havePermissionByStatus: boolean = false
|
|
197
|
+
let isTaskConstructor: boolean = false
|
|
198
|
+
let isOverallConstructor: boolean = false
|
|
199
|
+
let isTaskSupervisory: boolean = false
|
|
200
|
+
let isOverallSupervisory: boolean = false
|
|
201
|
+
|
|
202
|
+
if (this.mode == ChecklistMode.EDITOR && this.status) {
|
|
203
|
+
const email = (store.getState() as any).auth?.user?.email
|
|
204
|
+
// 현재 유저가 "공종별 시공 관리자" 인지 체크
|
|
205
|
+
isTaskConstructor = this.buildingComplex.taskConstructorEmails?.includes(email) || false
|
|
206
|
+
// 현재 유저가 "총괄 시공 책임자" 인지 체크
|
|
207
|
+
isOverallConstructor = this.buildingComplex.overallConstructorEmails?.includes(email) || false
|
|
208
|
+
// 현재 유저가 "공종별 감리 책임자" 인지 체크
|
|
209
|
+
isTaskSupervisory = this.buildingComplex.taskSupervisoryEmails?.includes(email) || false
|
|
210
|
+
// 현재 유저가 "총괄 감리 책임자" 인지 체크
|
|
211
|
+
isOverallSupervisory = this.buildingComplex.overallSupervisoryEmails?.includes(email) || false
|
|
212
|
+
// 스탭이 시공자 스탭일때에 내가 시공자 권한이 있는지 체크
|
|
213
|
+
havePermissionByStatus = isConstructorStep
|
|
214
|
+
? isTaskConstructor || isOverallConstructor
|
|
215
|
+
: isTaskSupervisory || isOverallSupervisory
|
|
216
|
+
}
|
|
176
217
|
|
|
177
218
|
// 체크리스트 아이템 정렬
|
|
178
219
|
this.checklist?.checklistItems?.sort((a, b) => {
|
|
@@ -211,7 +252,7 @@ class ChecklistView extends LitElement {
|
|
|
211
252
|
<th>검측 부위</th>
|
|
212
253
|
<td>${this.checklist?.inspectionParts?.join(', ') || ''}</td>
|
|
213
254
|
<th>검측 상태</th>
|
|
214
|
-
<td>${
|
|
255
|
+
<td>${BUILDING_INSPECTION_STATUS_DISPLAY[this.checklist?.buildingInspection?.status]}</td>
|
|
215
256
|
</tr>
|
|
216
257
|
</table>
|
|
217
258
|
|
|
@@ -253,7 +294,7 @@ class ChecklistView extends LitElement {
|
|
|
253
294
|
name=${'radio-construction-' + item.id}
|
|
254
295
|
value="T"
|
|
255
296
|
.checked=${item.constructionConfirmStatus === 'T'}
|
|
256
|
-
?disabled=${!isConstructorStep}
|
|
297
|
+
?disabled=${!isConstructorStep || !havePermissionByStatus}
|
|
257
298
|
@change=${this._onChangeConfirmStatus}
|
|
258
299
|
></md-radio>
|
|
259
300
|
</td>
|
|
@@ -264,7 +305,7 @@ class ChecklistView extends LitElement {
|
|
|
264
305
|
name=${'radio-construction-' + item.id}
|
|
265
306
|
value="F"
|
|
266
307
|
.checked=${item.constructionConfirmStatus === 'F'}
|
|
267
|
-
?disabled=${!isConstructorStep}
|
|
308
|
+
?disabled=${!isConstructorStep || !havePermissionByStatus}
|
|
268
309
|
@change=${this._onChangeConfirmStatus}
|
|
269
310
|
></md-radio>
|
|
270
311
|
</td>
|
|
@@ -275,7 +316,7 @@ class ChecklistView extends LitElement {
|
|
|
275
316
|
name=${'radio-supervisory-' + item.id}
|
|
276
317
|
value="T"
|
|
277
318
|
.checked=${item.supervisoryConfirmStatus === 'T'}
|
|
278
|
-
?disabled=${!isSupervisoryStep}
|
|
319
|
+
?disabled=${!isSupervisoryStep || !havePermissionByStatus}
|
|
279
320
|
@change=${this._onChangeConfirmStatus}
|
|
280
321
|
></md-radio>
|
|
281
322
|
</td>
|
|
@@ -286,7 +327,7 @@ class ChecklistView extends LitElement {
|
|
|
286
327
|
name=${'radio-supervisory-' + item.id}
|
|
287
328
|
value="F"
|
|
288
329
|
.checked=${item.supervisoryConfirmStatus === 'F'}
|
|
289
|
-
?disabled=${!isSupervisoryStep}
|
|
330
|
+
?disabled=${!isSupervisoryStep || !havePermissionByStatus}
|
|
290
331
|
@change=${this._onChangeConfirmStatus}
|
|
291
332
|
></md-radio>
|
|
292
333
|
</td>
|
|
@@ -300,61 +341,62 @@ class ChecklistView extends LitElement {
|
|
|
300
341
|
<table tail>
|
|
301
342
|
<tbody>
|
|
302
343
|
<tr first>
|
|
303
|
-
<th rowspan="2"
|
|
344
|
+
<th rowspan="2">시공자 점검일</th>
|
|
304
345
|
<td rowspan="2">
|
|
305
346
|
${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.constructionInspectionDate)}
|
|
306
347
|
</td>
|
|
307
|
-
<th
|
|
348
|
+
<th>공종별 시공 관리자</th>
|
|
308
349
|
<td>
|
|
309
350
|
<span sign-text>(인)</span>
|
|
310
351
|
<ox-input-signature
|
|
311
|
-
.value=${this.checklist.
|
|
312
|
-
name="
|
|
352
|
+
.value=${this.checklist.taskConstructorSignature}
|
|
353
|
+
name="taskConstructorSignature"
|
|
313
354
|
@change=${this._onChangeSignature}
|
|
314
|
-
?disabled=${
|
|
355
|
+
?disabled=${(this.status != BuildingInspectionStatus.WAIT && this.status != BuildingInspectionStatus.FAIL) ||
|
|
356
|
+
!isTaskConstructor}
|
|
315
357
|
>
|
|
316
358
|
</ox-input-signature>
|
|
317
359
|
</td>
|
|
318
360
|
</tr>
|
|
319
361
|
<tr>
|
|
320
|
-
<th
|
|
362
|
+
<th>총괄 시공 책임자</th>
|
|
321
363
|
<td>
|
|
322
364
|
<span sign-text>(인)</span>
|
|
323
365
|
<ox-input-signature
|
|
324
|
-
.value=${this.checklist.
|
|
325
|
-
name="
|
|
366
|
+
.value=${this.checklist.overallConstructorSignature}
|
|
367
|
+
name="overallConstructorSignature"
|
|
326
368
|
@change=${this._onChangeSignature}
|
|
327
|
-
?disabled=${!
|
|
369
|
+
?disabled=${this.status != BuildingInspectionStatus.OVERALL_WAIT || !isOverallConstructor}
|
|
328
370
|
>
|
|
329
371
|
</ox-input-signature>
|
|
330
372
|
</td>
|
|
331
373
|
</tr>
|
|
332
374
|
<tr>
|
|
333
|
-
<th rowspan="2"
|
|
375
|
+
<th rowspan="2">감리자 점검일</th>
|
|
334
376
|
<td rowspan="2">
|
|
335
377
|
${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.supervisorInspectionDate)}
|
|
336
378
|
</td>
|
|
337
|
-
<th
|
|
379
|
+
<th>공종별 감리 책임자</th>
|
|
338
380
|
<td>
|
|
339
381
|
<span sign-text>(인)</span>
|
|
340
382
|
<ox-input-signature
|
|
341
|
-
.value=${this.checklist.
|
|
342
|
-
name="
|
|
383
|
+
.value=${this.checklist.taskSupervisorySignature}
|
|
384
|
+
name="taskSupervisorySignature"
|
|
343
385
|
@change=${this._onChangeSignature}
|
|
344
|
-
?disabled=${!
|
|
386
|
+
?disabled=${this.status != BuildingInspectionStatus.REQUEST || !isTaskSupervisory}
|
|
345
387
|
>
|
|
346
388
|
</ox-input-signature>
|
|
347
389
|
</td>
|
|
348
390
|
</tr>
|
|
349
391
|
<tr>
|
|
350
|
-
<th
|
|
392
|
+
<th>총괄 감리 책임자</th>
|
|
351
393
|
<td>
|
|
352
394
|
<span sign-text>(인)</span>
|
|
353
395
|
<ox-input-signature
|
|
354
|
-
.value=${this.checklist.
|
|
355
|
-
name="
|
|
396
|
+
.value=${this.checklist.overallSupervisorySignature}
|
|
397
|
+
name="overallSupervisorySignature"
|
|
356
398
|
@change=${this._onChangeSignature}
|
|
357
|
-
?disabled=${!
|
|
399
|
+
?disabled=${this.status != BuildingInspectionStatus.OVERALL_REQUEST || !isOverallSupervisory}
|
|
358
400
|
>
|
|
359
401
|
</ox-input-signature>
|
|
360
402
|
</td>
|
|
@@ -24,7 +24,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
28
28
|
return html `
|
|
29
29
|
<building-inspection-detail-header
|
|
30
30
|
.buildingInspectionId=${(_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.id}
|
|
@@ -40,6 +40,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
40
40
|
.mode=${"EDITOR" /* ChecklistMode.EDITOR */}
|
|
41
41
|
status=${this.buildingInspection.status}
|
|
42
42
|
.checklist=${this.buildingInspection.checklist || {}}
|
|
43
|
+
.buildingComplex=${((_l = (_k = (_j = this.buildingInspection) === null || _j === void 0 ? void 0 : _j.buildingLevel) === null || _k === void 0 ? void 0 : _k.building) === null || _l === void 0 ? void 0 : _l.buildingComplex) || {}}
|
|
43
44
|
></checklist-view>
|
|
44
45
|
`)}
|
|
45
46
|
|
|
@@ -109,6 +110,10 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
109
110
|
name
|
|
110
111
|
buildingComplex {
|
|
111
112
|
id
|
|
113
|
+
overallConstructorEmails
|
|
114
|
+
taskConstructorEmails
|
|
115
|
+
overallSupervisoryEmails
|
|
116
|
+
taskSupervisoryEmails
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
}
|
|
@@ -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,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,+CAA+C,CAAA;AACtD,OAAO,6BAA6B,CAAA;AAI7B,IAAM,iCAAiC,GAAvC,MAAM,iCAAkC,SAAQ,QAAQ;IAAxD;;QAwCI,YAAO,GAAQ,EAAE,CAAA;QACjB,uBAAkB,GAAQ,EAAE,CAAA;IAyLvC,CAAC;IAvLC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,qB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E,SAAS,CAAC,EAAE;wBAChB,2BAA2B,EAAE,SAAS,CAAC,2BAA2B;wBAClE,wBAAwB,EAAE,SAAS,CAAC,wBAAwB;wBAC5D,2BAA2B,EAAE,SAAS,CAAC,2BAA2B;wBAClE,wBAAwB,EAAE,SAAS,CAAC,wBAAwB;qBAC7D;oBACD,aAAa,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBACnD,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,yBAAyB,EAAE,IAAI,CAAC,yBAAyB;wBACzD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;qBACxD,CAAC,CAAC;iBACJ;aACF;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,MAAM,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAA;YACtC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAA;SACxD;aAAM;YACL,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA,MAAA,MAAA,QAAQ,CAAC,MAAM,0CAAG,CAAC,CAAC,0CAAE,OAAO,KAAI,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;SAC5F;IACH,CAAC;;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"]}
|
|
1
|
+
{"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-checklist.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAElE,OA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CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;kEAAkB;AAC1B;IAAC,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CAuO7C;SAvOY,iCAAiC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\n\nimport { verifyBiometric } from '@things-factory/auth-base/client'\n\nimport './component/building-inspection-detail-header'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n this.buildingInspection.id,\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button @click=${this._onClickModifyChecklist}>\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n buildingInspection {\n status\n }\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n comment\n }\n }\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n overallConstructorEmails\n taskConstructorEmails\n overallSupervisoryEmails\n taskSupervisoryEmails\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n try {\n const result = await verifyBiometric()\n if (result.verified) {\n console.log('Verification successful. Proceeding with sensitive action.')\n } else {\n notify({ message: 'Verification failed:' + result.message })\n return\n }\n } catch (error) {\n notify({ message: 'Error during biometric verification:' + error })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n}\n"]}
|
|
@@ -17,11 +17,13 @@ export declare const CHECKLIST_MAIN_TYPE_LIST: {
|
|
|
17
17
|
};
|
|
18
18
|
export declare enum BuildingInspectionStatus {
|
|
19
19
|
WAIT = "WAIT",
|
|
20
|
+
OVERALL_WAIT = "OVERALL_WAIT",
|
|
20
21
|
REQUEST = "REQUEST",
|
|
22
|
+
OVERALL_REQUEST = "OVERALL_REQUEST",
|
|
21
23
|
PASS = "PASS",
|
|
22
24
|
FAIL = "FAIL"
|
|
23
25
|
}
|
|
24
|
-
export declare const
|
|
26
|
+
export declare const BUILDING_INSPECTION_STATUS_DISPLAY: {
|
|
25
27
|
WAIT: string;
|
|
26
28
|
REQUEST: string;
|
|
27
29
|
PASS: string;
|
|
@@ -26,11 +26,13 @@ export const CHECKLIST_MAIN_TYPE_LIST = {
|
|
|
26
26
|
export var BuildingInspectionStatus;
|
|
27
27
|
(function (BuildingInspectionStatus) {
|
|
28
28
|
BuildingInspectionStatus["WAIT"] = "WAIT";
|
|
29
|
+
BuildingInspectionStatus["OVERALL_WAIT"] = "OVERALL_WAIT";
|
|
29
30
|
BuildingInspectionStatus["REQUEST"] = "REQUEST";
|
|
31
|
+
BuildingInspectionStatus["OVERALL_REQUEST"] = "OVERALL_REQUEST";
|
|
30
32
|
BuildingInspectionStatus["PASS"] = "PASS";
|
|
31
33
|
BuildingInspectionStatus["FAIL"] = "FAIL";
|
|
32
34
|
})(BuildingInspectionStatus || (BuildingInspectionStatus = {}));
|
|
33
|
-
export const
|
|
35
|
+
export const BUILDING_INSPECTION_STATUS_DISPLAY = {
|
|
34
36
|
[BuildingInspectionStatus.WAIT]: '검측 대기',
|
|
35
37
|
[BuildingInspectionStatus.REQUEST]: '검측 요청',
|
|
36
38
|
[BuildingInspectionStatus.PASS]: '합격',
|
|
@@ -81,7 +83,7 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
|
|
|
81
83
|
검측<br />현황
|
|
82
84
|
</span>
|
|
83
85
|
|
|
84
|
-
${Object.entries(
|
|
86
|
+
${Object.entries(BUILDING_INSPECTION_STATUS_DISPLAY).map(inspectionStatus => {
|
|
85
87
|
const displayName = inspectionStatus[1];
|
|
86
88
|
const status = inspectionStatus[0].toLowerCase();
|
|
87
89
|
return html `
|
|
@@ -204,7 +206,7 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
|
|
|
204
206
|
name: 'status',
|
|
205
207
|
header: '검측 결과',
|
|
206
208
|
record: {
|
|
207
|
-
renderer: value =>
|
|
209
|
+
renderer: value => BUILDING_INSPECTION_STATUS_DISPLAY[value]
|
|
208
210
|
},
|
|
209
211
|
width: 120
|
|
210
212
|
},
|
|
@@ -486,6 +488,7 @@ BuildingInspectionList.styles = [
|
|
|
486
488
|
display: flex;
|
|
487
489
|
flex-direction: column;
|
|
488
490
|
overflow: hidden;
|
|
491
|
+
min-height: 300px;
|
|
489
492
|
}
|
|
490
493
|
|
|
491
494
|
ox-grist {
|
|
@@ -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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
+
{"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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;IACH,CAAC;IAEO,WAAW,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;;AA3eM,6BAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4JF;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;AApL5C,sBAAsB;IADlC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,sBAAsB,CA6elC;SA7eY,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 OVERALL_WAIT = 'OVERALL_WAIT',\n REQUEST = 'REQUEST',\n OVERALL_REQUEST = 'OVERALL_REQUEST',\n PASS = 'PASS',\n FAIL = 'FAIL'\n}\nexport const BUILDING_INSPECTION_STATUS_DISPLAY = {\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 min-height: 300px;\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_DISPLAY).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_DISPLAY[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"]}
|
package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js
CHANGED
|
@@ -13,23 +13,41 @@ let buildingInspectionDetailHeader = class buildingInspectionDetailHeader extend
|
|
|
13
13
|
this.buildingLevelFloor = '';
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
+
const path = window.location.pathname;
|
|
16
17
|
return html `
|
|
17
18
|
<div header>
|
|
18
19
|
<h2>${this.projectName || ''} ${this.buildingName || ''} ${this.buildingLevelFloor || ''}층</h2>
|
|
19
20
|
<div button-container>
|
|
20
|
-
<md-elevated-button
|
|
21
|
+
<md-elevated-button
|
|
22
|
+
?disabled=${path.includes('building-inspection-list/')}
|
|
23
|
+
href=${`building-inspection-list/${this.buildingLevelId}`}
|
|
24
|
+
>
|
|
21
25
|
<md-icon slot="icon">assignment</md-icon>검측 리스트
|
|
22
26
|
</md-elevated-button>
|
|
23
|
-
<md-elevated-button
|
|
27
|
+
<md-elevated-button
|
|
28
|
+
?disabled=${path.includes('building-inspection-detail-drawing/')}
|
|
29
|
+
href=${`building-inspection-detail-drawing/${this.buildingInspectionId}`}
|
|
30
|
+
>
|
|
24
31
|
<md-icon slot="icon">assignment</md-icon>검측도면
|
|
25
32
|
</md-elevated-button>
|
|
26
|
-
<md-elevated-button
|
|
33
|
+
<md-elevated-button
|
|
34
|
+
?disabled=${path.includes('building-inspection-detail-checklist/')}
|
|
35
|
+
href=${`building-inspection-detail-checklist/${this.buildingInspectionId}`}
|
|
36
|
+
>
|
|
27
37
|
<md-icon slot="icon">description</md-icon>검측 체크리스트
|
|
28
38
|
</md-elevated-button>
|
|
29
|
-
<md-elevated-button
|
|
39
|
+
<md-elevated-button
|
|
40
|
+
?disabled=${path.includes('building-inspection-detail-photo/')}
|
|
41
|
+
href=${`building-inspection-detail-photo/${this.buildingInspectionId}`}
|
|
42
|
+
disabled
|
|
43
|
+
>
|
|
30
44
|
<md-icon slot="icon">description</md-icon>사진촬영
|
|
31
45
|
</md-elevated-button>
|
|
32
|
-
<md-elevated-button
|
|
46
|
+
<md-elevated-button
|
|
47
|
+
?disabled=${path.includes('building-inspection-detail-history/')}
|
|
48
|
+
href=${`building-inspection-detail-history/${this.buildingInspectionId}`}
|
|
49
|
+
disabled
|
|
50
|
+
>
|
|
33
51
|
<md-icon slot="icon">description</md-icon>감리이력
|
|
34
52
|
</md-elevated-button>
|
|
35
53
|
</div>
|