@dssp/project 1.0.0-alpha.8 → 1.0.0-alpha.81

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