@dssp/supervision 0.0.28 → 0.0.30
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-camera.ts +277 -0
- package/client/pages/building-inspection/building-inspection-detail-drawing.ts +26 -6
- package/client/pages/building-inspection/building-inspection-list.ts +0 -6
- package/client/pages/building-inspection/component/building-inspection-detail-header.ts +2 -2
- package/client/route.ts +4 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.d.ts +25 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js +291 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +24 -7
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-list.js +0 -6
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +2 -2
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/things-factory.config.js +1 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '@operato/input/ox-input-switch.js'
|
|
3
|
+
import '@operato/mini-map/ox-zoomable-image.js'
|
|
4
|
+
|
|
5
|
+
import gql from 'graphql-tag'
|
|
6
|
+
import { css, html, PropertyValues } from 'lit'
|
|
7
|
+
import { customElement, state } from 'lit/decorators.js'
|
|
8
|
+
|
|
9
|
+
import { PageView } from '@operato/shell'
|
|
10
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
11
|
+
import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
|
|
12
|
+
import { client } from '@operato/graphql'
|
|
13
|
+
|
|
14
|
+
import './component/building-inspection-detail-header'
|
|
15
|
+
|
|
16
|
+
@customElement('building-inspection-detail-camera')
|
|
17
|
+
export class BuildingInspectionCamera extends PageView {
|
|
18
|
+
static styles = [
|
|
19
|
+
ScrollbarStyles,
|
|
20
|
+
CommonGristStyles,
|
|
21
|
+
css`
|
|
22
|
+
:host {
|
|
23
|
+
display: grid;
|
|
24
|
+
grid-template-rows: 75px auto;
|
|
25
|
+
color: #4e5055;
|
|
26
|
+
width: 100%;
|
|
27
|
+
background-color: #f7f7f7;
|
|
28
|
+
overflow-y: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
div[body] {
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-items: center;
|
|
34
|
+
gap: var(--spacing-medium);
|
|
35
|
+
margin: var(--spacing-medium);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
div[preview] {
|
|
39
|
+
flex: 1;
|
|
40
|
+
border: 2px solid #ddd;
|
|
41
|
+
border-radius: 10px;
|
|
42
|
+
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
div[preview] img {
|
|
49
|
+
max-width: 100%;
|
|
50
|
+
max-height: 100%;
|
|
51
|
+
object-fit: contain;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
div[preview] md-icon {
|
|
55
|
+
--md-icon-size: 160px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
div[controls] {
|
|
59
|
+
width: 240px;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
align-items: center;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
div[action-buttons] {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: row;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.switch-container {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 10px;
|
|
76
|
+
font-size: 24px;
|
|
77
|
+
font-weight: bold;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
ox-input-switch {
|
|
81
|
+
--ox-simple-switch-fullwidth: 68px;
|
|
82
|
+
--ox-simple-switch-fullheight: 34px;
|
|
83
|
+
--ox-simple-switch-thumbnail-size: 34px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.camera-shutter {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
align-items: center;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
position: relative;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.camera-shutter md-icon {
|
|
95
|
+
--md-icon-size: 100px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.camera-shutter input {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
102
|
+
position: absolute;
|
|
103
|
+
left: 0;
|
|
104
|
+
top: 0;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
button {
|
|
109
|
+
padding: 10px 20px;
|
|
110
|
+
font-size: 16px;
|
|
111
|
+
border-radius: 5px;
|
|
112
|
+
border: none;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
button.save {
|
|
117
|
+
background-color: #4caf50;
|
|
118
|
+
color: white;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
button.retry {
|
|
122
|
+
background-color: #f0ad4e;
|
|
123
|
+
color: white;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button.cancel {
|
|
127
|
+
background-color: #d9534f;
|
|
128
|
+
color: white;
|
|
129
|
+
}
|
|
130
|
+
`
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
@state() project: any = {}
|
|
134
|
+
@state() buildingInspection: any = {}
|
|
135
|
+
@state() buildingInspectionId: string = ''
|
|
136
|
+
@state() capturedImage: string | null = null // For storing the captured image
|
|
137
|
+
@state() originImage: string | null = null
|
|
138
|
+
|
|
139
|
+
get context() {
|
|
140
|
+
return {
|
|
141
|
+
title: '검측 관리 상세 - 사진 촬영'
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
render() {
|
|
146
|
+
return html`
|
|
147
|
+
<building-inspection-detail-header
|
|
148
|
+
.buildingInspectionId=${this.buildingInspection?.id}
|
|
149
|
+
.buildingLevelId=${this.buildingInspection?.buildingLevel?.id}
|
|
150
|
+
.projectName=${this.project.name}
|
|
151
|
+
.buildingName=${this.buildingInspection?.buildingLevel?.building?.name}
|
|
152
|
+
.buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}
|
|
153
|
+
></building-inspection-detail-header>
|
|
154
|
+
|
|
155
|
+
<div body>
|
|
156
|
+
<!-- Display the captured image if available -->
|
|
157
|
+
<div preview>
|
|
158
|
+
${this.capturedImage
|
|
159
|
+
? html`<ox-zoomable-image src=${this.capturedImage} restrict-boundary></ox-zoomable-image>`
|
|
160
|
+
: html`<md-icon>photo_camera</md-icon>`}
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div controls>
|
|
164
|
+
<!-- AI toggle switch -->
|
|
165
|
+
<div class="switch-container">
|
|
166
|
+
<label>AI 기능</label>
|
|
167
|
+
<ox-input-switch type="checkbox" @change=${this.toggleAI} round></ox-input-switch>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<!-- Camera shutter button -->
|
|
171
|
+
<div class="camera-shutter">
|
|
172
|
+
<md-icon>camera</md-icon>
|
|
173
|
+
<input type="file" accept="image/*" capture @change="${this.handleImageCapture}" />
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<!-- Action buttons -->
|
|
177
|
+
<div class="action-buttons">
|
|
178
|
+
<button class="save">저장</button>
|
|
179
|
+
<button class="retry">재촬영</button>
|
|
180
|
+
<button class="cancel" @click=${() => (this.capturedImage = this.originImage)}>취소</button>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
`
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
protected async updated(changes: PropertyValues): Promise<void> {}
|
|
188
|
+
|
|
189
|
+
async pageUpdated(changes: any, lifecycle: PageLifecycle) {
|
|
190
|
+
if (this.active) {
|
|
191
|
+
this.buildingInspectionId = lifecycle.resourceId || ''
|
|
192
|
+
await this.initBuildingInspection(this.buildingInspectionId)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async initBuildingInspection(buildingInspectionId: string = '') {
|
|
197
|
+
const response = await client.query({
|
|
198
|
+
query: gql`
|
|
199
|
+
query BuildingInspection($buildingInspectionId: String!) {
|
|
200
|
+
buildingInspection(id: $buildingInspectionId) {
|
|
201
|
+
id
|
|
202
|
+
status
|
|
203
|
+
requestDate
|
|
204
|
+
drawingMarker
|
|
205
|
+
checklist {
|
|
206
|
+
location
|
|
207
|
+
inspectionDrawingType
|
|
208
|
+
}
|
|
209
|
+
buildingLevel {
|
|
210
|
+
id
|
|
211
|
+
floor
|
|
212
|
+
mainDrawing {
|
|
213
|
+
id
|
|
214
|
+
name
|
|
215
|
+
fullpath
|
|
216
|
+
}
|
|
217
|
+
mainDrawingImage
|
|
218
|
+
building {
|
|
219
|
+
id
|
|
220
|
+
name
|
|
221
|
+
buildingComplex {
|
|
222
|
+
id
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
`,
|
|
229
|
+
variables: {
|
|
230
|
+
buildingInspectionId
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
if (response.errors) return
|
|
235
|
+
|
|
236
|
+
this.buildingInspection = response.data.buildingInspection
|
|
237
|
+
|
|
238
|
+
await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
private async _getProjectByBuildingComplexId(buildingComplexId) {
|
|
242
|
+
const response = await client.query({
|
|
243
|
+
query: gql`
|
|
244
|
+
query ProjectByBuildingComplexId($buildingComplexId: String!) {
|
|
245
|
+
project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {
|
|
246
|
+
id
|
|
247
|
+
name
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
`,
|
|
251
|
+
variables: {
|
|
252
|
+
buildingComplexId
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
if (response.errors) return
|
|
257
|
+
|
|
258
|
+
this.project = response.data.project
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
private toggleAI(e: Event) {
|
|
262
|
+
const isChecked = (e.target as HTMLInputElement).checked
|
|
263
|
+
console.log(`AI 기능: ${isChecked ? 'ON' : 'OFF'}`)
|
|
264
|
+
// Implement additional AI functionality toggling if needed
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
private handleImageCapture(event: Event) {
|
|
268
|
+
const input = event.target as HTMLInputElement
|
|
269
|
+
if (input.files && input.files[0]) {
|
|
270
|
+
const reader = new FileReader()
|
|
271
|
+
reader.onload = e => {
|
|
272
|
+
this.capturedImage = e.target?.result as string
|
|
273
|
+
}
|
|
274
|
+
reader.readAsDataURL(input.files[0])
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
@@ -13,7 +13,7 @@ import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
|
13
13
|
import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
|
|
14
14
|
import { client } from '@operato/graphql'
|
|
15
15
|
import { notify } from '@operato/layout'
|
|
16
|
-
import {
|
|
16
|
+
import { Shape } from '@operato/image-marker'
|
|
17
17
|
|
|
18
18
|
import { DrawingImageProvider } from '@dssp/drawing/dist-client/drawing-management/drawing-image-provider.js'
|
|
19
19
|
|
|
@@ -122,7 +122,7 @@ export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageVie
|
|
|
122
122
|
const { id, type, symbol, box, dwgId } = JSON.parse(link)
|
|
123
123
|
const [x, y, width, height] = box?.split(',').map(Number) || []
|
|
124
124
|
|
|
125
|
-
this.linkUrl = dwgId
|
|
125
|
+
this.linkUrl = `DWGID:${dwgId}`
|
|
126
126
|
this.linkShapes = [
|
|
127
127
|
{
|
|
128
128
|
id: id!,
|
|
@@ -162,13 +162,29 @@ export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageVie
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
protected async updated(changes: PropertyValues): Promise<void> {
|
|
165
|
-
if (changes.has('buildingInspection')) {
|
|
166
|
-
|
|
165
|
+
if (changes.has('buildingInspection') && this.buildingInspection?.checklist) {
|
|
166
|
+
// 1-1. 위치 정보 - 체크리스트에 들어가는 위치정보 텍스트
|
|
167
|
+
const location_1 = this.buildingInspection.checklist?.location
|
|
168
|
+
|
|
169
|
+
// 1-2. 위치 정보 - 실제 위치정보 텍스트 (동 + 층) - ID 필드를 사용하면 DB ID 필드입니다.
|
|
170
|
+
const location_building = this.buildingInspection.buildingLevel.building.name
|
|
171
|
+
const location_floor = this.buildingInspection.buildingLevel.floor
|
|
172
|
+
|
|
173
|
+
// 2. 평면도 pdf 파일
|
|
174
|
+
// mainDrawing {
|
|
175
|
+
// id
|
|
176
|
+
// name
|
|
177
|
+
// fullpath
|
|
178
|
+
// }
|
|
179
|
+
const mainDrawing = this.buildingInspection.buildingLevel.mainDrawing
|
|
180
|
+
|
|
181
|
+
// 3. 선택 도면
|
|
182
|
+
const inspectionDrawingType = this.buildingInspection.checklist.inspectionDrawingType
|
|
167
183
|
|
|
168
184
|
const shapes = JSON.parse(this.buildingInspection?.drawingMarker || null) || []
|
|
169
|
-
const markers = await this.drawingImageProvider.getMarkers(
|
|
185
|
+
const markers = await this.drawingImageProvider.getMarkers(inspectionDrawingType)
|
|
170
186
|
|
|
171
|
-
this.imageUrl =
|
|
187
|
+
this.imageUrl = String(inspectionDrawingType).normalize('NFC')
|
|
172
188
|
this.shapes = [...shapes, ...markers]
|
|
173
189
|
}
|
|
174
190
|
}
|
|
@@ -191,6 +207,10 @@ export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageVie
|
|
|
191
207
|
status
|
|
192
208
|
requestDate
|
|
193
209
|
drawingMarker
|
|
210
|
+
checklist {
|
|
211
|
+
location
|
|
212
|
+
inspectionDrawingType
|
|
213
|
+
}
|
|
194
214
|
buildingLevel {
|
|
195
215
|
id
|
|
196
216
|
floor
|
|
@@ -410,12 +410,6 @@ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
|
|
|
410
410
|
renderer: value => BUILDING_INSPECTION_STATUS_DISPLAY[value]
|
|
411
411
|
},
|
|
412
412
|
width: 120
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
type: 'datetime',
|
|
416
|
-
name: '',
|
|
417
|
-
header: '검측 결과 데이터',
|
|
418
|
-
width: 180
|
|
419
413
|
}
|
|
420
414
|
],
|
|
421
415
|
rows: {
|
|
@@ -93,8 +93,8 @@ class BuildingInspectionDetailHeader extends LitElement {
|
|
|
93
93
|
<md-icon slot="icon">description</md-icon>검측 체크리스트
|
|
94
94
|
</md-elevated-button>
|
|
95
95
|
<md-elevated-button
|
|
96
|
-
?disabled=${path.includes('building-inspection-detail-
|
|
97
|
-
href=${`building-inspection-detail-
|
|
96
|
+
?disabled=${path.includes('building-inspection-detail-camera/')}
|
|
97
|
+
href=${`building-inspection-detail-camera/${this.buildingInspectionId}`}
|
|
98
98
|
disabled
|
|
99
99
|
>
|
|
100
100
|
<md-icon slot="icon">description</md-icon>사진촬영
|
package/client/route.ts
CHANGED
|
@@ -19,5 +19,9 @@ export default function route(page: string) {
|
|
|
19
19
|
case 'building-inspection-detail-checklist':
|
|
20
20
|
import('./pages/building-inspection/building-inspection-detail-checklist')
|
|
21
21
|
return page
|
|
22
|
+
|
|
23
|
+
case 'building-inspection-detail-camera':
|
|
24
|
+
import('./pages/building-inspection/building-inspection-detail-camera')
|
|
25
|
+
return page
|
|
22
26
|
}
|
|
23
27
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import '@operato/input/ox-input-switch.js';
|
|
3
|
+
import '@operato/mini-map/ox-zoomable-image.js';
|
|
4
|
+
import { PropertyValues } from 'lit';
|
|
5
|
+
import { PageView } from '@operato/shell';
|
|
6
|
+
import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view';
|
|
7
|
+
import './component/building-inspection-detail-header';
|
|
8
|
+
export declare class BuildingInspectionCamera extends PageView {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
project: any;
|
|
11
|
+
buildingInspection: any;
|
|
12
|
+
buildingInspectionId: string;
|
|
13
|
+
capturedImage: string | null;
|
|
14
|
+
originImage: string | null;
|
|
15
|
+
get context(): {
|
|
16
|
+
title: string;
|
|
17
|
+
};
|
|
18
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
19
|
+
protected updated(changes: PropertyValues): Promise<void>;
|
|
20
|
+
pageUpdated(changes: any, lifecycle: PageLifecycle): Promise<void>;
|
|
21
|
+
initBuildingInspection(buildingInspectionId?: string): Promise<void>;
|
|
22
|
+
private _getProjectByBuildingComplexId;
|
|
23
|
+
private toggleAI;
|
|
24
|
+
private handleImageCapture;
|
|
25
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
3
|
+
import '@operato/input/ox-input-switch.js';
|
|
4
|
+
import '@operato/mini-map/ox-zoomable-image.js';
|
|
5
|
+
import gql from 'graphql-tag';
|
|
6
|
+
import { css, html } from 'lit';
|
|
7
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
8
|
+
import { PageView } from '@operato/shell';
|
|
9
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
10
|
+
import { client } from '@operato/graphql';
|
|
11
|
+
import './component/building-inspection-detail-header';
|
|
12
|
+
let BuildingInspectionCamera = class BuildingInspectionCamera extends PageView {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.project = {};
|
|
16
|
+
this.buildingInspection = {};
|
|
17
|
+
this.buildingInspectionId = '';
|
|
18
|
+
this.capturedImage = null; // For storing the captured image
|
|
19
|
+
this.originImage = null;
|
|
20
|
+
}
|
|
21
|
+
get context() {
|
|
22
|
+
return {
|
|
23
|
+
title: '검측 관리 상세 - 사진 촬영'
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
28
|
+
return html `
|
|
29
|
+
<building-inspection-detail-header
|
|
30
|
+
.buildingInspectionId=${(_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.id}
|
|
31
|
+
.buildingLevelId=${(_c = (_b = this.buildingInspection) === null || _b === void 0 ? void 0 : _b.buildingLevel) === null || _c === void 0 ? void 0 : _c.id}
|
|
32
|
+
.projectName=${this.project.name}
|
|
33
|
+
.buildingName=${(_f = (_e = (_d = this.buildingInspection) === null || _d === void 0 ? void 0 : _d.buildingLevel) === null || _e === void 0 ? void 0 : _e.building) === null || _f === void 0 ? void 0 : _f.name}
|
|
34
|
+
.buildingLevelFloor=${(_h = (_g = this.buildingInspection) === null || _g === void 0 ? void 0 : _g.buildingLevel) === null || _h === void 0 ? void 0 : _h.floor}
|
|
35
|
+
></building-inspection-detail-header>
|
|
36
|
+
|
|
37
|
+
<div body>
|
|
38
|
+
<!-- Display the captured image if available -->
|
|
39
|
+
<div preview>
|
|
40
|
+
${this.capturedImage
|
|
41
|
+
? html `<ox-zoomable-image src=${this.capturedImage} restrict-boundary></ox-zoomable-image>`
|
|
42
|
+
: html `<md-icon>photo_camera</md-icon>`}
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div controls>
|
|
46
|
+
<!-- AI toggle switch -->
|
|
47
|
+
<div class="switch-container">
|
|
48
|
+
<label>AI 기능</label>
|
|
49
|
+
<ox-input-switch type="checkbox" @change=${this.toggleAI} round></ox-input-switch>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<!-- Camera shutter button -->
|
|
53
|
+
<div class="camera-shutter">
|
|
54
|
+
<md-icon>camera</md-icon>
|
|
55
|
+
<input type="file" accept="image/*" capture @change="${this.handleImageCapture}" />
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<!-- Action buttons -->
|
|
59
|
+
<div class="action-buttons">
|
|
60
|
+
<button class="save">저장</button>
|
|
61
|
+
<button class="retry">재촬영</button>
|
|
62
|
+
<button class="cancel" @click=${() => (this.capturedImage = this.originImage)}>취소</button>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
async updated(changes) { }
|
|
69
|
+
async pageUpdated(changes, lifecycle) {
|
|
70
|
+
if (this.active) {
|
|
71
|
+
this.buildingInspectionId = lifecycle.resourceId || '';
|
|
72
|
+
await this.initBuildingInspection(this.buildingInspectionId);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async initBuildingInspection(buildingInspectionId = '') {
|
|
76
|
+
var _a, _b, _c, _d;
|
|
77
|
+
const response = await client.query({
|
|
78
|
+
query: gql `
|
|
79
|
+
query BuildingInspection($buildingInspectionId: String!) {
|
|
80
|
+
buildingInspection(id: $buildingInspectionId) {
|
|
81
|
+
id
|
|
82
|
+
status
|
|
83
|
+
requestDate
|
|
84
|
+
drawingMarker
|
|
85
|
+
checklist {
|
|
86
|
+
location
|
|
87
|
+
inspectionDrawingType
|
|
88
|
+
}
|
|
89
|
+
buildingLevel {
|
|
90
|
+
id
|
|
91
|
+
floor
|
|
92
|
+
mainDrawing {
|
|
93
|
+
id
|
|
94
|
+
name
|
|
95
|
+
fullpath
|
|
96
|
+
}
|
|
97
|
+
mainDrawingImage
|
|
98
|
+
building {
|
|
99
|
+
id
|
|
100
|
+
name
|
|
101
|
+
buildingComplex {
|
|
102
|
+
id
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`,
|
|
109
|
+
variables: {
|
|
110
|
+
buildingInspectionId
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
if (response.errors)
|
|
114
|
+
return;
|
|
115
|
+
this.buildingInspection = response.data.buildingInspection;
|
|
116
|
+
await this._getProjectByBuildingComplexId((_d = (_c = (_b = (_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.buildingLevel) === null || _b === void 0 ? void 0 : _b.building) === null || _c === void 0 ? void 0 : _c.buildingComplex) === null || _d === void 0 ? void 0 : _d.id);
|
|
117
|
+
}
|
|
118
|
+
async _getProjectByBuildingComplexId(buildingComplexId) {
|
|
119
|
+
const response = await client.query({
|
|
120
|
+
query: gql `
|
|
121
|
+
query ProjectByBuildingComplexId($buildingComplexId: String!) {
|
|
122
|
+
project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {
|
|
123
|
+
id
|
|
124
|
+
name
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
`,
|
|
128
|
+
variables: {
|
|
129
|
+
buildingComplexId
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
if (response.errors)
|
|
133
|
+
return;
|
|
134
|
+
this.project = response.data.project;
|
|
135
|
+
}
|
|
136
|
+
toggleAI(e) {
|
|
137
|
+
const isChecked = e.target.checked;
|
|
138
|
+
console.log(`AI 기능: ${isChecked ? 'ON' : 'OFF'}`);
|
|
139
|
+
// Implement additional AI functionality toggling if needed
|
|
140
|
+
}
|
|
141
|
+
handleImageCapture(event) {
|
|
142
|
+
const input = event.target;
|
|
143
|
+
if (input.files && input.files[0]) {
|
|
144
|
+
const reader = new FileReader();
|
|
145
|
+
reader.onload = e => {
|
|
146
|
+
var _a;
|
|
147
|
+
this.capturedImage = (_a = e.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
148
|
+
};
|
|
149
|
+
reader.readAsDataURL(input.files[0]);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
BuildingInspectionCamera.styles = [
|
|
154
|
+
ScrollbarStyles,
|
|
155
|
+
CommonGristStyles,
|
|
156
|
+
css `
|
|
157
|
+
:host {
|
|
158
|
+
display: grid;
|
|
159
|
+
grid-template-rows: 75px auto;
|
|
160
|
+
color: #4e5055;
|
|
161
|
+
width: 100%;
|
|
162
|
+
background-color: #f7f7f7;
|
|
163
|
+
overflow-y: auto;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
div[body] {
|
|
167
|
+
display: flex;
|
|
168
|
+
justify-items: center;
|
|
169
|
+
gap: var(--spacing-medium);
|
|
170
|
+
margin: var(--spacing-medium);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
div[preview] {
|
|
174
|
+
flex: 1;
|
|
175
|
+
border: 2px solid #ddd;
|
|
176
|
+
border-radius: 10px;
|
|
177
|
+
|
|
178
|
+
display: flex;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
align-items: center;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
div[preview] img {
|
|
184
|
+
max-width: 100%;
|
|
185
|
+
max-height: 100%;
|
|
186
|
+
object-fit: contain;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
div[preview] md-icon {
|
|
190
|
+
--md-icon-size: 160px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
div[controls] {
|
|
194
|
+
width: 240px;
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-direction: column;
|
|
197
|
+
justify-content: space-between;
|
|
198
|
+
align-items: center;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
div[action-buttons] {
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: row;
|
|
204
|
+
justify-content: space-between;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.switch-container {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
gap: 10px;
|
|
211
|
+
font-size: 24px;
|
|
212
|
+
font-weight: bold;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
ox-input-switch {
|
|
216
|
+
--ox-simple-switch-fullwidth: 68px;
|
|
217
|
+
--ox-simple-switch-fullheight: 34px;
|
|
218
|
+
--ox-simple-switch-thumbnail-size: 34px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.camera-shutter {
|
|
222
|
+
display: flex;
|
|
223
|
+
justify-content: center;
|
|
224
|
+
align-items: center;
|
|
225
|
+
cursor: pointer;
|
|
226
|
+
position: relative;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.camera-shutter md-icon {
|
|
230
|
+
--md-icon-size: 100px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.camera-shutter input {
|
|
234
|
+
opacity: 0;
|
|
235
|
+
width: 100%;
|
|
236
|
+
height: 100%;
|
|
237
|
+
position: absolute;
|
|
238
|
+
left: 0;
|
|
239
|
+
top: 0;
|
|
240
|
+
cursor: pointer;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
button {
|
|
244
|
+
padding: 10px 20px;
|
|
245
|
+
font-size: 16px;
|
|
246
|
+
border-radius: 5px;
|
|
247
|
+
border: none;
|
|
248
|
+
cursor: pointer;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
button.save {
|
|
252
|
+
background-color: #4caf50;
|
|
253
|
+
color: white;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
button.retry {
|
|
257
|
+
background-color: #f0ad4e;
|
|
258
|
+
color: white;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
button.cancel {
|
|
262
|
+
background-color: #d9534f;
|
|
263
|
+
color: white;
|
|
264
|
+
}
|
|
265
|
+
`
|
|
266
|
+
];
|
|
267
|
+
__decorate([
|
|
268
|
+
state(),
|
|
269
|
+
__metadata("design:type", Object)
|
|
270
|
+
], BuildingInspectionCamera.prototype, "project", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
state(),
|
|
273
|
+
__metadata("design:type", Object)
|
|
274
|
+
], BuildingInspectionCamera.prototype, "buildingInspection", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
state(),
|
|
277
|
+
__metadata("design:type", String)
|
|
278
|
+
], BuildingInspectionCamera.prototype, "buildingInspectionId", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
state(),
|
|
281
|
+
__metadata("design:type", Object)
|
|
282
|
+
], BuildingInspectionCamera.prototype, "capturedImage", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
state(),
|
|
285
|
+
__metadata("design:type", Object)
|
|
286
|
+
], BuildingInspectionCamera.prototype, "originImage", void 0);
|
|
287
|
+
BuildingInspectionCamera = __decorate([
|
|
288
|
+
customElement('building-inspection-detail-camera')
|
|
289
|
+
], BuildingInspectionCamera);
|
|
290
|
+
export { BuildingInspectionCamera };
|
|
291
|
+
//# sourceMappingURL=building-inspection-detail-camera.js.map
|