@dssp/project 0.0.2

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 (195) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/images/hatiolab-logo.png +0 -0
  3. package/assets/images/o-mark.png +0 -0
  4. package/assets/images/x-mark.png +0 -0
  5. package/client/bootstrap.ts +0 -0
  6. package/client/index.ts +0 -0
  7. package/client/pages/checklist/checklist-importer.ts +96 -0
  8. package/client/pages/checklist/checklist-list-page.ts +355 -0
  9. package/client/pages/lib/waether.ts +159 -0
  10. package/client/pages/project/ox-progress-circle.ts +133 -0
  11. package/client/pages/project/project-create-popup.ts +148 -0
  12. package/client/pages/project/project-detail.ts +618 -0
  13. package/client/pages/project/project-list.ts +354 -0
  14. package/client/pages/project/project-plan-management.ts +437 -0
  15. package/client/pages/project/project-schedule-list.ts +280 -0
  16. package/client/pages/project/project-schedule.ts +248 -0
  17. package/client/pages/project/project-setting-list.ts +298 -0
  18. package/client/pages/project/project-update.ts +797 -0
  19. package/client/pages/resource/resource-importer.ts +96 -0
  20. package/client/pages/resource/resource-list-page.ts +355 -0
  21. package/client/pages/task/task-importer.ts +96 -0
  22. package/client/pages/task/task-list-page.ts +355 -0
  23. package/client/route.ts +39 -0
  24. package/client/tsconfig.json +11 -0
  25. package/dist-client/bootstrap.d.ts +0 -0
  26. package/dist-client/bootstrap.js +2 -0
  27. package/dist-client/bootstrap.js.map +1 -0
  28. package/dist-client/index.d.ts +0 -0
  29. package/dist-client/index.js +2 -0
  30. package/dist-client/index.js.map +1 -0
  31. package/dist-client/pages/checklist/checklist-importer.d.ts +9 -0
  32. package/dist-client/pages/checklist/checklist-importer.js +100 -0
  33. package/dist-client/pages/checklist/checklist-importer.js.map +1 -0
  34. package/dist-client/pages/checklist/checklist-list-page.d.ts +62 -0
  35. package/dist-client/pages/checklist/checklist-list-page.js +331 -0
  36. package/dist-client/pages/checklist/checklist-list-page.js.map +1 -0
  37. package/dist-client/pages/lib/waether.d.ts +6 -0
  38. package/dist-client/pages/lib/waether.js +152 -0
  39. package/dist-client/pages/lib/waether.js.map +1 -0
  40. package/dist-client/pages/project/ox-progress-circle.d.ts +41 -0
  41. package/dist-client/pages/project/ox-progress-circle.js +182 -0
  42. package/dist-client/pages/project/ox-progress-circle.js.map +1 -0
  43. package/dist-client/pages/project/project-create-popup.d.ts +14 -0
  44. package/dist-client/pages/project/project-create-popup.js +153 -0
  45. package/dist-client/pages/project/project-create-popup.js.map +1 -0
  46. package/dist-client/pages/project/project-detail.d.ts +35 -0
  47. package/dist-client/pages/project/project-detail.js +617 -0
  48. package/dist-client/pages/project/project-detail.js.map +1 -0
  49. package/dist-client/pages/project/project-list.d.ts +88 -0
  50. package/dist-client/pages/project/project-list.js +303 -0
  51. package/dist-client/pages/project/project-list.js.map +1 -0
  52. package/dist-client/pages/project/project-plan-management.d.ts +27 -0
  53. package/dist-client/pages/project/project-plan-management.js +438 -0
  54. package/dist-client/pages/project/project-plan-management.js.map +1 -0
  55. package/dist-client/pages/project/project-schedule-list.d.ts +18 -0
  56. package/dist-client/pages/project/project-schedule-list.js +292 -0
  57. package/dist-client/pages/project/project-schedule-list.js.map +1 -0
  58. package/dist-client/pages/project/project-schedule.d.ts +23 -0
  59. package/dist-client/pages/project/project-schedule.js +256 -0
  60. package/dist-client/pages/project/project-schedule.js.map +1 -0
  61. package/dist-client/pages/project/project-setting-list.d.ts +23 -0
  62. package/dist-client/pages/project/project-setting-list.js +307 -0
  63. package/dist-client/pages/project/project-setting-list.js.map +1 -0
  64. package/dist-client/pages/project/project-update.d.ts +24 -0
  65. package/dist-client/pages/project/project-update.js +797 -0
  66. package/dist-client/pages/project/project-update.js.map +1 -0
  67. package/dist-client/pages/resource/resource-importer.d.ts +9 -0
  68. package/dist-client/pages/resource/resource-importer.js +100 -0
  69. package/dist-client/pages/resource/resource-importer.js.map +1 -0
  70. package/dist-client/pages/resource/resource-list-page.d.ts +62 -0
  71. package/dist-client/pages/resource/resource-list-page.js +331 -0
  72. package/dist-client/pages/resource/resource-list-page.js.map +1 -0
  73. package/dist-client/pages/task/task-importer.d.ts +9 -0
  74. package/dist-client/pages/task/task-importer.js +100 -0
  75. package/dist-client/pages/task/task-importer.js.map +1 -0
  76. package/dist-client/pages/task/task-list-page.d.ts +62 -0
  77. package/dist-client/pages/task/task-list-page.js +331 -0
  78. package/dist-client/pages/task/task-list-page.js.map +1 -0
  79. package/dist-client/route.d.ts +1 -0
  80. package/dist-client/route.js +32 -0
  81. package/dist-client/route.js.map +1 -0
  82. package/dist-client/tsconfig.tsbuildinfo +1 -0
  83. package/dist-server/controllers/index.js +1 -0
  84. package/dist-server/controllers/index.js.map +1 -0
  85. package/dist-server/controllers/project-to-excel.js +30 -0
  86. package/dist-server/controllers/project-to-excel.js.map +1 -0
  87. package/dist-server/index.js +6 -0
  88. package/dist-server/index.js.map +1 -0
  89. package/dist-server/middlewares/index.js +8 -0
  90. package/dist-server/middlewares/index.js.map +1 -0
  91. package/dist-server/routes.js +105 -0
  92. package/dist-server/routes.js.map +1 -0
  93. package/dist-server/service/check-item/check-item-mutation.js +129 -0
  94. package/dist-server/service/check-item/check-item-mutation.js.map +1 -0
  95. package/dist-server/service/check-item/check-item-query.js +86 -0
  96. package/dist-server/service/check-item/check-item-query.js.map +1 -0
  97. package/dist-server/service/check-item/check-item-type.js +69 -0
  98. package/dist-server/service/check-item/check-item-type.js.map +1 -0
  99. package/dist-server/service/check-item/check-item.js +84 -0
  100. package/dist-server/service/check-item/check-item.js.map +1 -0
  101. package/dist-server/service/check-item/index.js +9 -0
  102. package/dist-server/service/check-item/index.js.map +1 -0
  103. package/dist-server/service/checklist/checklist-mutation.js +129 -0
  104. package/dist-server/service/checklist/checklist-mutation.js.map +1 -0
  105. package/dist-server/service/checklist/checklist-query.js +86 -0
  106. package/dist-server/service/checklist/checklist-query.js.map +1 -0
  107. package/dist-server/service/checklist/checklist-type.js +69 -0
  108. package/dist-server/service/checklist/checklist-type.js.map +1 -0
  109. package/dist-server/service/checklist/checklist.js +120 -0
  110. package/dist-server/service/checklist/checklist.js.map +1 -0
  111. package/dist-server/service/checklist/index.js +9 -0
  112. package/dist-server/service/checklist/index.js.map +1 -0
  113. package/dist-server/service/index.js +36 -0
  114. package/dist-server/service/index.js.map +1 -0
  115. package/dist-server/service/project/index.js +11 -0
  116. package/dist-server/service/project/index.js.map +1 -0
  117. package/dist-server/service/project/project-mutation.js +190 -0
  118. package/dist-server/service/project/project-mutation.js.map +1 -0
  119. package/dist-server/service/project/project-query.js +143 -0
  120. package/dist-server/service/project/project-query.js.map +1 -0
  121. package/dist-server/service/project/project-type.js +106 -0
  122. package/dist-server/service/project/project-type.js.map +1 -0
  123. package/dist-server/service/project/project.js +146 -0
  124. package/dist-server/service/project/project.js.map +1 -0
  125. package/dist-server/service/resource/index.js +9 -0
  126. package/dist-server/service/resource/index.js.map +1 -0
  127. package/dist-server/service/resource/resource-mutation.js +129 -0
  128. package/dist-server/service/resource/resource-mutation.js.map +1 -0
  129. package/dist-server/service/resource/resource-query.js +86 -0
  130. package/dist-server/service/resource/resource-query.js.map +1 -0
  131. package/dist-server/service/resource/resource-type.js +69 -0
  132. package/dist-server/service/resource/resource-type.js.map +1 -0
  133. package/dist-server/service/resource/resource.js +62 -0
  134. package/dist-server/service/resource/resource.js.map +1 -0
  135. package/dist-server/service/task/index.js +9 -0
  136. package/dist-server/service/task/index.js.map +1 -0
  137. package/dist-server/service/task/task-mutation.js +129 -0
  138. package/dist-server/service/task/task-mutation.js.map +1 -0
  139. package/dist-server/service/task/task-query.js +86 -0
  140. package/dist-server/service/task/task-query.js.map +1 -0
  141. package/dist-server/service/task/task-type.js +69 -0
  142. package/dist-server/service/task/task-type.js.map +1 -0
  143. package/dist-server/service/task/task.js +106 -0
  144. package/dist-server/service/task/task.js.map +1 -0
  145. package/dist-server/tsconfig.tsbuildinfo +1 -0
  146. package/helps/management/alarm.md +160 -0
  147. package/helps/management/alter-video.md +160 -0
  148. package/helps/management/cctv.md +160 -0
  149. package/helps/management/device.md +160 -0
  150. package/helps/management/parking.md +160 -0
  151. package/helps/management/site.md +160 -0
  152. package/helps/management/sun-pnl.md +160 -0
  153. package/helps/project/checklist.md +160 -0
  154. package/helps/project/project.md +160 -0
  155. package/helps/project/resource.md +160 -0
  156. package/helps/project/task.md +160 -0
  157. package/package.json +38 -0
  158. package/server/controllers/index.ts +0 -0
  159. package/server/controllers/project-to-excel.ts +40 -0
  160. package/server/index.ts +3 -0
  161. package/server/middlewares/index.ts +3 -0
  162. package/server/routes.ts +108 -0
  163. package/server/service/check-item/check-item-mutation.ts +142 -0
  164. package/server/service/check-item/check-item-query.ts +56 -0
  165. package/server/service/check-item/check-item-type.ts +49 -0
  166. package/server/service/check-item/check-item.ts +74 -0
  167. package/server/service/check-item/index.ts +6 -0
  168. package/server/service/checklist/checklist-mutation.ts +142 -0
  169. package/server/service/checklist/checklist-query.ts +56 -0
  170. package/server/service/checklist/checklist-type.ts +49 -0
  171. package/server/service/checklist/checklist.ts +105 -0
  172. package/server/service/checklist/index.ts +6 -0
  173. package/server/service/index.ts +35 -0
  174. package/server/service/project/index.ts +8 -0
  175. package/server/service/project/project-mutation.ts +201 -0
  176. package/server/service/project/project-query.ts +103 -0
  177. package/server/service/project/project-type.ts +71 -0
  178. package/server/service/project/project.ts +131 -0
  179. package/server/service/resource/index.ts +6 -0
  180. package/server/service/resource/resource-mutation.ts +139 -0
  181. package/server/service/resource/resource-query.ts +56 -0
  182. package/server/service/resource/resource-type.ts +49 -0
  183. package/server/service/resource/resource.ts +56 -0
  184. package/server/service/task/index.ts +6 -0
  185. package/server/service/task/task-mutation.ts +136 -0
  186. package/server/service/task/task-query.ts +56 -0
  187. package/server/service/task/task-type.ts +49 -0
  188. package/server/service/task/task.ts +97 -0
  189. package/server/tsconfig.json +10 -0
  190. package/things-factory.config.js +20 -0
  191. package/translations/en.json +1 -0
  192. package/translations/ja.json +1 -0
  193. package/translations/ko.json +9 -0
  194. package/translations/ms.json +1 -0
  195. package/translations/zh.json +1 -0
