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

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-mutation.d.ts +3 -3
  84. package/dist-server/service/building-inspection/building-inspection-mutation.js +145 -34
  85. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  86. package/dist-server/service/building-inspection/building-inspection-query.d.ts +3 -4
  87. package/dist-server/service/building-inspection/building-inspection-query.js +46 -30
  88. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  89. package/dist-server/service/building-inspection/building-inspection-type.d.ts +28 -9
  90. package/dist-server/service/building-inspection/building-inspection-type.js +96 -17
  91. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  92. package/dist-server/service/building-inspection/building-inspection.d.ts +13 -0
  93. package/dist-server/service/building-inspection/building-inspection.js +55 -2
  94. package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
  95. package/dist-server/service/building-inspection/index.d.ts +4 -7
  96. package/dist-server/service/building-inspection/index.js +11 -6
  97. package/dist-server/service/building-inspection/index.js.map +1 -1
  98. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.d.ts +6 -0
  99. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js +56 -0
  100. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js.map +1 -0
  101. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.d.ts +16 -0
  102. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js +171 -0
  103. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js.map +1 -0
  104. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.d.ts +23 -0
  105. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js +90 -0
  106. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js.map +1 -0
  107. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.d.ts +33 -0
  108. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js +132 -0
  109. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js.map +1 -0
  110. package/dist-server/service/building-inspection-daily-worklog/index.d.ts +5 -0
  111. package/dist-server/service/building-inspection-daily-worklog/index.js +9 -0
  112. package/dist-server/service/building-inspection-daily-worklog/index.js.map +1 -0
  113. package/dist-server/service/building-inspection-history/building-inspection-history-query.d.ts +16 -0
  114. package/dist-server/service/building-inspection-history/building-inspection-history-query.js +120 -0
  115. package/dist-server/service/building-inspection-history/building-inspection-history-query.js.map +1 -0
  116. package/dist-server/service/building-inspection-history/building-inspection-history-type.d.ts +5 -0
  117. package/dist-server/service/building-inspection-history/building-inspection-history-type.js +21 -0
  118. package/dist-server/service/building-inspection-history/building-inspection-history-type.js.map +1 -0
  119. package/dist-server/service/building-inspection-history/building-inspection-history.d.ts +34 -0
  120. package/dist-server/service/building-inspection-history/building-inspection-history.js +157 -0
  121. package/dist-server/service/building-inspection-history/building-inspection-history.js.map +1 -0
  122. package/dist-server/service/{building-inspection → building-inspection-history}/event-subscriber.d.ts +1 -1
  123. package/dist-server/service/{building-inspection → building-inspection-history}/event-subscriber.js +1 -1
  124. package/dist-server/service/building-inspection-history/event-subscriber.js.map +1 -0
  125. package/dist-server/service/building-inspection-history/index.d.ts +6 -0
  126. package/dist-server/service/building-inspection-history/index.js +10 -0
  127. package/dist-server/service/building-inspection-history/index.js.map +1 -0
  128. package/dist-server/service/checklist/checklist-mutation.d.ts +0 -5
  129. package/dist-server/service/checklist/checklist-mutation.js +1 -67
  130. package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
  131. package/dist-server/service/checklist/checklist-query.d.ts +6 -0
  132. package/dist-server/service/checklist/checklist-query.js +63 -0
  133. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  134. package/dist-server/service/checklist/checklist-type.d.ts +0 -13
  135. package/dist-server/service/checklist/checklist-type.js +1 -49
  136. package/dist-server/service/checklist/checklist-type.js.map +1 -1
  137. package/dist-server/service/checklist/checklist.d.ts +38 -3
  138. package/dist-server/service/checklist/checklist.js +131 -15
  139. package/dist-server/service/checklist/checklist.js.map +1 -1
  140. package/dist-server/service/checklist/event-subscriber.d.ts +2 -2
  141. package/dist-server/service/checklist/event-subscriber.js +2 -2
  142. package/dist-server/service/checklist/event-subscriber.js.map +1 -1
  143. package/dist-server/service/checklist/index.d.ts +1 -4
  144. package/dist-server/service/checklist/index.js +2 -5
  145. package/dist-server/service/checklist/index.js.map +1 -1
  146. package/dist-server/service/checklist-history/checklist-history-query.d.ts +11 -0
  147. package/dist-server/service/checklist-history/checklist-history-query.js +77 -0
  148. package/dist-server/service/checklist-history/checklist-history-query.js.map +1 -0
  149. package/dist-server/service/checklist-history/checklist-history-type.d.ts +5 -0
  150. package/dist-server/service/checklist-history/checklist-history-type.js +21 -0
  151. package/dist-server/service/checklist-history/checklist-history-type.js.map +1 -0
  152. package/dist-server/service/checklist-history/checklist-history.d.ts +50 -0
  153. package/dist-server/service/checklist-history/checklist-history.js +239 -0
  154. package/dist-server/service/checklist-history/checklist-history.js.map +1 -0
  155. package/dist-server/service/checklist-history/event-subscriber.d.ts +7 -0
  156. package/dist-server/service/checklist-history/event-subscriber.js +21 -0
  157. package/dist-server/service/checklist-history/event-subscriber.js.map +1 -0
  158. package/dist-server/service/checklist-history/index.d.ts +6 -0
  159. package/dist-server/service/checklist-history/index.js +10 -0
  160. package/dist-server/service/checklist-history/index.js.map +1 -0
  161. package/dist-server/service/checklist-item/checklist-item-query.d.ts +1 -1
  162. package/dist-server/service/checklist-item/checklist-item-query.js +5 -3
  163. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
  164. package/dist-server/service/checklist-item/index.d.ts +0 -1
  165. package/dist-server/service/checklist-item/index.js +1 -2
  166. package/dist-server/service/checklist-item/index.js.map +1 -1
  167. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.d.ts +1 -0
  168. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +33 -6
  169. package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
  170. package/dist-server/service/checklist-item-comment/index.d.ts +0 -2
  171. package/dist-server/service/checklist-item-comment/index.js +1 -3
  172. package/dist-server/service/checklist-item-comment/index.js.map +1 -1
  173. package/dist-server/service/checklist-item-history/checklist-item-history-query.d.ts +16 -0
  174. package/dist-server/service/checklist-item-history/checklist-item-history-query.js +123 -0
  175. package/dist-server/service/checklist-item-history/checklist-item-history-query.js.map +1 -0
  176. package/dist-server/service/checklist-item-history/checklist-item-history-type.d.ts +5 -0
  177. package/dist-server/service/checklist-item-history/checklist-item-history-type.js +21 -0
  178. package/dist-server/service/checklist-item-history/checklist-item-history-type.js.map +1 -0
  179. package/dist-server/service/checklist-item-history/checklist-item-history.d.ts +25 -0
  180. package/dist-server/service/checklist-item-history/checklist-item-history.js +123 -0
  181. package/dist-server/service/checklist-item-history/checklist-item-history.js.map +1 -0
  182. package/dist-server/service/checklist-item-history/event-subscriber.d.ts +7 -0
  183. package/dist-server/service/checklist-item-history/event-subscriber.js +21 -0
  184. package/dist-server/service/checklist-item-history/event-subscriber.js.map +1 -0
  185. package/dist-server/service/checklist-item-history/index.d.ts +6 -0
  186. package/dist-server/service/checklist-item-history/index.js +10 -0
  187. package/dist-server/service/checklist-item-history/index.js.map +1 -0
  188. package/dist-server/service/checklist-template-item/checklist-template-item.js +2 -4
  189. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
  190. package/dist-server/service/index.d.ts +4 -2
  191. package/dist-server/service/index.js +22 -13
  192. package/dist-server/service/index.js.map +1 -1
  193. package/dist-server/service/issue/index.d.ts +0 -1
  194. package/dist-server/service/issue/index.js +1 -2
  195. package/dist-server/service/issue/index.js.map +1 -1
  196. package/dist-server/service/project-report/index.d.ts +0 -1
  197. package/dist-server/service/project-report/index.js +1 -2
  198. package/dist-server/service/project-report/index.js.map +1 -1
  199. package/dist-server/service/project-report/project-report.d.ts +0 -2
  200. package/dist-server/service/project-report/project-report.js +0 -6
  201. package/dist-server/service/project-report/project-report.js.map +1 -1
  202. package/dist-server/service/supervisor/index.d.ts +0 -1
  203. package/dist-server/service/supervisor/index.js +1 -2
  204. package/dist-server/service/supervisor/index.js.map +1 -1
  205. package/dist-server/tsconfig.tsbuildinfo +1 -1
  206. package/package.json +13 -13
  207. package/things-factory.config.js +3 -1
  208. package/dist-server/service/building-inspection/building-inspection-history.d.ts +0 -17
  209. package/dist-server/service/building-inspection/building-inspection-history.js +0 -86
  210. package/dist-server/service/building-inspection/building-inspection-history.js.map +0 -1
  211. package/dist-server/service/building-inspection/event-subscriber.js.map +0 -1
  212. package/dist-server/service/checklist/checklist-history.d.ts +0 -24
  213. package/dist-server/service/checklist/checklist-history.js +0 -120
  214. package/dist-server/service/checklist/checklist-history.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 @@
