@dssp/supervision 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (217) hide show
  1. package/dist-client/graphql/building-inspection.d.ts +1 -0
  2. package/dist-client/graphql/building-inspection.js +100 -0
  3. package/dist-client/graphql/building-inspection.js.map +1 -0
  4. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +9 -0
  5. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +130 -72
  6. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  7. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +1 -0
  8. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +77 -14
  9. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
  10. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +18 -2
  11. package/dist-client/pages/building-inspection/building-inspection-list.js +360 -28
  12. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  13. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +31 -9
  14. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
  15. package/dist-client/pages/building-inspection/component/daily-worklog-popup.d.ts +27 -0
  16. package/dist-client/pages/building-inspection/component/daily-worklog-popup.js +542 -0
  17. package/dist-client/pages/building-inspection/component/daily-worklog-popup.js.map +1 -0
  18. package/dist-client/pages/building-inspection/component/image-preview-popup.d.ts +15 -0
  19. package/dist-client/pages/building-inspection/component/image-preview-popup.js +351 -0
  20. package/dist-client/pages/building-inspection/component/image-preview-popup.js.map +1 -0
  21. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.d.ts +20 -0
  22. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js +432 -0
  23. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js.map +1 -0
  24. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.d.ts +30 -0
  25. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js +479 -0
  26. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js.map +1 -0
  27. package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.d.ts +27 -0
  28. package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js +401 -0
  29. package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js.map +1 -0
  30. package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +2 -1
  31. package/dist-client/pages/building-inspection/component/inspection-event-provider.js +39 -17
  32. package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
  33. package/dist-client/pages/building-inspection/inspection-create-popup.js +22 -9
  34. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  35. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +60 -0
  36. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +1132 -0
  37. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -0
  38. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.d.ts +2 -0
  39. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +740 -0
  40. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -0
  41. package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.d.ts +19 -0
  42. package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.js +205 -0
  43. package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.js.map +1 -0
  44. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.d.ts +1 -0
  45. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js +304 -0
  46. package/dist-client/pages/building-inspection-grid/component/notice-comment-popup.js.map +1 -0
  47. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +15 -0
  48. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js +430 -0
  49. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.js.map +1 -0
  50. package/dist-client/pages/checklist/attachment-list-popup.d.ts +1 -0
  51. package/dist-client/pages/checklist/attachment-list-popup.js +250 -67
  52. package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
  53. package/dist-client/pages/checklist/checklist-view.d.ts +7 -0
  54. package/dist-client/pages/checklist/checklist-view.js +363 -185
  55. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  56. package/dist-client/pages/checklist/comment-list-popup.js +14 -3
  57. package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
  58. package/dist-client/pages/checklist/file-preview-popup.js +0 -1
  59. package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
  60. package/dist-client/pages/checklist/inspection-info-popup.d.ts +50 -0
  61. package/dist-client/pages/checklist/inspection-info-popup.js +684 -0
  62. package/dist-client/pages/checklist/inspection-info-popup.js.map +1 -0
  63. package/dist-client/pages/checklist/inspection-tab-popup.d.ts +18 -0
  64. package/dist-client/pages/checklist/inspection-tab-popup.js +196 -0
  65. package/dist-client/pages/checklist/inspection-tab-popup.js.map +1 -0
  66. package/dist-client/pages/checklist-template/checklist-template-item.js +8 -3
  67. package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -1
  68. package/dist-client/pages/checklist-template/checklist-template-list.js +2 -2
  69. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  70. package/dist-client/route.d.ts +1 -1
  71. package/dist-client/route.js +3 -0
  72. package/dist-client/route.js.map +1 -1
  73. package/dist-client/stt/speech-to-text.d.ts +36 -0
  74. package/dist-client/stt/speech-to-text.js +89 -0
  75. package/dist-client/stt/speech-to-text.js.map +1 -0
  76. package/dist-client/stt/stt-utils.d.ts +28 -0
  77. package/dist-client/stt/stt-utils.js +146 -0
  78. package/dist-client/stt/stt-utils.js.map +1 -0
  79. package/dist-client/tsconfig.tsbuildinfo +1 -1
  80. package/dist-server/service/action-plan/index.d.ts +0 -1
  81. package/dist-server/service/action-plan/index.js +1 -2
  82. package/dist-server/service/action-plan/index.js.map +1 -1
  83. package/dist-server/service/building-inspection/building-inspection-history.d.ts +1 -0
  84. package/dist-server/service/building-inspection/building-inspection-history.js +5 -0
  85. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
  86. package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +3 -3
  87. package/dist-server/service/building-inspection/building-inspection-mutation.js +145 -34
  88. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  89. package/dist-server/service/building-inspection/building-inspection-query.d.ts +3 -4
  90. package/dist-server/service/building-inspection/building-inspection-query.js +46 -30
  91. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  92. package/dist-server/service/building-inspection/building-inspection-type.d.ts +28 -9
  93. package/dist-server/service/building-inspection/building-inspection-type.js +96 -17
  94. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  95. package/dist-server/service/building-inspection/building-inspection.d.ts +13 -0
  96. package/dist-server/service/building-inspection/building-inspection.js +55 -2
  97. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  98. package/dist-server/service/building-inspection/index.d.ts +5 -8
  99. package/dist-server/service/building-inspection/index.js +11 -6
  100. package/dist-server/service/building-inspection/index.js.map +1 -1
  101. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.d.ts +6 -0
  102. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js +56 -0
  103. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js.map +1 -0
  104. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.d.ts +16 -0
  105. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js +171 -0
  106. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js.map +1 -0
  107. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.d.ts +23 -0
  108. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js +90 -0
  109. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js.map +1 -0
  110. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.d.ts +33 -0
  111. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js +132 -0
  112. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js.map +1 -0
  113. package/dist-server/service/building-inspection-daily-worklog/index.d.ts +5 -0
  114. package/dist-server/service/building-inspection-daily-worklog/index.js +9 -0
  115. package/dist-server/service/building-inspection-daily-worklog/index.js.map +1 -0
  116. package/dist-server/service/building-inspection-history/building-inspection-history-query.d.ts +16 -0
  117. package/dist-server/service/building-inspection-history/building-inspection-history-query.js +120 -0
  118. package/dist-server/service/building-inspection-history/building-inspection-history-query.js.map +1 -0
  119. package/dist-server/service/building-inspection-history/building-inspection-history-type.d.ts +5 -0
  120. package/dist-server/service/building-inspection-history/building-inspection-history-type.js +21 -0
  121. package/dist-server/service/building-inspection-history/building-inspection-history-type.js.map +1 -0
  122. package/dist-server/service/building-inspection-history/building-inspection-history.d.ts +34 -0
  123. package/dist-server/service/building-inspection-history/building-inspection-history.js +157 -0
  124. package/dist-server/service/building-inspection-history/building-inspection-history.js.map +1 -0
  125. package/dist-server/service/{building-inspection → building-inspection-history}/event-subscriber.d.ts +1 -1
  126. package/dist-server/service/{building-inspection → building-inspection-history}/event-subscriber.js +1 -1
  127. package/dist-server/service/building-inspection-history/event-subscriber.js.map +1 -0
  128. package/dist-server/service/building-inspection-history/index.d.ts +6 -0
  129. package/dist-server/service/building-inspection-history/index.js +10 -0
  130. package/dist-server/service/building-inspection-history/index.js.map +1 -0
  131. package/dist-server/service/checklist/checklist-history.d.ts +8 -0
  132. package/dist-server/service/checklist/checklist-history.js +36 -0
  133. package/dist-server/service/checklist/checklist-history.js.map +1 -1
  134. package/dist-server/service/checklist/checklist-mutation.d.ts +0 -5
  135. package/dist-server/service/checklist/checklist-mutation.js +1 -67
  136. package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
  137. package/dist-server/service/checklist/checklist-query.d.ts +6 -0
  138. package/dist-server/service/checklist/checklist-query.js +63 -0
  139. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  140. package/dist-server/service/checklist/checklist-type.d.ts +0 -13
  141. package/dist-server/service/checklist/checklist-type.js +1 -49
  142. package/dist-server/service/checklist/checklist-type.js.map +1 -1
  143. package/dist-server/service/checklist/checklist.d.ts +38 -3
  144. package/dist-server/service/checklist/checklist.js +131 -15
  145. package/dist-server/service/checklist/checklist.js.map +1 -1
  146. package/dist-server/service/checklist/event-subscriber.d.ts +2 -2
  147. package/dist-server/service/checklist/event-subscriber.js +2 -2
  148. package/dist-server/service/checklist/event-subscriber.js.map +1 -1
  149. package/dist-server/service/checklist/index.d.ts +1 -4
  150. package/dist-server/service/checklist/index.js +2 -5
  151. package/dist-server/service/checklist/index.js.map +1 -1
  152. package/dist-server/service/checklist-history/checklist-history-query.d.ts +11 -0
  153. package/dist-server/service/checklist-history/checklist-history-query.js +77 -0
  154. package/dist-server/service/checklist-history/checklist-history-query.js.map +1 -0
  155. package/dist-server/service/checklist-history/checklist-history-type.d.ts +5 -0
  156. package/dist-server/service/checklist-history/checklist-history-type.js +21 -0
  157. package/dist-server/service/checklist-history/checklist-history-type.js.map +1 -0
  158. package/dist-server/service/checklist-history/checklist-history.d.ts +50 -0
  159. package/dist-server/service/checklist-history/checklist-history.js +239 -0
  160. package/dist-server/service/checklist-history/checklist-history.js.map +1 -0
  161. package/dist-server/service/checklist-history/event-subscriber.d.ts +7 -0
  162. package/dist-server/service/checklist-history/event-subscriber.js +21 -0
  163. package/dist-server/service/checklist-history/event-subscriber.js.map +1 -0
  164. package/dist-server/service/checklist-history/index.d.ts +6 -0
  165. package/dist-server/service/checklist-history/index.js +10 -0
  166. package/dist-server/service/checklist-history/index.js.map +1 -0
  167. package/dist-server/service/checklist-item/checklist-item-query.d.ts +1 -1
  168. package/dist-server/service/checklist-item/checklist-item-query.js +5 -3
  169. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
  170. package/dist-server/service/checklist-item/index.d.ts +0 -1
  171. package/dist-server/service/checklist-item/index.js +1 -2
  172. package/dist-server/service/checklist-item/index.js.map +1 -1
  173. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.d.ts +1 -0
  174. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +33 -6
  175. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
  176. package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
  177. package/dist-server/service/checklist-item-comment/index.js +1 -3
  178. package/dist-server/service/checklist-item-comment/index.js.map +1 -1
  179. package/dist-server/service/checklist-item-history/checklist-item-history-query.d.ts +16 -0
  180. package/dist-server/service/checklist-item-history/checklist-item-history-query.js +123 -0
  181. package/dist-server/service/checklist-item-history/checklist-item-history-query.js.map +1 -0
  182. package/dist-server/service/checklist-item-history/checklist-item-history-type.d.ts +5 -0
  183. package/dist-server/service/checklist-item-history/checklist-item-history-type.js +21 -0
  184. package/dist-server/service/checklist-item-history/checklist-item-history-type.js.map +1 -0
  185. package/dist-server/service/checklist-item-history/checklist-item-history.d.ts +25 -0
  186. package/dist-server/service/checklist-item-history/checklist-item-history.js +123 -0
  187. package/dist-server/service/checklist-item-history/checklist-item-history.js.map +1 -0
  188. package/dist-server/service/checklist-item-history/event-subscriber.d.ts +7 -0
  189. package/dist-server/service/checklist-item-history/event-subscriber.js +21 -0
  190. package/dist-server/service/checklist-item-history/event-subscriber.js.map +1 -0
  191. package/dist-server/service/checklist-item-history/index.d.ts +6 -0
  192. package/dist-server/service/checklist-item-history/index.js +10 -0
  193. package/dist-server/service/checklist-item-history/index.js.map +1 -0
  194. package/dist-server/service/checklist-template-item/checklist-template-item.js +2 -4
  195. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  196. package/dist-server/service/index.d.ts +4 -2
  197. package/dist-server/service/index.js +22 -13
  198. package/dist-server/service/index.js.map +1 -1
  199. package/dist-server/service/issue/index.d.ts +0 -1
  200. package/dist-server/service/issue/index.js +1 -2
  201. package/dist-server/service/issue/index.js.map +1 -1
  202. package/dist-server/service/project-report/index.d.ts +0 -1
  203. package/dist-server/service/project-report/index.js +1 -2
  204. package/dist-server/service/project-report/index.js.map +1 -1
  205. package/dist-server/service/project-report/project-report.d.ts +0 -2
  206. package/dist-server/service/project-report/project-report.js +0 -6
  207. package/dist-server/service/project-report/project-report.js.map +1 -1
  208. package/dist-server/service/supervisor/index.d.ts +0 -1
  209. package/dist-server/service/supervisor/index.js +1 -2
  210. package/dist-server/service/supervisor/index.js.map +1 -1
  211. package/dist-server/tsconfig.tsbuildinfo +1 -1
  212. package/package.json +13 -13
  213. package/things-factory.config.js +3 -1
  214. package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
  215. package/dist-server/service/checklist-item-comment/event-subscriber.d.ts +0 -7
  216. package/dist-server/service/checklist-item-comment/event-subscriber.js +0 -21
  217. package/dist-server/service/checklist-item-comment/event-subscriber.js.map +0 -1
