@dssp/supervision 0.0.36 → 1.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
  2. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  3. package/dist-client/pages/checklist/checklist-view.js +2 -5
  4. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  5. package/dist-client/route.d.ts +1 -1
  6. package/dist-client/tsconfig.tsbuildinfo +1 -1
  7. package/dist-server/service/index.d.ts +1 -1
  8. package/dist-server/tsconfig.tsbuildinfo +1 -1
  9. package/package.json +13 -13
  10. package/client/bootstrap.ts +0 -1
  11. package/client/index.ts +0 -0
  12. package/client/pages/action-plan/action-plan-importer.ts +0 -94
  13. package/client/pages/action-plan/action-plan-list-page.ts +0 -340
  14. package/client/pages/building-inspection/building-inspection-detail-camera.ts +0 -277
  15. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +0 -258
  16. package/client/pages/building-inspection/building-inspection-detail-drawing.ts +0 -288
  17. package/client/pages/building-inspection/building-inspection-list.ts +0 -565
  18. package/client/pages/building-inspection/component/building-inspection-detail-header.ts +0 -123
  19. package/client/pages/building-inspection/component/inspection-event-provider.ts +0 -81
  20. package/client/pages/building-inspection/inspection-create-popup.ts +0 -785
  21. package/client/pages/checklist/attachment-list-popup.ts +0 -301
  22. package/client/pages/checklist/checklist-view.ts +0 -581
  23. package/client/pages/checklist/comment-list-popup.ts +0 -328
  24. package/client/pages/checklist/file-preview-popup.ts +0 -70
  25. package/client/pages/checklist-template/checklist-template-item.ts +0 -240
  26. package/client/pages/checklist-template/checklist-template-list.ts +0 -368
  27. package/client/pages/checklist-template/checklist-type-management.ts +0 -262
  28. package/client/pages/issue/issue-importer.ts +0 -94
  29. package/client/pages/issue/issue-list-page.ts +0 -340
  30. package/client/pages/project-report/project-report-importer.ts +0 -94
  31. package/client/pages/project-report/project-report-list-page.ts +0 -340
  32. package/client/pages/supervisor/supervisor-importer.ts +0 -94
  33. package/client/pages/supervisor/supervisor-list-page.ts +0 -340
  34. package/client/route.ts +0 -27
  35. package/client/tsconfig.json +0 -11
  36. package/dist-client/pages/checklist/comment-list-popup copy.d.ts +0 -2
  37. package/dist-client/pages/checklist/comment-list-popup copy.js +0 -344
  38. package/dist-client/pages/checklist/comment-list-popup copy.js.map +0 -1
  39. package/server/controllers/index.ts +0 -0
  40. package/server/index.ts +0 -4
  41. package/server/middlewares/index.ts +0 -3
  42. package/server/migrations/index.ts +0 -9
  43. package/server/routes.ts +0 -28
  44. package/server/service/action-plan/action-plan-mutation.ts +0 -198
  45. package/server/service/action-plan/action-plan-query.ts +0 -62
  46. package/server/service/action-plan/action-plan-type.ts +0 -61
  47. package/server/service/action-plan/action-plan.ts +0 -103
  48. package/server/service/action-plan/index.ts +0 -7
  49. package/server/service/building-inspection/building-inspection-history.ts +0 -72
  50. package/server/service/building-inspection/building-inspection-mutation.ts +0 -276
  51. package/server/service/building-inspection/building-inspection-query.ts +0 -242
  52. package/server/service/building-inspection/building-inspection-type.ts +0 -145
  53. package/server/service/building-inspection/building-inspection.ts +0 -108
  54. package/server/service/building-inspection/event-subscriber.ts +0 -20
  55. package/server/service/building-inspection/index.ts +0 -11
  56. package/server/service/checklist/checklist-history.ts +0 -96
  57. package/server/service/checklist/checklist-mutation.ts +0 -103
  58. package/server/service/checklist/checklist-query.ts +0 -58
  59. package/server/service/checklist/checklist-type.ts +0 -49
  60. package/server/service/checklist/checklist.ts +0 -127
  61. package/server/service/checklist/event-subscriber.ts +0 -17
  62. package/server/service/checklist/index.ts +0 -9
  63. package/server/service/checklist-item/checklist-item-mutation.ts +0 -5
  64. package/server/service/checklist-item/checklist-item-query.ts +0 -84
  65. package/server/service/checklist-item/checklist-item-type.ts +0 -12
  66. package/server/service/checklist-item/checklist-item.ts +0 -103
  67. package/server/service/checklist-item/index.ts +0 -7
  68. package/server/service/checklist-item-comment/checklist-item-comment-history.ts +0 -69
  69. package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +0 -80
  70. package/server/service/checklist-item-comment/checklist-item-comment-query.ts +0 -36
  71. package/server/service/checklist-item-comment/checklist-item-comment-type.ts +0 -32
  72. package/server/service/checklist-item-comment/checklist-item-comment.ts +0 -56
  73. package/server/service/checklist-item-comment/event-subscriber.ts +0 -17
  74. package/server/service/checklist-item-comment/index.ts +0 -9
  75. package/server/service/checklist-template/checklist-template-mutation.ts +0 -66
  76. package/server/service/checklist-template/checklist-template-query.ts +0 -39
  77. package/server/service/checklist-template/checklist-template-type.ts +0 -23
  78. package/server/service/checklist-template/checklist-template.ts +0 -71
  79. package/server/service/checklist-template/index.ts +0 -6
  80. package/server/service/checklist-template-item/checklist-template-item-mutation.ts +0 -64
  81. package/server/service/checklist-template-item/checklist-template-item-query.ts +0 -44
  82. package/server/service/checklist-template-item/checklist-template-item-type.ts +0 -39
  83. package/server/service/checklist-template-item/checklist-template-item.ts +0 -68
  84. package/server/service/checklist-template-item/index.ts +0 -6
  85. package/server/service/checklist-type/checklist-type-mutation.ts +0 -66
  86. package/server/service/checklist-type/checklist-type-query.ts +0 -39
  87. package/server/service/checklist-type/checklist-type-type.ts +0 -26
  88. package/server/service/checklist-type/checklist-type.ts +0 -64
  89. package/server/service/checklist-type/index.ts +0 -6
  90. package/server/service/index.ts +0 -88
  91. package/server/service/issue/index.ts +0 -7
  92. package/server/service/issue/issue-mutation.ts +0 -198
  93. package/server/service/issue/issue-query.ts +0 -62
  94. package/server/service/issue/issue-type.ts +0 -61
  95. package/server/service/issue/issue.ts +0 -100
  96. package/server/service/project-report/index.ts +0 -7
  97. package/server/service/project-report/project-report-mutation.ts +0 -198
  98. package/server/service/project-report/project-report-query.ts +0 -62
  99. package/server/service/project-report/project-report-type.ts +0 -61
  100. package/server/service/project-report/project-report.ts +0 -113
  101. package/server/service/supervisor/index.ts +0 -7
  102. package/server/service/supervisor/supervisor-mutation.ts +0 -198
  103. package/server/service/supervisor/supervisor-query.ts +0 -62
  104. package/server/service/supervisor/supervisor-type.ts +0 -61
  105. package/server/service/supervisor/supervisor.ts +0 -108
  106. package/server/tsconfig.json +0 -10
