@dssp/supervision 1.0.0-alpha.1 → 1.0.0-alpha.16

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