@dssp/supervision 0.0.32 → 0.0.34

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.
Files changed (65) hide show
  1. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +2 -1
  2. package/client/pages/building-inspection/component/inspection-event-provider.ts +1 -1
  3. package/client/pages/checklist/attachment-list-popup.ts +283 -0
  4. package/client/pages/checklist/checklist-view.ts +88 -7
  5. package/client/pages/checklist/comment-list-popup.ts +319 -0
  6. package/client/pages/checklist/file-preview-popup.ts +70 -0
  7. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +2 -1
  8. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  9. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +1 -1
  10. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  11. package/dist-client/pages/checklist/attachment-list-popup.d.ts +2 -0
  12. package/dist-client/pages/checklist/attachment-list-popup.js +290 -0
  13. package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -0
  14. package/dist-client/pages/checklist/checklist-view.d.ts +2 -0
  15. package/dist-client/pages/checklist/checklist-view.js +78 -7
  16. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  17. package/dist-client/pages/checklist/comment-list-popup.d.ts +1 -0
  18. package/dist-client/pages/checklist/comment-list-popup.js +344 -0
  19. package/dist-client/pages/checklist/comment-list-popup.js.map +1 -0
  20. package/dist-client/pages/checklist/file-preview-popup.d.ts +1 -0
  21. package/dist-client/pages/checklist/file-preview-popup.js +78 -0
  22. package/dist-client/pages/checklist/file-preview-popup.js.map +1 -0
  23. package/dist-client/tsconfig.tsbuildinfo +1 -1
  24. package/dist-server/service/checklist-item/checklist-item-query.d.ts +6 -0
  25. package/dist-server/service/checklist-item/checklist-item-query.js +55 -0
  26. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
  27. package/dist-server/service/checklist-item/checklist-item.d.ts +2 -1
  28. package/dist-server/service/checklist-item/checklist-item.js +5 -4
  29. package/dist-server/service/checklist-item/checklist-item.js.map +1 -1
  30. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.d.ts +16 -0
  31. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js +83 -0
  32. package/dist-server/service/checklist-item-comment/checklist-item-comment-history.js.map +1 -0
  33. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.d.ts +7 -0
  34. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +69 -0
  35. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -0
  36. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.d.ts +7 -0
  37. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js +49 -0
  38. package/dist-server/service/checklist-item-comment/checklist-item-comment-query.js.map +1 -0
  39. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.d.ts +14 -0
  40. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js +53 -0
  41. package/dist-server/service/checklist-item-comment/checklist-item-comment-type.js.map +1 -0
  42. package/dist-server/service/checklist-item-comment/checklist-item-comment.d.ts +12 -0
  43. package/dist-server/service/checklist-item-comment/checklist-item-comment.js +57 -0
  44. package/dist-server/service/checklist-item-comment/checklist-item-comment.js.map +1 -0
  45. package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +7 -0
  46. package/dist-server/service/checklist-item-comment/event-subscriber.js +21 -0
  47. package/dist-server/service/checklist-item-comment/event-subscriber.js.map +1 -0
  48. package/dist-server/service/checklist-item-comment/index.d.ts +7 -0
  49. package/dist-server/service/checklist-item-comment/index.js +12 -0
  50. package/dist-server/service/checklist-item-comment/index.js.map +1 -0
  51. package/dist-server/service/index.d.ts +2 -1
  52. package/dist-server/service/index.js +6 -1
  53. package/dist-server/service/index.js.map +1 -1
  54. package/dist-server/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +5 -5
  56. package/server/service/checklist-item/checklist-item-query.ts +34 -0
  57. package/server/service/checklist-item/checklist-item.ts +6 -3
  58. package/server/service/checklist-item-comment/checklist-item-comment-history.ts +69 -0
  59. package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +60 -0
  60. package/server/service/checklist-item-comment/checklist-item-comment-query.ts +36 -0
  61. package/server/service/checklist-item-comment/checklist-item-comment-type.ts +32 -0
  62. package/server/service/checklist-item-comment/checklist-item-comment.ts +56 -0
  63. package/server/service/checklist-item-comment/event-subscriber.ts +17 -0
  64. package/server/service/checklist-item-comment/index.ts +9 -0
  65. package/server/service/index.ts +10 -1
