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

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