@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,288 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/image-marker/ox-image-marker.js'
3
- import '@operato/image-marker/ox-image-marker-view.js'
4
-
5
- import gql from 'graphql-tag'
6
- import { css, html, PropertyValues } from 'lit'
7
- import { customElement, query, state } from 'lit/decorators.js'
8
- import { consume } from '@lit/context'
9
- import { ScopedElementsMixin } from '@open-wc/scoped-elements'
10
-
11
- import { PageView } from '@operato/shell'
12
- import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
13
- import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
14
- import { client } from '@operato/graphql'
15
- import { notify } from '@operato/layout'
16
- import { Shape } from '@operato/image-marker'
17
-
18
- import { DrawingImageProvider } from '@dssp/drawing/dist-client/drawing-management/drawing-image-provider.js'
19
-
20
- import './component/building-inspection-detail-header'
21
- import { BuildingInspectionStatus } from './building-inspection-list'
22
-
23
- @customElement('building-inspection-detail-drawing')
24
- export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageView) {
25
- static styles = [
26
- ScrollbarStyles,
27
- CommonGristStyles,
28
- css`
29
- :host {
30
- display: grid;
31
- grid-template-rows: 55px auto;
32
- color: #4e5055;
33
-
34
- width: 100%;
35
- background-color: var(--md-sys-color-background, #f6f6f6);
36
- overflow-y: auto;
37
-
38
- --grid-record-emphasized-background-color: red;
39
- --grid-record-emphasized-color: yellow;
40
- }
41
-
42
- div[body] {
43
- display: flex;
44
- justify-content: center;
45
-
46
- ox-image-marker-view {
47
- width: 100%;
48
- }
49
- }
50
-
51
- dialog ox-image-marker-view {
52
- width: 80vw;
53
- height: 80vh;
54
- }
55
- `
56
- ]
57
-
58
- @state() project: any = {}
59
- @state() buildingInspection: any = {}
60
- @state() buildingInspectionId: string = ''
61
- @state() imageUrl?: string
62
- @state() shapes: Shape[] = []
63
- @state() linkUrl?: string
64
- @state() linkShapes: Shape[] = []
65
-
66
- @state() drawingImageProvider: DrawingImageProvider = new DrawingImageProvider()
67
- // @consume({ context: OxUserPreferencesContext, subscribe: true })
68
-
69
- @query('#image-marker') imageMarker!: any
70
- @query('#link-viewer') linkViewer!: any
71
- @query('dialog') dialog!: HTMLDialogElement
72
-
73
- get context() {
74
- return {
75
- title: '검측 관리 상세 - 검측 도면'
76
- }
77
- }
78
-
79
- connectedCallback(): void {
80
- super.connectedCallback()
81
-
82
- requestAnimationFrame(() => {
83
- this.imageMarker.setImageProvider(this.drawingImageProvider)
84
- this.linkViewer.setImageProvider(this.drawingImageProvider)
85
-
86
- this.dialog.addEventListener('click', event => {
87
- const rect = this.dialog.getBoundingClientRect()
88
- const isInDialog =
89
- rect.top <= event.clientY && event.clientY <= rect.bottom && rect.left <= event.clientX && event.clientX <= rect.right
90
-
91
- // 다이아로그 내부를 클릭한 것이 아니면 다이아로그 닫기
92
- if (!isInDialog) {
93
- this.dialog.close()
94
- }
95
- })
96
- })
97
- }
98
-
99
- disconnectedCallback(): void {
100
- this.imageMarker?.setImageProvider(null)
101
- this.linkViewer?.setImageProvider(null)
102
-
103
- super.disconnectedCallback()
104
- }
105
-
106
- render() {
107
- return html`
108
- <building-inspection-detail-header
109
- .buildingInspectionId=${this.buildingInspection?.id}
110
- .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}
111
- .projectName=${this.project.name}
112
- .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}
113
- .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}
114
- ></building-inspection-detail-header>
115
-
116
- <div
117
- body
118
- @link-clicked=${async (e: CustomEvent) => {
119
- this.linkViewer.reset()
120
-
121
- const { link } = e.detail
122
- const { id, type, symbol, box, dwgId } = JSON.parse(link)
123
- const [x, y, width, height] = box?.split(',').map(Number) || []
124
-
125
- this.linkUrl = `DWGID:${dwgId}`
126
- this.linkShapes = [
127
- {
128
- id: id!,
129
- type: 'link',
130
- x,
131
- y,
132
- width,
133
- height,
134
- link: '{}'
135
- }
136
- ]
137
-
138
- if (this.dialog) {
139
- this.dialog.showModal()
140
- }
141
- }}
142
- >
143
- ${this.buildingInspection?.status == BuildingInspectionStatus.PASS
144
- ? html`<ox-image-marker-view
145
- id="image-marker"
146
- .imageUrl=${this.imageUrl}
147
- .shapes=${this.shapes}
148
- ></ox-image-marker-view>`
149
- : html` <ox-image-marker
150
- id="image-marker"
151
- .imageUrl=${this.imageUrl}
152
- .shapes=${this.shapes}
153
- @shapes-changed=${this.onClickMarkerSave}
154
- .currentMode=${'view'}
155
- ></ox-image-marker>`}
156
- </div>
157
-
158
- <dialog>
159
- <ox-image-marker-view id="link-viewer" .imageUrl=${this.linkUrl} .shapes=${this.linkShapes}></ox-image-marker-view>
160
- </dialog>
161
- `
162
- }
163
-
164
- protected async updated(changes: PropertyValues): Promise<void> {
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
183
-
184
- const shapes = JSON.parse(this.buildingInspection?.drawingMarker || null) || []
185
- const markers = await this.drawingImageProvider.getMarkers(inspectionDrawingType)
186
-
187
- this.imageUrl = String(inspectionDrawingType).normalize('NFC')
188
- this.shapes = [...shapes, ...markers]
189
- }
190
- }
191
-
192
- async pageUpdated(changes: any, lifecycle: PageLifecycle) {
193
- if (this.active) {
194
- this.buildingInspectionId = lifecycle.resourceId || ''
195
- await this.initBuildingInspection(this.buildingInspectionId)
196
-
197
- this.imageMarker.reset()
198
- }
199
- }
200
-
201
- async initBuildingInspection(buildingInspectionId: string = '') {
202
- const response = await client.query({
203
- query: gql`
204
- query BuildingInspection($buildingInspectionId: String!) {
205
- buildingInspection(id: $buildingInspectionId) {
206
- id
207
- status
208
- requestDate
209
- drawingMarker
210
- checklist {
211
- location
212
- inspectionDrawingType
213
- }
214
- buildingLevel {
215
- id
216
- floor
217
- mainDrawing {
218
- id
219
- name
220
- fullpath
221
- }
222
- mainDrawingImage
223
- building {
224
- id
225
- name
226
- buildingComplex {
227
- id
228
- }
229
- }
230
- }
231
- }
232
- }
233
- `,
234
- variables: {
235
- buildingInspectionId
236
- }
237
- })
238
-
239
- if (response.errors) return
240
-
241
- this.buildingInspection = response.data.buildingInspection
242
-
243
- await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)
244
- }
245
-
246
- private async _getProjectByBuildingComplexId(buildingComplexId) {
247
- const response = await client.query({
248
- query: gql`
249
- query ProjectByBuildingComplexId($buildingComplexId: String!) {
250
- project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {
251
- id
252
- name
253
- }
254
- }
255
- `,
256
- variables: {
257
- buildingComplexId
258
- }
259
- })
260
-
261
- if (response.errors) return
262
-
263
- this.project = response.data.project
264
- }
265
-
266
- private async onClickMarkerSave(e) {
267
- const response = await client.query({
268
- query: gql`
269
- mutation UpdateBuildingInspection($patch: UpdateBuildingInspectionDrawingMarker!) {
270
- updateBuildingInspection(patch: $patch) {
271
- id
272
- drawingMarker
273
- }
274
- }
275
- `,
276
- variables: {
277
- patch: {
278
- id: this.buildingInspectionId,
279
- drawingMarker: JSON.stringify(e.detail)
280
- }
281
- }
282
- })
283
-
284
- if (response.errors) return
285
-
286
- notify({ message: '저장되었습니다.' })
287
- }
288
- }