@dssp/supervision 0.0.31 → 0.0.33
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 +1 -1
- package/client/pages/building-inspection/building-inspection-detail-drawing.ts +2 -2
- package/client/pages/building-inspection/building-inspection-list.ts +75 -58
- package/client/pages/building-inspection/component/building-inspection-detail-header.ts +15 -11
- package/client/pages/building-inspection/component/inspection-event-provider.ts +1 -1
- package/client/pages/checklist/checklist-view.ts +63 -7
- package/client/pages/checklist/comment-list-popup.ts +318 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +2 -2
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-list.js +75 -58
- 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 +15 -11
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js +1 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.d.ts +1 -0
- package/dist-client/pages/checklist/checklist-view.js +57 -7
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/pages/checklist/comment-list-popup.d.ts +2 -0
- package/dist-client/pages/checklist/comment-list-popup.js +343 -0
- package/dist-client/pages/checklist/comment-list-popup.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/checklist-item/checklist-item-query.d.ts +3 -0
- package/dist-server/service/checklist-item/checklist-item-query.js +21 -0
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
- package/dist-server/service/checklist-item/checklist-item.d.ts +2 -1
- package/dist-server/service/checklist-item/checklist-item.js +5 -4
- package/dist-server/service/checklist-item/checklist-item.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-history.d.ts +16 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js +83 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js.map +1 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.d.ts +7 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +69 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-query.d.ts +7 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js +49 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js.map +1 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-type.d.ts +14 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js +53 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js.map +1 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment.d.ts +12 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment.js +57 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment.js.map +1 -0
- package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist-item-comment/event-subscriber.js +21 -0
- package/dist-server/service/checklist-item-comment/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist-item-comment/index.d.ts +7 -0
- package/dist-server/service/checklist-item-comment/index.js +12 -0
- package/dist-server/service/checklist-item-comment/index.js.map +1 -0
- package/dist-server/service/index.d.ts +2 -1
- package/dist-server/service/index.js +6 -1
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/checklist-item/checklist-item-query.ts +11 -0
- package/server/service/checklist-item/checklist-item.ts +6 -3
- package/server/service/checklist-item-comment/checklist-item-comment-history.ts +69 -0
- package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +60 -0
- package/server/service/checklist-item-comment/checklist-item-comment-query.ts +36 -0
- package/server/service/checklist-item-comment/checklist-item-comment-type.ts +32 -0
- package/server/service/checklist-item-comment/checklist-item-comment.ts +56 -0
- package/server/service/checklist-item-comment/event-subscriber.ts +17 -0
- package/server/service/checklist-item-comment/index.ts +9 -0
- package/server/service/index.ts +10 -1
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import gql from 'graphql-tag'
|
|
3
|
+
import { client } from '@operato/graphql'
|
|
4
|
+
import { css, html, LitElement } from 'lit'
|
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
6
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
|
7
|
+
import { notify } from '@operato/layout'
|
|
8
|
+
import { store, User } from '@operato/shell'
|
|
9
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
10
|
+
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
|
11
|
+
import './checklist-view'
|
|
12
|
+
|
|
13
|
+
@customElement('comment-list-popup')
|
|
14
|
+
class CommentListPopup extends connect(store)(LitElement) {
|
|
15
|
+
static styles = [
|
|
16
|
+
ButtonContainerStyles,
|
|
17
|
+
ScrollbarStyles,
|
|
18
|
+
css`
|
|
19
|
+
:host {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
padding: 15px 20px;
|
|
23
|
+
background-color: var(--md-sys-color-surface);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
div[body] {
|
|
27
|
+
height: 100%;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 12px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
div[comments-container] {
|
|
34
|
+
overflow-y: auto;
|
|
35
|
+
gap: 10px;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
flex: 1;
|
|
39
|
+
|
|
40
|
+
div[comment-row] {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
|
|
44
|
+
div[creator-container] {
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: space-between;
|
|
47
|
+
|
|
48
|
+
span[creator] {
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: 3px;
|
|
53
|
+
}
|
|
54
|
+
span[createdAt] {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 3px;
|
|
58
|
+
|
|
59
|
+
md-icon[delete] {
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
div[comment] {
|
|
66
|
+
margin-left: 20px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
h3 {
|
|
72
|
+
position: relative;
|
|
73
|
+
color: rgb(5, 149, 229);
|
|
74
|
+
font-size: 17px;
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
background-color: var(--md-sys-color-surface);
|
|
77
|
+
margin-top: 0px;
|
|
78
|
+
margin-bottom: 5px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
textarea {
|
|
82
|
+
height: 75px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
div[button-container] {
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: flex-end;
|
|
88
|
+
gap: 10px;
|
|
89
|
+
|
|
90
|
+
md-elevated-button[blue] {
|
|
91
|
+
--md-elevated-button-container-color: #0595e5;
|
|
92
|
+
|
|
93
|
+
--md-elevated-button-label-text-color: #fff;
|
|
94
|
+
--md-elevated-button-hover-label-text-color: #fff;
|
|
95
|
+
--md-elevated-button-pressed-label-text-color: #fff;
|
|
96
|
+
--md-elevated-button-focus-label-text-color: #fff;
|
|
97
|
+
--md-elevated-button-icon-color: #fff;
|
|
98
|
+
--md-elevated-button-hover-icon-color: #fff;
|
|
99
|
+
--md-elevated-button-pressed-icon-color: #fff;
|
|
100
|
+
--md-elevated-button-focus-icon-color: #fff;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
`
|
|
104
|
+
]
|
|
105
|
+
|
|
106
|
+
@property({ type: String }) checklistItemId: string = ''
|
|
107
|
+
|
|
108
|
+
@state() item: any = { count: 0 }
|
|
109
|
+
@state() checklistItemComments: any = []
|
|
110
|
+
@state() comment: string = ''
|
|
111
|
+
@state() checklistItemCommentCount: number = 0
|
|
112
|
+
@state() user: User = {}
|
|
113
|
+
@state() page: number = 1
|
|
114
|
+
@state() loading: boolean = false
|
|
115
|
+
@state() hasMoreComments: boolean = true
|
|
116
|
+
|
|
117
|
+
@query('div[comments-container]') commentsContainer!: HTMLDivElement
|
|
118
|
+
|
|
119
|
+
render() {
|
|
120
|
+
return html`
|
|
121
|
+
<div body>
|
|
122
|
+
<h3>제품검사에 대한 확인: ${this.checklistItemCommentCount || 0}건</h3>
|
|
123
|
+
|
|
124
|
+
<div comments-container @scroll=${this._onScroll}>
|
|
125
|
+
${this.checklistItemComments.map(comment => {
|
|
126
|
+
return html`
|
|
127
|
+
<div comment-row>
|
|
128
|
+
<div creator-container>
|
|
129
|
+
<span creator><md-icon slot="icon">account_circle</md-icon> ${comment.creator.name}</span>
|
|
130
|
+
<span createdAt>
|
|
131
|
+
<md-icon slot="icon">schedule</md-icon> ${this._formatDate(comment.createdAt)}
|
|
132
|
+
${comment.creator.email === this.user.email
|
|
133
|
+
? html` <md-icon delete slot="icon" @click=${() => this._deleteComment(comment.id)}>delete</md-icon>`
|
|
134
|
+
: ''}
|
|
135
|
+
</span>
|
|
136
|
+
</div>
|
|
137
|
+
<div comment>${comment.comment}</div>
|
|
138
|
+
</div>
|
|
139
|
+
`
|
|
140
|
+
})}
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<textarea .value=${this.comment || ''} @input=${this._onInputChange}></textarea>
|
|
144
|
+
|
|
145
|
+
<div button-container>
|
|
146
|
+
<md-elevated-button blue @click=${this._createComment}> <md-icon slot="icon">task</md-icon>저장 </md-elevated-button>
|
|
147
|
+
<md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소 </md-elevated-button>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
`
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async firstUpdated() {
|
|
154
|
+
this.user = (store.getState() as any).auth?.user
|
|
155
|
+
this.comment = ''
|
|
156
|
+
this.page = 1
|
|
157
|
+
await this._loadComments()
|
|
158
|
+
this._scrollBottom()
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
private async _loadComments() {
|
|
162
|
+
if (this.loading || !this.hasMoreComments) return
|
|
163
|
+
|
|
164
|
+
this.loading = true
|
|
165
|
+
|
|
166
|
+
const response = await client.query({
|
|
167
|
+
query: gql`
|
|
168
|
+
query ChecklistItemComments($pagination: Pagination!, $checklistItemId: String!) {
|
|
169
|
+
checklistItemComments(pagination: $pagination, checklistItemId: $checklistItemId) {
|
|
170
|
+
id
|
|
171
|
+
comment
|
|
172
|
+
creator {
|
|
173
|
+
id
|
|
174
|
+
email
|
|
175
|
+
}
|
|
176
|
+
createdAt
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
checklistItem(id: $checklistItemId) {
|
|
180
|
+
id
|
|
181
|
+
checklistItemCommentCount
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
`,
|
|
185
|
+
variables: {
|
|
186
|
+
checklistItemId: this.checklistItemId,
|
|
187
|
+
pagination: {
|
|
188
|
+
page: this.page,
|
|
189
|
+
limit: 10
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
if (response.errors) return
|
|
195
|
+
|
|
196
|
+
const items = response.data.checklistItemComments
|
|
197
|
+
if (items.length < 10) this.hasMoreComments = false
|
|
198
|
+
|
|
199
|
+
this.checklistItemComments = [...items.reverse(), ...this.checklistItemComments]
|
|
200
|
+
this.page += 1
|
|
201
|
+
this.checklistItemCommentCount = response.data.checklistItem.checklistItemCommentCount
|
|
202
|
+
this.loading = false
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// 스크롤이 맨 위에 가까울 때 데이터 요청
|
|
206
|
+
private _onScroll() {
|
|
207
|
+
const { scrollTop } = this.commentsContainer
|
|
208
|
+
if (scrollTop <= 5) {
|
|
209
|
+
this._loadComments()
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private async _createComment() {
|
|
214
|
+
if (!this.comment) {
|
|
215
|
+
notify({ message: '조치사항을 입력해주세요.', level: 'warn' })
|
|
216
|
+
return
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const response = await client.mutate({
|
|
220
|
+
mutation: gql`
|
|
221
|
+
mutation CreateChecklistItemComment($checklistItemComment: NewChecklistItemComment!) {
|
|
222
|
+
createChecklistItemComment(checklistItemComment: $checklistItemComment) {
|
|
223
|
+
id
|
|
224
|
+
comment
|
|
225
|
+
creator {
|
|
226
|
+
id
|
|
227
|
+
email
|
|
228
|
+
}
|
|
229
|
+
createdAt
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
`,
|
|
233
|
+
variables: {
|
|
234
|
+
checklistItemComment: {
|
|
235
|
+
comment: this.comment,
|
|
236
|
+
checklistItemId: this.checklistItemId
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
if (!response.errors) {
|
|
242
|
+
this.comment = ''
|
|
243
|
+
this.checklistItemComments = [...this.checklistItemComments, { ...response.data.createChecklistItemComment }]
|
|
244
|
+
this._scrollBottom()
|
|
245
|
+
this.checklistItemCommentCount++
|
|
246
|
+
} else {
|
|
247
|
+
notify({ message: response.errors?.[0]?.message || '조치사항 등록에 실패하였습니다.', level: 'error' })
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
this._dispatchEvent()
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
private async _deleteComment(commentId: string) {
|
|
254
|
+
if (
|
|
255
|
+
await OxPrompt.open({
|
|
256
|
+
title: '조치 사항을 삭제',
|
|
257
|
+
text: '조치 사항을 삭제 하시겠습니까?',
|
|
258
|
+
confirmButton: { text: '삭제' },
|
|
259
|
+
cancelButton: { text: '취소' }
|
|
260
|
+
})
|
|
261
|
+
) {
|
|
262
|
+
const response = await client.mutate({
|
|
263
|
+
mutation: gql`
|
|
264
|
+
mutation DeleteChecklistItemComment($id: String!) {
|
|
265
|
+
deleteChecklistItemComment(id: $id)
|
|
266
|
+
}
|
|
267
|
+
`,
|
|
268
|
+
variables: {
|
|
269
|
+
id: commentId
|
|
270
|
+
}
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
if (!response.errors) {
|
|
274
|
+
this.checklistItemComments = [...this.checklistItemComments.filter(comment => comment.id != commentId)]
|
|
275
|
+
notify({ message: '조치사항을 삭제하였습니다.', level: 'info' })
|
|
276
|
+
} else {
|
|
277
|
+
notify({ message: response.errors?.[0]?.message || '조치사항 삭제에 실패하였습니다.', level: 'error' })
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
this._dispatchEvent()
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
private _close() {
|
|
285
|
+
history.back()
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Input 요소의 값이 변경될 때 호출되는 콜백 함수
|
|
289
|
+
private _onInputChange(event: InputEvent) {
|
|
290
|
+
const target = event.target as HTMLInputElement
|
|
291
|
+
this.comment = target.value
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
private _formatDate(date) {
|
|
295
|
+
const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }))
|
|
296
|
+
|
|
297
|
+
const year = _date.getFullYear()
|
|
298
|
+
const month = String(_date.getMonth() + 1).padStart(2, '0')
|
|
299
|
+
const day = String(_date.getDate()).padStart(2, '0')
|
|
300
|
+
const hours = String(_date.getHours()).padStart(2, '0')
|
|
301
|
+
const minutes = String(_date.getMinutes()).padStart(2, '0')
|
|
302
|
+
const seconds = String(_date.getSeconds()).padStart(2, '0')
|
|
303
|
+
|
|
304
|
+
return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// 댓글 스크롤 맨 밑으로
|
|
308
|
+
private async _scrollBottom() {
|
|
309
|
+
setTimeout(() => {
|
|
310
|
+
this.commentsContainer.scrollTop = this.commentsContainer.scrollHeight
|
|
311
|
+
}, 100)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// 조치사항 변경 이벤트 디스패치
|
|
315
|
+
_dispatchEvent() {
|
|
316
|
+
this.dispatchEvent(new CustomEvent('change-comment', { detail: { checklistItemId: this.checklistItemId } }))
|
|
317
|
+
}
|
|
318
|
+
}
|
|
@@ -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,EA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,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,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"]}
|
|
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;AA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C,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;;AArOM,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,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 checklistItemCommentCount\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"]}
|
|
@@ -223,11 +223,11 @@ BuildingInspectionDetailDrawing.styles = [
|
|
|
223
223
|
css `
|
|
224
224
|
:host {
|
|
225
225
|
display: grid;
|
|
226
|
-
grid-template-rows:
|
|
226
|
+
grid-template-rows: 55px auto;
|
|
227
227
|
color: #4e5055;
|
|
228
228
|
|
|
229
229
|
width: 100%;
|
|
230
|
-
background-color: #
|
|
230
|
+
background-color: var(--md-sys-color-background, #f6f6f6);
|
|
231
231
|
overflow-y: auto;
|
|
232
232
|
|
|
233
233
|
--grid-record-emphasized-background-color: red;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-detail-drawing.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0CAA0C,CAAA;AACjD,OAAO,+CAA+C,CAAA;AAEtD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEpE,OAAO,EAAE,MAAM,EAA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C,KAAK,CAAC,cAAc,CAAC;;mEAAiB;AACvC;IAAC,KAAK,CAAC,QAAQ,CAAC;8BAAU,iBAAiB;+DAAA;AA/ChC,+BAA+B;IAD3C,aAAa,CAAC,oCAAoC,CAAC;GACvC,+BAA+B,CAwQ3C;SAxQY,+BAA+B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/image-marker/ox-image-marker.js'\nimport '@operato/image-marker/ox-image-marker-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport { Shape } from '@operato/image-marker'\n\nimport { DrawingImageProvider } from '@dssp/drawing/dist-client/drawing-management/drawing-image-provider.js'\n\nimport './component/building-inspection-detail-header'\nimport { BuildingInspectionStatus } from './building-inspection-list'\n\n@customElement('building-inspection-detail-drawing')\nexport class BuildingInspectionDetailDrawing 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 div[body] {\n display: flex;\n justify-content: center;\n\n ox-image-marker-view {\n width: 100%;\n }\n }\n\n dialog ox-image-marker-view {\n width: 80vw;\n height: 80vh;\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n @state() imageUrl?: string\n @state() shapes: Shape[] = []\n @state() linkUrl?: string\n @state() linkShapes: Shape[] = []\n\n @state() drawingImageProvider: DrawingImageProvider = new DrawingImageProvider()\n // @consume({ context: OxUserPreferencesContext, subscribe: true })\n\n @query('#image-marker') imageMarker!: any\n @query('#link-viewer') linkViewer!: any\n @query('dialog') dialog!: HTMLDialogElement\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 도면'\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n\n requestAnimationFrame(() => {\n this.imageMarker.setImageProvider(this.drawingImageProvider)\n this.linkViewer.setImageProvider(this.drawingImageProvider)\n\n this.dialog.addEventListener('click', event => {\n const rect = this.dialog.getBoundingClientRect()\n const isInDialog =\n rect.top <= event.clientY && event.clientY <= rect.bottom && rect.left <= event.clientX && event.clientX <= rect.right\n\n // 다이아로그 내부를 클릭한 것이 아니면 다이아로그 닫기\n if (!isInDialog) {\n this.dialog.close()\n }\n })\n })\n }\n\n disconnectedCallback(): void {\n this.imageMarker?.setImageProvider(null)\n this.linkViewer?.setImageProvider(null)\n\n super.disconnectedCallback()\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\n body\n @link-clicked=${async (e: CustomEvent) => {\n this.linkViewer.reset()\n\n const { link } = e.detail\n const { id, type, symbol, box, dwgId } = JSON.parse(link)\n const [x, y, width, height] = box?.split(',').map(Number) || []\n\n this.linkUrl = `DWGID:${dwgId}`\n this.linkShapes = [\n {\n id: id!,\n type: 'link',\n x,\n y,\n width,\n height,\n link: '{}'\n }\n ]\n\n if (this.dialog) {\n this.dialog.showModal()\n }\n }}\n >\n ${this.buildingInspection?.status == BuildingInspectionStatus.PASS\n ? html`<ox-image-marker-view\n id=\"image-marker\"\n .imageUrl=${this.imageUrl}\n .shapes=${this.shapes}\n ></ox-image-marker-view>`\n : html` <ox-image-marker\n id=\"image-marker\"\n .imageUrl=${this.imageUrl}\n .shapes=${this.shapes}\n @shapes-changed=${this.onClickMarkerSave}\n .currentMode=${'view'}\n ></ox-image-marker>`}\n </div>\n\n <dialog>\n <ox-image-marker-view id=\"link-viewer\" .imageUrl=${this.linkUrl} .shapes=${this.linkShapes}></ox-image-marker-view>\n </dialog>\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {\n if (changes.has('buildingInspection') && this.buildingInspection?.checklist) {\n // 1-1. 위치 정보 - 체크리스트에 들어가는 위치정보 텍스트\n const location_1 = this.buildingInspection.checklist?.location\n\n // 1-2. 위치 정보 - 실제 위치정보 텍스트 (동 + 층) - ID 필드를 사용하면 DB ID 필드입니다.\n const location_building = this.buildingInspection.buildingLevel.building.name\n const location_floor = this.buildingInspection.buildingLevel.floor\n\n // 2. 평면도 pdf 파일\n // mainDrawing {\n // id\n // name\n // fullpath\n // }\n const mainDrawing = this.buildingInspection.buildingLevel.mainDrawing\n\n // 3. 선택 도면\n const inspectionDrawingType = this.buildingInspection.checklist.inspectionDrawingType\n\n const shapes = JSON.parse(this.buildingInspection?.drawingMarker || null) || []\n const markers = await this.drawingImageProvider.getMarkers(inspectionDrawingType)\n\n this.imageUrl = String(inspectionDrawingType).normalize('NFC')\n this.shapes = [...shapes, ...markers]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.buildingInspectionId)\n\n this.imageMarker.reset()\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 drawingMarker\n checklist {\n location\n inspectionDrawingType\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 async onClickMarkerSave(e) {\n const response = await client.query({\n query: gql`\n mutation UpdateBuildingInspection($patch: UpdateBuildingInspectionDrawingMarker!) {\n updateBuildingInspection(patch: $patch) {\n id\n drawingMarker\n }\n }\n `,\n variables: {\n patch: {\n id: this.buildingInspectionId,\n drawingMarker: JSON.stringify(e.detail)\n }\n }\n })\n\n if (response.errors) return\n\n notify({ message: '저장되었습니다.' })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"building-inspection-detail-drawing.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0CAA0C,CAAA;AACjD,OAAO,+CAA+C,CAAA;AAEtD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;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8BAAU,iBAAiB;+DAAA;AA/ChC,+BAA+B;IAD3C,aAAa,CAAC,oCAAoC,CAAC;GACvC,+BAA+B,CAwQ3C;SAxQY,+BAA+B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/image-marker/ox-image-marker.js'\nimport '@operato/image-marker/ox-image-marker-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport { Shape } from '@operato/image-marker'\n\nimport { DrawingImageProvider } from '@dssp/drawing/dist-client/drawing-management/drawing-image-provider.js'\n\nimport './component/building-inspection-detail-header'\nimport { BuildingInspectionStatus } from './building-inspection-list'\n\n@customElement('building-inspection-detail-drawing')\nexport class BuildingInspectionDetailDrawing extends ScopedElementsMixin(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 div[body] {\n display: flex;\n justify-content: center;\n\n ox-image-marker-view {\n width: 100%;\n }\n }\n\n dialog ox-image-marker-view {\n width: 80vw;\n height: 80vh;\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n @state() imageUrl?: string\n @state() shapes: Shape[] = []\n @state() linkUrl?: string\n @state() linkShapes: Shape[] = []\n\n @state() drawingImageProvider: DrawingImageProvider = new DrawingImageProvider()\n // @consume({ context: OxUserPreferencesContext, subscribe: true })\n\n @query('#image-marker') imageMarker!: any\n @query('#link-viewer') linkViewer!: any\n @query('dialog') dialog!: HTMLDialogElement\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 도면'\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n\n requestAnimationFrame(() => {\n this.imageMarker.setImageProvider(this.drawingImageProvider)\n this.linkViewer.setImageProvider(this.drawingImageProvider)\n\n this.dialog.addEventListener('click', event => {\n const rect = this.dialog.getBoundingClientRect()\n const isInDialog =\n rect.top <= event.clientY && event.clientY <= rect.bottom && rect.left <= event.clientX && event.clientX <= rect.right\n\n // 다이아로그 내부를 클릭한 것이 아니면 다이아로그 닫기\n if (!isInDialog) {\n this.dialog.close()\n }\n })\n })\n }\n\n disconnectedCallback(): void {\n this.imageMarker?.setImageProvider(null)\n this.linkViewer?.setImageProvider(null)\n\n super.disconnectedCallback()\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\n body\n @link-clicked=${async (e: CustomEvent) => {\n this.linkViewer.reset()\n\n const { link } = e.detail\n const { id, type, symbol, box, dwgId } = JSON.parse(link)\n const [x, y, width, height] = box?.split(',').map(Number) || []\n\n this.linkUrl = `DWGID:${dwgId}`\n this.linkShapes = [\n {\n id: id!,\n type: 'link',\n x,\n y,\n width,\n height,\n link: '{}'\n }\n ]\n\n if (this.dialog) {\n this.dialog.showModal()\n }\n }}\n >\n ${this.buildingInspection?.status == BuildingInspectionStatus.PASS\n ? html`<ox-image-marker-view\n id=\"image-marker\"\n .imageUrl=${this.imageUrl}\n .shapes=${this.shapes}\n ></ox-image-marker-view>`\n : html` <ox-image-marker\n id=\"image-marker\"\n .imageUrl=${this.imageUrl}\n .shapes=${this.shapes}\n @shapes-changed=${this.onClickMarkerSave}\n .currentMode=${'view'}\n ></ox-image-marker>`}\n </div>\n\n <dialog>\n <ox-image-marker-view id=\"link-viewer\" .imageUrl=${this.linkUrl} .shapes=${this.linkShapes}></ox-image-marker-view>\n </dialog>\n `\n }\n\n protected async updated(changes: PropertyValues): Promise<void> {\n if (changes.has('buildingInspection') && this.buildingInspection?.checklist) {\n // 1-1. 위치 정보 - 체크리스트에 들어가는 위치정보 텍스트\n const location_1 = this.buildingInspection.checklist?.location\n\n // 1-2. 위치 정보 - 실제 위치정보 텍스트 (동 + 층) - ID 필드를 사용하면 DB ID 필드입니다.\n const location_building = this.buildingInspection.buildingLevel.building.name\n const location_floor = this.buildingInspection.buildingLevel.floor\n\n // 2. 평면도 pdf 파일\n // mainDrawing {\n // id\n // name\n // fullpath\n // }\n const mainDrawing = this.buildingInspection.buildingLevel.mainDrawing\n\n // 3. 선택 도면\n const inspectionDrawingType = this.buildingInspection.checklist.inspectionDrawingType\n\n const shapes = JSON.parse(this.buildingInspection?.drawingMarker || null) || []\n const markers = await this.drawingImageProvider.getMarkers(inspectionDrawingType)\n\n this.imageUrl = String(inspectionDrawingType).normalize('NFC')\n this.shapes = [...shapes, ...markers]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.buildingInspectionId)\n\n this.imageMarker.reset()\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 drawingMarker\n checklist {\n location\n inspectionDrawingType\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 async onClickMarkerSave(e) {\n const response = await client.query({\n query: gql`\n mutation UpdateBuildingInspection($patch: UpdateBuildingInspectionDrawingMarker!) {\n updateBuildingInspection(patch: $patch) {\n id\n drawingMarker\n }\n }\n `,\n variables: {\n patch: {\n id: this.buildingInspectionId,\n drawingMarker: JSON.stringify(e.detail)\n }\n }\n })\n\n if (response.errors) return\n\n notify({ message: '저장되었습니다.' })\n }\n}\n"]}
|