1
+ export declare function getBuildingInspectionForChecklist(buildingInspectionId?: string): Promise<any>;
@@ -0,0 +1,100 @@
1
+ import { client } from '@operato/graphql';
2
+ import { gql } from '@apollo/client';
3
+ export async function getBuildingInspectionForChecklist(buildingInspectionId = '') {
4
+ if (!buildingInspectionId)
5
+ return null;
6
+ const response = await client.query({
7
+ query: gql `
8
+ query BuildingInspection($buildingInspectionId: String!) {
9
+ buildingInspection(id: $buildingInspectionId) {
10
+ id
11
+ status
12
+ requestDate
13
+ memo
14
+ checklist {
15
+ id
16
+ name
17
+ constructionType
18
+ constructionDetailType
19
+ location
20
+ inspectionParts
21
+ documentNo
22
+ inspectionRequestDocumentNo
23
+ inspectionRequestMemo
24
+ inspectionRequestUpdatedAt
25
+ inspectionResultDocumentNo
26
+ inspectionResultStatus
27
+ inspectionResultType
28
+ inspectionResultMemo
29
+ inspectionResultUpdatedAt
30
+ constructionInspectionDate
31
+ supervisorInspectionDate
32
+ overallConstructorSignature
33
+ taskConstructorSignature
34
+ overallSupervisorySignature
35
+ taskSupervisorySignature
36
+ nameListAttachment {
37
+ id
38
+ name
39
+ fullpath
40
+ }
41
+ taskConstructor {
42
+ id
43
+ name
44
+ }
45
+ overallConstructor {
46
+ id
47
+ name
48
+ }
49
+ taskSupervisory {
50
+ id
51
+ name
52
+ }
53
+ overallSupervisory {
54
+ id
55
+ name
56
+ }
57
+
58
+ checklistItems {
59
+ id
60
+ name
61
+ sequence
62
+ mainType
63
+ detailType
64
+ inspctionCriteria
65
+ constructionConfirmStatus
66
+ supervisoryConfirmStatus
67
+ checklistItemCommentCount
68
+ checklistItemAttachmentCount
69
+ }
70
+ }
71
+
72
+ buildingLevel {
73
+ id
74
+ floor
75
+
76
+ building {
77
+ id
78
+ buildingComplex {
79
+ id
80
+ overallConstructorEmails
81
+ taskConstructorEmails
82
+ overallSupervisoryEmails
83
+ taskSupervisoryEmails
84
+ supervisoryCompany
85
+ constructionCompany
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ `,
92
+ variables: {
93
+ buildingInspectionId
94
+ }
95
+ });
96
+ if (response.errors)
97
+ return null;
98
+ return response.data.buildingInspection;
99
+ }
100
+ //# sourceMappingURL=building-inspection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"building-inspection.js","sourceRoot":"","sources":["../../client/graphql/building-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,MAAM,CAAC,KAAK,UAAU,iCAAiC,CAAC,uBAA+B,EAAE;IACvF,IAAI,CAAC,oBAAoB;QAAE,OAAO,IAAI,CAAA;IAEtC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoFT;QACD,SAAS,EAAE;YACT,oBAAoB;SACrB;KACF,CAAC,CAAA;IAEF,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAEhC,OAAO,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAA;AACzC,CAAC","sourcesContent":["import { client } from '@operato/graphql'\nimport { gql } from '@apollo/client'\n\nexport async function getBuildingInspectionForChecklist(buildingInspectionId: string = '') {\n if (!buildingInspectionId) return null\n\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 memo\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n inspectionRequestDocumentNo\n inspectionRequestMemo\n inspectionRequestUpdatedAt\n inspectionResultDocumentNo\n inspectionResultStatus\n inspectionResultType\n inspectionResultMemo\n inspectionResultUpdatedAt\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n nameListAttachment {\n id\n name\n fullpath\n }\n taskConstructor {\n id\n name\n }\n overallConstructor {\n id\n name\n }\n taskSupervisory {\n id\n name\n }\n overallSupervisory {\n id\n name\n }\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\n buildingLevel {\n id\n floor\n\n building {\n id\n buildingComplex {\n id\n overallConstructorEmails\n taskConstructorEmails\n overallSupervisoryEmails\n taskSupervisoryEmails\n supervisoryCompany\n constructionCompany\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return null\n\n return response.data.buildingInspection\n}\n"]}
@@ -3,6 +3,8 @@ import '@operato/data-grist';
3
3
  import { PageView } from '@operato/shell';