@@ -0,0 +1,401 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/button/elevated-button.js';
3
+ import '@material/web/icon/icon.js';
4
+ import '@material/web/tabs/tabs.js';
5
+ import '@material/web/tabs/primary-tab.js';
6
+ import gql from 'graphql-tag';
7
+ import { client } from '@operato/graphql';
8
+ import { css, html, LitElement } from 'lit';
9
+ import { customElement, property, state } from 'lit/decorators.js';
10
+ import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
11
+ import { notify, openPopup } from '@operato/layout';
12
+ import '../image-preview-popup';
13
+ import { BuildingInspectionStatus } from '../../building-inspection-list';
14
+ export var PhotoTab;
15
+ (function (PhotoTab) {
16
+ PhotoTab["CONSTRUCTOR"] = "constructor";
17
+ PhotoTab["SUPERVISOR"] = "supervisor";
18
+ })(PhotoTab || (PhotoTab = {}));
19
+ let PhotoAlbumPopup = class PhotoAlbumPopup extends LitElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.checklistId = '';
23
+ this.activeTab = PhotoTab.CONSTRUCTOR;
24
+ this.constructorFiles = [];
25
+ this.supervisorFiles = [];
26
+ }
27
+ render() {
28
+ const currentFiles = this.activeTab === PhotoTab.CONSTRUCTOR ? this.constructorFiles : this.supervisorFiles;
29
+ const constructorCount = this.constructorFiles.length;
30
+ const supervisorCount = this.supervisorFiles.length;
31
+ return html `
32
+ <div body>
33
+ <div class="tabs-container">
34
+ <md-tabs>
35
+ <md-primary-tab
36
+ ?active=${this.activeTab === PhotoTab.CONSTRUCTOR}
37
+ @click=${() => this._setActiveTab(PhotoTab.CONSTRUCTOR)}
38
+ >
39
+ 시공자 (${constructorCount})
40
+ </md-primary-tab>
41
+ <md-primary-tab
42
+ ?active=${this.activeTab === PhotoTab.SUPERVISOR}
43
+ @click=${() => this._setActiveTab(PhotoTab.SUPERVISOR)}
44
+ >
45
+ 감리자 (${supervisorCount})
46
+ </md-primary-tab>
47
+ </md-tabs>
48
+ </div>
49
+
50
+ <div class="tab-content">
51
+ <div class="photo-count">
52
+ ${this.activeTab === PhotoTab.CONSTRUCTOR ? '시공자' : '감리자'} 첨부파일: ${currentFiles.length}건
53
+ </div>
54
+
55
+ ${currentFiles.length > 0
56
+ ? html `
57
+ <div class="photo-grid">
58
+ ${currentFiles.map((file, index) => {
59
+ var _a;
60
+ return html `
61
+ <div class="photo-item" @click=${() => this._openFilePreview(currentFiles, index)}>
62
+ ${this._isImageFile(file.fullpath)
63
+ ? html `<img
64
+ src="${file.fullpath}"
65
+ alt="${file.name}"
66
+ @error=${(e) => this._onImageError(e, file)}
67
+ />`
68
+ : html `
69
+ <div class="file-icon-container">
70
+ <md-icon class="file-icon">description</md-icon>
71
+ <div class="file-extension">${this._getFileExtension(file.fullpath)}</div>
72
+ </div>
73
+ `}
74
+ <div class="photo-overlay">
75
+ <div class="photo-info">
76
+ <div class="photo-name">${file.name}</div>
77
+ <div class="photo-creator">
78
+ <md-icon style="--md-icon-size: 10px;">account_circle</md-icon>
79
+ ${((_a = file.creator) === null || _a === void 0 ? void 0 : _a.name) || ''}
80
+ </div>
81
+ <div class="photo-date">${this._formatDate(file.createdAt)}</div>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ `;
86
+ })}
87
+ </div>
88
+ `
89
+ : html `
90
+ <div class="empty-state">
91
+ <md-icon>attach_file</md-icon>
92
+ <div>${this.activeTab === PhotoTab.CONSTRUCTOR ? '시공자' : '감리자'}가 업로드한 첨부파일이 없습니다.</div>
93
+ </div>
94
+ `}
95
+ </div>
96
+ </div>
97
+
98
+ <div class="button-container">
99
+ <md-elevated-button @click=${this._close}> <md-icon slot="icon">close</md-icon>닫기 </md-elevated-button>
100
+ </div>
101
+ `;
102
+ }
103
+ async firstUpdated() {
104
+ await this._loadPhotos();
105
+ }
106
+ async _loadPhotos() {
107
+ var _a;
108
+ try {
109
+ const response = await client.query({
110
+ query: gql `
111
+ query ChecklistPhotos($checklistId: String!) {
112
+ checklist(id: $checklistId) {
113
+ id
114
+ checklistItems {
115
+ id
116
+ name
117
+ checklistItemAttachments {
118
+ id
119
+ name
120
+ fullpath
121
+ description
122
+ creator {
123
+ id
124
+ name
125
+ email
126
+ }
127
+ createdAt
128
+ }
129
+ }
130
+ }
131
+ }
132
+ `,
133
+ variables: {
134
+ checklistId: this.checklistId
135
+ }
136
+ });
137
+ if (response.errors) {
138
+ notify({ message: '사진 목록을 불러오는데 실패했습니다.', level: 'error' });
139
+ return;
140
+ }
141
+ const checklist = response.data.checklist;
142
+ // 모든 체크리스트 아이템의 첨부파일을 수집 (이미지와 일반 파일 모두)
143
+ const allAttachments = ((_a = checklist.checklistItems) === null || _a === void 0 ? void 0 : _a.flatMap((item) => {
144
+ var _a;
145
+ return ((_a = item.checklistItemAttachments) === null || _a === void 0 ? void 0 : _a.map((attachment) => (Object.assign(Object.assign({}, attachment), { previewTitle: `[검사 항목] ${item.name}` })))) || [];
146
+ })) || [];
147
+ // 시공자와 감리자로 분류 (이메일 도메인이나 역할로 구분)
148
+ this.constructorFiles = allAttachments.filter(attachment => [BuildingInspectionStatus.WAIT, BuildingInspectionStatus.OVERALL_WAIT, BuildingInspectionStatus.FAIL].includes(attachment.description));
149
+ this.supervisorFiles = allAttachments.filter(attachment => [BuildingInspectionStatus.REQUEST, BuildingInspectionStatus.OVERALL_REQUEST].includes(attachment.description));
150
+ }
151
+ catch (error) {
152
+ console.error('사진 목록 로딩 중 오류 발생:', error);
153
+ notify({ message: '사진 목록을 불러오는데 실패했습니다.', level: 'error' });
154
+ }
155
+ }
156
+ _isImageFile(filepath) {
157
+ if (!filepath)
158
+ return false;
159
+ const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'];
160
+ const extension = filepath.toLowerCase().split('.').pop();
161
+ return imageExtensions.includes(extension || '');
162
+ }
163
+ _getFileExtension(filepath) {
164
+ if (!filepath)
165
+ return '';
166
+ const extension = filepath.toLowerCase().split('.').pop();
167
+ return extension || 'file';
168
+ }
169
+ _setActiveTab(tab) {
170
+ this.activeTab = tab;
171
+ }
172
+ _openFilePreview(files, startIndex) {
173
+ const file = files[startIndex];
174
+ if (this._isImageFile(file.fullpath)) {
175
+ // 이미지들만 필터링해서 이미지 미리보기 팝업 열기
176
+ const imageFiles = files.filter(f => this._isImageFile(f.fullpath));
177
+ const imageIndex = imageFiles.findIndex(f => f.id === file.id);
178
+ openPopup(html ` <image-preview-popup .images=${imageFiles} .currentIndex=${Math.max(0, imageIndex)}></image-preview-popup> `, { backdrop: true, size: 'large', title: '사진 미리보기' });
179
+ }
180
+ else {
181
+ // 일반 파일은 새 탭에서 열기 또는 다운로드
182
+ window.open(file.fullpath, '_blank');
183
+ }
184
+ }
185
+ _onImageError(e, file) {
186
+ const target = e.target;
187
+ target.style.display = 'none';
188
+ // 오류 발생 시 기본 아이콘 표시
189
+ const container = target.parentElement;
190
+ container.innerHTML += `
191
+ <div style="display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background-color: #f5f5f5;">
192
+ <md-icon style="--md-icon-size: 48px; color: #ccc;">broken_image</md-icon>
193
+ </div>
194
+ `;
195
+ }
196
+ _formatDate(date) {
197
+ const _date = new Date(date);
198
+ if (isNaN(_date.getTime())) {
199
+ return '날짜 없음';
200
+ }
201
+ const year = _date.getFullYear();
202
+ const month = String(_date.getMonth() + 1).padStart(2, '0');
203
+ const day = String(_date.getDate()).padStart(2, '0');
204
+ const hours = String(_date.getHours()).padStart(2, '0');
205
+ const minutes = String(_date.getMinutes()).padStart(2, '0');
206
+ return `${year}.${month}.${day} ${hours}:${minutes}`;
207
+ }
208
+ _close() {
209
+ history.back();
210
+ }
211
+ };
212
+ PhotoAlbumPopup.styles = [
213
+ ButtonContainerStyles,
214
+ ScrollbarStyles,
215
+ css `
216
+ :host {
217
+ display: flex;
218
+ flex-direction: column;
219
+ background-color: #fff;
220
+ width: 100%;
221
+ max-height: 80vh;
222
+ }
223
+
224
+ div[body] {
225
+ flex: 1;
226
+ overflow-y: auto;
227
+ padding: 20px;
228
+ }
229
+
230
+ .tabs-container {
231
+ margin-bottom: 20px;
232
+ border-bottom: 2px solid #ddd;
233
+ }
234
+
235
+ md-tabs {
236
+ --md-primary-tab-container-color: transparent;
237
+ --md-primary-tab-active-indicator-color: #2196f3;
238
+ --md-primary-tab-label-text-color: #666;
239
+ --md-primary-tab-active-label-text-color: #2196f3;
240
+ }
241
+
242
+ .photo-grid {
243
+ display: grid;
244
+ grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
245
+ gap: 15px;
246
+ margin-bottom: 20px;
247
+ }
248
+
249
+ .photo-item {
250
+ position: relative;
251
+ aspect-ratio: 1;
252
+ border-radius: 8px;
253
+ overflow: hidden;
254
+ cursor: pointer;
255
+ transition: all 0.2s ease;
256
+ border: 2px solid #ddd;
257
+ }
258
+
259
+ .photo-item:hover {
260
+ transform: translateY(-2px);
261
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
262
+ border-color: #2196f3;
263
+ }
264
+
265
+ .photo-item img {
266
+ width: 100%;
267
+ height: 100%;
268
+ object-fit: cover;
269
+ }
270
+
271
+ .photo-overlay {
272
+ position: absolute;
273
+ bottom: 0;
274
+ left: 0;
275
+ right: 0;
276
+ background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
277
+ color: white;
278
+ padding: 10px 8px 8px;
279
+ font-size: 12px;
280
+ line-height: 1.2;
281
+ }
282
+
283
+ .photo-info {
284
+ display: flex;
285
+ flex-direction: column;
286
+ gap: 2px;
287
+ }
288
+
289
+ .photo-name {
290
+ font-weight: bold;
291
+ overflow: hidden;
292
+ text-overflow: ellipsis;
293
+ white-space: nowrap;
294
+ }
295
+
296
+ .photo-creator {
297
+ font-size: 10px;
298
+ opacity: 0.9;
299
+ display: flex;
300
+ align-items: center;
301
+ gap: 3px;
302
+ }
303
+
304
+ .photo-date {
305
+ font-size: 10px;
306
+ opacity: 0.8;
307
+ }
308
+
309
+ .file-icon-container {
310
+ width: 100%;
311
+ height: 100%;
312
+ display: flex;
313
+ flex-direction: column;
314
+ align-items: center;
315
+ justify-content: center;
316
+ background-color: #f5f5f5;
317
+ position: relative;
318
+ }
319
+
320
+ .file-icon {
321
+ --md-icon-size: 48px;
322
+ color: #666;
323
+ margin-bottom: 8px;
324
+ }
325
+
326
+ .file-extension {
327
+ font-size: 12px;
328
+ font-weight: bold;
329
+ color: #444;
330
+ background-color: #e0e0e0;
331
+ padding: 2px 6px;
332
+ border-radius: 3px;
333
+ text-transform: uppercase;
334
+ }
335
+
336
+ .empty-state {
337
+ text-align: center;
338
+ color: #666;
339
+ padding: 60px 20px;
340
+ }
341
+
342
+ .empty-state md-icon {
343
+ --md-icon-size: 64px;
344
+ color: #ccc;
345
+ margin-bottom: 16px;
346
+ }
347
+
348
+ .tab-content {
349
+ min-height: 300px;
350
+ }
351
+
352
+ .photo-count {
353
+ color: #666;
354
+ font-size: 14px;
355
+ margin-bottom: 15px;
356
+ padding: 10px;
357
+ background-color: #f5f5f5;
358
+ border-radius: 5px;
359
+ text-align: center;
360
+ }
361
+
362
+ h3 {
363
+ position: relative;
364
+ color: rgb(5, 149, 229);
365
+ font-size: 17px;
366
+ font-weight: 700;
367
+ margin: 0px 0px 20px 0px;
368
+ padding-top: 0px;
369
+ }
370
+
371
+ .button-container {
372
+ display: flex;
373
+ justify-content: center;
374
+ padding: 15px;
375
+ border-top: 1px solid #ddd;
376
+ background-color: #f9f9f9;
377
+ margin-left: unset;
378
+ }
379
+ `
380
+ ];
381
+ __decorate([
382
+ property({ type: String }),
383
+ __metadata("design:type", String)
384
+ ], PhotoAlbumPopup.prototype, "checklistId", void 0);
385
+ __decorate([
386
+ state(),
387
+ __metadata("design:type", String)
388
+ ], PhotoAlbumPopup.prototype, "activeTab", void 0);
389
+ __decorate([
390
+ state(),
391
+ __metadata("design:type", Array)
392
+ ], PhotoAlbumPopup.prototype, "constructorFiles", void 0);
393
+ __decorate([
394
+ state(),
395
+ __metadata("design:type", Array)
396
+ ], PhotoAlbumPopup.prototype, "supervisorFiles", void 0);
397
+ PhotoAlbumPopup = __decorate([
398
+ customElement('photo-album-popup')
399
+ ], PhotoAlbumPopup);
400
+ export { PhotoAlbumPopup };
401
+ //# sourceMappingURL=photo-album-popup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"photo-album-popup.js","sourceRoot":"","sources":["../../../../../client/pages/building-inspection/component/inspection-document/photo-album-popup.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAChD,OAAO,4BAA4B,CAAA;AACnC,OAAO,4BAA4B,CAAA;AACnC,OAAO,mCAAmC,CAAA;AAE1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAA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UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;QAE3D,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,OAAO,EAAE,CAAA;IACtD,CAAC;IAEO,MAAM;QACZ,OAAO,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC;;AAlYM,sBAAM,GAAG;IACd,qBAAqB;IACrB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoKF;CACF,AAxKY,CAwKZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAyB;AAE3C;IAAR,KAAK,EAAE;;kDAA2C;AAC1C;IAAR,KAAK,EAAE;;yDAA6B;AAC5B;IAAR,KAAK,EAAE;;wDAA4B;AA/KzB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAoY3B","sourcesContent":["import '@material/web/button/elevated-button.js'\nimport '@material/web/icon/icon.js'\nimport '@material/web/tabs/tabs.js'\nimport '@material/web/tabs/primary-tab.js'\n\nimport gql from 'graphql-tag'\nimport { client } from '@operato/graphql'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport { notify, openPopup } from '@operato/layout'\nimport '../image-preview-popup'\nimport { BuildingInspectionStatus } from '../../building-inspection-list'\n\nexport enum PhotoTab {\n CONSTRUCTOR = 'constructor',\n SUPERVISOR = 'supervisor'\n}\n\n@customElement('photo-album-popup')\nexport class PhotoAlbumPopup extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: #fff;\n width: 100%;\n max-height: 80vh;\n }\n\n div[body] {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n }\n\n .tabs-container {\n margin-bottom: 20px;\n border-bottom: 2px solid #ddd;\n }\n\n md-tabs {\n --md-primary-tab-container-color: transparent;\n --md-primary-tab-active-indicator-color: #2196f3;\n --md-primary-tab-label-text-color: #666;\n --md-primary-tab-active-label-text-color: #2196f3;\n }\n\n .photo-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));\n gap: 15px;\n margin-bottom: 20px;\n }\n\n .photo-item {\n position: relative;\n aspect-ratio: 1;\n border-radius: 8px;\n overflow: hidden;\n cursor: pointer;\n transition: all 0.2s ease;\n border: 2px solid #ddd;\n }\n\n .photo-item:hover {\n transform: translateY(-2px);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n border-color: #2196f3;\n }\n\n .photo-item img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n .photo-overlay {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));\n color: white;\n padding: 10px 8px 8px;\n font-size: 12px;\n line-height: 1.2;\n }\n\n .photo-info {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .photo-name {\n font-weight: bold;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .photo-creator {\n font-size: 10px;\n opacity: 0.9;\n display: flex;\n align-items: center;\n gap: 3px;\n }\n\n .photo-date {\n font-size: 10px;\n opacity: 0.8;\n }\n\n .file-icon-container {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: #f5f5f5;\n position: relative;\n }\n\n .file-icon {\n --md-icon-size: 48px;\n color: #666;\n margin-bottom: 8px;\n }\n\n .file-extension {\n font-size: 12px;\n font-weight: bold;\n color: #444;\n background-color: #e0e0e0;\n padding: 2px 6px;\n border-radius: 3px;\n text-transform: uppercase;\n }\n\n .empty-state {\n text-align: center;\n color: #666;\n padding: 60px 20px;\n }\n\n .empty-state md-icon {\n --md-icon-size: 64px;\n color: #ccc;\n margin-bottom: 16px;\n }\n\n .tab-content {\n min-height: 300px;\n }\n\n .photo-count {\n color: #666;\n font-size: 14px;\n margin-bottom: 15px;\n padding: 10px;\n background-color: #f5f5f5;\n border-radius: 5px;\n text-align: center;\n }\n\n h3 {\n position: relative;\n color: rgb(5, 149, 229);\n font-size: 17px;\n font-weight: 700;\n margin: 0px 0px 20px 0px;\n padding-top: 0px;\n }\n\n .button-container {\n display: flex;\n justify-content: center;\n padding: 15px;\n border-top: 1px solid #ddd;\n background-color: #f9f9f9;\n margin-left: unset;\n }\n `\n ]\n\n @property({ type: String }) checklistId: string = ''\n\n @state() activeTab: PhotoTab = PhotoTab.CONSTRUCTOR\n @state() constructorFiles: any[] = []\n @state() supervisorFiles: any[] = []\n\n render() {\n const currentFiles = this.activeTab === PhotoTab.CONSTRUCTOR ? this.constructorFiles : this.supervisorFiles\n const constructorCount = this.constructorFiles.length\n const supervisorCount = this.supervisorFiles.length\n\n return html`\n <div body>\n <div class=\"tabs-container\">\n <md-tabs>\n <md-primary-tab\n ?active=${this.activeTab === PhotoTab.CONSTRUCTOR}\n @click=${() => this._setActiveTab(PhotoTab.CONSTRUCTOR)}\n >\n 시공자 (${constructorCount})\n </md-primary-tab>\n <md-primary-tab\n ?active=${this.activeTab === PhotoTab.SUPERVISOR}\n @click=${() => this._setActiveTab(PhotoTab.SUPERVISOR)}\n >\n 감리자 (${supervisorCount})\n </md-primary-tab>\n </md-tabs>\n </div>\n\n <div class=\"tab-content\">\n <div class=\"photo-count\">\n ${this.activeTab === PhotoTab.CONSTRUCTOR ? '시공자' : '감리자'} 첨부파일: ${currentFiles.length}건\n </div>\n\n ${currentFiles.length > 0\n ? html`\n <div class=\"photo-grid\">\n ${currentFiles.map(\n (file, index) => html`\n <div class=\"photo-item\" @click=${() => this._openFilePreview(currentFiles, index)}>\n ${this._isImageFile(file.fullpath)\n ? html`<img\n src=\"${file.fullpath}\"\n alt=\"${file.name}\"\n @error=${(e: Event) => this._onImageError(e, file)}\n />`\n : html`\n <div class=\"file-icon-container\">\n <md-icon class=\"file-icon\">description</md-icon>\n <div class=\"file-extension\">${this._getFileExtension(file.fullpath)}</div>\n </div>\n `}\n <div class=\"photo-overlay\">\n <div class=\"photo-info\">\n <div class=\"photo-name\">${file.name}</div>\n <div class=\"photo-creator\">\n <md-icon style=\"--md-icon-size: 10px;\">account_circle</md-icon>\n ${file.creator?.name || ''}\n </div>\n <div class=\"photo-date\">${this._formatDate(file.createdAt)}</div>\n </div>\n </div>\n </div>\n `\n )}\n </div>\n `\n : html`\n <div class=\"empty-state\">\n <md-icon>attach_file</md-icon>\n <div>${this.activeTab === PhotoTab.CONSTRUCTOR ? '시공자' : '감리자'}가 업로드한 첨부파일이 없습니다.</div>\n </div>\n `}\n </div>\n </div>\n\n <div class=\"button-container\">\n <md-elevated-button @click=${this._close}> <md-icon slot=\"icon\">close</md-icon>닫기 </md-elevated-button>\n </div>\n `\n }\n\n async firstUpdated() {\n await this._loadPhotos()\n }\n\n private async _loadPhotos() {\n try {\n const response = await client.query({\n query: gql`\n query ChecklistPhotos($checklistId: String!) {\n checklist(id: $checklistId) {\n id\n checklistItems {\n id\n name\n checklistItemAttachments {\n id\n name\n fullpath\n description\n creator {\n id\n name\n email\n }\n createdAt\n }\n }\n }\n }\n `,\n variables: {\n checklistId: this.checklistId\n }\n })\n\n if (response.errors) {\n notify({ message: '사진 목록을 불러오는데 실패했습니다.', level: 'error' })\n return\n }\n\n const checklist = response.data.checklist\n // 모든 체크리스트 아이템의 첨부파일을 수집 (이미지와 일반 파일 모두)\n const allAttachments =\n checklist.checklistItems?.flatMap(\n (item: any) =>\n item.checklistItemAttachments?.map((attachment: any) => ({\n ...attachment,\n previewTitle: `[검사 항목] ${item.name}`\n })) || []\n ) || []\n\n // 시공자와 감리자로 분류 (이메일 도메인이나 역할로 구분)\n this.constructorFiles = allAttachments.filter(attachment =>\n [BuildingInspectionStatus.WAIT, BuildingInspectionStatus.OVERALL_WAIT, BuildingInspectionStatus.FAIL].includes(\n attachment.description\n )\n )\n\n this.supervisorFiles = allAttachments.filter(attachment =>\n [BuildingInspectionStatus.REQUEST, BuildingInspectionStatus.OVERALL_REQUEST].includes(attachment.description)\n )\n } catch (error) {\n console.error('사진 목록 로딩 중 오류 발생:', error)\n notify({ message: '사진 목록을 불러오는데 실패했습니다.', level: 'error' })\n }\n }\n\n private _isImageFile(filepath: string): boolean {\n if (!filepath) return false\n const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg']\n const extension = filepath.toLowerCase().split('.').pop()\n return imageExtensions.includes(extension || '')\n }\n\n private _getFileExtension(filepath: string): string {\n if (!filepath) return ''\n const extension = filepath.toLowerCase().split('.').pop()\n return extension || 'file'\n }\n\n private _setActiveTab(tab: PhotoTab) {\n this.activeTab = tab\n }\n\n private _openFilePreview(files: any[], startIndex: number) {\n const file = files[startIndex]\n\n if (this._isImageFile(file.fullpath)) {\n // 이미지들만 필터링해서 이미지 미리보기 팝업 열기\n const imageFiles = files.filter(f => this._isImageFile(f.fullpath))\n const imageIndex = imageFiles.findIndex(f => f.id === file.id)\n\n openPopup(\n html` <image-preview-popup .images=${imageFiles} .currentIndex=${Math.max(0, imageIndex)}></image-preview-popup> `,\n { backdrop: true, size: 'large', title: '사진 미리보기' }\n )\n } else {\n // 일반 파일은 새 탭에서 열기 또는 다운로드\n window.open(file.fullpath, '_blank')\n }\n }\n\n private _onImageError(e: Event, file: any) {\n const target = e.target as HTMLImageElement\n target.style.display = 'none'\n\n // 오류 발생 시 기본 아이콘 표시\n const container = target.parentElement!\n container.innerHTML += `\n <div style=\"display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background-color: #f5f5f5;\">\n <md-icon style=\"--md-icon-size: 48px; color: #ccc;\">broken_image</md-icon>\n </div>\n `\n }\n\n private _formatDate(date: string | Date): string {\n const _date = new Date(date)\n\n if (isNaN(_date.getTime())) {\n return '날짜 없음'\n }\n\n const year = _date.getFullYear()\n const month = String(_date.getMonth() + 1).padStart(2, '0')\n const day = String(_date.getDate()).padStart(2, '0')\n const hours = String(_date.getHours()).padStart(2, '0')\n const minutes = String(_date.getMinutes()).padStart(2, '0')\n\n return `${year}.${month}.${day} ${hours}:${minutes}`\n }\n\n private _close() {\n history.back()\n }\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import { BizEvent, CALENDAR, EventProvider } from '@operato/event-view';
2
2
  export declare class InspectionEventProvider implements EventProvider {
3
3
  buildingLevelId: {};
4
- constructor(buildingLevelId?: string);
4
+ projectId: string;
5
+ constructor(buildingLevelId?: string, projectId?: string);
5
6
  fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>>;
6
7
  private getCalendarTemplate;
7
8
  }