@@ -0,0 +1,319 @@
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
+
12
+ @customElement('comment-list-popup')
13
+ class CommentListPopup extends connect(store)(LitElement) {
14
+ static styles = [
15
+ ButtonContainerStyles,
16
+ ScrollbarStyles,
17
+ css`
18
+ :host {
19
+ display: flex;
20
+ flex-direction: column;
21
+ padding: 15px 20px;
22
+ background-color: var(--md-sys-color-surface);
23
+ }
24
+
25
+ div[body] {
26
+ height: 100%;
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 12px;
30
+ }
31
+
32
+ div[comments-container] {
33
+ overflow-y: auto;
34
+ gap: 10px;
35
+ display: flex;
36
+ flex-direction: column;
37
+ flex: 1;
38
+
39
+ div[comment-row] {
40
+ display: flex;
41
+ flex-direction: column;
42
+
43
+ div[creator-container] {
44
+ display: flex;
45
+ justify-content: space-between;
46
+
47
+ span[creator] {
48
+ font-weight: 600;
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 3px;
52
+ }
53
+ span[createdAt] {
54
+ display: flex;
55
+ align-items: center;
56
+ gap: 3px;
57
+
58
+ md-icon[delete] {
59
+ cursor: pointer;
60
+ }
61
+ }
62
+ }
63
+
64
+ div[comment] {
65
+ margin-left: 20px;
66
+ }
67
+ }
68
+ }
69
+
70
+ h3 {
71
+ position: relative;
72
+ color: rgb(5, 149, 229);
73
+ font-size: 17px;
74
+ font-weight: 700;
75
+ background-color: var(--md-sys-color-surface);
76
+ margin-top: 0px;
77
+ margin-bottom: 5px;
78
+ }
79
+
80
+ textarea {
81
+ height: 75px;
82
+ border: 1px solid #ccc;
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
+ name
176
+ }
177
+ createdAt
178
+ }
179
+
180
+ checklistItem(id: $checklistItemId) {
181
+ id
182
+ checklistItemCommentCount
183
+ }
184
+ }
185
+ `,
186
+ variables: {
187
+ checklistItemId: this.checklistItemId,
188
+ pagination: {
189
+ page: this.page,
190
+ limit: 10
191
+ }
192
+ }
193
+ })
194
+
195
+ if (response.errors) return
196
+
197
+ const items = response.data.checklistItemComments
198
+ if (items.length < 10) this.hasMoreComments = false
199
+
200
+ this.checklistItemComments = [...items.reverse(), ...this.checklistItemComments]
201
+ this.page += 1
202
+ this.checklistItemCommentCount = response.data.checklistItem.checklistItemCommentCount
203
+ this.loading = false
204
+ }
205
+
206
+ // 스크롤이 맨 위에 가까울 때 데이터 요청
207
+ private _onScroll() {
208
+ const { scrollTop } = this.commentsContainer
209
+ if (scrollTop <= 5) {
210
+ this._loadComments()
211
+ }
212
+ }
213
+
214
+ private async _createComment() {
215
+ if (!this.comment) {
216
+ notify({ message: '조치사항을 입력해주세요.', level: 'warn' })
217
+ return
218
+ }
219
+
220
+ const response = await client.mutate({
221
+ mutation: gql`
222
+ mutation CreateChecklistItemComment($checklistItemComment: NewChecklistItemComment!) {
223
+ createChecklistItemComment(checklistItemComment: $checklistItemComment) {
224
+ id
225
+ comment
226
+ creator {
227
+ id
228
+ email
229
+ }
230
+ createdAt
231
+ }
232
+ }
233
+ `,
234
+ variables: {
235
+ checklistItemComment: {
236
+ comment: this.comment,
237
+ checklistItemId: this.checklistItemId
238
+ }
239
+ }
240
+ })
241
+
242
+ if (!response.errors) {
243
+ this.comment = ''
244
+ this.checklistItemComments = [...this.checklistItemComments, { ...response.data.createChecklistItemComment }]
245
+ this._scrollBottom()
246
+ this.checklistItemCommentCount++
247
+ } else {
248
+ notify({ message: response.errors?.[0]?.message || '조치사항 등록에 실패하였습니다.', level: 'error' })
249
+ }
250
+
251
+ this._dispatchEvent()
252
+ }
253
+
254
+ private async _deleteComment(commentId: string) {
255
+ if (
256
+ await OxPrompt.open({
257
+ title: '조치 사항을 삭제',
258
+ text: '조치 사항을 삭제 하시겠습니까?',
259
+ confirmButton: { text: '삭제' },
260
+ cancelButton: { text: '취소' }
261
+ })
262
+ ) {
263
+ const response = await client.mutate({
264
+ mutation: gql`
265
+ mutation DeleteChecklistItemComment($id: String!) {
266
+ deleteChecklistItemComment(id: $id)
267
+ }
268
+ `,
269
+ variables: {
270
+ id: commentId
271
+ }
272
+ })
273
+
274
+ if (!response.errors) {
275
+ this.checklistItemComments = [...this.checklistItemComments.filter(comment => comment.id != commentId)]
276
+ notify({ message: '조치사항을 삭제하였습니다.', level: 'info' })
277
+ } else {
278
+ notify({ message: response.errors?.[0]?.message || '조치사항 삭제에 실패하였습니다.', level: 'error' })
279
+ }
280
+
281
+ this._dispatchEvent()
282
+ }
283
+ }
284
+
285
+ private _close() {
286
+ history.back()
287
+ }
288
+
289
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
290
+ private _onInputChange(event: InputEvent) {
291
+ const target = event.target as HTMLInputElement
292
+ this.comment = target.value
293
+ }
294
+
295
+ private _formatDate(date) {
296
+ const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }))
297
+
298
+ const year = _date.getFullYear()
299
+ const month = String(_date.getMonth() + 1).padStart(2, '0')
300
+ const day = String(_date.getDate()).padStart(2, '0')
301
+ const hours = String(_date.getHours()).padStart(2, '0')
302
+ const minutes = String(_date.getMinutes()).padStart(2, '0')
303
+ const seconds = String(_date.getSeconds()).padStart(2, '0')
304
+
305
+ return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`
306
+ }
307
+
308
+ // 댓글 스크롤 맨 밑으로
309
+ private async _scrollBottom() {
310
+ setTimeout(() => {
311
+ this.commentsContainer.scrollTop = this.commentsContainer.scrollHeight
312
+ }, 100)
313
+ }
314
+
315
+ // 조치사항 변경 이벤트 디스패치
316
+ _dispatchEvent() {
317
+ this.dispatchEvent(new CustomEvent('change-comment', { detail: { checklistItemId: this.checklistItemId } }))
318
+ }
319
+ }
@@ -0,0 +1,70 @@
1
+ import '@material/web/icon/icon.js'
2
+ import { css, html, LitElement } from 'lit'
3
+ import { customElement, property, query } from 'lit/decorators.js'
4
+ import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
5
+
6
+ @customElement('file-preview-popup')
7
+ class FilePreviewPopup extends LitElement {
8
+ static styles = [
9
+ ButtonContainerStyles,
10
+ ScrollbarStyles,
11
+ css`
12
+ :host {
13
+ display: flex;
14
+ flex-direction: column;
15
+ padding: 15px 20px;
16
+ overflow-y: auto;
17
+ background-color: var(--md-sys-color-surface);
18
+ }
19
+
20
+ .modal-content {
21
+ margin: 5% auto;
22
+ width: 90%;
23
+ background-color: white;
24
+ text-align: center;
25
+ }
26
+ `
27
+ ]
28
+
29
+ @property({ type: String }) filepath: string = ''
30
+
31
+ @query('#previewContent') previewContent!: HTMLDivElement
32
+
33
+ render() {
34
+ return html` <div class="modal-content" id="previewContent"></div>`
35
+ }
36
+
37
+ async firstUpdated() {
38
+ this.showPreview(this.filepath)
39
+ }
40
+
41
+ showPreview(fileUrl) {
42
+ // 파일 확장자 확인
43
+ const fileExtension = fileUrl.split('.').pop().toLowerCase()
44
+ this.previewContent.innerHTML = ''
45
+
46
+ console.log(fileExtension)
47
+
48
+ if (['jpg', 'jpeg', 'png', 'gif', 'webp'].includes(fileExtension)) {
49
+ // 이미지 미리보기
50
+ const img = document.createElement('img')
51
+ img.src = fileUrl
52
+ img.alt = '미리보기 이미지'
53
+ img.style.width = '100%'
54
+ this.previewContent.appendChild(img)
55
+ } else if (fileExtension === 'pdf') {
56
+ // PDF 미리보기
57
+ const iframe = document.createElement('iframe')
58
+ iframe.src = `${fileUrl}#toolbar=0&navpanes=0&scrollbar=0` // 툴바, 내비게이션 및 스크롤바 숨기기
59
+ iframe.style.width = '100%'
60
+ iframe.style.height = '100vh'
61
+ iframe.style.border = 'none'
62
+ this.previewContent.appendChild(iframe)
63
+ } else {
64
+ // 미리보기가 지원되지 않는 파일 형식 안내
65
+ const message = document.createElement('p')
66
+ message.innerText = '미리보기가 지원되지 않는 파일 형식입니다.'
67
+ this.previewContent.appendChild(message)
68
+ }
69
+ }
70
+ }
@@ -93,7 +93,8 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
93
93
  inspctionCriteria