4
4
  import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view';
5
5
  import './component/building-inspection-detail-header';
6
+ import './component/inspection-document/inspection-request-document';
7
+ import './component/inspection-document/inspection-result-notification';
6
8
  import '../checklist/checklist-view';
7
9
  export declare class BuildingInspectionDetailChecklist extends PageView {
8
10
  static styles: import("lit").CSSResult[];
@@ -17,4 +19,11 @@ export declare class BuildingInspectionDetailChecklist extends PageView {
17
19
  private _getProjectByBuildingComplexId;
18
20
  private _onClickModifyChecklist;
19
21
  private validateChecklist;
22
+ private _showInspectionRequestDocument;
23
+ private _showInspectionResultNotification;
24
+ private _onInspectionMemoChange;
25
+ private _onInspectionResultChange;
26
+ private _onInspectionTypeChange;
27
+ private _onInstructionsChange;
28
+ private _uploadNameListFile;
20
29
  }
@@ -7,12 +7,17 @@ import { css, html } from 'lit';
7
7
  import { customElement, state } from 'lit/decorators.js';
8
8
  import { keyed } from 'lit/directives/keyed.js';
9
9
  import { client } from '@operato/graphql';
10
- import { notify } from '@operato/layout';
10
+ import { notify, openPopup } from '@operato/layout';
11
+ import { store } from '@operato/shell';
11
12
  import gql from 'graphql-tag';
12
13
  import { verifyBiometric } from '@things-factory/auth-base/dist-client';
13
14
  import './component/building-inspection-detail-header';
15
+ import './component/inspection-document/inspection-request-document';
16
+ import './component/inspection-document/inspection-result-notification';
14
17
  import '../checklist/checklist-view';
15
18
  import { BuildingInspectionStatus } from './building-inspection-list';
19
+ import { getBuildingInspectionForChecklist } from '../../graphql/building-inspection';
20
+ import { InspectionMode } from './component/inspection-document/inspection-request-document';
16
21
  let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist extends PageView {
17
22
  constructor() {
18
23
  super(...arguments);
@@ -42,6 +47,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
42
47
  status=${this.buildingInspection.status}
43
48
  .checklist=${this.buildingInspection.checklist || {}}
44
49
  .buildingComplex=${((_l = (_k = (_j = this.buildingInspection) === null || _j === void 0 ? void 0 : _j.buildingLevel) === null || _k === void 0 ? void 0 : _k.building) === null || _l === void 0 ? void 0 : _l.buildingComplex) || {}}
50
+ .projectType=${this.project.projectType}
45
51
  ></checklist-view>
46
52
  `)}
47
53
 
@@ -64,74 +70,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
64
70
  }
65
71
  async initBuildingInspection(buildingInspectionId = '') {
66
72
  var _a, _b, _c, _d;
67
- const response = await client.query({
68
- query: gql `
69
- query BuildingInspection($buildingInspectionId: String!) {
70
- buildingInspection(id: $buildingInspectionId) {
71
- id
72
- status
73
- requestDate
74
- checklist {
75
- id
76
- name
77
- constructionType
78
- constructionDetailType
79
- location
80
- inspectionParts
81
- documentNo
82
- constructionInspectionDate
83
- supervisorInspectionDate
84
- overallConstructorSignature
85
- taskConstructorSignature
86
- overallSupervisorySignature
87
- taskSupervisorySignature
88
- buildingInspection {
89
- status
90
- }
91
- checklistItems {
92
- id
93
- name
94
- sequence
95
- mainType
96
- detailType
97
- inspctionCriteria
98
- constructionConfirmStatus
99
- supervisoryConfirmStatus
100
- checklistItemCommentCount
101
- checklistItemAttachmentCount
102
- }
103
- }
104
- buildingLevel {
105
- id
106
- floor
107
- mainDrawing {
108
- id
109
- name
110
- fullpath
111
- }
112
- mainDrawingImage
113
- building {
114
- id
115
- name
116
- buildingComplex {
117
- id
118
- overallConstructorEmails
119
- taskConstructorEmails
120
- overallSupervisoryEmails
121
- taskSupervisoryEmails
122
- }
123
- }
124
- }
125
- }
126
- }
127
- `,
128
- variables: {
129
- buildingInspectionId
130
- }
131
- });
132
- if (response.errors)
133
- return;
134
- this.buildingInspection = response.data.buildingInspection;
73
+ this.buildingInspection = await getBuildingInspectionForChecklist(buildingInspectionId);
135
74
  await this._getProjectByBuildingComplexId((_d = (_c = (_b = (_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.buildingLevel) === null || _b === void 0 ? void 0 : _b.building) === null || _c === void 0 ? void 0 : _c.buildingComplex) === null || _d === void 0 ? void 0 : _d.id);
136
75
  }
137
76
  async _getProjectByBuildingComplexId(buildingComplexId) {
@@ -141,6 +80,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
141
80
  project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {
142
81
  id
143
82
  name
83
+ projectType
144
84
  }
145
85
  }
146
86
  `,
@@ -156,7 +96,18 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
156
96
  this.validateChecklist(this.buildingInspection.checklist);
157
97
  }
158
98
  async validateChecklist(checklist) {
159
- var _a, _b;
99
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
100
+ // 사용자 권한 체크
101
+ const email = (_b = (_a = store.getState().auth) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.email;
102
+ const isOverallConstructor = ((_g = (_f = (_e = (_d = (_c = this.buildingInspection) === null || _c === void 0 ? void 0 : _c.buildingLevel) === null || _d === void 0 ? void 0 : _d.building) === null || _e === void 0 ? void 0 : _e.buildingComplex) === null || _f === void 0 ? void 0 : _f.overallConstructorEmails) === null || _g === void 0 ? void 0 : _g.includes(email)) || false;
103
+ const isOverallSupervisory = ((_m = (_l = (_k = (_j = (_h = this.buildingInspection) === null || _h === void 0 ? void 0 : _h.buildingLevel) === null || _j === void 0 ? void 0 : _j.building) === null || _k === void 0 ? void 0 : _k.buildingComplex) === null || _l === void 0 ? void 0 : _l.overallSupervisoryEmails) === null || _m === void 0 ? void 0 : _m.includes(email)) || false;
104
+ // 권한에 따라 적절한 문서 표시
105
+ if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_WAIT && isOverallConstructor) {
106
+ await this._showInspectionRequestDocument(checklist);
107
+ }
108
+ else if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_REQUEST && isOverallSupervisory) {
109
+ await this._showInspectionResultNotification(checklist);
110
+ }
160
111
  try {
161
112
  const result = await verifyBiometric();
162
113
  if (result.verified) {
@@ -171,6 +122,10 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
171
122
  notify({ message: 'Error during biometric verification:' + error });
172
123
  return;
173
124
  }
125
+ // 실명부 파일 업로드 처리 (새로 업로드된 경우만)
126
+ if (checklist.isNameListAttachmentUploaded) {
127
+ await this._uploadNameListFile(checklist);
128
+ }
174
129
  const response = await client.mutate({
175
130
  mutation: gql `
176
131
  mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {
@@ -185,7 +140,11 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
185
140
  overallConstructorSignature: checklist.overallConstructorSignature,
186
141
  taskConstructorSignature: checklist.taskConstructorSignature,
187
142
  overallSupervisorySignature: checklist.overallSupervisorySignature,
188
- taskSupervisorySignature: checklist.taskSupervisorySignature
143
+ taskSupervisorySignature: checklist.taskSupervisorySignature,
144
+ inspectionRequestMemo: checklist.inspectionRequestMemo,
145
+ inspectionResultMemo: checklist.inspectionResultMemo,
146
+ inspectionResultStatus: checklist.inspectionResultStatus,
147
+ inspectionResultType: checklist.inspectionResultType
189
148
  },
190
149
  checklistItem: checklist.checklistItems.map(item => ({
191
150
  id: item.id,
@@ -200,7 +159,106 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
200
159
  this.initBuildingInspection(this.buildingInspection.id);
201
160
  }
202
161
  else {
203
- notify({ message: ((_b = (_a = response.errors) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.message) || '검측 요청서 등록에 실패하였습니다.', level: 'error' });
162
+ notify({ message: ((_p = (_o = response.errors) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.message) || '검측 요청서 등록에 실패하였습니다.', level: 'error' });
163
+ }
164
+ }
165
+ // resolve 호출 전까지 싱크를 위해 Promise 사용
166
+ async _showInspectionRequestDocument(checklist) {
167
+ return new Promise(resolve => {
168
+ openPopup(html `
169
+ <inspection-request-document
170
+ .checklist=${checklist}
171
+ .buildingInspection=${this.buildingInspection}
172
+ .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}
173
+ @inspection-memo-change=${this._onInspectionMemoChange.bind(this)}
174
+ @name-list-file-selected=${(e) => {
175
+ // checklist에 선택된 파일 저장
176
+ checklist.nameListAttachment = e.detail.file;
177
+ checklist.isNameListAttachmentUploaded = true;
178
+ }}
179
+ @popup-close=${() => resolve()}
180
+ ></inspection-request-document>
181
+ `, { backdrop: true, size: 'large', title: '검측요청결과 통보내용' });
182
+ });
183
+ }
184
+ async _showInspectionResultNotification(checklist) {
185
+ return new Promise(resolve => {
186
+ openPopup(html `
187
+ <inspection-result-notification
188
+ .checklist=${checklist}
189
+ .buildingInspection=${this.buildingInspection}
190
+ .project=${this.project}
191
+ .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}
192
+ @inspection-result-change=${this._onInspectionResultChange.bind(this)}
193
+ @inspection-type-change=${this._onInspectionTypeChange.bind(this)}
194
+ @instructions-change=${this._onInstructionsChange.bind(this)}
195
+ @popup-close=${() => resolve()}
196
+ ></inspection-result-notification>
197
+ `, { backdrop: true, size: 'large', title: '검측 결과 통보' });
198
+ });
199
+ }
200
+ _onInspectionMemoChange(e) {
201
+ var _a;
202
+ const { inspectionRequestMemo } = e.detail;
203
+ if ((_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.checklist) {
204
+ this.buildingInspection.checklist.inspectionRequestMemo = inspectionRequestMemo;
205
+ }
206
+ this.requestUpdate();
207
+ }
208
+ _onInspectionResultChange(e) {
209
+ var _a;
210
+ const { inspectionResultStatus } = e.detail;
211
+ // checklist 업데이트 (레퍼런스 유지하여 호출부 인자에도 반영)
212
+ if ((_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.checklist) {
213
+ this.buildingInspection.checklist.inspectionResultStatus = inspectionResultStatus;
214
+ }
215
+ this.requestUpdate();
216
+ }
217
+ _onInspectionTypeChange(e) {
218
+ var _a;
219
+ const { inspectionResultType } = e.detail;
220
+ // checklist 업데이트 (레퍼런스 유지)
221
+ if ((_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.checklist) {
222
+ this.buildingInspection.checklist.inspectionResultType = inspectionResultType;
223
+ }
224
+ this.requestUpdate();
225
+ }
226
+ _onInstructionsChange(e) {
227
+ var _a;
228
+ const { inspectionResultMemo } = e.detail;
229
+ // checklist 업데이트 (레퍼런스 유지)
230
+ if ((_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.checklist) {
231
+ this.buildingInspection.checklist.inspectionResultMemo = inspectionResultMemo;
232
+ }
233
+ this.requestUpdate();
234
+ }
235
+ // 실명부 파일 업로드
236
+ async _uploadNameListFile(checklist) {
237
+ var _a;
238
+ if (!checklist.isNameListAttachmentUploaded || !checklist.nameListAttachment) {
239
+ return;
240
+ }
241
+ const response = await client.mutate({
242
+ mutation: gql `
243
+ mutation CreateAttachments($attachments: [NewAttachment!]!) {
244
+ createAttachments(attachments: $attachments) {
245
+ id
246
+ }
247
+ }
248
+ `,
249
+ variables: {
250
+ attachments: [
251
+ {
252
+ file: checklist.nameListAttachment,
253
+ refBy: checklist.id,
254
+ refType: 'Checklist_NameList'
255
+ }
256
+ ]
257
+ },
258
+ context: { hasUpload: true }
259
+ });
260
+ if (response.errors) {
261
+ throw new Error(((_a = response.errors[0]) === null || _a === void 0 ? void 0 : _a.message) || '실명부 파일 업로드에 실패했습니다.');
204
262
  }
205
263
  }
206
264
  };
@@ -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,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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,CAAC;YACrB,MAAM,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAA;YACvC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAA;QACzD,CAAC;aAAM,CAAC;YACN,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;QAC7F,CAAC;IACH,CAAC;;AAzOM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,AArCY,CAqCZ;AAEQ;IAAR,KAAK,EAAE;;kEAAkB;AACjB;IAAR,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CA2O7C","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'\n\nimport { verifyBiometric } from '@things-factory/auth-base/dist-client'\n\nimport './component/building-inspection-detail-header'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\nimport { BuildingInspectionStatus } from './building-inspection-list'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n new Date(),\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button\n ?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}\n @click=${this._onClickModifyChecklist}\n >\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n buildingInspection {\n status\n }\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n checklistItemCommentCount\n checklistItemAttachmentCount\n }\n }\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n overallConstructorEmails\n taskConstructorEmails\n overallSupervisoryEmails\n taskSupervisoryEmails\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n try {\n const result = await verifyBiometric()\n if (result.verified) {\n console.log('Verification successful. Proceeding with sensitive action.')\n } else {\n notify({ message: 'Verification failed:' + result.message })\n return\n }\n } catch (error) {\n notify({ message: 'Error during biometric verification:' + error })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측 요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n}\n"]}
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,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AAEvE,OAAO,+CAA+C,CAAA;AACtD,OAAO,6DAA6D,CA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,oBAAoB,CAAA;QAC/E,CAAC;QACD,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC;IAED,aAAa;IACL,KAAK,CAAC,mBAAmB,CAAC,SAAc;;QAC9C,IAAI,CAAC,SAAS,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC;YAC7E,OAAM;QACR,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;;;OAMZ;YACD,SAAS,EAAE;gBACT,WAAW,EAAE;oBACX;wBACE,IAAI,EAAE,SAAS,CAAC,kBAAkB;wBAClC,KAAK,EAAE,SAAS,CAAC,EAAE;wBACnB,OAAO,EAAE,oBAAoB;qBAC9B;iBACF;aACF;YACD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;SAC7B,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,CAAA,MAAA,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,0CAAE,OAAO,KAAI,qBAAqB,CAAC,CAAA;QACvE,CAAC;IACH,CAAC;;AA3SM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,AArCY,CAqCZ;AAEQ;IAAR,KAAK,EAAE;;kEAAkB;AACjB;IAAR,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CA6S7C","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, openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport gql from 'graphql-tag'\n\nimport { verifyBiometric } from '@things-factory/auth-base/dist-client'\n\nimport './component/building-inspection-detail-header'\nimport './component/inspection-document/inspection-request-document'\nimport './component/inspection-document/inspection-result-notification'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\nimport { BuildingInspectionStatus } from './building-inspection-list'\nimport { getBuildingInspectionForChecklist } from '../../graphql/building-inspection'\nimport { InspectionMode } from './component/inspection-document/inspection-request-document'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n new Date(),\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n .projectType=${this.project.projectType}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button\n ?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}\n @click=${this._onClickModifyChecklist}\n >\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n this.buildingInspection = await getBuildingInspectionForChecklist(buildingInspectionId)\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 projectType\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 // 사용자 권한 체크\n const email = (store.getState() as any).auth?.user?.email\n const isOverallConstructor =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallConstructorEmails?.includes(email) || false\n const isOverallSupervisory =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallSupervisoryEmails?.includes(email) || false\n\n // 권한에 따라 적절한 문서 표시\n if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_WAIT && isOverallConstructor) {\n await this._showInspectionRequestDocument(checklist)\n } else if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_REQUEST && isOverallSupervisory) {\n await this._showInspectionResultNotification(checklist)\n }\n\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 // 실명부 파일 업로드 처리 (새로 업로드된 경우만)\n if (checklist.isNameListAttachmentUploaded) {\n await this._uploadNameListFile(checklist)\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 inspectionRequestMemo: checklist.inspectionRequestMemo,\n inspectionResultMemo: checklist.inspectionResultMemo,\n inspectionResultStatus: checklist.inspectionResultStatus,\n inspectionResultType: checklist.inspectionResultType\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 // resolve 호출 전까지 싱크를 위해 Promise 사용\n private async _showInspectionRequestDocument(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-request-document\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}\n @inspection-memo-change=${this._onInspectionMemoChange.bind(this)}\n @name-list-file-selected=${(e: CustomEvent) => {\n // checklist에 선택된 파일 저장\n checklist.nameListAttachment = e.detail.file\n checklist.isNameListAttachmentUploaded = true\n }}\n @popup-close=${() => resolve()}\n ></inspection-request-document>\n `,\n { backdrop: true, size: 'large', title: '검측요청결과 통보내용' }\n )\n })\n }\n\n private async _showInspectionResultNotification(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-result-notification\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .project=${this.project}\n .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}\n @inspection-result-change=${this._onInspectionResultChange.bind(this)}\n @inspection-type-change=${this._onInspectionTypeChange.bind(this)}\n @instructions-change=${this._onInstructionsChange.bind(this)}\n @popup-close=${() => resolve()}\n ></inspection-result-notification>\n `,\n { backdrop: true, size: 'large', title: '검측 결과 통보' }\n )\n })\n }\n\n private _onInspectionMemoChange(e: CustomEvent) {\n const { inspectionRequestMemo } = e.detail\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionRequestMemo = inspectionRequestMemo\n }\n this.requestUpdate()\n }\n\n private _onInspectionResultChange(e: CustomEvent) {\n const { inspectionResultStatus } = e.detail\n // checklist 업데이트 (레퍼런스 유지하여 호출부 인자에도 반영)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultStatus = inspectionResultStatus\n }\n this.requestUpdate()\n }\n\n private _onInspectionTypeChange(e: CustomEvent) {\n const { inspectionResultType } = e.detail\n // checklist 업데이트 (레퍼런스 유지)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultType = inspectionResultType\n }\n this.requestUpdate()\n }\n\n private _onInstructionsChange(e: CustomEvent) {\n const { inspectionResultMemo } = e.detail\n // checklist 업데이트 (레퍼런스 유지)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultMemo = inspectionResultMemo\n }\n this.requestUpdate()\n }\n\n // 실명부 파일 업로드\n private async _uploadNameListFile(checklist: any) {\n if (!checklist.isNameListAttachmentUploaded || !checklist.nameListAttachment) {\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateAttachments($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n }\n }\n `,\n variables: {\n attachments: [\n {\n file: checklist.nameListAttachment,\n refBy: checklist.id,\n refType: 'Checklist_NameList'\n }\n ]\n },\n context: { hasUpload: true }\n })\n\n if (response.errors) {\n throw new Error(response.errors[0]?.message || '실명부 파일 업로드에 실패했습니다.')\n }\n }\n}\n"]}
@@ -31,5 +31,6 @@ export declare class BuildingInspectionDetailDrawing extends BuildingInspectionD
31
31
  initBuildingInspection(buildingInspectionId?: string): Promise<void>;