@@ -1,19 +1,27 @@
1
1
  import { html } from 'lit';
2
2
  import gql from 'graphql-tag';
3
3
  import { client } from '@operato/graphql';
4
+ import moment from 'moment-timezone';
4
5
  export class InspectionEventProvider {
5
- constructor(buildingLevelId = '') {
6
+ constructor(buildingLevelId = '', projectId = '') {
6
7
  this.buildingLevelId = {};
8
+ this.projectId = '';
7
9
  this.buildingLevelId = buildingLevelId;
10
+ this.projectId = projectId;
8
11
  }
9
12
  async fetchEventsForCalendar(calendar) {
10
13
  var _a, _b;
11
14
  const result = new Map();
12
- const startDate = calendar[0]['date'].toISOString().split('T')[0];
13
- const endDate = (_a = calendar.at(-1)) === null || _a === void 0 ? void 0 : _a['date'].toISOString().split('T')[0];
15
+ const startDate = moment(calendar[0]['date']).format('YYYY-MM-DD');
16
+ const endDate = moment(calendar[calendar.length - 1]['date']).format('YYYY-MM-DD');
14
17
  const response = await client.query({
15
18
  query: gql `
16
- query BuildingInspectionDateSummaryOfLevelAndPeriod($buildingLevelId: String!, $startDate: String!, $endDate: String!) {
19
+ query BuildingInspectionDateSummaryOfLevelAndPeriod(
20
+ $buildingLevelId: String!
21
+ $startDate: String!
22
+ $endDate: String!
23
+ $projectId: String!
24
+ ) {
17
25
  buildingInspectionDateSummaryOfLevelAndPeriod(
18
26
  buildingLevelId: $buildingLevelId
19
27
  startDate: $startDate
@@ -25,30 +33,44 @@ export class InspectionEventProvider {
25
33
  pass
26
34
  fail
27
35
  }
36
+ dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {
37
+ id
38
+ date
39
+ }
28
40
  }
29
41
  `,
30
42
  variables: {
31
43
  buildingLevelId: this.buildingLevelId,
44
+ projectId: this.projectId,
32
45
  startDate,
33
46
  endDate
34
47
  }
35
48
  });
36
- // if (response.errors) return null
37
- const calendarData = this.getCalendarTemplate((_b = response.data) === null || _b === void 0 ? void 0 : _b.buildingInspectionDateSummaryOfLevelAndPeriod);
49
+ const calendarData = this.getCalendarTemplate((_a = response.data) === null || _a === void 0 ? void 0 : _a.buildingInspectionDateSummaryOfLevelAndPeriod);
50
+ const worklogDates = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.dailyWorklogDatesOfProject.map(v => v.date)) || [];
51
+ const worklogSet = new Set(worklogDates);
38
52
  calendar.forEach(({ date }) => {
39
53
  const formattedDate = date.toLocaleDateString('en-CA'); // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.
40
54
  const template = calendarData[formattedDate];
41
- if (!template)
42
- return;
43
- result.set(date, [
44
- {
45
- due: formattedDate,
46
- template: template,
47
- title: '',
48
- color: '',
49
- clickEvent: e => console.log('e :', e, template)
50
- }
51
- ]);
55
+ const hasWorklog = worklogSet.has(formattedDate);
56
+ if (template || hasWorklog) {
57
+ result.set(date, [
58
+ {
59
+ due: formattedDate,
60
+ template: html `
61
+ <div style="display:grid;grid-template-columns:repeat(2,1fr);padding-inline:7px;align-items:center;gap:4px;">
62
+ ${template || html ``}
63
+ ${hasWorklog
64
+ ? html `<div style="justify-self:end"><md-icon style="color:#008000;">description</md-icon></div>`
65
+ : html ``}
66
+ </div>
67
+ `,
68
+ title: '',
69
+ color: '',
70
+ clickEvent: e => console.log('calendar click', formattedDate)
71
+ }
72
+ ]);
73
+ }
52
74
  });
53
75
  return result;
54
76
  }
@@ -1 +1 @@
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,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AgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;;OAEjH,CAAA;QACH,CAAC;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"]}
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;AACzC,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAEpC,MAAM,OAAO,uBAAuB;IAIlC,YAAY,kBAA0B,EAAE,EAAE,YAAoB,EAAE;QAHhE,oBAAe,GAAG,EAAE,CAAA;QACpB,cAAS,GAAW,EAAE,CAAA;QAGpB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,QAAkB;;QAC7C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAA;QAC1C,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;QAClE,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;QAElF,MAAM,QAAQ,GA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BAAgB,EAAE,aAAa,CAAC;qBAC9D;iBACF,CAAC,CAAA;YACJ,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAED,+BAA+B;IACvB,mBAAmB,CAAC,iBAAwB,EAAE;QACpD,MAAM,QAAQ,GAAG,EAAE,CAAA;QACnB,KAAK,IAAI,IAAI,IAAI,cAAc,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;;YAE3B,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC5G,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE;YAClH,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC5G,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gEAAgE,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;;OAEjH,CAAA;QACH,CAAC;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'\nimport moment from 'moment-timezone'\n\nexport class InspectionEventProvider implements EventProvider {\n buildingLevelId = {}\n projectId: string = ''\n\n constructor(buildingLevelId: string = '', projectId: string = '') {\n this.buildingLevelId = buildingLevelId\n this.projectId = projectId\n }\n\n async fetchEventsForCalendar(calendar: CALENDAR): Promise<Map<Date, BizEvent[]>> {\n const result = new Map<Date, BizEvent[]>()\n const startDate = moment(calendar[0]['date']).format('YYYY-MM-DD')\n const endDate = moment(calendar[calendar.length - 1]['date']).format('YYYY-MM-DD')\n\n const response = await client.query({\n query: gql`\n query BuildingInspectionDateSummaryOfLevelAndPeriod(\n $buildingLevelId: String!\n $startDate: String!\n $endDate: String!\n $projectId: String!\n ) {\n buildingInspectionDateSummaryOfLevelAndPeriod(\n buildingLevelId: $buildingLevelId\n startDate: $startDate\n endDate: $endDate\n ) {\n requestDate\n wait\n request\n pass\n fail\n }\n dailyWorklogDatesOfProject(projectId: $projectId, startDate: $startDate, endDate: $endDate) {\n id\n date\n }\n }\n `,\n variables: {\n buildingLevelId: this.buildingLevelId,\n projectId: this.projectId,\n startDate,\n endDate\n }\n })\n\n const calendarData = this.getCalendarTemplate(response.data?.buildingInspectionDateSummaryOfLevelAndPeriod)\n const worklogDates: string[] = response.data?.dailyWorklogDatesOfProject.map(v => v.date) || []\n const worklogSet = new Set(worklogDates)\n\n calendar.forEach(({ date }) => {\n const formattedDate = date.toLocaleDateString('en-CA') // 'en-CA'는 'YYYY-MM-DD' 형식으로 반환됩니다.\n const template = calendarData[formattedDate]\n\n const hasWorklog = worklogSet.has(formattedDate)\n if (template || hasWorklog) {\n result.set(date, [\n {\n due: formattedDate,\n template: html`\n <div style=\"display:grid;grid-template-columns:repeat(2,1fr);padding-inline:7px;align-items:center;gap:4px;\">\n ${template || html``}\n ${hasWorklog\n ? html`<div style=\"justify-self:end\"><md-icon style=\"color:#008000;\">description</md-icon></div>`\n : html``}\n </div>\n `,\n title: '',\n color: '',\n clickEvent: e => console.log('calendar click', formattedDate)\n }\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"]}