@@ -0,0 +1,797 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { PageView } from '@operato/shell';
3
+ import { css, html } from 'lit';
4
+ import { customElement, state } from 'lit/decorators.js';
5
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
6
+ import { client } from '@operato/graphql';
7
+ import { notify } from '@operato/layout';
8
+ import gql from 'graphql-tag';
9
+ import '@material/web/button/elevated-button.js';
10
+ import '@material/web/textfield/outlined-text-field.js';
11
+ let ProjectUpdate = class ProjectUpdate extends ScopedElementsMixin(PageView) {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.defaultProject = {
15
+ name: '',
16
+ buildingComplex: {
17
+ address: '',
18
+ area: 0,
19
+ constructionCompany: '',
20
+ clientCompany: '',
21
+ supervisoryCompany: '',
22
+ designCompany: '',
23
+ constructionType: '',
24
+ buildings: []
25
+ }
26
+ };
27
+ this.projectId = '';
28
+ this.project = Object.assign({}, this.defaultProject);
29
+ }
30
+ get context() {
31
+ return {
32
+ title: '프로젝트 정보 관리'
33
+ };
34
+ }
35
+ render() {
36
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22;
37
+ return html `
38
+ <div header>
39
+ <h2>프로젝트 정보 관리</h2>
40
+ <div button-container>
41
+ <md-elevated-button green @click=${this._saveProject}>
42
+ <md-icon slot="icon">save</md-icon>정보 저장
43
+ </md-elevated-button>
44
+ <md-elevated-button href=${`project-plan-management/${this.project.id}`}>
45
+ <md-icon slot="icon">description</md-icon>도면 관리
46
+ </md-elevated-button>
47
+ <md-elevated-button href=${`project-task-update/${this.project.id}`}>
48
+ <md-icon slot="icon">event_note</md-icon>공정표 관리
49
+ </md-elevated-button>
50
+ </div>
51
+ </div>
52
+ <div body>
53
+ <div project-info>
54
+ <h3>기본 정보</h3>
55
+ <div row>
56
+ <span>프로젝트명</span>
57
+ <span
58
+ ><md-outlined-text-field
59
+ type="text"
60
+ name="name"
61
+ project
62
+ .value=${this.project.name || ''}
63
+ @input=${this._onInputChange}
64
+ ></md-outlined-text-field>
65
+ </span>
66
+ </div>
67
+ <div row>
68
+ <span>프로젝트 주소</span>
69
+ <span>
70
+ <md-outlined-text-field
71
+ type="text"
72
+ name="address"
73
+ building-complex
74
+ .value=${((_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.buildingComplex) === null || _b === void 0 ? void 0 : _b.address) || ''}
75
+ @input=${this._onInputChange}
76
+ ></md-outlined-text-field>
77
+ </span>
78
+ </div>
79
+ <div row>
80
+ <span>위도</span>
81
+ <span>
82
+ <md-outlined-text-field
83
+ type="text"
84
+ name="latitude"
85
+ numeric
86
+ building-complex
87
+ .value=${((_e = (_d = (_c = this.project) === null || _c === void 0 ? void 0 : _c.buildingComplex) === null || _d === void 0 ? void 0 : _d.latitude) === null || _e === void 0 ? void 0 : _e.toString()) || ''}
88
+ @input=${this._onInputChange}
89
+ ></md-outlined-text-field>
90
+ </span>
91
+ </div>
92
+ <div row>
93
+ <span>경도</span>
94
+ <span>
95
+ <md-outlined-text-field
96
+ type="text"
97
+ name="longitude"
98
+ numeric
99
+ building-complex
100
+ .value=${((_h = (_g = (_f = this.project) === null || _f === void 0 ? void 0 : _f.buildingComplex) === null || _g === void 0 ? void 0 : _g.longitude) === null || _h === void 0 ? void 0 : _h.toString()) || ''}
101
+ @input=${this._onInputChange}
102
+ ></md-outlined-text-field>
103
+ </span>
104
+ </div>
105
+ <div row>
106
+ <span>면적</span>
107
+ <span align-end
108
+ ><md-outlined-text-field
109
+ type="text"
110
+ name="area"
111
+ numeric
112
+ building-complex
113
+ .value=${((_l = (_k = (_j = this.project) === null || _j === void 0 ? void 0 : _j.buildingComplex) === null || _k === void 0 ? void 0 : _k.area) === null || _l === void 0 ? void 0 : _l.toString()) || ''}
114
+ @input=${this._onInputChange}
115
+ ></md-outlined-text-field>
116
+ ㎡</span
117
+ >
118
+ </div>
119
+ <div row>
120
+ <span>착공일정 ~ 준공일정</span>
121
+ <span
122
+ ><input
123
+ type="date"
124
+ name="startDate"
125
+ project
126
+ .value=${this.project.startDate || ''}
127
+ @input=${this._onInputChange}
128
+ max="9999-12-31"
129
+ />
130
+ ~
131
+ <input
132
+ type="date"
133
+ name="endDate"
134
+ project
135
+ .value=${this.project.endDate || ''}
136
+ @input=${this._onInputChange}
137
+ max="9999-12-31"
138
+ />
139
+ </span>
140
+ </div>
141
+ <div row>
142
+ <span>발주처</span>
143
+ <span
144
+ ><md-outlined-text-field
145
+ type="text"
146
+ name="clientCompany"
147
+ building-complex
148
+ .value=${((_o = (_m = this.project) === null || _m === void 0 ? void 0 : _m.buildingComplex) === null || _o === void 0 ? void 0 : _o.clientCompany) || ''}
149
+ @input=${this._onInputChange}
150
+ ></md-outlined-text-field>
151
+ </span>
152
+ </div>
153
+ <div row>
154
+ <span>건설사</span>
155
+ <span
156
+ ><md-outlined-text-field
157
+ type="text"
158
+ name="constructionCompany"
159
+ building-complex
160
+ .value=${((_q = (_p = this.project) === null || _p === void 0 ? void 0 : _p.buildingComplex) === null || _q === void 0 ? void 0 : _q.constructionCompany) || ''}
161
+ @input=${this._onInputChange}
162
+ ></md-outlined-text-field>
163
+ </span>
164
+ </div>
165
+ <div row>
166
+ <span>설계사</span>
167
+ <span
168
+ ><md-outlined-text-field
169
+ type="text"
170
+ name="designCompany"
171
+ building-complex
172
+ .value=${((_s = (_r = this.project) === null || _r === void 0 ? void 0 : _r.buildingComplex) === null || _s === void 0 ? void 0 : _s.designCompany) || ''}
173
+ @input=${this._onInputChange}
174
+ ></md-outlined-text-field>
175
+ </span>
176
+ </div>
177
+ <div row>
178
+ <span>감리사</span>
179
+ <span
180
+ ><md-outlined-text-field
181
+ type="text"
182
+ name="supervisoryCompany"
183
+ building-complex
184
+ .value=${((_u = (_t = this.project) === null || _t === void 0 ? void 0 : _t.buildingComplex) === null || _u === void 0 ? void 0 : _u.supervisoryCompany) || ''}
185
+ @input=${this._onInputChange}
186
+ ></md-outlined-text-field>
187
+ </span>
188
+ </div>
189
+ <div row>
190
+ <span>건설구분</span>
191
+ <span
192
+ ><md-outlined-text-field
193
+ type="text"
194
+ name="constructionType"
195
+ building-complex
196
+ .value=${((_w = (_v = this.project) === null || _v === void 0 ? void 0 : _v.buildingComplex) === null || _w === void 0 ? void 0 : _w.constructionType) || ''}
197
+ @input=${this._onInputChange}
198
+ ></md-outlined-text-field>
199
+ </span>
200
+ </div>
201
+ <div row>
202
+ <span>대표사진 업로드</span>
203
+ <span>
204
+ <ox-input-image
205
+ name="mainPhoto"
206
+ value=${((_y = (_x = this.project) === null || _x === void 0 ? void 0 : _x.mainPhoto) === null || _y === void 0 ? void 0 : _y.fullpath) || ''}
207
+ @change=${this.onCreateAttachment.bind(this)}
208
+ ></ox-input-image>
209
+ </span>
210
+ </div>
211
+ <div row>
212
+ <span>단지 BIM</span>
213
+ <span>
214
+ <ox-input-file
215
+ name="drawing"
216
+ label=" "
217
+ description="IFC 업로드"
218
+ .value=${((_0 = (_z = this.project) === null || _z === void 0 ? void 0 : _z.buildingComplex) === null || _0 === void 0 ? void 0 : _0.drawing) || ''}
219
+ @change=${this.onCreateAttachment.bind(this)}
220
+ ></ox-input-file>
221
+ </span>
222
+ </div>
223
+ <div row>
224
+ <span>공사금액</span>
225
+ <span
226
+ ><md-outlined-text-field
227
+ type="text"
228
+ name="constructionCost"
229
+ numeric
230
+ building-complex
231
+ .value=${((_3 = (_2 = (_1 = this.project) === null || _1 === void 0 ? void 0 : _1.buildingComplex) === null || _2 === void 0 ? void 0 : _2.constructionCost) === null || _3 === void 0 ? void 0 : _3.toString()) || ''}
232
+ @input=${this._onInputChange}
233
+ ></md-outlined-text-field>
234
+ </span>
235
+ </div>
236
+ <div row>
237
+ <span>기타사항</span>
238
+ <span>
239
+ <md-outlined-text-field
240
+ type="textarea"
241
+ name="etc"
242
+ building-complex
243
+ .value=${((_5 = (_4 = this.project) === null || _4 === void 0 ? void 0 : _4.buildingComplex) === null || _5 === void 0 ? void 0 : _5.etc) || ''}
244
+ @input=${this._onInputChange}
245
+ ></md-outlined-text-field>
246
+ </span>
247
+ </div>
248
+ </div>
249
+ <div detail-info>
250
+ <div>
251
+ <h3>건설구분 상세 정보</h3>
252
+ <div row>
253
+ <span>세대수</span>
254
+ <span
255
+ ><md-outlined-text-field
256
+ type="text"
257
+ numeric
258
+ building-complex
259
+ name="householdCount"
260
+ .value=${((_8 = (_7 = (_6 = this.project) === null || _6 === void 0 ? void 0 : _6.buildingComplex) === null || _7 === void 0 ? void 0 : _7.householdCount) === null || _8 === void 0 ? void 0 : _8.toString()) || ''}
261
+ @input=${this._onInputChange}
262
+ ></md-outlined-text-field>
263
+ </span>
264
+ </div>
265
+ <div row>
266
+ <span>동수</span>
267
+ <span
268
+ ><md-outlined-text-field
269
+ type="text"
270
+ numeric
271
+ building-complex
272
+ name="buildingCount"
273
+ value=${((_11 = (_10 = (_9 = this.project) === null || _9 === void 0 ? void 0 : _9.buildingComplex) === null || _10 === void 0 ? void 0 : _10.buildingCount) === null || _11 === void 0 ? void 0 : _11.toString()) || ''}
274
+ @input=${this._onInputChange}
275
+ ></md-outlined-text-field>
276
+ <md-elevated-button @click=${this._setBuilding}>적용</md-elevated-button>
277
+ </span>
278
+ </div>
279
+ <hr />
280
+ <div warn>* 동/층의 정보를 수정하면 기존의 동/층 정보는 모두 제거됩니다.</div>
281
+ <div separate-container>
282
+ ${(_14 = (_13 = (_12 = this.project) === null || _12 === void 0 ? void 0 : _12.buildingComplex) === null || _13 === void 0 ? void 0 : _13.buildings) === null || _14 === void 0 ? void 0 : _14.map((building, idx) => {
283
+ var _a;
284
+ return html `
285
+ <div>
286
+ <span>
287
+ <md-outlined-text-field
288
+ type="text"
289
+ building
290
+ name="name"
291
+ .value=${(building === null || building === void 0 ? void 0 : building.name) || ''}
292
+ @input=${e => this._onInputChange(e, idx)}
293
+ placeholder="ooo동"
294
+ ></md-outlined-text-field>
295
+ </span>
296
+ <span>
297
+ <span floor-title>층수</span>
298
+ <md-outlined-text-field
299
+ type="text"
300
+ numeric
301
+ building
302
+ name="floorCount"
303
+ .value=${((_a = building === null || building === void 0 ? void 0 : building.floorCount) === null || _a === void 0 ? void 0 : _a.toString()) || ''}
304
+ @input=${e => this._onInputChange(e, idx)}
305
+ placeholder="oo"
306
+ ></md-outlined-text-field>
307
+ </span>
308
+ </div>
309
+ `;
310
+ })}
311
+ </div>
312
+ </div>
313
+
314
+ <div project>
315
+ <h3>프로젝트 현황</h3>
316
+ <div row separate-container>
317
+ <div>
318
+ <span>전체 진행현황</span>
319
+ <span
320
+ ><md-outlined-text-field
321
+ type="text"
322
+ numeric
323
+ project
324
+ name="totalProgress"
325
+ .value=${((_15 = this.project.totalProgress) === null || _15 === void 0 ? void 0 : _15.toString()) || ''}
326
+ @input=${this._onInputChange}
327
+ suffix-text="%"
328
+ ></md-outlined-text-field>
329
+ </span>
330
+ </div>
331
+ <div>
332
+ <span>검측/통과비율</span>
333
+ <span
334
+ ><md-outlined-text-field
335
+ type="text"
336
+ numeric
337
+ project
338
+ name="inspPassRate"
339
+ .value=${((_16 = this.project.inspPassRate) === null || _16 === void 0 ? void 0 : _16.toString()) || ''}
340
+ @input=${this._onInputChange}
341
+ suffix-text="%"
342
+ ></md-outlined-text-field>
343
+ </span>
344
+ </div>
345
+ </div>
346
+ <div row separate-container>
347
+ <div>
348
+ <span>주간 진행현황</span>
349
+ <span
350
+ ><md-outlined-text-field
351
+ type="text"
352
+ numeric
353
+ project
354
+ name="weeklyProgress"
355
+ .value=${((_17 = this.project.weeklyProgress) === null || _17 === void 0 ? void 0 : _17.toString()) || ''}
356
+ @input=${this._onInputChange}
357
+ suffix-text="%"
358
+ ></md-outlined-text-field>
359
+ </span>
360
+ </div>
361
+ <div>
362
+ <span>로봇작업진행율</span>
363
+ <span
364
+ ><md-outlined-text-field
365
+ type="text"
366
+ numeric
367
+ project
368
+ name="robotProgressRate"
369
+ .value=${((_18 = this.project.robotProgressRate) === null || _18 === void 0 ? void 0 : _18.toString()) || ''}
370
+ @input=${this._onInputChange}
371
+ suffix-text="%"
372
+ ></md-outlined-text-field>
373
+ </span>
374
+ </div>
375
+ </div>
376
+ <div row separate-container>
377
+ <div>
378
+ <span>KPI</span>
379
+ <span
380
+ ><md-outlined-text-field
381
+ type="text"
382
+ numeric
383
+ project
384
+ name="kpi"
385
+ .value=${((_19 = this.project.kpi) === null || _19 === void 0 ? void 0 : _19.toString()) || ''}
386
+ @input=${this._onInputChange}
387
+ suffix-text="%"
388
+ ></md-outlined-text-field>
389
+ </span>
390
+ </div>
391
+ <div>
392
+ <span>구조안전도</span>
393
+ <span
394
+ ><md-outlined-text-field
395
+ type="text"
396
+ numeric
397
+ project
398
+ name="structuralSafetyRate"
399
+ .value=${((_20 = this.project.structuralSafetyRate) === null || _20 === void 0 ? void 0 : _20.toString()) || ''}
400
+ @input=${this._onInputChange}
401
+ suffix-text="%"
402
+ ></md-outlined-text-field>
403
+ </span>
404
+ </div>
405
+ </div>
406
+ </div>
407
+
408
+ <div>
409
+ <h3>공지사항</h3>
410
+ <div>
411
+ <span></span>
412
+ <span>
413
+ <md-outlined-text-field
414
+ type="textarea"
415
+ name="notice"
416
+ building-complex
417
+ .value=${((_22 = (_21 = this.project) === null || _21 === void 0 ? void 0 : _21.buildingComplex) === null || _22 === void 0 ? void 0 : _22.notice) || ''}
418
+ @input=${this._onInputChange}
419
+ ></md-outlined-text-field>
420
+ </span>
421
+ </div>
422
+ </div>
423
+ </div>
424
+ </div>
425
+ `;
426
+ }
427
+ async pageInitialized(lifecycle) { }
428
+ async pageUpdated(changes, lifecycle) {
429
+ if (this.active) {
430
+ this.projectId = lifecycle.resourceId || '';
431
+ await this.initProject(this.projectId);
432
+ }
433
+ }
434
+ async initProject(projectId = '') {
435
+ var _a;
436
+ const response = await client.query({
437
+ query: gql `
438
+ query Project($id: String!) {
439
+ project(id: $id) {
440
+ id
441
+ name
442
+ startDate
443
+ endDate
444
+ mainPhoto {
445
+ fullpath
446
+ }
447
+ totalProgress
448
+ weeklyProgress
449
+ kpi
450
+ inspPassRate
451
+ robotProgressRate
452
+ structuralSafetyRate
453
+ buildingComplex {
454
+ id
455
+ address
456
+ latitude
457
+ longitude
458
+ area
459
+ clientCompany
460
+ constructionCompany
461
+ supervisoryCompany
462
+ designCompany
463
+ drawing {
464
+ id
465
+ name
466
+ }
467
+ constructionType
468
+ constructionCost
469
+ etc
470
+ notice
471
+ householdCount
472
+ buildingCount
473
+ buildings {
474
+ id
475
+ name
476
+ floorCount
477
+ }
478
+ }
479
+ }
480
+ }
481
+ `,
482
+ variables: {
483
+ id: projectId
484
+ }
485
+ });
486
+ this.project = (_a = response.data) === null || _a === void 0 ? void 0 : _a.project;
487
+ console.log('init project : ', this.project);
488
+ }
489
+ async _saveProject() {
490
+ // 첨부 파일 필드 제거 (첨부 파일은 {filename}Upload 로 전송)
491
+ delete this.project.mainPhoto;
492
+ delete this.project.buildingComplex.drawing;
493
+ console.log('this.project :', this.project);
494
+ const response = await client.mutate({
495
+ mutation: gql `
496
+ mutation UpdateProject($project: ProjectPatch!) {
497
+ updateProject(project: $project) {
498
+ id
499
+ }
500
+ }
501
+ `,
502
+ variables: {
503
+ project: this.project
504
+ },
505
+ context: {
506
+ hasUpload: true
507
+ }
508
+ });
509
+ if (!response.errors) {
510
+ notify({ message: '저장에 성공하였습니다.' });
511
+ }
512
+ }
513
+ // 동 적용 버튼을 누르면 입력한 수 만큼 해당 단지에 동 데이터 생성
514
+ _setBuilding() {
515
+ var _a, _b, _c, _d, _e;
516
+ const buildingCount = ((_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.buildingComplex) === null || _b === void 0 ? void 0 : _b.buildingCount) || 0;
517
+ const buildingInitData = { name: undefined, floorCount: undefined };
518
+ // 빌딩 데이터가 없으면 빈 배열 넣어줌
519
+ if (!((_e = (_d = (_c = this.project) === null || _c === void 0 ? void 0 : _c.buildingComplex) === null || _d === void 0 ? void 0 : _d.buildings) === null || _e === void 0 ? void 0 : _e.length)) {
520
+ this.project.buildingComplex.buildings = [];
521
+ }
522
+ if (this.project.buildingComplex.buildings.length >= buildingCount) {
523
+ // 동 수가 더 작게 들어오면 기존 배열을 필요한 크기만큼 잘라내기
524
+ this.project.buildingComplex.buildings = [...this.project.buildingComplex.buildings.slice(0, buildingCount)];
525
+ }
526
+ else {
527
+ // 동수가 더 크게 들어오면 기존 배열 + 빈 값을 채움
528
+ const additionalCount = buildingCount - this.project.buildingComplex.buildings.length;
529
+ const additionalBuildings = Array.from({ length: additionalCount }, () => (Object.assign({}, buildingInitData)));
530
+ this.project.buildingComplex.buildings = [...this.project.buildingComplex.buildings, ...additionalBuildings];
531
+ }
532
+ // 리렌더링
533
+ this.project = Object.assign({}, this.project);
534
+ }
535
+ // Input 요소의 값이 변경될 때 호출되는 콜백 함수
536
+ _onInputChange(event, idx) {
537
+ const target = event.target;
538
+ let inputVal = target.value;
539
+ // 숫자 타입은 다른 문자 입력 제거
540
+ if (target.hasAttribute('numeric')) {
541
+ inputVal = Number(inputVal.replace(/[^\d.]/g, ''));
542
+ }
543
+ if (target.hasAttribute('project')) {
544
+ this.project[target.name] = inputVal;
545
+ }
546
+ else if (target.hasAttribute('building-complex')) {
547
+ this.project.buildingComplex[target.name] = inputVal;
548
+ }
549
+ else if (target.hasAttribute('building')) {
550
+ this.project.buildingComplex.buildings[idx][target.name] = inputVal;
551
+ }
552
+ }
553
+ // 이미지 업로드
554
+ async onCreateAttachment(e) {
555
+ const target = e.target;
556
+ const file = (target.name === 'mainPhoto' ? e.detail : e.detail[0]) || null;
557
+ if (target.name === 'mainPhoto') {
558
+ this.project.mainPhotoUpload = file;
559
+ }
560
+ else {
561
+ this.project.buildingComplex.drawingUpload = file;
562
+ }
563
+ }
564
+ };
565
+ ProjectUpdate.styles = [
566
+ css `
567
+ :host {
568
+ display: grid;
569
+ grid-template-rows: 75px auto;
570
+ color: #4e5055;
571
+
572
+ width: 100%;
573
+ background-color: #f7f7f7;
574
+ overflow-y: auto;
575
+
576
+ --grid-record-emphasized-background-color: red;
577
+ --grid-record-emphasized-color: yellow;
578
+ }
579
+
580
+ md-outlined-text-field {
581
+ width: 100%;
582
+
583
+ --md-outlined-text-field-container-shape: 5px;
584
+ --md-sys-color-primary: #586878;
585
+ --md-outlined-text-field-input-text-size: 14px;
586
+ --md-outlined-field-bottom-space: 4px;
587
+ --md-outlined-field-top-space: 4px;
588
+ }
589
+ md-outlined-text-field[type='textarea'] {
590
+ width: 100%;
591
+ height: 130px;
592
+ }
593
+
594
+ ox-input-image {
595
+ width: 100px;
596
+ height: 100px;
597
+ }
598
+ ox-input-file {
599
+ width: 100px;
600
+ height: 100px;
601
+ padding: 0;
602
+ }
603
+
604
+ div[header] {
605
+ display: flex;
606
+ margin: 0px 20px;
607
+
608
+ h2 {
609
+ flex: 0.5;
610
+ color: #3f71a0;
611
+ }
612
+
613
+ div[button-container] {
614
+ display: flex;
615
+ align-items: center;
616
+ justify-content: end;
617
+ flex: 0.5;
618
+
619
+ md-elevated-button {
620
+ margin: 0px 3px;
621
+
622
+ --md-elevated-button-container-height: 35px;
623
+ --md-elevated-button-label-text-size: 16px;
624
+ --md-elevated-button-container-color: #0595e5;
625
+
626
+ --md-elevated-button-label-text-color: #fff;
627
+ --md-elevated-button-hover-label-text-color: #fff;
628
+ --md-elevated-button-pressed-label-text-color: #fff;
629
+ --md-elevated-button-focus-label-text-color: #fff;
630
+ --md-elevated-button-icon-color: #fff;
631
+ --md-elevated-button-hover-icon-color: #fff;
632
+ --md-elevated-button-pressed-icon-color: #fff;
633
+ --md-elevated-button-focus-icon-color: #fff;
634
+
635
+ &[green] {
636
+ --md-elevated-button-container-color: #42b382;
637
+ }
638
+ }
639
+ }
640
+ }
641
+
642
+ div[body] {
643
+ display: flex;
644
+ margin: 0px 25px 25px 25px;
645
+ gap: 10px;
646
+
647
+ & > div {
648
+ display: flex;
649
+ height: fit-content;
650
+ flex-direction: column;
651
+ padding: 15px;
652
+ background-color: #ffffff;
653
+ border: 1px solid #cccccc80;
654
+ border-radius: 5px;
655
+ gap: 10px;
656
+
657
+ h3 {
658
+ color: #2e79be;
659
+ font-size: 18px;
660
+ margin: 0px;
661
+ }
662
+
663
+ div[row] {
664
+ display: flex;
665
+ align-items: center;
666
+
667
+ span:first-child {
668
+ flex: 0.3;
669
+ text-align: right;
670
+ }
671
+
672
+ span:last-child {
673
+ flex: 0.7;
674
+ display: flex;
675
+ gap: 10px;
676
+ margin-left: 12px;
677
+ align-items: center;
678
+
679
+ &[align-end] {
680
+ align-items: end;
681
+ }
682
+ }
683
+ }
684
+ }
685
+
686
+ div[project-info] {
687
+ flex: 0.55;
688
+ }
689
+
690
+ div[detail-info] {
691
+ flex: 0.45;
692
+ padding: 0px;
693
+ gap: 10px;
694
+ background-color: transparent;
695
+ border: none;
696
+
697
+ & > div {
698
+ display: flex;
699
+ flex-direction: column;
700
+ gap: 10px;
701
+ border: 1px solid #cccccc80;
702
+ border-radius: 5px;
703
+ padding: 15px;
704
+ background-color: #fff;
705
+
706
+ md-outlined-text-field[type='text'] {
707
+ width: 60%;
708
+ }
709
+
710
+ md-elevated-button {
711
+ --md-elevated-button-container-height: 30px;
712
+ --md-elevated-button-container-color: #fff;
713
+ --md-elevated-button-label-text-size: 16px;
714
+ }
715
+ hr {
716
+ border: 1px #cccccc dashed;
717
+ width: 100%;
718
+ margin-bottom: 2px;
719
+ }
720
+ div[warn] {
721
+ font-size: 12px;
722
+ color: red;
723
+ margin-left: 5px;
724
+ margin-bottom: 5px;
725
+ }
726
+
727
+ div[row] {
728
+ span:first-child {
729
+ flex: 0.2;
730
+ }
731
+ span:last-child {
732
+ flex: 0.8;
733
+ }
734
+ }
735
+
736
+ div[separate-container] {
737
+ display: grid;
738
+ grid-template-columns: repeat(2, 1fr);
739
+ gap: 10px;
740
+
741
+ md-outlined-text-field {
742
+ width: 70px;
743
+ }
744
+
745
+ & > div {
746
+ display: flex;
747
+
748
+ span[floor-title] {
749
+ min-width: 33px;
750
+ margin-right: 5px;
751
+ }
752
+ span:first-child {
753
+ flex: 0.4;
754
+ justify-content: end;
755
+ display: flex;
756
+ }
757
+ span:last-child {
758
+ flex: 0.6;
759
+ display: flex;
760
+ align-items: center;
761
+ padding-left: 17px;
762
+ }
763
+ }
764
+ }
765
+
766
+ &[project] {
767
+ div[separate-container] {
768
+ & > div {
769
+ span:first-child {
770
+ flex: 0.6;
771
+ min-width: 100px;
772
+ }
773
+ span:last-child {
774
+ flex: 0.4;
775
+ margin-left: 0;
776
+ }
777
+ }
778
+ }
779
+ }
780
+ }
781
+ }
782
+ }
783
+ `
784
+ ];
785
+ __decorate([
786
+ state(),
787
+ __metadata("design:type", String)
788
+ ], ProjectUpdate.prototype, "projectId", void 0);
789
+ __decorate([
790
+ state(),
791
+ __metadata("design:type", Object)
792
+ ], ProjectUpdate.prototype, "project", void 0);
793
+ ProjectUpdate = __decorate([
794
+ customElement('project-update')
795
+ ], ProjectUpdate);
796
+ export { ProjectUpdate };
797
+ //# sourceMappingURL=project-update.js.map