@dssp/supervision 0.0.10 → 0.0.11
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/client/pages/building-inspection/building-inspection-detail-checklist.ts +42 -1
- package/client/pages/building-inspection/building-inspection-detail-drawing.ts +2 -2
- package/client/pages/checklist/checklist-view.ts +32 -12
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +42 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +2 -2
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.js +40 -6
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/building-inspection/building-inspection-history.d.ts +1 -1
- package/dist-server/service/building-inspection/building-inspection-history.js +6 -6
- package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +3 -2
- package/dist-server/service/building-inspection/building-inspection-mutation.js +81 -2
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +18 -1
- package/dist-server/service/building-inspection/building-inspection-type.js +67 -7
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
- package/dist-server/service/checklist/checklist-history.d.ts +2 -2
- package/dist-server/service/checklist/checklist-history.js +3 -3
- package/dist-server/service/checklist/checklist-history.js.map +1 -1
- package/dist-server/service/checklist/checklist.d.ts +2 -2
- package/dist-server/service/checklist/checklist.js +2 -2
- package/dist-server/service/checklist/checklist.js.map +1 -1
- package/dist-server/service/index.js +2 -1
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/server/service/building-inspection/building-inspection-history.ts +5 -5
- package/server/service/building-inspection/building-inspection-mutation.ts +95 -3
- package/server/service/building-inspection/building-inspection-type.ts +43 -2
- package/server/service/checklist/checklist-history.ts +3 -3
- package/server/service/checklist/checklist.ts +2 -2
- package/server/service/index.ts +3 -2
|
@@ -87,7 +87,6 @@ export class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageV
|
|
|
87
87
|
<md-elevated-button @click=${this._onClickModifyChecklist}>
|
|
88
88
|
<md-icon slot="icon">assignment</md-icon>등록
|
|
89
89
|
</md-elevated-button>
|
|
90
|
-
<md-elevated-button> <md-icon slot="icon">assignment</md-icon>취소 </md-elevated-button>
|
|
91
90
|
</div>
|
|
92
91
|
</div>
|
|
93
92
|
`
|
|
@@ -116,6 +115,12 @@ export class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageV
|
|
|
116
115
|
location
|
|
117
116
|
inspectionParts
|
|
118
117
|
documentNo
|
|
118
|
+
constructionInspectionDate
|
|
119
|
+
supervisorInspectionDate
|
|
120
|
+
overallConstructorSignature
|
|
121
|
+
taskConstructorSignature
|
|
122
|
+
overallSupervisorySignature
|
|
123
|
+
taskSupervisorySignature
|
|
119
124
|
checklistItems {
|
|
120
125
|
id
|
|
121
126
|
name
|
|
@@ -182,5 +187,41 @@ export class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageV
|
|
|
182
187
|
|
|
183
188
|
private _onClickModifyChecklist() {
|
|
184
189
|
console.log('checklist : ', this.buildingInspection.checklist)
|
|
190
|
+
|
|
191
|
+
this.validateChecklist(this.buildingInspection.checklist)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
private async validateChecklist(checklist: any) {
|
|
195
|
+
const response = await client.mutate({
|
|
196
|
+
mutation: gql`
|
|
197
|
+
mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {
|
|
198
|
+
updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)
|
|
199
|
+
}
|
|
200
|
+
`,
|
|
201
|
+
variables: {
|
|
202
|
+
buildingInspection: {
|
|
203
|
+
id: this.buildingInspection.id,
|
|
204
|
+
checklist: {
|
|
205
|
+
id: checklist.id,
|
|
206
|
+
overallConstructorSignature: checklist.overallConstructorSignature,
|
|
207
|
+
taskConstructorSignature: checklist.taskConstructorSignature,
|
|
208
|
+
overallSupervisorySignature: checklist.overallSupervisorySignature,
|
|
209
|
+
taskSupervisorySignature: checklist.taskSupervisorySignature
|
|
210
|
+
},
|
|
211
|
+
checklistItem: checklist.checklistItems.map(item => ({
|
|
212
|
+
id: item.id,
|
|
213
|
+
constructionConfirmStatus: item.constructionConfirmStatus,
|
|
214
|
+
supervisoryConfirmStatus: item.supervisoryConfirmStatus
|
|
215
|
+
}))
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
if (!response.errors) {
|
|
221
|
+
notify({ message: '검측요청서를 등록하였습니다.' })
|
|
222
|
+
this.initBuildingInspection(this.buildingInspection.id)
|
|
223
|
+
} else {
|
|
224
|
+
notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })
|
|
225
|
+
}
|
|
185
226
|
}
|
|
186
227
|
}
|
|
@@ -60,7 +60,7 @@ export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageVie
|
|
|
60
60
|
<div body>
|
|
61
61
|
<ox-image-marker
|
|
62
62
|
.imageUrl=${this.buildingInspection?.buildingLevel?.mainDrawingImage || '/assets/images/img-drawing-default.png'}
|
|
63
|
-
.shapes=${JSON.parse(this.buildingInspection?.drawingMarker || []
|
|
63
|
+
.shapes=${JSON.parse(this.buildingInspection?.drawingMarker || null) || []}
|
|
64
64
|
@shapes-changed=${this.onClickMarkerSave}
|
|
65
65
|
></ox-image-marker>
|
|
66
66
|
</div>
|
|
@@ -138,7 +138,7 @@ export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageVie
|
|
|
138
138
|
private async onClickMarkerSave(e) {
|
|
139
139
|
const response = await client.query({
|
|
140
140
|
query: gql`
|
|
141
|
-
mutation UpdateBuildingInspection($patch:
|
|
141
|
+
mutation UpdateBuildingInspection($patch: UpdateBuildingInspectionDrawingMarker!) {
|
|
142
142
|
updateBuildingInspection(patch: $patch) {
|
|
143
143
|
id
|
|
144
144
|
drawingMarker
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js'
|
|
2
|
-
import { css, html, LitElement } from 'lit'
|
|
3
|
-
import { customElement, property } from 'lit/decorators.js'
|
|
2
|
+
import { css, html, LitElement, PropertyValues } from 'lit'
|
|
3
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
|
4
4
|
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
|
5
|
-
import {
|
|
6
|
-
ChecklistTypeMainType,
|
|
7
|
-
CHECKLIST_MAIN_TYPE_LIST,
|
|
8
|
-
BuildingInspectionStatus
|
|
9
|
-
} from '../building-inspection/building-inspection-list'
|
|
5
|
+
import { CHECKLIST_MAIN_TYPE_LIST, BuildingInspectionStatus } from '../building-inspection/building-inspection-list'
|
|
10
6
|
import '@operato/input/ox-input-signature.js'
|
|
11
7
|
|
|
12
8
|
export const enum ChecklistMode {
|
|
@@ -169,6 +165,11 @@ class ChecklistView extends LitElement {
|
|
|
169
165
|
@property({ type: Object }) checklist: any = {}
|
|
170
166
|
@property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT
|
|
171
167
|
|
|
168
|
+
@query('ox-input-signature[name="overallConstructorSignature"]') private elOverallConstructorSignature
|
|
169
|
+
@query('ox-input-signature[name="taskConstructorSignature"]') private elTaskConstructorSignature
|
|
170
|
+
@query('ox-input-signature[name="overallSupervisorySignature"]') private elOverallSupervisorySignature
|
|
171
|
+
@query('ox-input-signature[name="taskSupervisorySignature"]') private elTaskSupervisorySignature
|
|
172
|
+
|
|
172
173
|
render() {
|
|
173
174
|
const today = this._getDate(new Date())
|
|
174
175
|
const isConstructorStep = this.status == BuildingInspectionStatus.WAIT || this.status == BuildingInspectionStatus.FAIL
|
|
@@ -188,7 +189,9 @@ class ChecklistView extends LitElement {
|
|
|
188
189
|
return a.sequence - b.sequence
|
|
189
190
|
})
|
|
190
191
|
|
|
191
|
-
const processedItems = this.
|
|
192
|
+
const processedItems = this.drawChecklistItems(this.checklist?.checklistItems || [])
|
|
193
|
+
|
|
194
|
+
console.log('this.checklist :', this.checklist)
|
|
192
195
|
|
|
193
196
|
return html`
|
|
194
197
|
<div wrapper>
|
|
@@ -252,6 +255,7 @@ class ChecklistView extends LitElement {
|
|
|
252
255
|
item-name="constructionConfirmStatus"
|
|
253
256
|
name=${'radio-construction-' + item.id}
|
|
254
257
|
value="T"
|
|
258
|
+
.checked=${item.constructionConfirmStatus === 'T'}
|
|
255
259
|
?disabled=${!isConstructorStep}
|
|
256
260
|
@change=${this._onChangeConfirmStatus}
|
|
257
261
|
></md-radio>
|
|
@@ -262,6 +266,7 @@ class ChecklistView extends LitElement {
|
|
|
262
266
|
item-name="constructionConfirmStatus"
|
|
263
267
|
name=${'radio-construction-' + item.id}
|
|
264
268
|
value="F"
|
|
269
|
+
.checked=${item.constructionConfirmStatus === 'F'}
|
|
265
270
|
?disabled=${!isConstructorStep}
|
|
266
271
|
@change=${this._onChangeConfirmStatus}
|
|
267
272
|
></md-radio>
|
|
@@ -272,6 +277,7 @@ class ChecklistView extends LitElement {
|
|
|
272
277
|
item-name="supervisoryConfirmStatus"
|
|
273
278
|
name=${'radio-supervisory-' + item.id}
|
|
274
279
|
value="T"
|
|
280
|
+
.checked=${item.supervisoryConfirmStatus === 'T'}
|
|
275
281
|
?disabled=${!isSupervisoryStep}
|
|
276
282
|
@change=${this._onChangeConfirmStatus}
|
|
277
283
|
></md-radio>
|
|
@@ -282,6 +288,7 @@ class ChecklistView extends LitElement {
|
|
|
282
288
|
item-name="supervisoryConfirmStatus"
|
|
283
289
|
name=${'radio-supervisory-' + item.id}
|
|
284
290
|
value="F"
|
|
291
|
+
.checked=${item.supervisoryConfirmStatus === 'F'}
|
|
285
292
|
?disabled=${!isSupervisoryStep}
|
|
286
293
|
@change=${this._onChangeConfirmStatus}
|
|
287
294
|
></md-radio>
|
|
@@ -298,7 +305,7 @@ class ChecklistView extends LitElement {
|
|
|
298
305
|
<tr first>
|
|
299
306
|
<th rowspan="2">시공자점검일</th>
|
|
300
307
|
<td rowspan="2">
|
|
301
|
-
${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.
|
|
308
|
+
${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.constructionInspectionDate)}
|
|
302
309
|
</td>
|
|
303
310
|
<th>총괄 시공책임자</th>
|
|
304
311
|
<td>
|
|
@@ -328,7 +335,7 @@ class ChecklistView extends LitElement {
|
|
|
328
335
|
<tr>
|
|
329
336
|
<th rowspan="2">감리자점검일</th>
|
|
330
337
|
<td rowspan="2">
|
|
331
|
-
${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.
|
|
338
|
+
${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.supervisorInspectionDate)}
|
|
332
339
|
</td>
|
|
333
340
|
<th>총괄 감리책임자</th>
|
|
334
341
|
<td>
|
|
@@ -369,6 +376,19 @@ class ChecklistView extends LitElement {
|
|
|
369
376
|
`
|
|
370
377
|
}
|
|
371
378
|
|
|
379
|
+
updated(_changed: PropertyValues): void {
|
|
380
|
+
if (_changed.has('checklist')) {
|
|
381
|
+
if (this.checklist?.overallConstructorSignature)
|
|
382
|
+
this.elOverallConstructorSignature.loadSignature(this.checklist?.overallConstructorSignature)
|
|
383
|
+
if (this.checklist?.taskConstructorSignature)
|
|
384
|
+
this.elTaskConstructorSignature.loadSignature(this.checklist?.taskConstructorSignature)
|
|
385
|
+
if (this.checklist?.overallSupervisorySignature)
|
|
386
|
+
this.elOverallSupervisorySignature.loadSignature(this.checklist?.overallSupervisorySignature)
|
|
387
|
+
if (this.checklist?.taskSupervisorySignature)
|
|
388
|
+
this.elTaskSupervisorySignature.loadSignature(this.checklist?.taskSupervisorySignature)
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
372
392
|
private _onChangeConfirmStatus(e: Event) {
|
|
373
393
|
const target = e.target as HTMLInputElement
|
|
374
394
|
const itemId = target.getAttribute('item-id')
|
|
@@ -389,7 +409,7 @@ class ChecklistView extends LitElement {
|
|
|
389
409
|
private _getDate(date) {
|
|
390
410
|
if (!date) return ' 년 월 일'
|
|
391
411
|
|
|
392
|
-
const _date = date || new Date()
|
|
412
|
+
const _date = new Date(date) || new Date()
|
|
393
413
|
return _date.toLocaleDateString('ko-KR', {
|
|
394
414
|
timeZone: 'Asia/Seoul',
|
|
395
415
|
year: 'numeric',
|
|
@@ -398,7 +418,7 @@ class ChecklistView extends LitElement {
|
|
|
398
418
|
})
|
|
399
419
|
}
|
|
400
420
|
|
|
401
|
-
private
|
|
421
|
+
private drawChecklistItems(checklistItems) {
|
|
402
422
|
const mainTypeRowspans = {}
|
|
403
423
|
const detailTypeRowspans = {}
|
|
404
424
|
let previousMainType = null
|
|
@@ -17,5 +17,6 @@ export declare class BuildingInspectionDetailChecklist extends BuildingInspectio
|
|
|
17
17
|
initBuildingInspection(buildingInspectionId?: string): Promise<void>;
|
|
18
18
|
private _getProjectByBuildingComplexId;
|
|
19
19
|
private _onClickModifyChecklist;
|
|
20
|
+
private validateChecklist;
|
|
20
21
|
}
|
|
21
22
|
export {};
|
|
@@ -7,6 +7,7 @@ import { css, html } from 'lit';
|
|
|
7
7
|
import { customElement, state } from 'lit/decorators.js';
|
|
8
8
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
9
9
|
import { client } from '@operato/graphql';
|
|
10
|
+
import { notify } from '@operato/layout';
|
|
10
11
|
import gql from 'graphql-tag';
|
|
11
12
|
import './component/building-inspection-detail-header';
|
|
12
13
|
import '../checklist/checklist-view';
|
|
@@ -43,7 +44,6 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
43
44
|
<md-elevated-button @click=${this._onClickModifyChecklist}>
|
|
44
45
|
<md-icon slot="icon">assignment</md-icon>등록
|
|
45
46
|
</md-elevated-button>
|
|
46
|
-
<md-elevated-button> <md-icon slot="icon">assignment</md-icon>취소 </md-elevated-button>
|
|
47
47
|
</div>
|
|
48
48
|
</div>
|
|
49
49
|
`;
|
|
@@ -71,6 +71,12 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
71
71
|
location
|
|
72
72
|
inspectionParts
|
|
73
73
|
documentNo
|
|
74
|
+
constructionInspectionDate
|
|
75
|
+
supervisorInspectionDate
|
|
76
|
+
overallConstructorSignature
|
|
77
|
+
taskConstructorSignature
|
|
78
|
+
overallSupervisorySignature
|
|
79
|
+
taskSupervisorySignature
|
|
74
80
|
checklistItems {
|
|
75
81
|
id
|
|
76
82
|
name
|
|
@@ -132,6 +138,41 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
|
|
|
132
138
|
}
|
|
133
139
|
_onClickModifyChecklist() {
|
|
134
140
|
console.log('checklist : ', this.buildingInspection.checklist);
|
|
141
|
+
this.validateChecklist(this.buildingInspection.checklist);
|
|
142
|
+
}
|
|
143
|
+
async validateChecklist(checklist) {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
const response = await client.mutate({
|
|
146
|
+
mutation: gql `
|
|
147
|
+
mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {
|
|
148
|
+
updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)
|
|
149
|
+
}
|
|
150
|
+
`,
|
|
151
|
+
variables: {
|
|
152
|
+
buildingInspection: {
|
|
153
|
+
id: this.buildingInspection.id,
|
|
154
|
+
checklist: {
|
|
155
|
+
id: checklist.id,
|
|
156
|
+
overallConstructorSignature: checklist.overallConstructorSignature,
|
|
157
|
+
taskConstructorSignature: checklist.taskConstructorSignature,
|
|
158
|
+
overallSupervisorySignature: checklist.overallSupervisorySignature,
|
|
159
|
+
taskSupervisorySignature: checklist.taskSupervisorySignature
|
|
160
|
+
},
|
|
161
|
+
checklistItem: checklist.checklistItems.map(item => ({
|
|
162
|
+
id: item.id,
|
|
163
|
+
constructionConfirmStatus: item.constructionConfirmStatus,
|
|
164
|
+
supervisoryConfirmStatus: item.supervisoryConfirmStatus
|
|
165
|
+
}))
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
if (!response.errors) {
|
|
170
|
+
notify({ message: '검측요청서를 등록하였습니다.' });
|
|
171
|
+
this.initBuildingInspection(this.buildingInspection.id);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
notify({ message: ((_b = (_a = response.errors) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.message) || '검측 요청서 등록에 실패하였습니다.', level: 'error' });
|
|
175
|
+
}
|
|
135
176
|
}
|
|
136
177
|
};
|
|
137
178
|
BuildingInspectionDetailChecklist.styles = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-checklist.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,aAAa,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAG7B,OAAO,+CAA+C,CAAA;AACtD,OAAO,6BAA6B,CAAA;AAI7B,IAA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AAI,QAAQ,CAAC,MAAM;YAAE,OAAM;QAE3B,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAA;QAE1D,MAAM,IAAI,CAAC,8BAA8B,CAAC,MAAA,MAAA,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,0CAAE,QAAQ,0CAAE,eAAe,0CAAE,EAAE,CAAC,CAAA;IAClH,CAAC;IAEO,KAAK,CAAC,8BAA8B,CAAC,iBAAiB;QAC5D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;OAOT;YACD,SAAS,EAAE;gBACT,iBAAiB;aAClB;SACF,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM;YAAE,OAAM;QAE3B,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAA;IACtC,CAAC;IAEO,uBAAuB;QAC7B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;IAChE,CAAC;;AApKM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;kEAAkB;AAC1B;IAAC,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CAsK7C;SAtKY,iCAAiC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\n\nimport './component/building-inspection-detail-header'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageView) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n ></checklist-view>\n\n <div button-container>\n <md-elevated-button @click=${this._onClickModifyChecklist}>\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n <md-elevated-button> <md-icon slot=\"icon\">assignment</md-icon>취소 </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n comment\n }\n }\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n console.log('checklist : ', this.buildingInspection.checklist)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-checklist.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,aAAa,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAA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import { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { openPopup } from '@operato/layout'\n\nimport './component/building-inspection-detail-header'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageView) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n ></checklist-view>\n\n <div button-container>\n <md-elevated-button @click=${this._onClickModifyChecklist}>\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n comment\n }\n }\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n console.log('checklist : ', this.buildingInspection.checklist)\n\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n}\n"]}
|
|
@@ -36,7 +36,7 @@ let BuildingInspectionDetailDrawing = class BuildingInspectionDetailDrawing exte
|
|
|
36
36
|
<div body>
|
|
37
37
|
<ox-image-marker
|
|
38
38
|
.imageUrl=${((_k = (_j = this.buildingInspection) === null || _j === void 0 ? void 0 : _j.buildingLevel) === null || _k === void 0 ? void 0 : _k.mainDrawingImage) || '/assets/images/img-drawing-default.png'}
|
|
39
|
-
.shapes=${JSON.parse(((_l = this.buildingInspection) === null || _l === void 0 ? void 0 : _l.drawingMarker) || []
|
|
39
|
+
.shapes=${JSON.parse(((_l = this.buildingInspection) === null || _l === void 0 ? void 0 : _l.drawingMarker) || null) || []}
|
|
40
40
|
@shapes-changed=${this.onClickMarkerSave}
|
|
41
41
|
></ox-image-marker>
|
|
42
42
|
</div>
|
|
@@ -108,7 +108,7 @@ let BuildingInspectionDetailDrawing = class BuildingInspectionDetailDrawing exte
|
|
|
108
108
|
async onClickMarkerSave(e) {
|
|
109
109
|
const response = await client.query({
|
|
110
110
|
query: gql `
|
|
111
|
-
mutation UpdateBuildingInspection($patch:
|
|
111
|
+
mutation UpdateBuildingInspection($patch: UpdateBuildingInspectionDrawingMarker!) {
|
|
112
112
|
updateBuildingInspection(patch: $patch) {
|
|
113
113
|
id
|
|
114
114
|
drawingMarker
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-detail-drawing.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,aAAa,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,+CAA+C,CAAA;AACtD,OAAO,0CAA0C,CAAA;AAG1C,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,mBAAmB,CAAC,QAAQ,CAAC;IAA3E;;QAyBI,YAAO,GAAQ,EAAE,CAAA;QACjB,uBAAkB,GAAQ,EAAE,CAAA;QAC5B,yBAAoB,GAAW,EAAE,CAAA;IAsH5C,CAAC;IApHC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,kBAAkB;SAC1B,CAAA;IACH,CAAC;IAED,MAAM;;QACJ,OAAO,IAAI,CAAA;;gCAEiB,MAAA,IAAI,CAAC,kBAAkB,0CAAE,EAAE;2BAChC,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,0CAAE,EAAE;uBAC9C,IAAI,CAAC,OAAO,CAAC,IAAI;wBAChB,MAAA,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,0CAAE,QAAQ,0CAAE,IAAI;8BAChD,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,0CAAE,KAAK;;;;;sBAKrD,CAAA,MAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,0CAAE,gBAAgB,KAAI,wCAAwC;oBACtG,IAAI,CAAC,KAAK,CAAC,CAAA,MAAA,IAAI,CAAC,kBAAkB,0CAAE,aAAa,KAAI,
|
|
1
|
+
{"version":3,"file":"building-inspection-detail-drawing.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-drawing.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,aAAa,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,+CAA+C,CAAA;AACtD,OAAO,0CAA0C,CAAA;AAG1C,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,mBAAmB,CAAC,QAAQ,CAAC;IAA3E;;QAyBI,YAAO,GAAQ,EAAE,CAAA;QACjB,uBAAkB,GAAQ,EAAE,CAAA;QAC5B,yBAAoB,GAAW,EAAE,CAAA;IAsH5C,CAAC;IApHC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,kBAAkB;SAC1B,CAAA;IACH,CAAC;IAED,MAAM;;QACJ,OAAO,IAAI,CAAA;;gCAEiB,MAAA,IAAI,CAAC,kBAAkB,0CAAE,EAAE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AE,CAAC,CAAA;IAClH,CAAC;IAEO,KAAK,CAAC,8BAA8B,CAAC,iBAAiB;QAC5D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;OAOT;YACD,SAAS,EAAE;gBACT,iBAAiB;aAClB;SACF,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM;YAAE,OAAM;QAE3B,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAA;IACtC,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;OAOT;YACD,SAAS,EAAE;gBACT,KAAK,EAAE;oBACL,EAAE,EAAE,IAAI,CAAC,oBAAoB;oBAC7B,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;iBACxC;aACF;SACF,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM;YAAE,OAAM;QAE3B,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAA;IACjC,CAAC;;AA/IM,sCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;gEAAkB;AAC1B;IAAC,KAAK,EAAE;;2EAA6B;AACrC;IAAC,KAAK,EAAE;;6EAAkC;AA3B/B,+BAA+B;IAD3C,aAAa,CAAC,oCAAoC,CAAC;GACvC,+BAA+B,CAiJ3C;SAjJY,+BAA+B","sourcesContent":["import '@material/web/icon/icon.js'\nimport { CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport './component/building-inspection-detail-header'\nimport '@operato/image-marker/ox-image-marker.js'\n\n@customElement('building-inspection-detail-drawing')\nexport class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageView) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 75px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: #f7f7f7;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n @state() buildingInspectionId: string = ''\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 도면'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n <ox-image-marker\n .imageUrl=${this.buildingInspection?.buildingLevel?.mainDrawingImage || '/assets/images/img-drawing-default.png'}\n .shapes=${JSON.parse(this.buildingInspection?.drawingMarker || null) || []}\n @shapes-changed=${this.onClickMarkerSave}\n ></ox-image-marker>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n this.buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(this.buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n drawingMarker\n buildingLevel {\n id\n floor\n mainDrawing {\n id\n name\n fullpath\n }\n mainDrawingImage\n building {\n id\n name\n buildingComplex {\n id\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return\n\n this.buildingInspection = response.data.buildingInspection\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private async onClickMarkerSave(e) {\n const response = await client.query({\n query: gql`\n mutation UpdateBuildingInspection($patch: UpdateBuildingInspectionDrawingMarker!) {\n updateBuildingInspection(patch: $patch) {\n id\n drawingMarker\n }\n }\n `,\n variables: {\n patch: {\n id: this.buildingInspectionId,\n drawingMarker: JSON.stringify(e.detail)\n }\n }\n })\n\n if (response.errors) return\n\n notify({ message: '저장되었습니다.' })\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@material/web/icon/icon.js';
|
|
3
3
|
import { css, html, LitElement } from 'lit';
|
|
4
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
5
5
|
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
|
6
6
|
import { CHECKLIST_MAIN_TYPE_LIST, BuildingInspectionStatus } from '../building-inspection/building-inspection-list';
|
|
7
7
|
import '@operato/input/ox-input-signature.js';
|
|
@@ -32,7 +32,8 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
32
32
|
// 3순위: sequence 오름차순
|
|
33
33
|
return a.sequence - b.sequence;
|
|
34
34
|
});
|
|
35
|
-
const processedItems = this.
|
|
35
|
+
const processedItems = this.drawChecklistItems(((_c = this.checklist) === null || _c === void 0 ? void 0 : _c.checklistItems) || []);
|
|
36
|
+
console.log('this.checklist :', this.checklist);
|
|
36
37
|
return html `
|
|
37
38
|
<div wrapper>
|
|
38
39
|
<div name>${this.checklist.name}</div>
|
|
@@ -95,6 +96,7 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
95
96
|
item-name="constructionConfirmStatus"
|
|
96
97
|
name=${'radio-construction-' + item.id}
|
|
97
98
|
value="T"
|
|
99
|
+
.checked=${item.constructionConfirmStatus === 'T'}
|
|
98
100
|
?disabled=${!isConstructorStep}
|
|
99
101
|
@change=${this._onChangeConfirmStatus}
|
|
100
102
|
></md-radio>
|
|
@@ -105,6 +107,7 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
105
107
|
item-name="constructionConfirmStatus"
|
|
106
108
|
name=${'radio-construction-' + item.id}
|
|
107
109
|
value="F"
|
|
110
|
+
.checked=${item.constructionConfirmStatus === 'F'}
|
|
108
111
|
?disabled=${!isConstructorStep}
|
|
109
112
|
@change=${this._onChangeConfirmStatus}
|
|
110
113
|
></md-radio>
|
|
@@ -115,6 +118,7 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
115
118
|
item-name="supervisoryConfirmStatus"
|
|
116
119
|
name=${'radio-supervisory-' + item.id}
|
|
117
120
|
value="T"
|
|
121
|
+
.checked=${item.supervisoryConfirmStatus === 'T'}
|
|
118
122
|
?disabled=${!isSupervisoryStep}
|
|
119
123
|
@change=${this._onChangeConfirmStatus}
|
|
120
124
|
></md-radio>
|
|
@@ -125,6 +129,7 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
125
129
|
item-name="supervisoryConfirmStatus"
|
|
126
130
|
name=${'radio-supervisory-' + item.id}
|
|
127
131
|
value="F"
|
|
132
|
+
.checked=${item.supervisoryConfirmStatus === 'F'}
|
|
128
133
|
?disabled=${!isSupervisoryStep}
|
|
129
134
|
@change=${this._onChangeConfirmStatus}
|
|
130
135
|
></md-radio>
|
|
@@ -141,7 +146,7 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
141
146
|
<tr first>
|
|
142
147
|
<th rowspan="2">시공자점검일</th>
|
|
143
148
|
<td rowspan="2">
|
|
144
|
-
${this.mode == "VIEWER" /* ChecklistMode.VIEWER */ ? today : this._getDate(this.checklist.
|
|
149
|
+
${this.mode == "VIEWER" /* ChecklistMode.VIEWER */ ? today : this._getDate(this.checklist.constructionInspectionDate)}
|
|
145
150
|
</td>
|
|
146
151
|
<th>총괄 시공책임자</th>
|
|
147
152
|
<td>
|
|
@@ -171,7 +176,7 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
171
176
|
<tr>
|
|
172
177
|
<th rowspan="2">감리자점검일</th>
|
|
173
178
|
<td rowspan="2">
|
|
174
|
-
${this.mode == "VIEWER" /* ChecklistMode.VIEWER */ ? today : this._getDate(this.checklist.
|
|
179
|
+
${this.mode == "VIEWER" /* ChecklistMode.VIEWER */ ? today : this._getDate(this.checklist.supervisorInspectionDate)}
|
|
175
180
|
</td>
|
|
176
181
|
<th>총괄 감리책임자</th>
|
|
177
182
|
<td>
|
|
@@ -211,6 +216,19 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
211
216
|
</div>
|
|
212
217
|
`;
|
|
213
218
|
}
|
|
219
|
+
updated(_changed) {
|
|
220
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
221
|
+
if (_changed.has('checklist')) {
|
|
222
|
+
if ((_a = this.checklist) === null || _a === void 0 ? void 0 : _a.overallConstructorSignature)
|
|
223
|
+
this.elOverallConstructorSignature.loadSignature((_b = this.checklist) === null || _b === void 0 ? void 0 : _b.overallConstructorSignature);
|
|
224
|
+
if ((_c = this.checklist) === null || _c === void 0 ? void 0 : _c.taskConstructorSignature)
|
|
225
|
+
this.elTaskConstructorSignature.loadSignature((_d = this.checklist) === null || _d === void 0 ? void 0 : _d.taskConstructorSignature);
|
|
226
|
+
if ((_e = this.checklist) === null || _e === void 0 ? void 0 : _e.overallSupervisorySignature)
|
|
227
|
+
this.elOverallSupervisorySignature.loadSignature((_f = this.checklist) === null || _f === void 0 ? void 0 : _f.overallSupervisorySignature);
|
|
228
|
+
if ((_g = this.checklist) === null || _g === void 0 ? void 0 : _g.taskSupervisorySignature)
|
|
229
|
+
this.elTaskSupervisorySignature.loadSignature((_h = this.checklist) === null || _h === void 0 ? void 0 : _h.taskSupervisorySignature);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
214
232
|
_onChangeConfirmStatus(e) {
|
|
215
233
|
var _a, _b;
|
|
216
234
|
const target = e.target;
|
|
@@ -226,7 +244,7 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
226
244
|
_getDate(date) {
|
|
227
245
|
if (!date)
|
|
228
246
|
return ' 년 월 일';
|
|
229
|
-
const _date = date || new Date();
|
|
247
|
+
const _date = new Date(date) || new Date();
|
|
230
248
|
return _date.toLocaleDateString('ko-KR', {
|
|
231
249
|
timeZone: 'Asia/Seoul',
|
|
232
250
|
year: 'numeric',
|
|
@@ -234,7 +252,7 @@ let ChecklistView = class ChecklistView extends LitElement {
|
|
|
234
252
|
day: 'numeric'
|
|
235
253
|
});
|
|
236
254
|
}
|
|
237
|
-
|
|
255
|
+
drawChecklistItems(checklistItems) {
|
|
238
256
|
const mainTypeRowspans = {};
|
|
239
257
|
const detailTypeRowspans = {};
|
|
240
258
|
let previousMainType = null;
|
|
@@ -428,6 +446,22 @@ __decorate([
|
|
|
428
446
|
property({ type: String }),
|
|
429
447
|
__metadata("design:type", String)
|
|
430
448
|
], ChecklistView.prototype, "status", void 0);
|
|
449
|
+
__decorate([
|
|
450
|
+
query('ox-input-signature[name="overallConstructorSignature"]'),
|
|
451
|
+
__metadata("design:type", Object)
|
|
452
|
+
], ChecklistView.prototype, "elOverallConstructorSignature", void 0);
|
|
453
|
+
__decorate([
|
|
454
|
+
query('ox-input-signature[name="taskConstructorSignature"]'),
|
|
455
|
+
__metadata("design:type", Object)
|
|
456
|
+
], ChecklistView.prototype, "elTaskConstructorSignature", void 0);
|
|
457
|
+
__decorate([
|
|
458
|
+
query('ox-input-signature[name="overallSupervisorySignature"]'),
|
|
459
|
+
__metadata("design:type", Object)
|
|
460
|
+
], ChecklistView.prototype, "elOverallSupervisorySignature", void 0);
|
|
461
|
+
__decorate([
|
|
462
|
+
query('ox-input-signature[name="taskSupervisorySignature"]'),
|
|
463
|
+
__metadata("design:type", Object)
|
|
464
|
+
], ChecklistView.prototype, "elTaskSupervisorySignature", void 0);
|
|
431
465
|
ChecklistView = __decorate([
|
|
432
466
|
customElement('checklist-view')
|
|
433
467
|
], ChecklistView);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checklist-view.js","sourceRoot":"","sources":["../../../client/pages/checklist/checklist-view.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAEL,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,iDAAiD,CAAA;AACxD,OAAO,sCAAsC,CAAA;AAQ7C,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAsJ8B,SAAI,uCAAsC;QAC1C,cAAS,GAAQ,EAAE,CAAA;QACnB,WAAM,GAA6B,wBAAwB,CAAC,IAAI,CAAA;IAiR9F,CAAC;IA/QC,MAAM;;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QACvC,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,IAAI,wBAAwB,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,wBAAwB,CAAC,IAAI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,CAAA;YACtD,MAAM,kBAAkB,GAAG,UAAU,KAAK,kBAAkB,CAAA;YAE5D,MAAM,eAAe,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;YAClD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,QAAQ,IAAI,UAAU,EAAE,CAAC,CAAA;YAEzE,aAAa;YACb,gBAAgB,GAAG,QAAQ,CAAA;YAC3B,kBAAkB,GAAG,UAAU,CAAA;YAE/B,OAAO;gBACL,IAAI;gBACJ,gBAAgB;gBAChB,eAAe;gBACf,kBAAkB;gBAClB,iBAAiB;aAClB,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;;AAvaM,oBAAM,GAAG;IACd,qBAAqB;IACrB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+IF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAA2C;AACtE;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAoB;AAC/C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CAAiE;AAxJxF,aAAa;IADlB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,aAAa,CAyalB","sourcesContent":["import '@material/web/icon/icon.js'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport {\n ChecklistTypeMainType,\n CHECKLIST_MAIN_TYPE_LIST,\n BuildingInspectionStatus\n} from '../building-inspection/building-inspection-list'\nimport '@operato/input/ox-input-signature.js'\n\nexport const enum ChecklistMode {\n VIEWER = 'VIEWER',\n EDITOR = 'EDITOR'\n}\n\n@customElement('checklist-view')\nclass ChecklistView extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n font-size: 14px;\n padding: 20px;\n min-width: 800px;\n\n background-color: var(--md-sys-color-surface);\n }\n\n [bold] {\n font-weight: bold;\n }\n\n div[name] {\n display: flex;\n color: #586878;\n font-size: 24px;\n font-weight: bold;\n align-items: center;\n justify-content: center;\n }\n\n table {\n width: 100%;\n font-size: 15px;\n color: #586878;\n text-align: left;\n border-collapse: collapse;\n td,\n th {\n border: 1px #999999 solid;\n padding-inline: 8px;\n }\n th {\n background-color: #efefef;\n font-weight: bold;\n }\n td {\n height: 35px;\n &[radio] {\n text-align: center;\n vertical-align: middle;\n width: 55px;\n }\n &[attachment] {\n width: 90px;\n }\n }\n }\n\n table[header] {\n margin-top: 5px;\n\n td {\n min-width: 180px;\n border-left: none;\n }\n th {\n width: 110px;\n border-right: none;\n }\n }\n\n table[body] {\n border: 2px solid #999999;\n border-bottom: none;\n margin-top: 10px;\n\n th {\n text-align: center;\n\n &[type] {\n min-width: 150px;\n }\n &[inspection-name] {\n min-width: 250px;\n }\n &[result] {\n width: 270px;\n }\n &[criteria] {\n width: 90px;\n }\n &[small] {\n width: 60px;\n }\n }\n td {\n &[main-type] {\n width: 50px;\n text-align: center;\n word-break: keep-all;\n }\n }\n }\n\n table[tail] {\n border: 2px solid #999999;\n border-top: none;\n margin-top: -1px;\n\n tr[first] td {\n border-top: none;\n }\n td {\n width: 25%;\n border-left: none;\n text-align: center;\n position: relative;\n }\n th {\n width: 25%;\n border-right: none;\n }\n\n span[sign-text] {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n pointer-events: none;\n }\n ox-input-signature {\n margin: 10px;\n\n &[disabled] {\n background: #eee;\n }\n }\n }\n\n div[footer] {\n display: flex;\n flex-direction: column;\n gap: 3px;\n font-size: 12px;\n margin-top: 10px;\n color: #586878;\n text-indent: -9px;\n padding-left: 9px;\n }\n `\n ]\n\n @property({ type: String }) mode: ChecklistMode = ChecklistMode.VIEWER\n @property({ type: Object }) checklist: any = {}\n @property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT\n\n render() {\n const today = this._getDate(new Date())\n const isConstructorStep = this.status == BuildingInspectionStatus.WAIT || this.status == BuildingInspectionStatus.FAIL\n const isSupervisoryStep = this.status == BuildingInspectionStatus.REQUEST\n\n // 체크리스트 아이템 정렬\n this.checklist?.checklistItems?.sort((a, b) => {\n // 1순위: mainType 오름차순\n if (a.mainType < b.mainType) return -1\n if (a.mainType > b.mainType) return 1\n\n // 2순위: detailType 오름차순\n if (a.detailType < b.detailType) return -1\n if (a.detailType > b.detailType) return 1\n\n // 3순위: sequence 오름차순\n return a.sequence - b.sequence\n })\n\n const processedItems = this.processChecklistItems(this.checklist?.checklistItems || [])\n\n return html`\n <div wrapper>\n <div name>${this.checklist.name}</div>\n\n <table header>\n <tr>\n <th>공종</th>\n <td>${this.checklist.constructionType}</td>\n <th>문서 번호</th>\n <td>${this.checklist.documentNo}</td>\n </tr>\n <tr>\n <th>세부 공종</th>\n <td>${this.checklist.constructionDetailType}</td>\n <th>위치 및 부위</th>\n <td>${this.checklist.location}</td>\n </tr>\n <tr>\n <th>검측 부위</th>\n <td>${this.checklist?.inspectionParts?.join(', ') || ''}</td>\n <th></th>\n <td></td>\n </tr>\n </table>\n\n <table body>\n <thead>\n <tr>\n <th colspan=\"2\" rowspan=\"3\" type>구분</th>\n <th rowspan=\"3\" inspection-name>검사항목</th>\n <th rowspan=\"3\" criteria>검사기준</th>\n <th colspan=\"4\" result>검사결과</th>\n <th rowspan=\"3\" small>첨부자료</th>\n <th rowspan=\"3\" small>조치사항</th>\n </tr>\n <tr>\n <th colspan=\"2\">시공자</th>\n <th colspan=\"2\">감리자</th>\n </tr>\n <tr>\n <th>적합</th>\n <th>부적합</th>\n <th>적합</th>\n <th>부적합</th>\n </tr>\n </thead>\n <tbody>\n ${processedItems.map(({ item, showMainTypeCell, mainTypeRowspan, showDetailTypeCell, detailTypeRowspan }, idx) => {\n return html` <tr>\n ${showMainTypeCell\n ? html`<td main-type bold rowspan=\"${mainTypeRowspan}\">${CHECKLIST_MAIN_TYPE_LIST[item.mainType]}</td>`\n : ''}\n ${showDetailTypeCell ? html` <td bold rowspan=\"${detailTypeRowspan}\">${item.detailType}</td> ` : ''}\n\n <td bold>${idx + 1}. ${item.name}</td>\n <td>${item.inspctionCriteria}</td>\n <td radio>\n <md-radio\n item-id=${item.id}\n item-name=\"constructionConfirmStatus\"\n name=${'radio-construction-' + item.id}\n value=\"T\"\n ?disabled=${!isConstructorStep}\n @change=${this._onChangeConfirmStatus}\n ></md-radio>\n </td>\n <td radio>\n <md-radio\n item-id=${item.id}\n item-name=\"constructionConfirmStatus\"\n name=${'radio-construction-' + item.id}\n value=\"F\"\n ?disabled=${!isConstructorStep}\n @change=${this._onChangeConfirmStatus}\n ></md-radio>\n </td>\n <td radio>\n <md-radio\n item-id=${item.id}\n item-name=\"supervisoryConfirmStatus\"\n name=${'radio-supervisory-' + item.id}\n value=\"T\"\n ?disabled=${!isSupervisoryStep}\n @change=${this._onChangeConfirmStatus}\n ></md-radio>\n </td>\n <td radio>\n <md-radio\n item-id=${item.id}\n item-name=\"supervisoryConfirmStatus\"\n name=${'radio-supervisory-' + item.id}\n value=\"F\"\n ?disabled=${!isSupervisoryStep}\n @change=${this._onChangeConfirmStatus}\n ></md-radio>\n </td>\n <td attachment></td>\n <td></td>\n </tr>`\n })}\n </tbody>\n </table>\n\n <table tail>\n <tbody>\n <tr first>\n <th rowspan=\"2\">시공자점검일</th>\n <td rowspan=\"2\">\n ${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.constructionInsprctionDate)}\n </td>\n <th>총괄 시공책임자</th>\n <td>\n <span sign-text>(인)</span>\n <ox-input-signature\n .value=${this.checklist.overallConstructorSignature || ''}\n name=\"overallConstructorSignature\"\n @change=${this._onChangeSignature}\n ?disabled=${!isConstructorStep}\n >\n </ox-input-signature>\n </td>\n </tr>\n <tr>\n <th>공종별 시공관리자</th>\n <td>\n <span sign-text>(인)</span>\n <ox-input-signature\n .value=${this.checklist.taskConstructorSignature || ''}\n name=\"taskConstructorSignature\"\n @change=${this._onChangeSignature}\n ?disabled=${!isConstructorStep}\n >\n </ox-input-signature>\n </td>\n </tr>\n <tr>\n <th rowspan=\"2\">감리자점검일</th>\n <td rowspan=\"2\">\n ${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.supervisorInsprctionDate)}\n </td>\n <th>총괄 감리책임자</th>\n <td>\n <span sign-text>(인)</span>\n <ox-input-signature\n .value=${this.checklist.overallSupervisorySignature || ''}\n name=\"overallSupervisorySignature\"\n @change=${this._onChangeSignature}\n ?disabled=${!isSupervisoryStep}\n >\n </ox-input-signature>\n </td>\n </tr>\n <tr>\n <th>공종별 감리 책임자</th>\n <td>\n <span sign-text>(인)</span>\n <ox-input-signature\n .value=${this.checklist.taskSupervisorySignature || ''}\n name=\"taskSupervisorySignature\"\n @change=${this._onChangeSignature}\n ?disabled=${!isSupervisoryStep}\n >\n </ox-input-signature>\n </td>\n </tr>\n </tbody>\n </table>\n\n <div footer>\n <div>\n - 검사결과는 1차, 2차로 구분 재검측시 2차에 기록하고 검사기준도 검사결과와 비교될 수 있도록 시방서 또는 도면 등에 있는\n 수치를 작성하며, 수치가 없는 검사항목은 시방서 또는 설계도서에 있는 내용과 검사한 내용으로 작성함\n </div>\n <div>- 검사항목 및 검사기준은 각 공종별로 감리원과 협의하여 작성할 것</div>\n </div>\n </div>\n `\n }\n\n private _onChangeConfirmStatus(e: Event) {\n const target = e.target as HTMLInputElement\n const itemId = target.getAttribute('item-id')\n const name = target.getAttribute('item-name') || ''\n const value = target.value\n\n this.checklist.checklistItems = this.checklist?.checklistItems?.map(item =>\n item.id == itemId ? { ...item, [name]: value } : item\n )\n }\n\n private _onChangeSignature(e: Event) {\n const target = e.target as HTMLInputElement\n\n this.checklist[target.name] = target.value\n }\n\n private _getDate(date) {\n if (!date) return ' 년 월 일'\n\n const _date = date || new Date()\n return _date.toLocaleDateString('ko-KR', {\n timeZone: 'Asia/Seoul',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n })\n }\n\n private processChecklistItems(checklistItems) {\n const mainTypeRowspans = {}\n const detailTypeRowspans = {}\n let previousMainType = null\n let previousDetailType = null\n\n return checklistItems.map((item, index) => {\n const mainType = item.mainType\n const detailType = item.detailType\n\n // mainType이 변경되면 rowspan을 계산\n if (mainType !== previousMainType) {\n mainTypeRowspans[mainType] = checklistItems.filter(i => i.mainType === mainType).length\n previousDetailType = null // detailType 초기화\n }\n\n // detailType이 변경되면 rowspan을 계산\n if (detailType !== previousDetailType) {\n detailTypeRowspans[`${mainType}-${detailType}`] = checklistItems.filter(\n i => i.mainType === mainType && i.detailType === detailType\n ).length\n }\n\n const showMainTypeCell = mainType !== previousMainType\n const showDetailTypeCell = detailType !== previousDetailType\n\n const mainTypeRowspan = mainTypeRowspans[mainType]\n const detailTypeRowspan = detailTypeRowspans[`${mainType}-${detailType}`]\n\n // 이전 값을 업데이트\n previousMainType = mainType\n previousDetailType = detailType\n\n return {\n item,\n showMainTypeCell,\n mainTypeRowspan,\n showDetailTypeCell,\n detailTypeRowspan\n }\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"checklist-view.js","sourceRoot":"","sources":["../../../client/pages/checklist/checklist-view.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAA;AACpH,OAA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B,aAAa,CAAC,gBAAgB,CAAC;GAC1B,aAAa,CAiclB","sourcesContent":["import '@material/web/icon/icon.js'\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport { CHECKLIST_MAIN_TYPE_LIST, BuildingInspectionStatus } from '../building-inspection/building-inspection-list'\nimport '@operato/input/ox-input-signature.js'\n\nexport const enum ChecklistMode {\n VIEWER = 'VIEWER',\n EDITOR = 'EDITOR'\n}\n\n@customElement('checklist-view')\nclass ChecklistView extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n font-size: 14px;\n padding: 20px;\n min-width: 800px;\n\n background-color: var(--md-sys-color-surface);\n }\n\n [bold] {\n font-weight: bold;\n }\n\n div[name] {\n display: flex;\n color: #586878;\n font-size: 24px;\n font-weight: bold;\n align-items: center;\n justify-content: center;\n }\n\n table {\n width: 100%;\n font-size: 15px;\n color: #586878;\n text-align: left;\n border-collapse: collapse;\n td,\n th {\n border: 1px #999999 solid;\n padding-inline: 8px;\n }\n th {\n background-color: #efefef;\n font-weight: bold;\n }\n td {\n height: 35px;\n &[radio] {\n text-align: center;\n vertical-align: middle;\n width: 55px;\n }\n &[attachment] {\n width: 90px;\n }\n }\n }\n\n table[header] {\n margin-top: 5px;\n\n td {\n min-width: 180px;\n border-left: none;\n }\n th {\n width: 110px;\n border-right: none;\n }\n }\n\n table[body] {\n border: 2px solid #999999;\n border-bottom: none;\n margin-top: 10px;\n\n th {\n text-align: center;\n\n &[type] {\n min-width: 150px;\n }\n &[inspection-name] {\n min-width: 250px;\n }\n &[result] {\n width: 270px;\n }\n &[criteria] {\n width: 90px;\n }\n &[small] {\n width: 60px;\n }\n }\n td {\n &[main-type] {\n width: 50px;\n text-align: center;\n word-break: keep-all;\n }\n }\n }\n\n table[tail] {\n border: 2px solid #999999;\n border-top: none;\n margin-top: -1px;\n\n tr[first] td {\n border-top: none;\n }\n td {\n width: 25%;\n border-left: none;\n text-align: center;\n position: relative;\n }\n th {\n width: 25%;\n border-right: none;\n }\n\n span[sign-text] {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n pointer-events: none;\n }\n ox-input-signature {\n margin: 10px;\n\n &[disabled] {\n background: #eee;\n }\n }\n }\n\n div[footer] {\n display: flex;\n flex-direction: column;\n gap: 3px;\n font-size: 12px;\n margin-top: 10px;\n color: #586878;\n text-indent: -9px;\n padding-left: 9px;\n }\n `\n ]\n\n @property({ type: String }) mode: ChecklistMode = ChecklistMode.VIEWER\n @property({ type: Object }) checklist: any = {}\n @property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT\n\n @query('ox-input-signature[name=\"overallConstructorSignature\"]') private elOverallConstructorSignature\n @query('ox-input-signature[name=\"taskConstructorSignature\"]') private elTaskConstructorSignature\n @query('ox-input-signature[name=\"overallSupervisorySignature\"]') private elOverallSupervisorySignature\n @query('ox-input-signature[name=\"taskSupervisorySignature\"]') private elTaskSupervisorySignature\n\n render() {\n const today = this._getDate(new Date())\n const isConstructorStep = this.status == BuildingInspectionStatus.WAIT || this.status == BuildingInspectionStatus.FAIL\n const isSupervisoryStep = this.status == BuildingInspectionStatus.REQUEST\n\n // 체크리스트 아이템 정렬\n this.checklist?.checklistItems?.sort((a, b) => {\n // 1순위: mainType 오름차순\n if (a.mainType < b.mainType) return -1\n if (a.mainType > b.mainType) return 1\n\n // 2순위: detailType 오름차순\n if (a.detailType < b.detailType) return -1\n if (a.detailType > b.detailType) return 1\n\n // 3순위: sequence 오름차순\n return a.sequence - b.sequence\n })\n\n const processedItems = this.drawChecklistItems(this.checklist?.checklistItems || [])\n\n console.log('this.checklist :', this.checklist)\n\n return html`\n <div wrapper>\n <div name>${this.checklist.name}</div>\n\n <table header>\n <tr>\n <th>공종</th>\n <td>${this.checklist.constructionType}</td>\n <th>문서 번호</th>\n <td>${this.checklist.documentNo}</td>\n </tr>\n <tr>\n <th>세부 공종</th>\n <td>${this.checklist.constructionDetailType}</td>\n <th>위치 및 부위</th>\n <td>${this.checklist.location}</td>\n </tr>\n <tr>\n <th>검측 부위</th>\n <td>${this.checklist?.inspectionParts?.join(', ') || ''}</td>\n <th></th>\n <td></td>\n </tr>\n </table>\n\n <table body>\n <thead>\n <tr>\n <th colspan=\"2\" rowspan=\"3\" type>구분</th>\n <th rowspan=\"3\" inspection-name>검사항목</th>\n <th rowspan=\"3\" criteria>검사기준</th>\n <th colspan=\"4\" result>검사결과</th>\n <th rowspan=\"3\" small>첨부자료</th>\n <th rowspan=\"3\" small>조치사항</th>\n </tr>\n <tr>\n <th colspan=\"2\">시공자</th>\n <th colspan=\"2\">감리자</th>\n </tr>\n <tr>\n <th>적합</th>\n <th>부적합</th>\n <th>적합</th>\n <th>부적합</th>\n </tr>\n </thead>\n <tbody>\n ${processedItems.map(({ item, showMainTypeCell, mainTypeRowspan, showDetailTypeCell, detailTypeRowspan }, idx) => {\n return html` <tr>\n ${showMainTypeCell\n ? html`<td main-type bold rowspan=\"${mainTypeRowspan}\">${CHECKLIST_MAIN_TYPE_LIST[item.mainType]}</td>`\n : ''}\n ${showDetailTypeCell ? html` <td bold rowspan=\"${detailTypeRowspan}\">${item.detailType}</td> ` : ''}\n\n <td bold>${idx + 1}. ${item.name}</td>\n <td>${item.inspctionCriteria}</td>\n <td radio>\n <md-radio\n item-id=${item.id}\n item-name=\"constructionConfirmStatus\"\n name=${'radio-construction-' + item.id}\n value=\"T\"\n .checked=${item.constructionConfirmStatus === 'T'}\n ?disabled=${!isConstructorStep}\n @change=${this._onChangeConfirmStatus}\n ></md-radio>\n </td>\n <td radio>\n <md-radio\n item-id=${item.id}\n item-name=\"constructionConfirmStatus\"\n name=${'radio-construction-' + item.id}\n value=\"F\"\n .checked=${item.constructionConfirmStatus === 'F'}\n ?disabled=${!isConstructorStep}\n @change=${this._onChangeConfirmStatus}\n ></md-radio>\n </td>\n <td radio>\n <md-radio\n item-id=${item.id}\n item-name=\"supervisoryConfirmStatus\"\n name=${'radio-supervisory-' + item.id}\n value=\"T\"\n .checked=${item.supervisoryConfirmStatus === 'T'}\n ?disabled=${!isSupervisoryStep}\n @change=${this._onChangeConfirmStatus}\n ></md-radio>\n </td>\n <td radio>\n <md-radio\n item-id=${item.id}\n item-name=\"supervisoryConfirmStatus\"\n name=${'radio-supervisory-' + item.id}\n value=\"F\"\n .checked=${item.supervisoryConfirmStatus === 'F'}\n ?disabled=${!isSupervisoryStep}\n @change=${this._onChangeConfirmStatus}\n ></md-radio>\n </td>\n <td attachment></td>\n <td></td>\n </tr>`\n })}\n </tbody>\n </table>\n\n <table tail>\n <tbody>\n <tr first>\n <th rowspan=\"2\">시공자점검일</th>\n <td rowspan=\"2\">\n ${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.constructionInspectionDate)}\n </td>\n <th>총괄 시공책임자</th>\n <td>\n <span sign-text>(인)</span>\n <ox-input-signature\n .value=${this.checklist.overallConstructorSignature || ''}\n name=\"overallConstructorSignature\"\n @change=${this._onChangeSignature}\n ?disabled=${!isConstructorStep}\n >\n </ox-input-signature>\n </td>\n </tr>\n <tr>\n <th>공종별 시공관리자</th>\n <td>\n <span sign-text>(인)</span>\n <ox-input-signature\n .value=${this.checklist.taskConstructorSignature || ''}\n name=\"taskConstructorSignature\"\n @change=${this._onChangeSignature}\n ?disabled=${!isConstructorStep}\n >\n </ox-input-signature>\n </td>\n </tr>\n <tr>\n <th rowspan=\"2\">감리자점검일</th>\n <td rowspan=\"2\">\n ${this.mode == ChecklistMode.VIEWER ? today : this._getDate(this.checklist.supervisorInspectionDate)}\n </td>\n <th>총괄 감리책임자</th>\n <td>\n <span sign-text>(인)</span>\n <ox-input-signature\n .value=${this.checklist.overallSupervisorySignature || ''}\n name=\"overallSupervisorySignature\"\n @change=${this._onChangeSignature}\n ?disabled=${!isSupervisoryStep}\n >\n </ox-input-signature>\n </td>\n </tr>\n <tr>\n <th>공종별 감리 책임자</th>\n <td>\n <span sign-text>(인)</span>\n <ox-input-signature\n .value=${this.checklist.taskSupervisorySignature || ''}\n name=\"taskSupervisorySignature\"\n @change=${this._onChangeSignature}\n ?disabled=${!isSupervisoryStep}\n >\n </ox-input-signature>\n </td>\n </tr>\n </tbody>\n </table>\n\n <div footer>\n <div>\n - 검사결과는 1차, 2차로 구분 재검측시 2차에 기록하고 검사기준도 검사결과와 비교될 수 있도록 시방서 또는 도면 등에 있는\n 수치를 작성하며, 수치가 없는 검사항목은 시방서 또는 설계도서에 있는 내용과 검사한 내용으로 작성함\n </div>\n <div>- 검사항목 및 검사기준은 각 공종별로 감리원과 협의하여 작성할 것</div>\n </div>\n </div>\n `\n }\n\n updated(_changed: PropertyValues): void {\n if (_changed.has('checklist')) {\n if (this.checklist?.overallConstructorSignature)\n this.elOverallConstructorSignature.loadSignature(this.checklist?.overallConstructorSignature)\n if (this.checklist?.taskConstructorSignature)\n this.elTaskConstructorSignature.loadSignature(this.checklist?.taskConstructorSignature)\n if (this.checklist?.overallSupervisorySignature)\n this.elOverallSupervisorySignature.loadSignature(this.checklist?.overallSupervisorySignature)\n if (this.checklist?.taskSupervisorySignature)\n this.elTaskSupervisorySignature.loadSignature(this.checklist?.taskSupervisorySignature)\n }\n }\n\n private _onChangeConfirmStatus(e: Event) {\n const target = e.target as HTMLInputElement\n const itemId = target.getAttribute('item-id')\n const name = target.getAttribute('item-name') || ''\n const value = target.value\n\n this.checklist.checklistItems = this.checklist?.checklistItems?.map(item =>\n item.id == itemId ? { ...item, [name]: value } : item\n )\n }\n\n private _onChangeSignature(e: Event) {\n const target = e.target as HTMLInputElement\n\n this.checklist[target.name] = target.value\n }\n\n private _getDate(date) {\n if (!date) return ' 년 월 일'\n\n const _date = new Date(date) || new Date()\n return _date.toLocaleDateString('ko-KR', {\n timeZone: 'Asia/Seoul',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n })\n }\n\n private drawChecklistItems(checklistItems) {\n const mainTypeRowspans = {}\n const detailTypeRowspans = {}\n let previousMainType = null\n let previousDetailType = null\n\n return checklistItems.map((item, index) => {\n const mainType = item.mainType\n const detailType = item.detailType\n\n // mainType이 변경되면 rowspan을 계산\n if (mainType !== previousMainType) {\n mainTypeRowspans[mainType] = checklistItems.filter(i => i.mainType === mainType).length\n previousDetailType = null // detailType 초기화\n }\n\n // detailType이 변경되면 rowspan을 계산\n if (detailType !== previousDetailType) {\n detailTypeRowspans[`${mainType}-${detailType}`] = checklistItems.filter(\n i => i.mainType === mainType && i.detailType === detailType\n ).length\n }\n\n const showMainTypeCell = mainType !== previousMainType\n const showDetailTypeCell = detailType !== previousDetailType\n\n const mainTypeRowspan = mainTypeRowspans[mainType]\n const detailTypeRowspan = detailTypeRowspans[`${mainType}-${detailType}`]\n\n // 이전 값을 업데이트\n previousMainType = mainType\n previousDetailType = detailType\n\n return {\n item,\n showMainTypeCell,\n mainTypeRowspan,\n showDetailTypeCell,\n detailTypeRowspan\n }\n })\n }\n}\n"]}
|