@dssp/project 0.0.36 → 1.0.0-alpha.1
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.
- package/dist-client/pages/project/project-schedule.js +31 -22
- package/dist-client/pages/project/project-schedule.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/client/bootstrap.ts +0 -0
- package/client/index.ts +0 -0
- package/client/pages/lib/select2-component.ts +0 -175
- package/client/pages/lib/waether.ts +0 -159
- package/client/pages/project/component/project-update-header.ts +0 -88
- package/client/pages/project/popup/popup-plan-upload.ts +0 -138
- package/client/pages/project/popup/popup-project-create.ts +0 -147
- package/client/pages/project/popup/popup-schedule-upload.ts +0 -102
- package/client/pages/project/project-completed-list.ts +0 -281
- package/client/pages/project/project-detail.ts +0 -738
- package/client/pages/project/project-list.ts +0 -418
- package/client/pages/project/project-plan-management.ts +0 -476
- package/client/pages/project/project-schedule-list.ts +0 -294
- package/client/pages/project/project-schedule.ts +0 -393
- package/client/pages/project/project-setting-list.ts +0 -393
- package/client/pages/project/project-update.ts +0 -876
- package/client/pages/resource/construction-detail-type-popup.ts +0 -201
- package/client/pages/resource/construction-type-management.ts +0 -212
- package/client/pages/resource/inspection-drawing-type-management.ts +0 -245
- package/client/pages/resource/inspection-part-popup.ts +0 -201
- package/client/pages/resource/resource-importer.ts +0 -97
- package/client/pages/resource/resource-list-page.ts +0 -356
- package/client/pages/resource/worker-type-management.ts +0 -192
- package/client/pages/task/task-importer.ts +0 -94
- package/client/pages/task/task-list-page.ts +0 -340
- package/client/pages/task-resource/task-resource-importer.ts +0 -97
- package/client/pages/task-resource/task-resource-list-page.ts +0 -356
- package/client/route.ts +0 -55
- package/client/tsconfig.json +0 -11
- package/server/controllers/export-tasks.ts +0 -40
- package/server/controllers/import-task.ts +0 -134
- package/server/controllers/index.ts +0 -0
- package/server/controllers/parse-excel.ts +0 -86
- package/server/controllers/types.ts +0 -20
- package/server/index.ts +0 -4
- package/server/middlewares/index.ts +0 -3
- package/server/migrations/1723861466413-seed-roles.ts +0 -128
- package/server/migrations/1723861466414-seed-codes.ts +0 -157
- package/server/migrations/1723861476419-seed-resources.ts +0 -62
- package/server/migrations/1723861478420-seed-/bsample-project.ts +0 -87
- package/server/migrations/1723861478421-seed-/bsample-tasks.ts +0 -194
- package/server/migrations/index.ts +0 -9
- package/server/routes.ts +0 -108
- package/server/service/construction-detail-type/construction-detail-type-mutation.ts +0 -57
- package/server/service/construction-detail-type/construction-detail-type-query.ts +0 -31
- package/server/service/construction-detail-type/construction-detail-type-type.ts +0 -26
- package/server/service/construction-detail-type/construction-detail-type.ts +0 -52
- package/server/service/construction-detail-type/index.ts +0 -6
- package/server/service/construction-type/construction-type-mutation.ts +0 -66
- package/server/service/construction-type/construction-type-query.ts +0 -56
- package/server/service/construction-type/construction-type-type.ts +0 -26
- package/server/service/construction-type/construction-type.ts +0 -74
- package/server/service/construction-type/index.ts +0 -6
- package/server/service/index.ts +0 -56
- package/server/service/inspection-drawing-type/index.ts +0 -6
- package/server/service/inspection-drawing-type/inspection-drawing-type-mutation.ts +0 -69
- package/server/service/inspection-drawing-type/inspection-drawing-type-query.ts +0 -55
- package/server/service/inspection-drawing-type/inspection-drawing-type-type.ts +0 -23
- package/server/service/inspection-drawing-type/inspection-drawing-type.ts +0 -68
- package/server/service/inspection-part/index.ts +0 -6
- package/server/service/inspection-part/inspection-part-mutation.ts +0 -52
- package/server/service/inspection-part/inspection-part-query.ts +0 -41
- package/server/service/inspection-part/inspection-part-type.ts +0 -26
- package/server/service/inspection-part/inspection-part.ts +0 -51
- package/server/service/manager/index.ts +0 -6
- package/server/service/manager/manager-mutation.ts +0 -42
- package/server/service/manager/manager-query.ts +0 -28
- package/server/service/manager/manager-type.ts +0 -40
- package/server/service/manager/manager.ts +0 -29
- package/server/service/project/index.ts +0 -6
- package/server/service/project/project-mutation.ts +0 -255
- package/server/service/project/project-query.ts +0 -105
- package/server/service/project/project-type.ts +0 -72
- package/server/service/project/project.ts +0 -134
- package/server/service/resource/index.ts +0 -7
- package/server/service/resource/resource-mutation.ts +0 -137
- package/server/service/resource/resource-query.ts +0 -50
- package/server/service/resource/resource-type.ts +0 -41
- package/server/service/resource/resource.ts +0 -82
- package/server/service/task/index.ts +0 -6
- package/server/service/task/task-mutation.ts +0 -135
- package/server/service/task/task-query.ts +0 -169
- package/server/service/task/task-type.ts +0 -75
- package/server/service/task/task.ts +0 -130
- package/server/service/task-resource/index.ts +0 -7
- package/server/service/task-resource/task-resource-mutation.ts +0 -140
- package/server/service/task-resource/task-resource-query.ts +0 -36
- package/server/service/task-resource/task-resource-type.ts +0 -41
- package/server/service/task-resource/task-resource.ts +0 -51
- package/server/service/worker-type/index.ts +0 -6
- package/server/service/worker-type/worker-type-mutation.ts +0 -66
- package/server/service/worker-type/worker-type-query.ts +0 -47
- package/server/service/worker-type/worker-type-type.ts +0 -26
- package/server/service/worker-type/worker-type.ts +0 -68
- package/server/tsconfig.json +0 -10
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@material/web/button/elevated-button.js'
|
|
3
|
-
import '@material/web/textfield/outlined-text-field.js'
|
|
4
|
-
import '@material/web/button/filled-button.js'
|
|
5
|
-
import '@material/web/button/outlined-button.js'
|
|
6
|
-
|
|
7
|
-
import { PageView } from '@operato/shell'
|
|
8
|
-
import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
|
|
9
|
-
import { css, html } from 'lit'
|
|
10
|
-
import { customElement, state } from 'lit/decorators.js'
|
|
11
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
12
|
-
import { client } from '@operato/graphql'
|
|
13
|
-
import { notify } from '@operato/layout'
|
|
14
|
-
import { openPopup } from '@operato/layout'
|
|
15
|
-
|
|
16
|
-
import gql from 'graphql-tag'
|
|
17
|
-
import { Building, BuildingLevel, Project } from './project-list'
|
|
18
|
-
import './popup/popup-plan-upload'
|
|
19
|
-
import './component/project-update-header'
|
|
20
|
-
|
|
21
|
-
@customElement('project-plan-management')
|
|
22
|
-
export class ProjectPlanManagement extends ScopedElementsMixin(PageView) {
|
|
23
|
-
static styles = [
|
|
24
|
-
css`
|
|
25
|
-
:host {
|
|
26
|
-
display: grid;
|
|
27
|
-
grid-template-rows: 55px auto;
|
|
28
|
-
color: #4e5055;
|
|
29
|
-
|
|
30
|
-
background-color: var(--md-sys-color-background, #f6f6f6);
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
overflow-y: auto;
|
|
33
|
-
|
|
34
|
-
--grid-record-emphasized-background-color: red;
|
|
35
|
-
--grid-record-emphasized-color: yellow;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
md-outlined-text-field {
|
|
39
|
-
width: 100%;
|
|
40
|
-
|
|
41
|
-
--md-outlined-text-field-container-shape: 5px;
|
|
42
|
-
--md-outlined-text-field-outline-color: rgba(51,51,51,.20);
|
|
43
|
-
--md-outlined-text-field-focus-outline-color: #1f7fd9;
|
|
44
|
-
--md-outlined-text-field-focus-outline-width: 1px;
|
|
45
|
-
--md-sys-color-primary: #586878;
|
|
46
|
-
--md-outlined-text-field-input-text-size: 14px;
|
|
47
|
-
--md-outlined-field-bottom-space: 3px;
|
|
48
|
-
--md-outlined-field-top-space: 3px;
|
|
49
|
-
--md-outlined-field-leading-space: var(--spacing-medium, 8px);
|
|
50
|
-
--md-outlined-field-trailing-space: var(--spacing-medium, 8px);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
ox-input-image {
|
|
54
|
-
width: 100px;
|
|
55
|
-
height: 100px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
*[bold] {
|
|
59
|
-
font-weight: bold;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
div[body] {
|
|
63
|
-
display: grid;
|
|
64
|
-
grid-template-rows: 205px 1fr 60px;
|
|
65
|
-
margin: var(--spacing-large, 12px);
|
|
66
|
-
margin-top:0;
|
|
67
|
-
gap: var(--spacing-medium, 8px);
|
|
68
|
-
|
|
69
|
-
& > div {
|
|
70
|
-
display: grid;
|
|
71
|
-
grid-template-rows: 25px auto;
|
|
72
|
-
padding: var(--spacing-large, 12px);
|
|
73
|
-
background-color: var(--md-sys-color-on-primary);
|
|
74
|
-
border: 1px solid #cccccc80;
|
|
75
|
-
border-radius: 5px;
|
|
76
|
-
gap: var(--spacing-medium, 8px);
|
|
77
|
-
|
|
78
|
-
h3 {
|
|
79
|
-
color: #2e79be;
|
|
80
|
-
font-size: 16px;
|
|
81
|
-
margin: 0px;
|
|
82
|
-
text-wrap: nowrap;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
& > div[building-container] > div {
|
|
87
|
-
display: flex;
|
|
88
|
-
gap: var(--spacing-medium, 8px);
|
|
89
|
-
overflow-x: auto;
|
|
90
|
-
overflow-y: hidden;
|
|
91
|
-
|
|
92
|
-
ox-input-file {
|
|
93
|
-
height: 100px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
span[building] {
|
|
97
|
-
width: 125px;
|
|
98
|
-
text-align: center;
|
|
99
|
-
|
|
100
|
-
div {
|
|
101
|
-
color: #586878;
|
|
102
|
-
margin-top:var(--spacing-small, 4px);
|
|
103
|
-
font-size: 14px;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
& > div[floor-container] {
|
|
109
|
-
div[floor-title] {
|
|
110
|
-
display: flex;
|
|
111
|
-
justify-content: space-between;
|
|
112
|
-
height: fit-content;
|
|
113
|
-
gap: var(--spacing-huge, 24px);
|
|
114
|
-
overflow: hidden;
|
|
115
|
-
|
|
116
|
-
span[building-button] {
|
|
117
|
-
display: flex;
|
|
118
|
-
margin-left: auto;
|
|
119
|
-
gap: var(--spacing-small, 4px);
|
|
120
|
-
overflow-x: auto;
|
|
121
|
-
overflow-y: hidden;
|
|
122
|
-
|
|
123
|
-
md-filled-button {
|
|
124
|
-
--md-filled-button-container-color: #0595e5;
|
|
125
|
-
--md-filled-button-container-height: 30px;
|
|
126
|
-
--md-filled-button-trailing-space: var(--spacing-medium, 8px);
|
|
127
|
-
--md-filled-button-leading-space: var(--spacing-medium, 8px);
|
|
128
|
-
}
|
|
129
|
-
md-outlined-button {
|
|
130
|
-
--md-outlined-button-container-height: 30px;
|
|
131
|
-
--md-outlined-button-trailing-space: var(--spacing-medium, 8px);
|
|
132
|
-
--md-outlined-button-leading-space: var(--spacing-medium, 8px);
|
|
133
|
-
--md-sys-color-outline: rgba(51,51,51,.20);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
div[floor-plan] {
|
|
139
|
-
overflow-y: auto;
|
|
140
|
-
margin-top: var(--spacing-medium, 8px);
|
|
141
|
-
|
|
142
|
-
& > span {
|
|
143
|
-
display: inline-block;
|
|
144
|
-
text-align: center;
|
|
145
|
-
margin-right:var(--spacing-medium, 8px);
|
|
146
|
-
margin-bottom:var(--spacing-medium, 8px);
|
|
147
|
-
cursor: pointer;
|
|
148
|
-
|
|
149
|
-
& > [name='building-plan'] {
|
|
150
|
-
width: 150px;
|
|
151
|
-
height: 100px;
|
|
152
|
-
display: flex;
|
|
153
|
-
flex-direction: column;
|
|
154
|
-
justify-content: center;
|
|
155
|
-
border: 1px solid rgba(51,51,51,.1);
|
|
156
|
-
box-shadow: 1px 1px 1px #0000001a;
|
|
157
|
-
align-items: center;
|
|
158
|
-
border-radius: 5px;
|
|
159
|
-
font-size: 13px;
|
|
160
|
-
|
|
161
|
-
md-icon {
|
|
162
|
-
margin-bottom: var(--spacing-small, 4px);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
& > div[floor-name] {
|
|
167
|
-
margin-top: var(--spacing-small, 4px);
|
|
168
|
-
font-size:14px;
|
|
169
|
-
|
|
170
|
-
&[no-data] {
|
|
171
|
-
color: #f16154;
|
|
172
|
-
font-weight: bold;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
& > div[plan-scale-container] {
|
|
180
|
-
display: flex;
|
|
181
|
-
|
|
182
|
-
& > div {
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
gap: var(--spacing-medium, 8px);
|
|
186
|
-
margin-left: var(--spacing-medium, 8px);
|
|
187
|
-
|
|
188
|
-
md-outlined-text-field {
|
|
189
|
-
width: 100px;
|
|
190
|
-
--md-outlined-text-container-height: 30px;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
`
|
|
196
|
-
]
|
|
197
|
-
|
|
198
|
-
get context() {
|
|
199
|
-
return {
|
|
200
|
-
title: '도면 관리'
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
private defaultProject = {
|
|
205
|
-
name: '',
|
|
206
|
-
buildingComplex: {
|
|
207
|
-
address: '',
|
|
208
|
-
area: 0,
|
|
209
|
-
constructionCompany: '',
|
|
210
|
-
clientCompany: '',
|
|
211
|
-
supervisoryCompany: '',
|
|
212
|
-
designCompany: '',
|
|
213
|
-
constructionType: '',
|
|
214
|
-
buildings: []
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
@state() projectId: string = ''
|
|
218
|
-
@state() project: Project = { ...this.defaultProject }
|
|
219
|
-
@state() selectedBuildingIdx: number = 0
|
|
220
|
-
|
|
221
|
-
render() {
|
|
222
|
-
return html`
|
|
223
|
-
<project-update-header .projectId=${this.project.id || ''} title="도면 관리" @custom-click=${this._saveProject}>
|
|
224
|
-
</project-update-header>
|
|
225
|
-
|
|
226
|
-
<div body>
|
|
227
|
-
<div building-container>
|
|
228
|
-
<h3>동별 도면(BIM)</h3>
|
|
229
|
-
<div>
|
|
230
|
-
${this.project.buildingComplex?.buildings?.map((building, idx) => {
|
|
231
|
-
return html`
|
|
232
|
-
<span building>
|
|
233
|
-
<ox-input-file
|
|
234
|
-
name="building-drawing"
|
|
235
|
-
.value=${building?.drawing || undefined}
|
|
236
|
-
label=" "
|
|
237
|
-
description="동 도면 업로드"
|
|
238
|
-
idx=${idx}
|
|
239
|
-
@change=${this._onCreateAttachment.bind(this)}
|
|
240
|
-
></ox-input-file>
|
|
241
|
-
<div>${building.name}</div>
|
|
242
|
-
</span>
|
|
243
|
-
`
|
|
244
|
-
})}
|
|
245
|
-
</div>
|
|
246
|
-
</div>
|
|
247
|
-
|
|
248
|
-
<div floor-container>
|
|
249
|
-
<div floor-title>
|
|
250
|
-
<h3>${this.project.buildingComplex?.buildings?.[this.selectedBuildingIdx]?.name} 층별 도면(PDF)</h3>
|
|
251
|
-
<span building-button>
|
|
252
|
-
${this.project.buildingComplex.buildings?.map((building, idx) => {
|
|
253
|
-
return this.project.buildingComplex?.buildings?.[this.selectedBuildingIdx]?.id === building.id
|
|
254
|
-
? html`
|
|
255
|
-
<md-filled-button @click=${() => this._onClickBuildingChange(idx)}> ${building.name} </md-filled-button>
|
|
256
|
-
`
|
|
257
|
-
: html`
|
|
258
|
-
<md-outlined-button @click=${() => this._onClickBuildingChange(idx)}> ${building.name} </md-outlined-button>
|
|
259
|
-
`
|
|
260
|
-
})}
|
|
261
|
-
</span>
|
|
262
|
-
</div>
|
|
263
|
-
|
|
264
|
-
<div floor-plan>
|
|
265
|
-
${this.project.buildingComplex?.buildings?.[this.selectedBuildingIdx]?.buildingLevels?.map((buildingLevel, idx) => {
|
|
266
|
-
return buildingLevel.mainDrawingThumbnail
|
|
267
|
-
? html`
|
|
268
|
-
<span plan>
|
|
269
|
-
<img
|
|
270
|
-
name="building-plan"
|
|
271
|
-
.src=${buildingLevel.mainDrawingThumbnail}
|
|
272
|
-
idx=${idx}
|
|
273
|
-
@click=${this._onClickImage}
|
|
274
|
-
/>
|
|
275
|
-
<div floor-name>${buildingLevel.floor}층</div>
|
|
276
|
-
</span>
|
|
277
|
-
`
|
|
278
|
-
: html`
|
|
279
|
-
<span plan>
|
|
280
|
-
<a name="building-plan" idx=${idx} @click=${this._onClickImage}>
|
|
281
|
-
<md-icon slot="icon">image</md-icon>
|
|
282
|
-
<div bold>도면 파일</div>
|
|
283
|
-
<div>업로드</div>
|
|
284
|
-
</a>
|
|
285
|
-
<div floor-name no-data>${buildingLevel.floor}층</div>
|
|
286
|
-
</span>
|
|
287
|
-
`
|
|
288
|
-
})}
|
|
289
|
-
</div>
|
|
290
|
-
</div>
|
|
291
|
-
|
|
292
|
-
<div plan-scale-container>
|
|
293
|
-
<h3>도면 축척 설정</h3>
|
|
294
|
-
<div>
|
|
295
|
-
<span>가로</span>
|
|
296
|
-
<md-outlined-text-field
|
|
297
|
-
type="text"
|
|
298
|
-
name="planXScale"
|
|
299
|
-
numeric
|
|
300
|
-
.value=${this.project.buildingComplex.planXScale?.toString() || ''}
|
|
301
|
-
@input=${this._onInputChange}
|
|
302
|
-
suffix-text="mm"
|
|
303
|
-
>
|
|
304
|
-
</md-outlined-text-field>
|
|
305
|
-
<span>X</span>
|
|
306
|
-
<span>세로</span>
|
|
307
|
-
<md-outlined-text-field
|
|
308
|
-
type="text"
|
|
309
|
-
name="planYScale"
|
|
310
|
-
numeric
|
|
311
|
-
.value=${this.project.buildingComplex.planYScale?.toString() || ''}
|
|
312
|
-
@input=${this._onInputChange}
|
|
313
|
-
suffix-text="mm"
|
|
314
|
-
>
|
|
315
|
-
</md-outlined-text-field>
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
</div>
|
|
319
|
-
`
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
async pageInitialized(lifecycle: PageLifecycle) {}
|
|
323
|
-
|
|
324
|
-
async pageUpdated(changes: any, lifecycle: PageLifecycle) {
|
|
325
|
-
if (this.active) {
|
|
326
|
-
this.projectId = lifecycle.resourceId || ''
|
|
327
|
-
await this.initProject(this.projectId)
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
async initProject(projectId: string = '') {
|
|
332
|
-
const response = await client.query({
|
|
333
|
-
query: gql`
|
|
334
|
-
query Project($id: String!) {
|
|
335
|
-
project(id: $id) {
|
|
336
|
-
id
|
|
337
|
-
name
|
|
338
|
-
buildingComplex {
|
|
339
|
-
id
|
|
340
|
-
planXScale
|
|
341
|
-
planYScale
|
|
342
|
-
buildings {
|
|
343
|
-
id
|
|
344
|
-
name
|
|
345
|
-
drawing {
|
|
346
|
-
id
|
|
347
|
-
name
|
|
348
|
-
}
|
|
349
|
-
buildingLevels {
|
|
350
|
-
id
|
|
351
|
-
floor
|
|
352
|
-
mainDrawing {
|
|
353
|
-
id
|
|
354
|
-
name
|
|
355
|
-
}
|
|
356
|
-
elevationDrawing {
|
|
357
|
-
id
|
|
358
|
-
name
|
|
359
|
-
}
|
|
360
|
-
rebarDistributionDrawing {
|
|
361
|
-
id
|
|
362
|
-
name
|
|
363
|
-
}
|
|
364
|
-
mainDrawingThumbnail
|
|
365
|
-
elevationDrawingThumbnail
|
|
366
|
-
rebarDistributionDrawingThumbnail
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
`,
|
|
373
|
-
variables: {
|
|
374
|
-
id: projectId
|
|
375
|
-
}
|
|
376
|
-
})
|
|
377
|
-
|
|
378
|
-
this.project = response.data?.project
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
private async _saveProject() {
|
|
382
|
-
// 첨부 파일 필드 제거 (첨부 파일은 {filename}Upload 로 전송)
|
|
383
|
-
for (let buildingKey in this.project.buildingComplex.buildings) {
|
|
384
|
-
const building = this.project.buildingComplex.buildings[buildingKey]
|
|
385
|
-
delete this.project.buildingComplex.buildings[buildingKey].drawing
|
|
386
|
-
|
|
387
|
-
for (let levelKey in building.buildingLevels) {
|
|
388
|
-
delete this.project.buildingComplex.buildings[buildingKey].buildingLevels[levelKey].mainDrawing
|
|
389
|
-
delete this.project.buildingComplex.buildings[buildingKey].buildingLevels[levelKey].mainDrawingImage
|
|
390
|
-
delete this.project.buildingComplex.buildings[buildingKey].buildingLevels[levelKey].mainDrawingThumbnail
|
|
391
|
-
delete this.project.buildingComplex.buildings[buildingKey].buildingLevels[levelKey].elevationDrawing
|
|
392
|
-
delete this.project.buildingComplex.buildings[buildingKey].buildingLevels[levelKey].elevationDrawingThumbnail
|
|
393
|
-
delete this.project.buildingComplex.buildings[buildingKey].buildingLevels[levelKey].rebarDistributionDrawing
|
|
394
|
-
delete this.project.buildingComplex.buildings[buildingKey].buildingLevels[levelKey].rebarDistributionDrawingThumbnail
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
const response = await client.mutate({
|
|
399
|
-
mutation: gql`
|
|
400
|
-
mutation UpdateProjectPlan($project: ProjectPatch!) {
|
|
401
|
-
updateProjectPlan(project: $project) {
|
|
402
|
-
id
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
`,
|
|
406
|
-
variables: {
|
|
407
|
-
project: this.project
|
|
408
|
-
},
|
|
409
|
-
context: {
|
|
410
|
-
hasUpload: true
|
|
411
|
-
}
|
|
412
|
-
})
|
|
413
|
-
|
|
414
|
-
if (!response.errors) {
|
|
415
|
-
notify({ message: '저장에 성공하였습니다.' })
|
|
416
|
-
|
|
417
|
-
// 데이터 다시 조회
|
|
418
|
-
this.initProject(this.project.id)
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// Input 요소의 값이 변경될 때 호출되는 콜백 함수
|
|
423
|
-
private _onInputChange(event: InputEvent, idx: number) {
|
|
424
|
-
const target = event.target as HTMLInputElement
|
|
425
|
-
let inputVal: any = target.value
|
|
426
|
-
this.project.buildingComplex![target.name] = Number(inputVal.replace(/\D/g, ''))
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
// 이미지 업로드
|
|
430
|
-
async _onCreateAttachment(e: CustomEvent) {
|
|
431
|
-
const target = e.target as HTMLInputElement
|
|
432
|
-
const file = e.detail[0] || null
|
|
433
|
-
const idx = Number(target.getAttribute('idx')) || 0
|
|
434
|
-
|
|
435
|
-
this.project.buildingComplex!.buildings![idx].drawingUpload = file
|
|
436
|
-
|
|
437
|
-
// re rendering
|
|
438
|
-
this.project = { ...this.project }
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
_onClickBuildingChange(idx: number) {
|
|
442
|
-
this.selectedBuildingIdx = idx
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
_onClickImage(e) {
|
|
446
|
-
const target = e.currentTarget as HTMLInputElement
|
|
447
|
-
const idx = Number(target.getAttribute('idx')) || 0
|
|
448
|
-
const buildingLevel = this.project.buildingComplex!.buildings![this.selectedBuildingIdx].buildingLevels![idx]
|
|
449
|
-
const title = buildingLevel.floor?.toString() + '층' || ''
|
|
450
|
-
|
|
451
|
-
// 팝업 오픈
|
|
452
|
-
this._openPopup(title, buildingLevel, idx)
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
private _openPopup(title: string, buildingLevel: BuildingLevel, selectedIdx: number) {
|
|
456
|
-
openPopup(
|
|
457
|
-
html`<popup-plan-upload
|
|
458
|
-
.buildingLevel=${buildingLevel}
|
|
459
|
-
.selectedIdx=${selectedIdx}
|
|
460
|
-
@file_change=${this._onChangeAdditionalDrawing.bind(this)}
|
|
461
|
-
></popup-plan-upload>`,
|
|
462
|
-
{
|
|
463
|
-
backdrop: true,
|
|
464
|
-
size: 'medium',
|
|
465
|
-
title: `${title} 도면 관리`
|
|
466
|
-
}
|
|
467
|
-
)
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
private _onChangeAdditionalDrawing(e) {
|
|
471
|
-
const idx = e.detail?.selectedIdx || null
|
|
472
|
-
const buildingLevel: BuildingLevel = e.detail?.buildingLevel || {}
|
|
473
|
-
|
|
474
|
-
this.project.buildingComplex!.buildings![this.selectedBuildingIdx]!.buildingLevels![idx] = { ...buildingLevel }
|
|
475
|
-
}
|
|
476
|
-
}
|