94
94
  constructionConfirmStatus
95
95
  supervisoryConfirmStatus
96
- comment
96
+ checklistItemCommentCount
97
+ checklistItemAttachmentCount
97
98
  }
98
99
  }
99
100
  buildingLevel {
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-in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E,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;;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 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;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;IA+LvC,CAAC;IA7LC,I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wO7C;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"]}
@@ -36,7 +36,7 @@ export class InspectionEventProvider {
36
36
  // if (response.errors) return null
37
37
  const calendarData = this.getCalendarTemplate((_b = response.data) === null || _b === void 0 ? void 0 : _b.buildingInspectionDateSummaryOfLevelAndPeriod);
38
38
  calendar.forEach(({ date }) => {
39
- const formattedDate = date.toISOString().split('T')[0];
39
+ const formattedDate = date.toLocaleDateString('en-CA'); // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.
40
40
  const template = calendarData[formattedDate];
41
41
  if (!template)
42
42
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"inspection-event-provider.js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Result } from 'lit'\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\n\nexport class InspectionEventProvider implements EventProvider {\n buildingLevelId = {}\n\n constructor(buildingLevelId: string = '') {\n this.buildingLevelId = buildingLevelId\n }\n\n async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {\n const result = new Map<Date, BizEvent[]>()\n const startDate = calendar[0]['date'].toISOString().split('T')[0]\n const endDate = calendar.at(-1)?.['date'].toISOString().split('T')[0]\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfLevelAndPeriod($buildingLevelId: String!, $startDate: String!, $endDate: String!) {\n buildingInspectionDateSummaryOfLevelAndPeriod(\n buildingLevelId: $buildingLevelId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n }\n }\n `,\n variables: {\n buildingLevelId: this.buildingLevelId,\n startDate,\n endDate\n }\n })\n\n // if (response.errors) return null\n\n const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndPeriod)\n\n calendar.forEach(({ date }) => {\n const formattedDate = date.toISOString().split('T')[0]\n const template = calendarData[formattedDate]\n\n if (!template) return\n\n result.set(date, [\n {\n due: formattedDate,\n template: template,\n title: '',\n color: '',\n clickEvent: e => console.log('e :', e, template)\n }\n ])\n })\n\n return result\n }\n\n // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기\n private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {\n const template = {}\n for (let date of inspectionData) {\n template[date.requestDate] = html`\n <div style=\"display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;\">\n ${date.wait !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #4e5055\">●</span> ${date.wait}</div>` : ''}\n ${date.request !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #3395f1\">●</span> ${date.request}</div>` : ''}\n ${date.pass !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #1bb401\">●</span> ${date.pass}</div>` : ''}\n ${date.fail !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #ff4444\">●</span> ${date.fail}</div>` : ''}\n </div>\n `\n }\n\n return template\n }\n}\n"]}
1
+ {"version":3,"file":"inspection-event-provider.js","sourceRoot":"","sources":["../../../../client/pages/building-inspection/component/inspection-event-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,MAAM,OAAO,uBAAuB;IAGlC,YAAY,kBAA0B,EAAE;QAFxC,oBAAe,GAAG,EAAE,CAAA;QAGlB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;IACxC,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,QAAkB;;QAC7C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAA;QAC1C,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACjE,MAAM,OAAO,GAAG,MAAA,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,0CAAG,MAAM,EAAE,WAAW,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QAErE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;OAcT;YACD,SAAS,EAAE;gBACT,eAAe,EAAE,IAAI,CAAC,eAAe;gBACrC,SAAS;gBACT,OAAO;aACR;SACF,CAAC,CAAA;QAEF,mCAAmC;QAEnC,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAA,QAAQ,CAAC,IAAI,0CAAE,6CAA6C,CAAC,CAAA;QAE3G,QAAQ,CAAC,OAAO,CAAC,C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AC,EAAE;;OAEjH,CAAA;SACF;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF","sourcesContent":["import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view'\nimport { html, TemplateResult } from 'lit'\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\n\nexport class InspectionEventProvider implements EventProvider {\n buildingLevelId = {}\n\n constructor(buildingLevelId: string = '') {\n this.buildingLevelId = buildingLevelId\n }\n\n async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {\n const result = new Map<Date, BizEvent[]>()\n const startDate = calendar[0]['date'].toISOString().split('T')[0]\n const endDate = calendar.at(-1)?.['date'].toISOString().split('T')[0]\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfLevelAndPeriod($buildingLevelId: String!, $startDate: String!, $endDate: String!) {\n buildingInspectionDateSummaryOfLevelAndPeriod(\n buildingLevelId: $buildingLevelId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n }\n }\n `,\n variables: {\n buildingLevelId: this.buildingLevelId,\n startDate,\n endDate\n }\n })\n\n // if (response.errors) return null\n\n const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndPeriod)\n\n calendar.forEach(({ date }) => {\n const formattedDate = date.toLocaleDateString('en-CA') // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.\n const template = calendarData[formattedDate]\n\n if (!template) return\n\n result.set(date, [\n {\n due: formattedDate,\n template: template,\n title: '',\n color: '',\n clickEvent: e => console.log('e :', e, template)\n }\n ])\n })\n\n return result\n }\n\n // 검측 개수가 있는 데이터들만 날짜별로 템플릿 만들기\n private getCalendarTemplate(inspectionData: any[] = []): { [date: string]: TemplateResult } {\n const template = {}\n for (let date of inspectionData) {\n template[date.requestDate] = html`\n <div style=\"display: grid; grid-template-columns: repeat(2, 1fr); padding-inline: 7px;\">\n ${date.wait !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #4e5055\">●</span> ${date.wait}</div>` : ''}\n ${date.request !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #3395f1\">●</span> ${date.request}</div>` : ''}\n ${date.pass !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #1bb401\">●</span> ${date.pass}</div>` : ''}\n ${date.fail !== 0 ? html`<div><span style=\"font-size: 1.3em; color: #ff4444\">●</span> ${date.fail}</div>` : ''}\n </div>\n `\n }\n\n return template\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import '@material/web/icon/icon.js';
2
+ import './file-preview-popup';