@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,740 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/icon/icon.js';
3
+ import '@operato/data-grist/ox-grist.js';
4
+ import gql from 'graphql-tag';
5
+ import { css, html, LitElement } from 'lit';
6
+ import { customElement, property, query, state } from 'lit/decorators.js';
7
+ import { DataGrist } from '@operato/data-grist/ox-grist.js';
8
+ import { client } from '@operato/graphql';
9
+ import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
10
+ import { notify } from '@operato/layout';
11
+ import { BuildingInspectionStatus, CHECKLIST_MAIN_TYPE_LIST } from '../../building-inspection/building-inspection-list';
12
+ let GridInspectionCreatePopup = class GridInspectionCreatePopup extends LitElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.projectId = '';
16
+ this.checklistTemplateId = '';
17
+ this.selectedBuildingId = '';
18
+ this.selectedBuildingLevelId = '';
19
+ this.cell = '';
20
+ this.buildings = [];
21
+ this.selectedBuilding = {};
22
+ this.selectedLevel = {};
23
+ this.constructionTypes = [];
24
+ this.selectedConstructionType = {};
25
+ this.selectedConstructionDetailType = {};
26
+ this.managers = [];
27
+ this.selectedManager = {};
28
+ this.checklistTemplates = [];
29
+ this.checklist = {};
30
+ this.activeTab = 'edit';
31
+ }
32
+ render() {
33
+ var _a, _b, _c, _d, _e, _f, _g, _h;
34
+ return html `
35
+ <div body>
36
+ <div tab-container ?inactive=${this.activeTab !== 'edit'} edit>
37
+ <div detail>
38
+ <h3>세부 정보</h3>
39
+
40
+ <div data-row>
41
+ <label>공종</label>
42
+ <md-filled-select constructionType @change=${this._onSelectConstructionType}>
43
+ ${(_a = this.constructionTypes) === null || _a === void 0 ? void 0 : _a.map(constructionType => {
44
+ var _a;
45
+ const selected = constructionType.id === ((_a = this.selectedConstructionType) === null || _a === void 0 ? void 0 : _a.id);
46
+ return html `<md-select-option ?selected=${selected} .value=${constructionType.id}>
47
+ <div slot="headline">${constructionType.name}</div>
48
+ </md-select-option>`;
49
+ })}
50
+ </md-filled-select>
51
+
52
+ <div partition></div>
53
+
54
+ <label>세부 공종</label>
55
+ <md-filled-select constructionDetailType @change=${this._onSelectConstructionDetailType}>
56
+ ${(_c = (_b = this.selectedConstructionType) === null || _b === void 0 ? void 0 : _b.constructionDetailTypes) === null || _c === void 0 ? void 0 : _c.map(constructionDetailType => {
57
+ const selected = constructionDetailType.id === this.selectedConstructionDetailType.id;
58
+ return html `<md-select-option ?selected=${selected} .value=${constructionDetailType.id}>
59
+ <div slot="headline">${constructionDetailType.name}</div>
60
+ </md-select-option>`;
61
+ })}
62
+ </md-filled-select>
63
+ </div>
64
+
65
+ <div data-row>
66
+ <label>동</label>
67
+ <md-filled-text-field building name="buildingName" type="text" .value=${((_d = this.selectedBuilding) === null || _d === void 0 ? void 0 : _d.name) || ''} disabled>
68
+ </md-filled-text-field>
69
+
70
+ <div partition></div>
71
+
72
+ <label>층</label>
73
+ <md-filled-text-field
74
+ level
75
+ name="buildingLevelName"
76
+ type="text"
77
+ .value=${((_e = this.selectedLevel) === null || _e === void 0 ? void 0 : _e.floorDisplayName) || ''}
78
+ disabled
79
+ >
80
+ </md-filled-text-field>
81
+ </div>
82
+ </div>
83
+
84
+ <div checklist>
85
+ <h3>체크리스트</h3>
86
+
87
+ <div data-row>
88
+ <label>이름</label>
89
+ <md-filled-text-field
90
+ name="checklistName"
91
+ type="text"
92
+ .value=${((_f = this.checklist) === null || _f === void 0 ? void 0 : _f.name) || ''}
93
+ @input=${this._onInputChange}
94
+ >
95
+ </md-filled-text-field>
96
+
97
+ <div partition></div>
98
+
99
+ <label>템플릿</label>
100
+ <md-filled-select checklistTemplate @change=${this._onSelectChecklistTemplate}>
101
+ <md-select-option></md-select-option>
102
+ ${(_g = this.checklistTemplates) === null || _g === void 0 ? void 0 : _g.map((checklistTemplate, idx) => {
103
+ return html ` <md-select-option .value=${checklistTemplate.id}>
104
+ <div slot="headline">${checklistTemplate.name}</div>
105
+ </md-select-option>`;
106
+ })}
107
+ </md-filled-select>
108
+ </div>
109
+ </div>
110
+
111
+ <div manager>
112
+ <h3>담당자</h3>
113
+
114
+ <div data-row>
115
+ <label>담당자</label>
116
+ <md-filled-select manager @change=${this._onSelectManager}>
117
+ <md-select-option></md-select-option>
118
+ ${(_h = this.managers) === null || _h === void 0 ? void 0 : _h.map((manager, idx) => {
119
+ return html ` <md-select-option .value=${manager.userId}>
120
+ <div slot="headline">${manager.name}</div>
121
+ </md-select-option>`;
122
+ })}
123
+ </md-filled-select>
124
+ </div>
125
+ </div>
126
+
127
+ <ox-grist
128
+ .mode=${'GRID'}
129
+ .config=${this.gristConfig}
130
+ .fetchHandler=${this.fetchHandler.bind(this)}
131
+ @field-change=${this.onChangeGird}
132
+ >
133
+ </ox-grist>
134
+ </div>
135
+
136
+ <div tab-container ?inactive=${this.activeTab !== 'preview'} preview>
137
+ <checklist-view
138
+ .mode=${"VIEWER" /* ChecklistMode.VIEWER */}
139
+ .checklist=${this.checklist}
140
+ .manager=${this.selectedManager || {}}
141
+ .projectType=${"DSSP" /* ProjectType.DSSP */}
142
+ ></checklist-view>
143
+ </div>
144
+ </div>
145
+
146
+ <div tabs>
147
+ <button ?active=${this.activeTab === 'edit'} @click=${() => (this.activeTab = 'edit')}>검측 요청 정보</button>
148
+ <button ?active=${this.activeTab === 'preview'} @click=${() => (this.activeTab = 'preview')}>미리보기</button>
149
+ </div>
150
+
151
+ <div button-container>
152
+ <md-elevated-button blue @click=${this._createInspection}>
153
+ <md-icon slot="icon">task</md-icon>검측 요청서 등록
154
+ </md-elevated-button>
155
+ <md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소</md-elevated-button>
156
+ </div>
157
+ `;
158
+ }
159
+ updated() {
160
+ var _a, _b;
161
+ const ratio = Math.round((((_a = this.checklistViewContainer) === null || _a === void 0 ? void 0 : _a.offsetWidth) / ((_b = this.checklistView) === null || _b === void 0 ? void 0 : _b.offsetWidth)) * 100) / 100 || 1;
162
+ this.checklistView.style.transform = `scale(${ratio})`;
163
+ }
164
+ async firstUpdated() {
165
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
166
+ const response = await client.query({
167
+ query: gql `
168
+ query Project($id: String!) {
169
+ project(id: $id) {
170
+ id
171
+ name
172
+ documentNaming
173
+ buildingComplex {
174
+ id
175
+ buildings {
176
+ id
177
+ name
178
+ }
179
+ }
180
+ }
181
+
182
+ constructionTypes {
183
+ items {
184
+ name
185
+ id
186
+ }
187
+ }
188
+
189
+ checklistTemplates {
190
+ items {
191
+ id
192
+ name
193
+ }
194
+ }
195
+
196
+ checklistTypes {
197
+ items {
198
+ id
199
+ mainType
200
+ detailType
201
+ }
202
+ }
203
+
204
+ managers {
205
+ id
206
+ phone
207
+ position
208
+ userId
209
+ name
210
+ }
211
+ }
212
+ `,
213
+ variables: {
214
+ id: this.projectId
215
+ }
216
+ });
217
+ if (response.errors)
218
+ return;
219
+ const project = (_a = response.data) === null || _a === void 0 ? void 0 : _a.project;
220
+ const checklistTemplates = ((_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.checklistTemplates) === null || _c === void 0 ? void 0 : _c.items) || [];
221
+ const constructionTypes = ((_e = (_d = response.data) === null || _d === void 0 ? void 0 : _d.constructionTypes) === null || _e === void 0 ? void 0 : _e.items) || [];
222
+ this.managers = (_f = response.data) === null || _f === void 0 ? void 0 : _f.managers;
223
+ this.checklistDetailTypes = (_h = (_g = response.data.checklistTypes) === null || _g === void 0 ? void 0 : _g.items) === null || _h === void 0 ? void 0 : _h.map(v => {
224
+ return {
225
+ display: v.detailType,
226
+ value: v.id,
227
+ mainType: v.mainType
228
+ };
229
+ });
230
+ this.constructionTypes = [...constructionTypes];
231
+ this.checklistTemplates = [...checklistTemplates];
232
+ this.buildings = [...(((_j = project === null || project === void 0 ? void 0 : project.buildingComplex) === null || _j === void 0 ? void 0 : _j.buildings) || [])];
233
+ // selectedBuildingId가 있으면 해당 빌딩 선택, 없으면 첫번째 빌딩 선택
234
+ this.selectedBuilding = this.buildings.find(building => building.id == this.selectedBuildingId);
235
+ this.selectedBuilding = await this._getBuilding(this.selectedBuilding.id);
236
+ this.selectedConstructionType = constructionTypes === null || constructionTypes === void 0 ? void 0 : constructionTypes[0];
237
+ // selectedBuildingLevelId가 있으면 선택된 층, 없으면 첫번째 층 선택
238
+ this.selectedLevel = (_l = (_k = this.selectedBuilding) === null || _k === void 0 ? void 0 : _k.buildingLevels) === null || _l === void 0 ? void 0 : _l.find(level => level.id == this.selectedBuildingLevelId);
239
+ // 세부 공종 리스트 가져오기
240
+ this.selectedConstructionType = await this._getConstructionType(this.selectedConstructionType.id);
241
+ this.selectedConstructionDetailType = (_o = (_m = this.selectedConstructionType) === null || _m === void 0 ? void 0 : _m.constructionDetailTypes) === null || _o === void 0 ? void 0 : _o[0];
242
+ this.selectedConstructionType = await Object.assign({}, this.selectedConstructionType);
243
+ // 기본 값 셋팅 select
244
+ await this.htmlSelectChecklistTemplate.selectIndex(0);
245
+ await this.htmlSelectConstructionDetailType.selectIndex(0);
246
+ this.checklist = {
247
+ constructionType: (_p = this.selectedConstructionType) === null || _p === void 0 ? void 0 : _p.name,
248
+ constructionDetailType: (_q = this.selectedConstructionDetailType) === null || _q === void 0 ? void 0 : _q.name,
249
+ location: `${((_r = this.selectedBuilding) === null || _r === void 0 ? void 0 : _r.name) || ''} ${this.selectedLevel.floorDisplayName || ''}층`,
250
+ documentNo: `${project.documentNaming} 검측 제01-00000호`,
251
+ buildingInspection: {
252
+ status: BuildingInspectionStatus.WAIT
253
+ }
254
+ };
255
+ // 그리드 셋팅
256
+ this.setGristConfig();
257
+ }
258
+ requestRefresh(buildingInspectionId = '') {
259
+ this.dispatchEvent(new CustomEvent('requestRefresh', { detail: { buildingInspectionId } }));
260
+ }
261
+ _close() {
262
+ history.back();
263
+ }
264
+ setGristConfig() {
265
+ this.gristConfig = {
266
+ columns: [
267
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
268
+ {
269
+ type: 'gutter',
270
+ gutterName: 'button',
271
+ icon: 'arrow_upward',
272
+ handlers: {
273
+ click: 'move-up'
274
+ }
275
+ },
276
+ {
277
+ type: 'gutter',
278
+ gutterName: 'button',
279
+ icon: 'arrow_downward',
280
+ handlers: {
281
+ click: 'move-down'
282
+ }
283
+ },
284
+ {
285
+ type: 'select',
286
+ name: 'mainType',
287
+ header: '구분',
288
+ record: {
289
+ editable: true,
290
+ options: [{ display: '', value: '' }].concat(Object.keys(CHECKLIST_MAIN_TYPE_LIST).map(key => ({ display: CHECKLIST_MAIN_TYPE_LIST[key], value: key })))
291
+ },
292
+ width: 100
293
+ },
294
+ {
295
+ type: 'select',
296
+ name: 'detailType',
297
+ header: '상세 구분',
298
+ record: {
299
+ editable: true,
300
+ options: (columns, data, column) => [
301
+ { display: '', value: '' },
302
+ ...this.checklistDetailTypes.filter(v => v.mainType == column.mainType)
303
+ ]
304
+ },
305
+ width: 200
306
+ },
307
+ {
308
+ type: 'string',
309
+ name: 'name',
310
+ header: '검사 항목',
311
+ record: {
312
+ editable: true
313
+ },
314
+ width: 200
315
+ },
316
+ {
317
+ type: 'string',
318
+ name: 'inspctionCriteria',
319
+ header: '검사 기준',
320
+ record: {
321
+ editable: true
322
+ },
323
+ width: 200
324
+ }
325
+ ],
326
+ pagination: {
327
+ infinite: true
328
+ },
329
+ sorters: [{ name: 'mainType' }, { name: 'sequence' }]
330
+ };
331
+ }
332
+ async fetchHandler() {
333
+ if (!this.checklistTemplateId)
334
+ return [];
335
+ const response = await client.query({
336
+ query: gql `
337
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
338
+ checklistTemplateItems(filters: $filters, pagination: $pagination, sortings: $sortings) {
339
+ items {
340
+ id
341
+ sequence
342
+ name
343
+ inspctionCriteria
344
+ mainType
345
+ detailType
346
+ }
347
+ }
348
+ }
349
+ `,
350
+ variables: {
351
+ filters: {
352
+ name: 'checklistTemplateId',
353
+ value: this.checklistTemplateId,
354
+ operator: 'eq'
355
+ },
356
+ sortings: [{ name: 'mainType' }, { name: 'sequence' }]
357
+ }
358
+ });
359
+ // 체크리스트 아이템 데이터 갱신
360
+ this.onChangeGird();
361
+ return {
362
+ records: response.data.checklistTemplateItems.items || []
363
+ };
364
+ }
365
+ async _getBuilding(buildingId = '') {
366
+ var _a;
367
+ const response = await client.query({
368
+ query: gql `
369
+ query Building($id: String!) {
370
+ building(id: $id) {
371
+ id
372
+ name
373
+ buildingLevels {
374
+ id
375
+ floor
376
+ floorDisplayName
377
+ mainDrawing {
378
+ id
379
+ name
380
+ fullpath
381
+ }
382
+ mainDrawingImage
383
+ }
384
+ }
385
+ }
386
+ `,
387
+ variables: {
388
+ id: buildingId
389
+ }
390
+ });
391
+ if (response.errors)
392
+ return;
393
+ return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.building) || {};
394
+ }
395
+ _onSelectChecklistTemplate(e) {
396
+ const checklistTemplateId = e.target.value;
397
+ // 체크 리스트 이름 셋팅
398
+ this.checklist = Object.assign(Object.assign({}, this.checklist), { name: e.target.displayText });
399
+ // 그리드 아이템 셋팅
400
+ if (checklistTemplateId) {
401
+ this.checklistTemplateId = checklistTemplateId;
402
+ this.grist.fetch();
403
+ }
404
+ }
405
+ _onSelectManager(e) {
406
+ const managerId = e.target.value;
407
+ this.selectedManager = this.managers.find(manager => manager.userId == managerId);
408
+ }
409
+ async _createInspection() {
410
+ var _a, _b, _c;
411
+ let patch = {};
412
+ patch.buildingLevelId = this.selectedLevel.id;
413
+ patch.managerId = this.selectedManager.userId;
414
+ patch.checklist = {
415
+ name: this.checklist.name,
416
+ constructionType: this.htmlSelectConstructionType.displayText,
417
+ constructionDetailType: this.htmlSelectConstructionDetailType.displayText,
418
+ location: `${this.selectedBuilding.name} ${this.selectedLevel.floorDisplayName}층`,
419
+ inspectionParts: this.checklist.inspectionParts
420
+ };
421
+ patch.checklistItem = (_a = this.checklist.checklistItems) === null || _a === void 0 ? void 0 : _a.map(item => {
422
+ return {
423
+ name: item.name,
424
+ mainType: item.mainType,
425
+ detailType: item.detailType,
426
+ inspctionCriteria: item.inspctionCriteria
427
+ };
428
+ });
429
+ const [cellX, cellY] = this.cell.split(',');
430
+ patch.cellX = Number(cellX);
431
+ patch.cellY = Number(cellY);
432
+ const response = await client.mutate({
433
+ mutation: gql `
434
+ mutation CreateBuildingInspection($patch: NewBuildingInspection!) {
435
+ createBuildingInspection(patch: $patch) {
436
+ id
437
+ }
438
+ }
439
+ `,
440
+ variables: {
441
+ patch
442
+ }
443
+ });
444
+ if (!response.errors) {
445
+ notify({ message: '검측 요청서를 등록하였습니다.' });
446
+ this.requestRefresh(response.data.createBuildingInspection.id);
447
+ this._close();
448
+ }
449
+ else {
450
+ notify({ message: ((_c = (_b = response.errors) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.message) || '검측 요청서 등록에 실패하였습니다.', level: 'error' });
451
+ }
452
+ }
453
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
454
+ _onInputChange(event) {
455
+ const target = event.target;
456
+ this[target.name] = target.value;
457
+ this.checklist = Object.assign(Object.assign({}, this.checklist), { name: target.value });
458
+ }
459
+ // 체크리스트 아이템 데이터 갱신
460
+ onChangeGird() {
461
+ const checklistDetailTypes = Object.fromEntries(this.checklistDetailTypes.map(item => [item.value, item.display]));
462
+ const grist = this.grist;
463
+ // grist field-change가 오는 시점이 데이터 변경 전이라 setTimeout으로 변경
464
+ setTimeout(() => {
465
+ this.checklist.checklistItems = grist.dirtyData.records.map((row, idx) => {
466
+ return Object.assign(Object.assign({}, row), { detailType: checklistDetailTypes[row.detailType], sequence: idx });
467
+ });
468
+ this.checklist = Object.assign({}, this.checklist);
469
+ }, 100);
470
+ }
471
+ async _onSelectConstructionType(e) {
472
+ var _a, _b, _c, _d;
473
+ const constructionTypeId = e.target.value;
474
+ this.selectedConstructionType = await this._getConstructionType(constructionTypeId);
475
+ this.selectedConstructionDetailType = await Object.assign({}, (_b = (_a = this.selectedConstructionType) === null || _a === void 0 ? void 0 : _a.constructionDetailTypes) === null || _b === void 0 ? void 0 : _b[0]);
476
+ this.checklist = Object.assign(Object.assign({}, this.checklist), { constructionType: (_c = this.selectedConstructionType) === null || _c === void 0 ? void 0 : _c.name, constructionDetailType: (_d = this.selectedConstructionDetailType) === null || _d === void 0 ? void 0 : _d.name });
477
+ await this.htmlSelectConstructionDetailType.selectIndex(0);
478
+ }
479
+ _onSelectConstructionDetailType(e) {
480
+ var _a, _b, _c, _d;
481
+ const constructionDetailTypeId = e.target.value;
482
+ this.selectedConstructionDetailType = Object.assign({}, (((_b = (_a = this.selectedConstructionType) === null || _a === void 0 ? void 0 : _a.constructionDetailTypes) === null || _b === void 0 ? void 0 : _b.find(v => v.id == constructionDetailTypeId)) || {}));
483
+ this.checklist = Object.assign(Object.assign({}, this.checklist), { constructionType: (_c = this.selectedConstructionType) === null || _c === void 0 ? void 0 : _c.name, constructionDetailType: (_d = this.selectedConstructionDetailType) === null || _d === void 0 ? void 0 : _d.name });
484
+ }
485
+ async _getConstructionType(id = '') {
486
+ var _a;
487
+ const response = await client.query({
488
+ query: gql `
489
+ query ConstructionType($id: String!) {
490
+ constructionType(id: $id) {
491
+ id
492
+ name
493
+ description
494
+ constructionDetailTypes {
495
+ id
496
+ name
497
+ }
498
+ }
499
+ }
500
+ `,
501
+ variables: { id }
502
+ });
503
+ if (response.errors)
504
+ return;
505
+ return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.constructionType) || {};
506
+ }
507
+ };
508
+ GridInspectionCreatePopup.styles = [
509
+ ButtonContainerStyles,
510
+ ScrollbarStyles,
511
+ css `
512
+ :host {
513
+ display: flex;
514
+ flex-direction: column;
515
+ padding: 15px 20px;
516
+
517
+ background-color: var(--md-sys-color-surface);
518
+ }
519
+
520
+ md-filled-select {
521
+ width: auto;
522
+ min-width: 150px;
523
+ --md-filled-select-text-field-container-color: transparent;
524
+ --md-filled-select-text-field-active-indicator-color: #999;
525
+ --md-filled-select-text-field-input-text-size: 14px;
526
+ --md-filled-select-text-field-input-text-weight: bold;
527
+ --md-filled-select-text-field-input-text-line-height: 6px;
528
+ }
529
+ md-filled-select[level] {
530
+ min-width: 110px;
531
+ margin-left: 20px;
532
+ }
533
+
534
+ checklist-view {
535
+ pointer-events: none;
536
+ transform-origin: top left;
537
+ }
538
+
539
+ div[body] {
540
+ height: 100%;
541
+ overflow-y: auto;
542
+
543
+ div[tab-container][inactive] {
544
+ display: none !important;
545
+ }
546
+
547
+ div[edit] {
548
+ width: 100%;
549
+
550
+ div[detail] {
551
+ margin-bottom: 30px;
552
+ }
553
+
554
+ h3 {
555
+ position: relative;
556
+ color: #0595e5;
557
+ font-size: 17px;
558
+ font-weight: 700;
559
+ background-color: var(--md-sys-color-surface);
560
+ margin-top: 0;
561
+ margin-bottom: 5px;
562
+ }
563
+
564
+ div[data-row] {
565
+ display: grid;
566
+ grid-template-columns: 100px 1fr 0.3fr 100px 1fr;
567
+ gap: 15px;
568
+ margin-bottom: 11px;
569
+
570
+ & > label {
571
+ display: flex;
572
+ justify-content: flex-end;
573
+ align-items: center;
574
+ font-size: 15px;
575
+ }
576
+
577
+ div[inspection-parts] {
578
+ display: block;
579
+ margin-top: 7px;
580
+
581
+ & > span {
582
+ display: inline-block;
583
+ margin-right: 5px;
584
+ margin-bottom: 5px;
585
+
586
+ & > md-checkbox {
587
+ margin-top: 2px;
588
+ }
589
+ }
590
+ }
591
+ }
592
+ }
593
+
594
+ div[preview] {
595
+ display: flex;
596
+ overflow-y: auto;
597
+ overflow-x: hidden;
598
+ }
599
+ }
600
+
601
+ div[tabs] {
602
+ display: flex;
603
+
604
+ button {
605
+ background-color: #fff;
606
+ padding: 6px 14px;
607
+ color: #999;
608
+ border: solid 1px #999;
609
+ border-top: none;
610
+ border-radius: 0px 0px 8px 8px;
611
+ margin-right: -2px;
612
+ cursor: pointer;
613
+
614
+ &[active] {
615
+ color: var(--button-color, var(--md-sys-color-on-secondary-container));
616
+ font-weight: 600;
617
+ }
618
+ }
619
+ }
620
+
621
+ div[button-container] {
622
+ display: flex;
623
+ justify-content: flex-end;
624
+ gap: 10px;
625
+
626
+ md-elevated-button[blue] {
627
+ --md-elevated-button-container-color: #0595e5;
628
+
629
+ --md-elevated-button-label-text-color: #fff;
630
+ --md-elevated-button-hover-label-text-color: #fff;
631
+ --md-elevated-button-pressed-label-text-color: #fff;
632
+ --md-elevated-button-focus-label-text-color: #fff;
633
+ --md-elevated-button-icon-color: #fff;
634
+ --md-elevated-button-hover-icon-color: #fff;
635
+ --md-elevated-button-pressed-icon-color: #fff;
636
+ --md-elevated-button-focus-icon-color: #fff;
637
+ }
638
+ }
639
+ `
640
+ ];
641
+ __decorate([
642
+ property({ type: Object }),
643
+ __metadata("design:type", Object)
644
+ ], GridInspectionCreatePopup.prototype, "gristConfig", void 0);
645
+ __decorate([
646
+ property({ type: Object }),
647
+ __metadata("design:type", Object)
648
+ ], GridInspectionCreatePopup.prototype, "checklistDetailTypes", void 0);
649
+ __decorate([
650
+ property({ type: String }),
651
+ __metadata("design:type", String)
652
+ ], GridInspectionCreatePopup.prototype, "projectId", void 0);
653
+ __decorate([
654
+ property({ type: String }),
655
+ __metadata("design:type", String)
656
+ ], GridInspectionCreatePopup.prototype, "checklistTemplateId", void 0);
657
+ __decorate([
658
+ property({ type: String }),
659
+ __metadata("design:type", String)
660
+ ], GridInspectionCreatePopup.prototype, "selectedBuildingId", void 0);
661
+ __decorate([
662
+ property({ type: String }),
663
+ __metadata("design:type", String)
664
+ ], GridInspectionCreatePopup.prototype, "selectedBuildingLevelId", void 0);
665
+ __decorate([
666
+ property({ type: String }),
667
+ __metadata("design:type", String)
668
+ ], GridInspectionCreatePopup.prototype, "cell", void 0);
669
+ __decorate([
670
+ state(),
671
+ __metadata("design:type", Object)
672
+ ], GridInspectionCreatePopup.prototype, "buildings", void 0);
673
+ __decorate([
674
+ state(),
675
+ __metadata("design:type", Object)
676
+ ], GridInspectionCreatePopup.prototype, "selectedBuilding", void 0);
677
+ __decorate([
678
+ state(),
679
+ __metadata("design:type", Object)
680
+ ], GridInspectionCreatePopup.prototype, "selectedLevel", void 0);
681
+ __decorate([
682
+ state(),
683
+ __metadata("design:type", Object)
684
+ ], GridInspectionCreatePopup.prototype, "constructionTypes", void 0);
685
+ __decorate([
686
+ state(),
687
+ __metadata("design:type", Object)
688
+ ], GridInspectionCreatePopup.prototype, "selectedConstructionType", void 0);
689
+ __decorate([
690
+ state(),
691
+ __metadata("design:type", Object)
692
+ ], GridInspectionCreatePopup.prototype, "selectedConstructionDetailType", void 0);
693
+ __decorate([
694
+ state(),
695
+ __metadata("design:type", Object)
696
+ ], GridInspectionCreatePopup.prototype, "managers", void 0);
697
+ __decorate([
698
+ state(),
699
+ __metadata("design:type", Object)
700
+ ], GridInspectionCreatePopup.prototype, "selectedManager", void 0);
701
+ __decorate([
702
+ state(),
703
+ __metadata("design:type", Object)
704
+ ], GridInspectionCreatePopup.prototype, "checklistTemplates", void 0);
705
+ __decorate([
706
+ state(),
707
+ __metadata("design:type", Object)
708
+ ], GridInspectionCreatePopup.prototype, "checklist", void 0);
709
+ __decorate([
710
+ state(),
711
+ __metadata("design:type", String)
712
+ ], GridInspectionCreatePopup.prototype, "activeTab", void 0);
713
+ __decorate([
714
+ query('md-filled-select[checklistTemplate]'),
715
+ __metadata("design:type", Object)
716
+ ], GridInspectionCreatePopup.prototype, "htmlSelectChecklistTemplate", void 0);
717
+ __decorate([
718
+ query('md-filled-select[constructionType]'),
719
+ __metadata("design:type", Object)
720
+ ], GridInspectionCreatePopup.prototype, "htmlSelectConstructionType", void 0);
721
+ __decorate([
722
+ query('md-filled-select[constructionDetailType]'),
723
+ __metadata("design:type", Object)
724
+ ], GridInspectionCreatePopup.prototype, "htmlSelectConstructionDetailType", void 0);
725
+ __decorate([
726
+ query('ox-grist'),
727
+ __metadata("design:type", DataGrist)
728
+ ], GridInspectionCreatePopup.prototype, "grist", void 0);
729
+ __decorate([
730
+ query('div[preview]'),
731
+ __metadata("design:type", HTMLDivElement)
732
+ ], GridInspectionCreatePopup.prototype, "checklistViewContainer", void 0);
733
+ __decorate([
734
+ query('checklist-view'),
735
+ __metadata("design:type", HTMLElement)
736
+ ], GridInspectionCreatePopup.prototype, "checklistView", void 0);
737
+ GridInspectionCreatePopup = __decorate([
738
+ customElement('grid-inspection-create-popup')
739
+ ], GridInspectionCreatePopup);
740
+ //# sourceMappingURL=grid-inspection-create-popup.js.map