32
32
  private _getProjectByBuildingComplexId;
33
33
  private onClickMarkerSave;
34
+ private parseBoxCoordinates;
34
35
  }
35
36
  export {};
@@ -56,20 +56,37 @@ let BuildingInspectionDetailDrawing = class BuildingInspectionDetailDrawing exte
56
56
  body
57
57
  @link-clicked=${async (e) => {
58
58
  const { link } = e.detail;
59
- const { id, type, symbol, box, dwgId } = JSON.parse(link);
60
- const [x, y, width, height] = (box === null || box === void 0 ? void 0 : box.split(',').map(Number)) || [];
59
+ const { id, type, symbol, box, dwgId } = JSON.parse(link) || {};
60
+ // 좌표 파싱 유효성 검증
61
+ const coordinates = this.parseBoxCoordinates(box, {
62
+ id,
63
+ type,
64
+ symbol,
65
+ dwgId,
66
+ currentPdfId: this.linkUrl || 'unknown',
67
+ buildingInspectionId: this.buildingInspectionId
68
+ });
61
69
  this.linkUrl = `DWGID:${dwgId}`;
62
- this.linkShapes = [
63
- {
64
- id: id,
65
- type: 'link',
66
- x,
67
- y,
68
- width,
69
- height,
70
- link: '{}'
71
- }
72
- ];
70
+ // 유효한 좌표가 있으면 마커 표시, 없으면 빈 배열
71
+ if (coordinates) {
72
+ this.linkShapes = [
73
+ Object.assign(Object.assign({ id: id || 'unknown', type: 'link' }, coordinates), { link: JSON.stringify({ id, type, symbol, dwgId }) })
74
+ ];
75
+ }
76
+ else {
77
+ // 좌표가 유효하지 않아도 팝업은 열고 마커만 숨김
78
+ this.linkShapes = [];
79
+ console.warn('Invalid link coordinates, popup will open without marker:', {
80
+ box,
81
+ id,
82
+ type,
83
+ symbol,
84
+ dwgId,
85
+ currentPdfId: this.linkUrl || 'unknown',
86
+ buildingInspectionId: this.buildingInspectionId,
87
+ fullLink: link
88
+ });
89
+ }
73
90
  if (this.dialog) {
74
91
  this.dialog.showModal();
75
92
  requestAnimationFrame(() => {
@@ -203,7 +220,7 @@ let BuildingInspectionDetailDrawing = class BuildingInspectionDetailDrawing exte
203
220
  async onClickMarkerSave(e) {
204
221
  const response = await client.query({
205
222
  query: gql `
206
- mutation UpdateBuildingInspection($patch: UpdateBuildingInspectionDrawingMarker!) {
223
+ mutation UpdateBuildingInspection($patch: UpdateBuildingInspection!) {
207
224
  updateBuildingInspection(patch: $patch) {
208
225
  id
209
226
  drawingMarker
@@ -221,6 +238,52 @@ let BuildingInspectionDetailDrawing = class BuildingInspectionDetailDrawing exte
221
238
  return;
222
239
  notify({ message: '저장되었습니다.' });
223
240
  }
241
+ parseBoxCoordinates(box, context = {}) {
242
+ if (!box || typeof box !== 'string') {
243
+ console.warn('Invalid box coordinate for link:', {
244
+ box,
245
+ context,
246
+ reason: 'Box is undefined, null, or not a string'
247
+ });
248
+ return null;
249
+ }
250
+ try {
251
+ const coords = box.split(',').map(str => {
252
+ const num = Number(str.trim());
253
+ return Number.isFinite(num) ? num : NaN;
254
+ });
255
+ if (coords.length !== 4 || coords.some(coord => isNaN(coord))) {
256
+ console.warn('Box coordinate should have 4 valid numbers:', {
257
+ box,
258
+ parsedCoords: coords,
259
+ context,
260
+ reason: `Expected 4 numbers, got ${coords.length} values with NaN: ${coords.some(coord => isNaN(coord))}`
261
+ });
262
+ return null;
263
+ }
264
+ const [x, y, width, height] = coords;
265
+ // width, height가 0 이하면 유효하지 않음
266
+ if (width <= 0 || height <= 0) {
267
+ console.warn('Invalid width or height for link:', {
268
+ box,
269
+ coords: { x, y, width, height },
270
+ context,
271
+ reason: `Width (${width}) or height (${height}) is <= 0`
272
+ });
273
+ return null;
274
+ }
275
+ return { x, y, width, height };
276
+ }
277
+ catch (error) {
278
+ console.warn('Error parsing box coordinates:', {
279
+ box,
280
+ context,
281
+ error: error instanceof Error ? error.message : String(error),
282
+ reason: 'Exception thrown during parsing'
283
+ });
284
+ return null;
285
+ }
286
+ }
224
287
  };
225
288
  BuildingInspectionDetailDrawing.styles = [
226
289
  ScrollbarStyles,