@@ -1,277 +0,0 @@
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
- }
@@ -1,258 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/data-grist'
3
-
4
- import { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
5
- import { PageView } from '@operato/shell'
6
- import { css, html } from 'lit'
7
- import { customElement, state } from 'lit/decorators.js'
8
- import { keyed } from 'lit/directives/keyed.js'
9
- import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
10
- import { client } from '@operato/graphql'
11
- import { notify } from '@operato/layout'
12
- import gql from 'graphql-tag'
13
- import { openPopup } from '@operato/layout'
14
-
15
- import { verifyBiometric } from '@things-factory/auth-base/client'
16
-
17
- import './component/building-inspection-detail-header'
18
- import '../checklist/checklist-view'
19
- import { ChecklistMode } from '../checklist/checklist-view'
20
- import { BuildingInspectionStatus } from './building-inspection-list'
21
-
22
- @customElement('building-inspection-detail-checklist')
23
- export class BuildingInspectionDetailChecklist extends PageView {
24
- static styles = [
25
- ScrollbarStyles,
26
- CommonGristStyles,
27
- css`
28
- :host {
29
- display: grid;
30
- grid-template-rows: 55px auto;
31
- color: #4e5055;
32
-
33
- width: 100%;
34
- background-color: var(--md-sys-color-background, #f6f6f6);
35
- overflow-y: auto;
36
-
37
- --grid-record-emphasized-background-color: red;
38
- --grid-record-emphasized-color: yellow;
39
- }
40
-
41
- *[bold] {
42
- font-weight: bold;
43
- }
44
-
45
- div[body] {
46
- display: flex;
47
- justify-content: center;
48
- flex-direction: column;
49
- align-items: center;
50
-
51
- div[button-container] {
52
- display: flex;
53
- justify-content: flex-end;
54
- width: 100%;
55
- gap: 10px;
56
- margin-right: 50px;
57
- margin-bottom: 15px;
58
- }
59
- }
60
- `
61
- ]
62
-
63
- @state() project: any = {}
64
- @state() buildingInspection: any = {}
65
-
66
- get context() {
67
- return {
68
- title: '검측 관리 상세 - 검측 체크리스트'
69
- }
70
- }
71
-
72
- render() {
73
- return html`
74
- <building-inspection-detail-header
75
- .buildingInspectionId=${this.buildingInspection?.id}
76
- .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}
77
- .projectName=${this.project.name}
78
- .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}
79
- .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}
80
- ></building-inspection-detail-header>
81
-
82
- <div body>
83
- ${keyed(
84
- new Date(),
85
- html`
86
- <checklist-view
87
- .mode=${ChecklistMode.EDITOR}
88
- status=${this.buildingInspection.status}
89
- .checklist=${this.buildingInspection.checklist || {}}
90
- .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}
91
- ></checklist-view>
92
- `
93
- )}
94
-
95
- <div button-container>
96
- <md-elevated-button
97
- ?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}
98
- @click=${this._onClickModifyChecklist}
99
- >
100
- <md-icon slot="icon">assignment</md-icon>등록
101
- </md-elevated-button>
102
- </div>
103
- </div>
104
- `
105
- }
106
-
107
- async pageUpdated(changes: any, lifecycle: PageLifecycle) {
108
- if (this.active) {
109
- const buildingInspectionId = lifecycle.resourceId || ''
110
- await this.initBuildingInspection(buildingInspectionId)
111
- }
112
- }
113
-
114
- async initBuildingInspection(buildingInspectionId: string = '') {
115
- const response = await client.query({
116
- query: gql`
117
- query BuildingInspection($buildingInspectionId: String!) {
118
- buildingInspection(id: $buildingInspectionId) {
119
- id
120
- status
121
- requestDate
122
- checklist {
123
- id
124
- name
125
- constructionType
126
- constructionDetailType
127
- location
128
- inspectionParts
129
- documentNo
130
- constructionInspectionDate
131
- supervisorInspectionDate
132
- overallConstructorSignature
133
- taskConstructorSignature
134
- overallSupervisorySignature
135
- taskSupervisorySignature
136
- buildingInspection {
137
- status
138
- }
139
- checklistItems {
140
- id
141
- name
142
- sequence
143
- mainType
144
- detailType
145
- inspctionCriteria
146
- constructionConfirmStatus
147
- supervisoryConfirmStatus
148
- checklistItemCommentCount
149
- checklistItemAttachmentCount
150
- }
151
- }
152
- buildingLevel {
153
- id
154
- floor
155
- mainDrawing {
156
- id
157
- name
158
- fullpath
159
- }
160
- mainDrawingImage
161
- building {
162
- id
163
- name
164
- buildingComplex {
165
- id
166
- overallConstructorEmails
167
- taskConstructorEmails
168
- overallSupervisoryEmails
169
- taskSupervisoryEmails
170
- }
171
- }
172
- }
173
- }
174
- }
175
- `,
176
- variables: {
177
- buildingInspectionId
178
- }
179
- })
180
-
181
- if (response.errors) return
182
-
183
- this.buildingInspection = response.data.buildingInspection
184
-
185
- await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)
186
- }
187
-
188
- private async _getProjectByBuildingComplexId(buildingComplexId) {
189
- const response = await client.query({
190
- query: gql`
191
- query ProjectByBuildingComplexId($buildingComplexId: String!) {
192
- project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {
193
- id
194
- name
195
- }
196
- }
197
- `,
198
- variables: {
199
- buildingComplexId
200
- }
201
- })
202
-
203
- if (response.errors) return
204
-
205
- this.project = response.data.project
206
- }
207
-
208
- private _onClickModifyChecklist() {
209
- this.validateChecklist(this.buildingInspection.checklist)
210
- }
211
-
212
- private async validateChecklist(checklist: any) {
213
- try {
214
- const result = await verifyBiometric()
215
- if (result.verified) {
216
- console.log('Verification successful. Proceeding with sensitive action.')
217
- } else {
218
- notify({ message: 'Verification failed:' + result.message })
219
- return
220
- }
221
- } catch (error) {
222
- notify({ message: 'Error during biometric verification:' + error })
223
- return
224
- }
225
-
226
- const response = await client.mutate({
227
- mutation: gql`
228
- mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {
229
- updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)
230
- }
231
- `,
232
- variables: {
233
- buildingInspection: {
234
- id: this.buildingInspection.id,
235
- checklist: {
236
- id: checklist.id,
237
- overallConstructorSignature: checklist.overallConstructorSignature,
238
- taskConstructorSignature: checklist.taskConstructorSignature,
239
- overallSupervisorySignature: checklist.overallSupervisorySignature,
240
- taskSupervisorySignature: checklist.taskSupervisorySignature
241
- },
242
- checklistItem: checklist.checklistItems.map(item => ({
243
- id: item.id,
244
- constructionConfirmStatus: item.constructionConfirmStatus,
245
- supervisoryConfirmStatus: item.supervisoryConfirmStatus
246
- }))
247
- }
248
- }
249
- })
250
-
251
- if (!response.errors) {
252
- notify({ message: '검측 요청서를 등록하였습니다.' })
253
- this.initBuildingInspection(this.buildingInspection.id)
254
- } else {
255
- notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })
256
- }
257
- }
258
- }