@dssp/supervision 0.0.34 → 0.0.36
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 +9 -5
- package/client/pages/building-inspection/building-inspection-list.ts +10 -9
- package/client/pages/building-inspection/component/building-inspection-detail-header.ts +11 -5
- package/client/pages/checklist/attachment-list-popup.ts +22 -4
- package/client/pages/checklist/checklist-view.ts +34 -23
- package/client/pages/checklist/comment-list-popup.ts +12 -3
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +9 -5
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-list.js +10 -9
- 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 +11 -5
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/pages/checklist/attachment-list-popup.js +24 -4
- package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.js +32 -18
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/pages/checklist/comment-list-popup copy.d.ts +2 -0
- package/dist-client/pages/checklist/comment-list-popup copy.js +344 -0
- package/dist-client/pages/checklist/comment-list-popup copy.js.map +1 -0
- package/dist-client/pages/checklist/comment-list-popup.js +16 -3
- package/dist-client/pages/checklist/comment-list-popup.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-mutation.js +9 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item-query.d.ts +2 -0
- package/dist-server/service/checklist-item/checklist-item-query.js +15 -2
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +19 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/building-inspection/building-inspection-mutation.ts +13 -1
- package/server/service/checklist-item/checklist-item-query.ts +13 -6
- package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +21 -1
|
@@ -17,6 +17,7 @@ import { verifyBiometric } from '@things-factory/auth-base/client'
|
|
|
17
17
|
import './component/building-inspection-detail-header'
|
|
18
18
|
import '../checklist/checklist-view'
|
|
19
19
|
import { ChecklistMode } from '../checklist/checklist-view'
|
|
20
|
+
import { BuildingInspectionStatus } from './building-inspection-list'
|
|
20
21
|
|
|
21
22
|
@customElement('building-inspection-detail-checklist')
|
|
22
23
|
export class BuildingInspectionDetailChecklist extends PageView {
|
|
@@ -26,11 +27,11 @@ export class BuildingInspectionDetailChecklist extends PageView {
|
|
|
26
27
|
css`
|
|
27
28
|
:host {
|
|
28
29
|
display: grid;
|
|
29
|
-
grid-template-rows:
|
|
30
|
+
grid-template-rows: 55px auto;
|
|
30
31
|
color: #4e5055;
|
|
31
32
|
|
|
32
33
|
width: 100%;
|
|
33
|
-
background-color: #
|
|
34
|
+
background-color: var(--md-sys-color-background, #f6f6f6);
|
|
34
35
|
overflow-y: auto;
|
|
35
36
|
|
|
36
37
|
--grid-record-emphasized-background-color: red;
|
|
@@ -80,7 +81,7 @@ export class BuildingInspectionDetailChecklist extends PageView {
|
|
|
80
81
|
|
|
81
82
|
<div body>
|
|
82
83
|
${keyed(
|
|
83
|
-
|
|
84
|
+
new Date(),
|
|
84
85
|
html`
|
|
85
86
|
<checklist-view
|
|
86
87
|
.mode=${ChecklistMode.EDITOR}
|
|
@@ -92,7 +93,10 @@ export class BuildingInspectionDetailChecklist extends PageView {
|
|
|
92
93
|
)}
|
|
93
94
|
|
|
94
95
|
<div button-container>
|
|
95
|
-
<md-elevated-button
|
|
96
|
+
<md-elevated-button
|
|
97
|
+
?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}
|
|
98
|
+
@click=${this._onClickModifyChecklist}
|
|
99
|
+
>
|
|
96
100
|
<md-icon slot="icon">assignment</md-icon>등록
|
|
97
101
|
</md-elevated-button>
|
|
98
102
|
</div>
|
|
@@ -245,7 +249,7 @@ export class BuildingInspectionDetailChecklist extends PageView {
|
|
|
245
249
|
})
|
|
246
250
|
|
|
247
251
|
if (!response.errors) {
|
|
248
|
-
notify({ message: '
|
|
252
|
+
notify({ message: '검측 요청서를 등록하였습니다.' })
|
|
249
253
|
this.initBuildingInspection(this.buildingInspection.id)
|
|
250
254
|
} else {
|
|
251
255
|
notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })
|
|
@@ -73,7 +73,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
73
73
|
--md-outlined-button-container-height: 30px;
|
|
74
74
|
--md-outlined-button-trailing-space: var(--spacing-medium, 8px);
|
|
75
75
|
--md-outlined-button-leading-space: var(--spacing-medium, 8px);
|
|
76
|
-
--md-sys-color-outline: rgba(51,51,51
|
|
76
|
+
--md-sys-color-outline: rgba(51, 51, 51, 0.2);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
*[bold] {
|
|
@@ -83,20 +83,20 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
83
83
|
div[header] {
|
|
84
84
|
display: flex;
|
|
85
85
|
margin: 0px var(--spacing-large, 12px);
|
|
86
|
-
margin-bottom:var(--spacing-small, 5px);
|
|
86
|
+
margin-bottom: var(--spacing-small, 5px);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
div[header] h2 {
|
|
90
90
|
flex: 0.5;
|
|
91
91
|
color: #3f71a0;
|
|
92
|
-
font-size:18px;
|
|
92
|
+
font-size: 18px;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
div[body] {
|
|
96
96
|
display: flex;
|
|
97
97
|
flex-direction: column;
|
|
98
98
|
margin: var(--spacing-large, 12px);
|
|
99
|
-
margin-top:0;
|
|
99
|
+
margin-top: 0;
|
|
100
100
|
gap: var(--spacing-medium, 8px);
|
|
101
101
|
min-height: fit-content;
|
|
102
102
|
overflow-x: hidden;
|
|
@@ -157,10 +157,10 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
157
157
|
align-items: center;
|
|
158
158
|
justify-content: center;
|
|
159
159
|
|
|
160
|
-
span::before{
|
|
160
|
+
span::before {
|
|
161
161
|
display: inline-block;
|
|
162
162
|
position: relative;
|
|
163
|
-
content:
|
|
163
|
+
content: '';
|
|
164
164
|
width: 10px;
|
|
165
165
|
height: 10px;
|
|
166
166
|
border-radius: 6px;
|
|
@@ -168,7 +168,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
168
168
|
margin-right: 2px;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
span[status='wait']::before{
|
|
171
|
+
span[status='wait']::before {
|
|
172
172
|
background-color: #4e5055;
|
|
173
173
|
}
|
|
174
174
|
span[status='request']::before {
|
|
@@ -188,10 +188,10 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
188
188
|
flex-direction: row;
|
|
189
189
|
text-align: right;
|
|
190
190
|
gap: var(--spacing-small, 4px);
|
|
191
|
-
padding-right:var(--spacing-large, 12px);
|
|
191
|
+
padding-right: var(--spacing-large, 12px);
|
|
192
192
|
border-right: 2px dotted #ccc;
|
|
193
193
|
max-width: 100%;
|
|
194
|
-
line-height:1.3;
|
|
194
|
+
line-height: 1.3;
|
|
195
195
|
|
|
196
196
|
md-icon {
|
|
197
197
|
width: 40px;
|
|
@@ -311,6 +311,7 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
311
311
|
.mode=${'monthly'}
|
|
312
312
|
.eventProvider=${this.calendarData}
|
|
313
313
|
@select-date=${(e: CustomEvent) => {
|
|
314
|
+
// TODO 선택된 날짜의 검측데이터만 그리드에 보여야함
|
|
314
315
|
console.log('select-date', e.detail)
|
|
315
316
|
}}
|
|
316
317
|
>
|
|
@@ -45,6 +45,7 @@ class BuildingInspectionDetailHeader extends LitElement {
|
|
|
45
45
|
|
|
46
46
|
md-elevated-button {
|
|
47
47
|
margin-left: var(--spacing-small, 4px);
|
|
48
|
+
letter-spacing: -1px;
|
|
48
49
|
|
|
49
50
|
--md-elevated-button-container-height: 32px;
|
|
50
51
|
--md-elevated-button-label-text-size: 16px;
|
|
@@ -58,9 +59,14 @@ class BuildingInspectionDetailHeader extends LitElement {
|
|
|
58
59
|
--md-elevated-button-hover-icon-color: var(--md-sys-color-on-primary);
|
|
59
60
|
--md-elevated-button-pressed-icon-color: var(--md-sys-color-on-primary);
|
|
60
61
|
--md-elevated-button-focus-icon-color: var(--md-sys-color-on-primary);
|
|
62
|
+
--_leading-space:var(--spacing-tiny, 2px);
|
|
61
63
|
|
|
62
64
|
--_with-leading-icon-leading-space: var(--spacing-medium, 8px);
|
|
63
65
|
--_with-leading-icon-trailing-space: var(--spacing-medium, 8px);
|
|
66
|
+
|
|
67
|
+
md-icon{
|
|
68
|
+
margin-right: -2px;
|
|
69
|
+
}
|
|
64
70
|
}
|
|
65
71
|
`
|
|
66
72
|
]
|
|
@@ -82,33 +88,33 @@ class BuildingInspectionDetailHeader extends LitElement {
|
|
|
82
88
|
?disabled=${path.includes('building-inspection-list/')}
|
|
83
89
|
href=${`building-inspection-list/${this.buildingLevelId}`}
|
|
84
90
|
>
|
|
85
|
-
<md-icon slot="icon">
|
|
91
|
+
<md-icon slot="icon">list_alt</md-icon>검측 리스트
|
|
86
92
|
</md-elevated-button>
|
|
87
93
|
<md-elevated-button
|
|
88
94
|
?disabled=${path.includes('building-inspection-detail-drawing/')}
|
|
89
95
|
href=${`building-inspection-detail-drawing/${this.buildingInspectionId}`}
|
|
90
96
|
>
|
|
91
|
-
<md-icon slot="icon">
|
|
97
|
+
<md-icon slot="icon">fact_check</md-icon>검측도면
|
|
92
98
|
</md-elevated-button>
|
|
93
99
|
<md-elevated-button
|
|
94
100
|
?disabled=${path.includes('building-inspection-detail-checklist/')}
|
|
95
101
|
href=${`building-inspection-detail-checklist/${this.buildingInspectionId}`}
|
|
96
102
|
>
|
|
97
|
-
<md-icon slot="icon">
|
|
103
|
+
<md-icon slot="icon">task</md-icon>검측 체크리스트
|
|
98
104
|
</md-elevated-button>
|
|
99
105
|
<md-elevated-button
|
|
100
106
|
?disabled=${path.includes('building-inspection-detail-camera/')}
|
|
101
107
|
href=${`building-inspection-detail-camera/${this.buildingInspectionId}`}
|
|
102
108
|
disabled
|
|
103
109
|
>
|
|
104
|
-
<md-icon slot="icon">
|
|
110
|
+
<md-icon slot="icon">photo_camera</md-icon>사진촬영
|
|
105
111
|
</md-elevated-button>
|
|
106
112
|
<md-elevated-button
|
|
107
113
|
?disabled=${path.includes('building-inspection-detail-history/')}
|
|
108
114
|
href=${`building-inspection-detail-history/${this.buildingInspectionId}`}
|
|
109
115
|
disabled
|
|
110
116
|
>
|
|
111
|
-
<md-icon slot="icon">
|
|
117
|
+
<md-icon slot="icon">pending_actions</md-icon>감리이력
|
|
112
118
|
</md-elevated-button>
|
|
113
119
|
</div>
|
|
114
120
|
</div>
|
|
@@ -10,6 +10,7 @@ import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
|
10
10
|
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
|
11
11
|
import { openPopup } from '@operato/layout'
|
|
12
12
|
import './file-preview-popup'
|
|
13
|
+
import { BuildingInspectionStatus } from '../building-inspection/building-inspection-list'
|
|
13
14
|
|
|
14
15
|
@customElement('attachment-list-popup')
|
|
15
16
|
class AttachmentListPopup extends connect(store)(LitElement) {
|
|
@@ -95,6 +96,7 @@ class AttachmentListPopup extends connect(store)(LitElement) {
|
|
|
95
96
|
]
|
|
96
97
|
|
|
97
98
|
@property({ type: String }) checklistItemId: string = ''
|
|
99
|
+
@property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT
|
|
98
100
|
|
|
99
101
|
@state() item: any = { count: 0 }
|
|
100
102
|
@state() checklistItemAttachments: any = []
|
|
@@ -108,14 +110,14 @@ class AttachmentListPopup extends connect(store)(LitElement) {
|
|
|
108
110
|
<h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>
|
|
109
111
|
|
|
110
112
|
<div attachment-container>
|
|
111
|
-
${this.checklistItemAttachments.
|
|
113
|
+
${this.checklistItemAttachments.map(attachment => {
|
|
112
114
|
return html`
|
|
113
115
|
<div attachment-row>
|
|
114
116
|
<div creator-container>
|
|
115
117
|
<span creator><md-icon slot="icon">account_circle</md-icon> ${attachment.creator.name}</span>
|
|
116
118
|
<span createdAt>
|
|
117
119
|
<md-icon slot="icon">schedule</md-icon> ${this._formatDate(attachment.createdAt)}
|
|
118
|
-
${attachment.creator.email === this.user.email
|
|
120
|
+
${attachment.creator.email === this.user.email && this.status != BuildingInspectionStatus.PASS
|
|
119
121
|
? html` <md-icon delete slot="icon" @click=${() => this._deleteAttachment(attachment.id)}>delete</md-icon>`
|
|
120
122
|
: ''}
|
|
121
123
|
<a button-download href=${attachment.fullpath} download=${attachment.name}>
|
|
@@ -129,7 +131,13 @@ class AttachmentListPopup extends connect(store)(LitElement) {
|
|
|
129
131
|
})}
|
|
130
132
|
</div>
|
|
131
133
|
|
|
132
|
-
<ox-input-file
|
|
134
|
+
<ox-input-file
|
|
135
|
+
accept="*/*"
|
|
136
|
+
multiple="true"
|
|
137
|
+
hide-filelist
|
|
138
|
+
?disabled=${this.status == BuildingInspectionStatus.PASS}
|
|
139
|
+
@change=${this.onCreateAttachment.bind(this)}
|
|
140
|
+
></ox-input-file>
|
|
133
141
|
|
|
134
142
|
<div button-container>
|
|
135
143
|
<md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소 </md-elevated-button>
|
|
@@ -177,6 +185,11 @@ class AttachmentListPopup extends connect(store)(LitElement) {
|
|
|
177
185
|
}
|
|
178
186
|
|
|
179
187
|
private async _deleteAttachment(attachmentId: string) {
|
|
188
|
+
if (this.status == BuildingInspectionStatus.PASS) {
|
|
189
|
+
notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })
|
|
190
|
+
return
|
|
191
|
+
}
|
|
192
|
+
|
|
180
193
|
if (
|
|
181
194
|
await OxPrompt.open({
|
|
182
195
|
title: '첨부 자료를 삭제',
|
|
@@ -213,6 +226,11 @@ class AttachmentListPopup extends connect(store)(LitElement) {
|
|
|
213
226
|
|
|
214
227
|
// 파일 변경 시 파일을 저장할 핸들러
|
|
215
228
|
private async onCreateAttachment(e: CustomEvent) {
|
|
229
|
+
if (this.status == BuildingInspectionStatus.PASS) {
|
|
230
|
+
notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })
|
|
231
|
+
return
|
|
232
|
+
}
|
|
233
|
+
|
|
216
234
|
const files = e.detail
|
|
217
235
|
|
|
218
236
|
await this._createAttachments(files)
|
|
@@ -251,7 +269,7 @@ class AttachmentListPopup extends connect(store)(LitElement) {
|
|
|
251
269
|
|
|
252
270
|
const attachments = response.data.createAttachments
|
|
253
271
|
|
|
254
|
-
this.checklistItemAttachments = [...this.checklistItemAttachments
|
|
272
|
+
this.checklistItemAttachments = [...attachments, ...this.checklistItemAttachments]
|
|
255
273
|
this.checklistItemAttachmentCount = this.checklistItemAttachmentCount + attachments.length
|
|
256
274
|
}
|
|
257
275
|
|
|
@@ -30,11 +30,10 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
30
30
|
:host {
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
|
+
padding: var(--spacing-large, 12px);
|
|
34
|
+
padding-top: 0;
|
|
33
35
|
font-size: 14px;
|
|
34
|
-
padding: 20px;
|
|
35
36
|
min-width: 800px;
|
|
36
|
-
|
|
37
|
-
background-color: var(--md-sys-color-surface);
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
[bold] {
|
|
@@ -45,7 +44,6 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
45
44
|
display: flex;
|
|
46
45
|
color: #586878;
|
|
47
46
|
font-size: 24px;
|
|
48
|
-
font-weight: bold;
|
|
49
47
|
align-items: center;
|
|
50
48
|
justify-content: center;
|
|
51
49
|
}
|
|
@@ -58,8 +56,8 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
58
56
|
border-collapse: collapse;
|
|
59
57
|
td,
|
|
60
58
|
th {
|
|
61
|
-
border: 1px
|
|
62
|
-
padding-inline: 8px;
|
|
59
|
+
border: 1px rgba(51, 51, 51, 0.2) solid;
|
|
60
|
+
padding-inline: var(--spacing-medium, 8px);
|
|
63
61
|
vertical-align: middle;
|
|
64
62
|
}
|
|
65
63
|
th {
|
|
@@ -67,16 +65,17 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
67
65
|
font-weight: bold;
|
|
68
66
|
}
|
|
69
67
|
td {
|
|
70
|
-
height:
|
|
68
|
+
height: 33px;
|
|
69
|
+
background-color: var(--md-sys-color-on-primary);
|
|
71
70
|
&[radio] {
|
|
72
71
|
text-align: center;
|
|
73
|
-
width:
|
|
72
|
+
width: 50px;
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
table[header] {
|
|
79
|
-
margin-top:
|
|
78
|
+
margin-top: var(--spacing-small, 4px);
|
|
80
79
|
|
|
81
80
|
td {
|
|
82
81
|
min-width: 180px;
|
|
@@ -89,9 +88,9 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
table[body] {
|
|
92
|
-
border: 2px solid
|
|
91
|
+
border: 2px solid var(--md-sys-color-on-primary-container);
|
|
93
92
|
border-bottom: none;
|
|
94
|
-
margin-top:
|
|
93
|
+
margin-top: var(--spacing-medium, 8px);
|
|
95
94
|
|
|
96
95
|
th {
|
|
97
96
|
text-align: center;
|
|
@@ -135,22 +134,24 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
135
134
|
vertical-align: middle;
|
|
136
135
|
}
|
|
137
136
|
}
|
|
137
|
+
&[disabled] * {
|
|
138
|
+
opacity: 0.6;
|
|
139
|
+
}
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
table[tail] {
|
|
142
|
-
border: 2px solid
|
|
144
|
+
border: 2px solid var(--md-sys-color-on-primary-container);
|
|
143
145
|
border-top: none;
|
|
144
146
|
margin-top: -1px;
|
|
145
147
|
|
|
146
|
-
tr[first] td {
|
|
147
|
-
border-top: none;
|
|
148
|
-
}
|
|
149
148
|
td {
|
|
150
149
|
width: 25%;
|
|
151
150
|
border-left: none;
|
|
152
151
|
text-align: center;
|
|
153
152
|
position: relative;
|
|
153
|
+
background-color: var(--md-sys-color-on-primary);
|
|
154
|
+
font-size: 14px;
|
|
154
155
|
}
|
|
155
156
|
th {
|
|
156
157
|
width: 25%;
|
|
@@ -165,7 +166,7 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
165
166
|
pointer-events: none;
|
|
166
167
|
}
|
|
167
168
|
ox-input-signature {
|
|
168
|
-
margin:
|
|
169
|
+
margin: var(--spacing-medium, 8px);
|
|
169
170
|
|
|
170
171
|
&[disabled] {
|
|
171
172
|
background: #eee;
|
|
@@ -176,12 +177,12 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
176
177
|
div[footer] {
|
|
177
178
|
display: flex;
|
|
178
179
|
flex-direction: column;
|
|
179
|
-
gap:
|
|
180
|
+
gap: var(--spacing-tiny, 2px);
|
|
180
181
|
font-size: 12px;
|
|
181
|
-
margin-top:
|
|
182
|
+
margin-top: var(--spacing-medium, 8px);
|
|
182
183
|
color: #586878;
|
|
183
184
|
text-indent: -9px;
|
|
184
|
-
padding-left:
|
|
185
|
+
padding-left: var(--spacing-medium, 8px);
|
|
185
186
|
}
|
|
186
187
|
`
|
|
187
188
|
]
|
|
@@ -251,7 +252,7 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
251
252
|
|
|
252
253
|
return html`
|
|
253
254
|
<div wrapper>
|
|
254
|
-
<div name>${this.checklist.name}</div>
|
|
255
|
+
<div name bold>${this.checklist.name}</div>
|
|
255
256
|
|
|
256
257
|
<table header>
|
|
257
258
|
<tr>
|
|
@@ -303,7 +304,7 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
303
304
|
: ''}
|
|
304
305
|
${showDetailTypeCell ? html` <td bold rowspan="${detailTypeRowspan}">${item.detailType}</td> ` : ''}
|
|
305
306
|
|
|
306
|
-
<td
|
|
307
|
+
<td>${idx + 1}. ${item.name}</td>
|
|
307
308
|
<td>${item.inspctionCriteria}</td>
|
|
308
309
|
<td radio>
|
|
309
310
|
<md-radio
|
|
@@ -349,11 +350,19 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
349
350
|
@change=${this._onChangeConfirmStatus}
|
|
350
351
|
></md-radio>
|
|
351
352
|
</td>
|
|
352
|
-
<td
|
|
353
|
+
<td
|
|
354
|
+
attachment
|
|
355
|
+
?disabled=${this.status == BuildingInspectionStatus.PASS}
|
|
356
|
+
@click=${() => this._onClickAttachment(item.id)}
|
|
357
|
+
>
|
|
353
358
|
<md-icon slot="icon">attach_file</md-icon>
|
|
354
359
|
<span>${item?.checklistItemAttachmentCount || ''}</span>
|
|
355
360
|
</td>
|
|
356
|
-
<td
|
|
361
|
+
<td
|
|
362
|
+
comment
|
|
363
|
+
?disabled=${this.status == BuildingInspectionStatus.PASS}
|
|
364
|
+
@click=${() => this._onClickComment(item.id)}
|
|
365
|
+
>
|
|
357
366
|
<md-icon slot="icon">chat</md-icon>
|
|
358
367
|
<span>${item?.checklistItemCommentCount || ''}</span>
|
|
359
368
|
</td>
|
|
@@ -516,6 +525,7 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
516
525
|
html`
|
|
517
526
|
<comment-list-popup
|
|
518
527
|
.checklistItemId=${checklistItemId}
|
|
528
|
+
.status=${this.status}
|
|
519
529
|
@change-comment=${this._refreshItem.bind(this)}
|
|
520
530
|
></comment-list-popup>
|
|
521
531
|
`,
|
|
@@ -532,6 +542,7 @@ class ChecklistView extends connect(store)(LitElement) {
|
|
|
532
542
|
html`
|
|
533
543
|
<attachment-list-popup
|
|
534
544
|
.checklistItemId=${checklistItemId}
|
|
545
|
+
.status=${this.status}
|
|
535
546
|
@change-attachment=${this._refreshItem.bind(this)}
|
|
536
547
|
></attachment-list-popup>
|
|
537
548
|
`,
|
|
@@ -8,6 +8,7 @@ import { notify } from '@operato/layout'
|
|
|
8
8
|
import { store, User } from '@operato/shell'
|
|
9
9
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
10
10
|
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
|
11
|
+
import { BuildingInspectionStatus } from '../building-inspection/building-inspection-list'
|
|
11
12
|
|
|
12
13
|
@customElement('comment-list-popup')
|
|
13
14
|
class CommentListPopup extends connect(store)(LitElement) {
|
|
@@ -39,6 +40,7 @@ class CommentListPopup extends connect(store)(LitElement) {
|
|
|
39
40
|
div[comment-row] {
|
|
40
41
|
display: flex;
|
|
41
42
|
flex-direction: column;
|
|
43
|
+
padding-right: 10px;
|
|
42
44
|
|
|
43
45
|
div[creator-container] {
|
|
44
46
|
display: flex;
|
|
@@ -104,6 +106,7 @@ class CommentListPopup extends connect(store)(LitElement) {
|
|
|
104
106
|
]
|
|
105
107
|
|
|
106
108
|
@property({ type: String }) checklistItemId: string = ''
|
|
109
|
+
@property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT
|
|
107
110
|
|
|
108
111
|
@state() item: any = { count: 0 }
|
|
109
112
|
@state() checklistItemComments: any = []
|
|
@@ -129,7 +132,7 @@ class CommentListPopup extends connect(store)(LitElement) {
|
|
|
129
132
|
<span creator><md-icon slot="icon">account_circle</md-icon> ${comment.creator.name}</span>
|
|
130
133
|
<span createdAt>
|
|
131
134
|
<md-icon slot="icon">schedule</md-icon> ${this._formatDate(comment.createdAt)}
|
|
132
|
-
${comment.creator.email === this.user.email
|
|
135
|
+
${comment.creator.email === this.user.email && this.status != BuildingInspectionStatus.PASS
|
|
133
136
|
? html` <md-icon delete slot="icon" @click=${() => this._deleteComment(comment.id)}>delete</md-icon>`
|
|
134
137
|
: ''}
|
|
135
138
|
</span>
|
|
@@ -140,10 +143,16 @@ class CommentListPopup extends connect(store)(LitElement) {
|
|
|
140
143
|
})}
|
|
141
144
|
</div>
|
|
142
145
|
|
|
143
|
-
<textarea
|
|
146
|
+
<textarea
|
|
147
|
+
.value=${this.comment || ''}
|
|
148
|
+
?disabled=${this.status == BuildingInspectionStatus.PASS}
|
|
149
|
+
@input=${this._onInputChange}
|
|
150
|
+
></textarea>
|
|
144
151
|
|
|
145
152
|
<div button-container>
|
|
146
|
-
<md-elevated-button blue @click=${this._createComment}>
|
|
153
|
+
<md-elevated-button blue ?disabled=${this.status == BuildingInspectionStatus.PASS} @click=${this._createComment}>
|
|
154
|
+
<md-icon slot="icon">task</md-icon>저장
|
|
155
|
+
</md-elevated-button>
|
|
147
156
|
<md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소 </md-elevated-button>
|
|
148
157
|
</div>
|
|
149
158
|
</div>
|
|
@@ -12,6 +12,7 @@ import gql from 'graphql-tag';
|
|
|
12
12
|
import { verifyBiometric } from '@things-factory/auth-base/client';
|
|
13
13
|
import './component/building-inspection-detail-header';
|
|
14
14
|
import '../checklist/checklist-view';
|
|
15
|
+
import { BuildingInspectionStatus } from './building-inspection-list';
|
|
15
16
|
let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist extends PageView {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments);
|
|
@@ -35,7 +36,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
35
36
|
></building-inspection-detail-header>
|
|
36
37
|
|
|
37
38
|
<div body>
|
|
38
|
-
${keyed(
|
|
39
|
+
${keyed(new Date(), html `
|
|
39
40
|
<checklist-view
|
|
40
41
|
.mode=${"EDITOR" /* ChecklistMode.EDITOR */}
|
|
41
42
|
status=${this.buildingInspection.status}
|
|
@@ -45,7 +46,10 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
45
46
|
`)}
|
|
46
47
|
|
|
47
48
|
<div button-container>
|
|
48
|
-
<md-elevated-button
|
|
49
|
+
<md-elevated-button
|
|
50
|
+
?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}
|
|
51
|
+
@click=${this._onClickModifyChecklist}
|
|
52
|
+
>
|
|
49
53
|
<md-icon slot="icon">assignment</md-icon>등록
|
|
50
54
|
</md-elevated-button>
|
|
51
55
|
</div>
|
|
@@ -192,7 +196,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
192
196
|
}
|
|
193
197
|
});
|
|
194
198
|
if (!response.errors) {
|
|
195
|
-
notify({ message: '
|
|
199
|
+
notify({ message: '검측 요청서를 등록하였습니다.' });
|
|
196
200
|
this.initBuildingInspection(this.buildingInspection.id);
|
|
197
201
|
}
|
|
198
202
|
else {
|
|
@@ -206,11 +210,11 @@ BuildingInspectionDetailChecklist.styles = [
|
|
|
206
210
|
css `
|
|
207
211
|
:host {
|
|
208
212
|
display: grid;
|
|
209
|
-
grid-template-rows:
|
|
213
|
+
grid-template-rows: 55px auto;
|
|
210
214
|
color: #4e5055;
|
|
211
215
|
|
|
212
216
|
width: 100%;
|
|
213
|
-
background-color: #
|
|
217
|
+
background-color: var(--md-sys-color-background, #f6f6f6);
|
|
214
218
|
overflow-y: auto;
|
|
215
219
|
|
|
216
220
|
--grid-record-emphasized-background-color: red;
|
|
@@ -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,e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ACJ;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;;AAtOM,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,CAwO7C;SAxOY,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 checklistItemCommentCount\n checklistItemAttachmentCount\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"]}
|
|
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;AAEpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAG9D,IAAM,iCAAiC,GAAvC,MAAM,iCAAkC,SAAQ,QAAQ;IAAxD;;QAwCI,YAAO,GAAQ,EAAE,CAAA;QACjB,uBAAkB,GAAQ,EAAE,CAAA;IAkMvC,CAAC;IAhMC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAA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zC,iCAAiC,CA2O7C;SA3OY,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'\nimport { BuildingInspectionStatus } from './building-inspection-list'\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: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\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 new Date(),\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\n ?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}\n @click=${this._onClickModifyChecklist}\n >\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 checklistItemCommentCount\n checklistItemAttachmentCount\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"]}
|