@dssp/supervision 0.0.9 → 0.0.10
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 +186 -0
- package/client/pages/building-inspection/building-inspection-detail-drawing.ts +160 -0
- package/client/pages/building-inspection/building-inspection-list.ts +430 -0
- package/client/pages/building-inspection/component/building-inspection-detail-header.ts +94 -0
- package/client/pages/building-inspection/inspection-create-popup.ts +696 -0
- package/client/pages/checklist/checklist-view.ts +443 -0
- package/client/pages/checklist-template/checklist-template-item.ts +240 -0
- package/client/pages/checklist-template/checklist-template-list.ts +271 -0
- package/client/pages/checklist-template/checklist-type-management.ts +242 -0
- package/client/route.ts +14 -18
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +21 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +187 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +21 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +169 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-list.d.ts +67 -0
- package/dist-client/pages/building-inspection/building-inspection-list.js +434 -0
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.d.ts +1 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +118 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -0
- package/dist-client/pages/building-inspection/inspection-create-popup.d.ts +3 -0
- package/dist-client/pages/building-inspection/inspection-create-popup.js +735 -0
- package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -0
- package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
- package/dist-client/pages/checklist/checklist-view.js +434 -0
- package/dist-client/pages/checklist/checklist-view.js.map +1 -0
- package/dist-client/pages/checklist-template/checklist-template-item.d.ts +2 -0
- package/dist-client/pages/checklist-template/checklist-template-item.js +237 -0
- package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -0
- package/dist-client/pages/{check-item/check-item-list-page.d.ts → checklist-template/checklist-template-list.d.ts} +8 -27
- package/dist-client/pages/checklist-template/checklist-template-list.js +259 -0
- package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -0
- package/dist-client/pages/checklist-template/checklist-type-management.d.ts +48 -0
- package/dist-client/pages/checklist-template/checklist-type-management.js +229 -0
- package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +10 -13
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +1 -1
- package/dist-server/index.js +1 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-history.d.ts +17 -0
- package/dist-server/service/building-inspection/building-inspection-history.js +85 -0
- package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -0
- package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +8 -0
- package/dist-server/service/building-inspection/building-inspection-mutation.js +148 -0
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -0
- package/dist-server/service/building-inspection/building-inspection-query.d.ts +20 -0
- package/dist-server/service/building-inspection/building-inspection-query.js +235 -0
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -0
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +43 -0
- package/dist-server/service/building-inspection/building-inspection-type.js +153 -0
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -0
- package/dist-server/service/building-inspection/building-inspection.d.ts +26 -0
- package/dist-server/service/building-inspection/building-inspection.js +113 -0
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -0
- package/dist-server/service/building-inspection/event-subscriber.d.ts +7 -0
- package/dist-server/service/building-inspection/event-subscriber.js +21 -0
- package/dist-server/service/building-inspection/event-subscriber.js.map +1 -0
- package/dist-server/service/building-inspection/index.d.ts +10 -0
- package/dist-server/service/building-inspection/index.js +14 -0
- package/dist-server/service/building-inspection/index.js.map +1 -0
- package/dist-server/service/checklist/checklist-history.d.ts +24 -0
- package/dist-server/service/checklist/checklist-history.js +120 -0
- package/dist-server/service/checklist/checklist-history.js.map +1 -0
- package/dist-server/service/checklist/checklist-mutation.d.ts +8 -0
- package/dist-server/service/checklist/checklist-mutation.js +96 -0
- package/dist-server/service/checklist/checklist-mutation.js.map +1 -0
- package/dist-server/service/checklist/checklist-query.d.ts +12 -0
- package/dist-server/service/checklist/checklist-query.js +83 -0
- package/dist-server/service/checklist/checklist-query.js.map +1 -0
- package/dist-server/service/checklist/checklist-type.d.ts +18 -0
- package/dist-server/service/checklist/checklist-type.js +69 -0
- package/dist-server/service/checklist/checklist-type.js.map +1 -0
- package/dist-server/service/checklist/checklist.d.ts +31 -0
- package/dist-server/service/checklist/checklist.js +143 -0
- package/dist-server/service/checklist/checklist.js.map +1 -0
- package/dist-server/service/checklist/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist/event-subscriber.js +21 -0
- package/dist-server/service/checklist/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist/index.d.ts +8 -0
- package/dist-server/service/checklist/index.js +12 -0
- package/dist-server/service/checklist/index.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item-mutation.d.ts +2 -0
- package/dist-server/service/checklist-item/checklist-item-mutation.js +13 -0
- package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item-query.d.ts +10 -0
- package/dist-server/service/checklist-item/checklist-item-query.js +68 -0
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item-type.d.ts +5 -0
- package/dist-server/service/checklist-item/checklist-item-type.js +21 -0
- package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item.d.ts +26 -0
- package/dist-server/service/checklist-item/checklist-item.js +113 -0
- package/dist-server/service/checklist-item/checklist-item.js.map +1 -0
- package/dist-server/service/checklist-item/index.d.ts +5 -0
- package/dist-server/service/checklist-item/index.js +10 -0
- package/dist-server/service/checklist-item/index.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template-mutation.d.ts +6 -0
- package/dist-server/service/checklist-template/checklist-template-mutation.js +64 -0
- package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template-query.d.ts +10 -0
- package/dist-server/service/checklist-template/checklist-template-query.js +65 -0
- package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template-type.d.ts +10 -0
- package/dist-server/service/checklist-template/checklist-template-type.js +39 -0
- package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template.d.ts +17 -0
- package/dist-server/service/checklist-template/checklist-template.js +78 -0
- package/dist-server/service/checklist-template/checklist-template.js.map +1 -0
- package/dist-server/service/checklist-template/index.d.ts +5 -0
- package/dist-server/service/checklist-template/index.js +9 -0
- package/dist-server/service/checklist-template/index.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.d.ts +7 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +68 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-query.d.ts +10 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-query.js +66 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.d.ts +16 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js +60 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -0
- package/dist-server/service/checklist-template-item/checklist-template-item.d.ts +19 -0
- package/dist-server/service/checklist-template-item/checklist-template-item.js +87 -0
- package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -0
- package/dist-server/service/checklist-template-item/index.d.ts +5 -0
- package/dist-server/service/checklist-template-item/index.js +9 -0
- package/dist-server/service/checklist-template-item/index.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type-mutation.d.ts +6 -0
- package/dist-server/service/checklist-type/checklist-type-mutation.js +64 -0
- package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type-query.d.ts +10 -0
- package/dist-server/service/checklist-type/checklist-type-query.js +65 -0
- package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type-type.d.ts +11 -0
- package/dist-server/service/checklist-type/checklist-type-type.js +43 -0
- package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type.d.ts +19 -0
- package/dist-server/service/checklist-type/checklist-type.js +78 -0
- package/dist-server/service/checklist-type/checklist-type.js.map +1 -0
- package/dist-server/service/checklist-type/index.d.ts +5 -0
- package/dist-server/service/checklist-type/index.js +9 -0
- package/dist-server/service/checklist-type/index.js.map +1 -0
- package/dist-server/service/index.d.ts +8 -3
- package/dist-server/service/index.js +25 -5
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/issue/issue.d.ts +1 -3
- package/dist-server/service/issue/issue.js +1 -7
- package/dist-server/service/issue/issue.js.map +1 -1
- package/dist-server/service/supervisor/supervisor.d.ts +1 -3
- package/dist-server/service/supervisor/supervisor.js +1 -7
- package/dist-server/service/supervisor/supervisor.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/supervision/checklist-item.md +160 -0
- package/helps/supervision/checklist.md +160 -0
- package/package.json +11 -7
- package/server/index.ts +1 -1
- package/server/service/building-inspection/building-inspection-history.ts +70 -0
- package/server/service/building-inspection/building-inspection-mutation.ts +147 -0
- package/server/service/building-inspection/building-inspection-query.ts +202 -0
- package/server/service/building-inspection/building-inspection-type.ts +101 -0
- package/server/service/building-inspection/building-inspection.ts +106 -0
- package/server/service/building-inspection/event-subscriber.ts +20 -0
- package/server/service/building-inspection/index.ts +11 -0
- package/server/service/checklist/checklist-history.ts +96 -0
- package/server/service/checklist/checklist-mutation.ts +103 -0
- package/server/service/checklist/checklist-query.ts +52 -0
- package/server/service/{check-item/check-item-type.ts → checklist/checklist-type.ts} +6 -18
- package/server/service/checklist/checklist.ts +127 -0
- package/server/service/checklist/event-subscriber.ts +17 -0
- package/server/service/checklist/index.ts +9 -0
- package/server/service/checklist-item/checklist-item-mutation.ts +5 -0
- package/server/service/checklist-item/checklist-item-query.ts +43 -0
- package/server/service/checklist-item/checklist-item-type.ts +12 -0
- package/server/service/checklist-item/checklist-item.ts +100 -0
- package/server/service/checklist-item/index.ts +7 -0
- package/server/service/checklist-template/checklist-template-mutation.ts +66 -0
- package/server/service/checklist-template/checklist-template-query.ts +39 -0
- package/server/service/checklist-template/checklist-template-type.ts +23 -0
- package/server/service/checklist-template/checklist-template.ts +71 -0
- package/server/service/checklist-template/index.ts +6 -0
- package/server/service/checklist-template-item/checklist-template-item-mutation.ts +64 -0
- package/server/service/checklist-template-item/checklist-template-item-query.ts +39 -0
- package/server/service/checklist-template-item/checklist-template-item-type.ts +39 -0
- package/server/service/checklist-template-item/checklist-template-item.ts +67 -0
- package/server/service/checklist-template-item/index.ts +6 -0
- package/server/service/checklist-type/checklist-type-mutation.ts +66 -0
- package/server/service/checklist-type/checklist-type-query.ts +39 -0
- package/server/service/checklist-type/checklist-type-type.ts +26 -0
- package/server/service/checklist-type/checklist-type.ts +64 -0
- package/server/service/checklist-type/index.ts +6 -0
- package/server/service/index.ts +59 -23
- package/server/service/issue/issue.ts +1 -6
- package/server/service/supervisor/supervisor.ts +1 -6
- package/things-factory.config.js +11 -7
- package/client/pages/check-item/check-item-importer.ts +0 -94
- package/client/pages/check-item/check-item-list-page.ts +0 -340
- package/dist-client/pages/check-item/check-item-importer.d.ts +0 -10
- package/dist-client/pages/check-item/check-item-importer.js +0 -101
- package/dist-client/pages/check-item/check-item-importer.js.map +0 -1
- package/dist-client/pages/check-item/check-item-list-page.js +0 -323
- package/dist-client/pages/check-item/check-item-list-page.js.map +0 -1
- package/dist-server/service/check-item/check-item-mutation.d.ts +0 -10
- package/dist-server/service/check-item/check-item-mutation.js +0 -168
- package/dist-server/service/check-item/check-item-mutation.js.map +0 -1
- package/dist-server/service/check-item/check-item-query.d.ts +0 -12
- package/dist-server/service/check-item/check-item-query.js +0 -97
- package/dist-server/service/check-item/check-item-query.js.map +0 -1
- package/dist-server/service/check-item/check-item-type.d.ts +0 -23
- package/dist-server/service/check-item/check-item-type.js +0 -86
- package/dist-server/service/check-item/check-item-type.js.map +0 -1
- package/dist-server/service/check-item/check-item.d.ts +0 -28
- package/dist-server/service/check-item/check-item.js +0 -117
- package/dist-server/service/check-item/check-item.js.map +0 -1
- package/dist-server/service/check-item/index.d.ts +0 -6
- package/dist-server/service/check-item/index.js +0 -10
- package/dist-server/service/check-item/index.js.map +0 -1
- package/server/service/check-item/check-item-mutation.ts +0 -198
- package/server/service/check-item/check-item-query.ts +0 -62
- package/server/service/check-item/check-item.ts +0 -111
- package/server/service/check-item/index.ts +0 -7
|
@@ -0,0 +1,186 @@
|
|
|
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 { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
|
|
8
|
+
import { customElement, query, state } from 'lit/decorators.js'
|
|
9
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
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 './component/building-inspection-detail-header'
|
|
16
|
+
import '../checklist/checklist-view'
|
|
17
|
+
import { ChecklistMode } from '../checklist/checklist-view'
|
|
18
|
+
|
|
19
|
+
@customElement('building-inspection-detail-checklist')
|
|
20
|
+
export class BuildingInspectionDetailChecklist extends ScopedElementsMixin(PageView) {
|
|
21
|
+
static styles = [
|
|
22
|
+
ScrollbarStyles,
|
|
23
|
+
CommonGristStyles,
|
|
24
|
+
css`
|
|
25
|
+
:host {
|
|
26
|
+
display: grid;
|
|
27
|
+
grid-template-rows: 75px auto;
|
|
28
|
+
color: #4e5055;
|
|
29
|
+
|
|
30
|
+
width: 100%;
|
|
31
|
+
background-color: #f7f7f7;
|
|
32
|
+
overflow-y: auto;
|
|
33
|
+
|
|
34
|
+
--grid-record-emphasized-background-color: red;
|
|
35
|
+
--grid-record-emphasized-color: yellow;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
*[bold] {
|
|
39
|
+
font-weight: bold;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
div[body] {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
align-items: center;
|
|
47
|
+
|
|
48
|
+
div[button-container] {
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: flex-end;
|
|
51
|
+
width: 100%;
|
|
52
|
+
gap: 10px;
|
|
53
|
+
margin-right: 50px;
|
|
54
|
+
margin-bottom: 15px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
@state() project: any = {}
|
|
61
|
+
@state() buildingInspection: any = {}
|
|
62
|
+
|
|
63
|
+
get context() {
|
|
64
|
+
return {
|
|
65
|
+
title: '검측 관리 상세 - 검측 체크리스트'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
render() {
|
|
70
|
+
return html`
|
|
71
|
+
<building-inspection-detail-header
|
|
72
|
+
.buildingInspectionId=${this.buildingInspection?.id}
|
|
73
|
+
.buildingLevelId=${this.buildingInspection?.buildingLevel?.id}
|
|
74
|
+
.projectName=${this.project.name}
|
|
75
|
+
.buildingName=${this.buildingInspection?.buildingLevel?.building?.name}
|
|
76
|
+
.buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}
|
|
77
|
+
></building-inspection-detail-header>
|
|
78
|
+
|
|
79
|
+
<div body>
|
|
80
|
+
<checklist-view
|
|
81
|
+
.mode=${ChecklistMode.EDITOR}
|
|
82
|
+
status=${this.buildingInspection.status}
|
|
83
|
+
.checklist=${this.buildingInspection.checklist || {}}
|
|
84
|
+
></checklist-view>
|
|
85
|
+
|
|
86
|
+
<div button-container>
|
|
87
|
+
<md-elevated-button @click=${this._onClickModifyChecklist}>
|
|
88
|
+
<md-icon slot="icon">assignment</md-icon>등록
|
|
89
|
+
</md-elevated-button>
|
|
90
|
+
<md-elevated-button> <md-icon slot="icon">assignment</md-icon>취소 </md-elevated-button>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
`
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async pageUpdated(changes: any, lifecycle: PageLifecycle) {
|
|
97
|
+
if (this.active) {
|
|
98
|
+
const buildingInspectionId = lifecycle.resourceId || ''
|
|
99
|
+
await this.initBuildingInspection(buildingInspectionId)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async initBuildingInspection(buildingInspectionId: string = '') {
|
|
104
|
+
const response = await client.query({
|
|
105
|
+
query: gql`
|
|
106
|
+
query BuildingInspection($buildingInspectionId: String!) {
|
|
107
|
+
buildingInspection(id: $buildingInspectionId) {
|
|
108
|
+
id
|
|
109
|
+
status
|
|
110
|
+
requestDate
|
|
111
|
+
checklist {
|
|
112
|
+
id
|
|
113
|
+
name
|
|
114
|
+
constructionType
|
|
115
|
+
constructionDetailType
|
|
116
|
+
location
|
|
117
|
+
inspectionParts
|
|
118
|
+
documentNo
|
|
119
|
+
checklistItems {
|
|
120
|
+
id
|
|
121
|
+
name
|
|
122
|
+
sequence
|
|
123
|
+
mainType
|
|
124
|
+
detailType
|
|
125
|
+
inspctionCriteria
|
|
126
|
+
constructionConfirmStatus
|
|
127
|
+
supervisoryConfirmStatus
|
|
128
|
+
comment
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
buildingLevel {
|
|
132
|
+
id
|
|
133
|
+
floor
|
|
134
|
+
mainDrawing {
|
|
135
|
+
id
|
|
136
|
+
name
|
|
137
|
+
fullpath
|
|
138
|
+
}
|
|
139
|
+
mainDrawingImage
|
|
140
|
+
building {
|
|
141
|
+
id
|
|
142
|
+
name
|
|
143
|
+
buildingComplex {
|
|
144
|
+
id
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`,
|
|
151
|
+
variables: {
|
|
152
|
+
buildingInspectionId
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
if (response.errors) return
|
|
157
|
+
|
|
158
|
+
this.buildingInspection = response.data.buildingInspection
|
|
159
|
+
|
|
160
|
+
await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
private async _getProjectByBuildingComplexId(buildingComplexId) {
|
|
164
|
+
const response = await client.query({
|
|
165
|
+
query: gql`
|
|
166
|
+
query ProjectByBuildingComplexId($buildingComplexId: String!) {
|
|
167
|
+
project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {
|
|
168
|
+
id
|
|
169
|
+
name
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
`,
|
|
173
|
+
variables: {
|
|
174
|
+
buildingComplexId
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
if (response.errors) return
|
|
179
|
+
|
|
180
|
+
this.project = response.data.project
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
private _onClickModifyChecklist() {
|
|
184
|
+
console.log('checklist : ', this.buildingInspection.checklist)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
3
|
+
import { PageView } from '@operato/shell'
|
|
4
|
+
import { css, html } from 'lit'
|
|
5
|
+
import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'
|
|
6
|
+
import { customElement, query, state } from 'lit/decorators.js'
|
|
7
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
8
|
+
import { client } from '@operato/graphql'
|
|
9
|
+
import { notify } from '@operato/layout'
|
|
10
|
+
import gql from 'graphql-tag'
|
|
11
|
+
import './component/building-inspection-detail-header'
|
|
12
|
+
import '@operato/image-marker/ox-image-marker.js'
|
|
13
|
+
|
|
14
|
+
@customElement('building-inspection-detail-drawing')
|
|
15
|
+
export class BuildingInspectionDetailDrawing extends ScopedElementsMixin(PageView) {
|
|
16
|
+
static styles = [
|
|
17
|
+
ScrollbarStyles,
|
|
18
|
+
CommonGristStyles,
|
|
19
|
+
css`
|
|
20
|
+
:host {
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-rows: 75px auto;
|
|
23
|
+
color: #4e5055;
|
|
24
|
+
|
|
25
|
+
width: 100%;
|
|
26
|
+
background-color: #f7f7f7;
|
|
27
|
+
overflow-y: auto;
|
|
28
|
+
|
|
29
|
+
--grid-record-emphasized-background-color: red;
|
|
30
|
+
--grid-record-emphasized-color: yellow;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
div[body] {
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
}
|
|
37
|
+
`
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
@state() project: any = {}
|
|
41
|
+
@state() buildingInspection: any = {}
|
|
42
|
+
@state() buildingInspectionId: string = ''
|
|
43
|
+
|
|
44
|
+
get context() {
|
|
45
|
+
return {
|
|
46
|
+
title: '검측 관리 상세 - 검측 도면'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
render() {
|
|
51
|
+
return html`
|
|
52
|
+
<building-inspection-detail-header
|
|
53
|
+
.buildingInspectionId=${this.buildingInspection?.id}
|
|
54
|
+
.buildingLevelId=${this.buildingInspection?.buildingLevel?.id}
|
|
55
|
+
.projectName=${this.project.name}
|
|
56
|
+
.buildingName=${this.buildingInspection?.buildingLevel?.building?.name}
|
|
57
|
+
.buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}
|
|
58
|
+
></building-inspection-detail-header>
|
|
59
|
+
|
|
60
|
+
<div body>
|
|
61
|
+
<ox-image-marker
|
|
62
|
+
.imageUrl=${this.buildingInspection?.buildingLevel?.mainDrawingImage || '/assets/images/img-drawing-default.png'}
|
|
63
|
+
.shapes=${JSON.parse(this.buildingInspection?.drawingMarker || [])}
|
|
64
|
+
@shapes-changed=${this.onClickMarkerSave}
|
|
65
|
+
></ox-image-marker>
|
|
66
|
+
</div>
|
|
67
|
+
`
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async pageUpdated(changes: any, lifecycle: PageLifecycle) {
|
|
71
|
+
if (this.active) {
|
|
72
|
+
this.buildingInspectionId = lifecycle.resourceId || ''
|
|
73
|
+
await this.initBuildingInspection(this.buildingInspectionId)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async initBuildingInspection(buildingInspectionId: string = '') {
|
|
78
|
+
const response = await client.query({
|
|
79
|
+
query: gql`
|
|
80
|
+
query BuildingInspection($buildingInspectionId: String!) {
|
|
81
|
+
buildingInspection(id: $buildingInspectionId) {
|
|
82
|
+
id
|
|
83
|
+
status
|
|
84
|
+
requestDate
|
|
85
|
+
drawingMarker
|
|
86
|
+
buildingLevel {
|
|
87
|
+
id
|
|
88
|
+
floor
|
|
89
|
+
mainDrawing {
|
|
90
|
+
id
|
|
91
|
+
name
|
|
92
|
+
fullpath
|
|
93
|
+
}
|
|
94
|
+
mainDrawingImage
|
|
95
|
+
building {
|
|
96
|
+
id
|
|
97
|
+
name
|
|
98
|
+
buildingComplex {
|
|
99
|
+
id
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
`,
|
|
106
|
+
variables: {
|
|
107
|
+
buildingInspectionId
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
if (response.errors) return
|
|
112
|
+
|
|
113
|
+
this.buildingInspection = response.data.buildingInspection
|
|
114
|
+
|
|
115
|
+
await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private 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
|
+
|
|
133
|
+
if (response.errors) return
|
|
134
|
+
|
|
135
|
+
this.project = response.data.project
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private async onClickMarkerSave(e) {
|
|
139
|
+
const response = await client.query({
|
|
140
|
+
query: gql`
|
|
141
|
+
mutation UpdateBuildingInspection($patch: UpdateBuildingInspection!) {
|
|
142
|
+
updateBuildingInspection(patch: $patch) {
|
|
143
|
+
id
|
|
144
|
+
drawingMarker
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`,
|
|
148
|
+
variables: {
|
|
149
|
+
patch: {
|
|
150
|
+
id: this.buildingInspectionId,
|
|
151
|
+
drawingMarker: JSON.stringify(e.detail)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
if (response.errors) return
|
|
157
|
+
|
|
158
|
+
notify({ message: '저장되었습니다.' })
|
|
159
|
+
}
|
|
160
|
+
}
|