@dssp/supervision 0.0.8 → 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.
Files changed (224) hide show
  1. package/client/pages/building-inspection/building-inspection-detail-checklist.ts +186 -0
  2. package/client/pages/building-inspection/building-inspection-detail-drawing.ts +160 -0
  3. package/client/pages/building-inspection/building-inspection-list.ts +430 -0
  4. package/client/pages/building-inspection/component/building-inspection-detail-header.ts +94 -0
  5. package/client/pages/building-inspection/inspection-create-popup.ts +696 -0
  6. package/client/pages/checklist/checklist-view.ts +443 -0
  7. package/client/pages/checklist-template/checklist-template-item.ts +240 -0
  8. package/client/pages/checklist-template/checklist-template-list.ts +271 -0
  9. package/client/pages/checklist-template/checklist-type-management.ts +242 -0
  10. package/client/route.ts +14 -18
  11. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +21 -0
  12. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +187 -0
  13. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -0
  14. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +21 -0
  15. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +169 -0
  16. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js.map +1 -0
  17. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +67 -0
  18. package/dist-client/pages/building-inspection/building-inspection-list.js +434 -0
  19. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -0
  20. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.d.ts +1 -0
  21. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +118 -0
  22. package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -0
  23. package/dist-client/pages/building-inspection/inspection-create-popup.d.ts +3 -0
  24. package/dist-client/pages/building-inspection/inspection-create-popup.js +735 -0
  25. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -0
  26. package/dist-client/pages/checklist/checklist-view.d.ts +6 -0
  27. package/dist-client/pages/checklist/checklist-view.js +434 -0
  28. package/dist-client/pages/checklist/checklist-view.js.map +1 -0
  29. package/dist-client/pages/checklist-template/checklist-template-item.d.ts +2 -0
  30. package/dist-client/pages/checklist-template/checklist-template-item.js +237 -0
  31. package/dist-client/pages/checklist-template/checklist-template-item.js.map +1 -0
  32. package/dist-client/pages/{check-item/check-item-list-page.d.ts → checklist-template/checklist-template-list.d.ts} +8 -27
  33. package/dist-client/pages/checklist-template/checklist-template-list.js +259 -0
  34. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -0
  35. package/dist-client/pages/checklist-template/checklist-type-management.d.ts +48 -0
  36. package/dist-client/pages/checklist-template/checklist-type-management.js +229 -0
  37. package/dist-client/pages/checklist-template/checklist-type-management.js.map +1 -0
  38. package/dist-client/route.d.ts +1 -1
  39. package/dist-client/route.js +10 -13
  40. package/dist-client/route.js.map +1 -1
  41. package/dist-client/tsconfig.tsbuildinfo +1 -1
  42. package/dist-server/index.d.ts +1 -1
  43. package/dist-server/index.js +1 -1
  44. package/dist-server/index.js.map +1 -1
  45. package/dist-server/service/building-inspection/building-inspection-history.d.ts +17 -0
  46. package/dist-server/service/building-inspection/building-inspection-history.js +85 -0
  47. package/dist-server/service/building-inspection/building-inspection-history.js.map +1 -0
  48. package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +8 -0
  49. package/dist-server/service/building-inspection/building-inspection-mutation.js +148 -0
  50. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -0
  51. package/dist-server/service/building-inspection/building-inspection-query.d.ts +20 -0
  52. package/dist-server/service/building-inspection/building-inspection-query.js +235 -0
  53. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -0
  54. package/dist-server/service/building-inspection/building-inspection-type.d.ts +43 -0
  55. package/dist-server/service/building-inspection/building-inspection-type.js +153 -0
  56. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -0
  57. package/dist-server/service/building-inspection/building-inspection.d.ts +26 -0
  58. package/dist-server/service/building-inspection/building-inspection.js +113 -0
  59. package/dist-server/service/building-inspection/building-inspection.js.map +1 -0
  60. package/dist-server/service/building-inspection/event-subscriber.d.ts +7 -0
  61. package/dist-server/service/building-inspection/event-subscriber.js +21 -0
  62. package/dist-server/service/building-inspection/event-subscriber.js.map +1 -0
  63. package/dist-server/service/building-inspection/index.d.ts +10 -0
  64. package/dist-server/service/building-inspection/index.js +14 -0
  65. package/dist-server/service/building-inspection/index.js.map +1 -0
  66. package/dist-server/service/checklist/checklist-history.d.ts +24 -0
  67. package/dist-server/service/checklist/checklist-history.js +120 -0
  68. package/dist-server/service/checklist/checklist-history.js.map +1 -0
  69. package/dist-server/service/checklist/checklist-mutation.d.ts +8 -0
  70. package/dist-server/service/checklist/checklist-mutation.js +96 -0
  71. package/dist-server/service/checklist/checklist-mutation.js.map +1 -0
  72. package/dist-server/service/checklist/checklist-query.d.ts +12 -0
  73. package/dist-server/service/checklist/checklist-query.js +83 -0
  74. package/dist-server/service/checklist/checklist-query.js.map +1 -0
  75. package/dist-server/service/checklist/checklist-type.d.ts +18 -0
  76. package/dist-server/service/checklist/checklist-type.js +69 -0
  77. package/dist-server/service/checklist/checklist-type.js.map +1 -0
  78. package/dist-server/service/checklist/checklist.d.ts +31 -0
  79. package/dist-server/service/checklist/checklist.js +143 -0
  80. package/dist-server/service/checklist/checklist.js.map +1 -0
  81. package/dist-server/service/checklist/event-subscriber.d.ts +7 -0
  82. package/dist-server/service/checklist/event-subscriber.js +21 -0
  83. package/dist-server/service/checklist/event-subscriber.js.map +1 -0
  84. package/dist-server/service/checklist/index.d.ts +8 -0
  85. package/dist-server/service/checklist/index.js +12 -0
  86. package/dist-server/service/checklist/index.js.map +1 -0
  87. package/dist-server/service/checklist-item/checklist-item-mutation.d.ts +2 -0
  88. package/dist-server/service/checklist-item/checklist-item-mutation.js +13 -0
  89. package/dist-server/service/checklist-item/checklist-item-mutation.js.map +1 -0
  90. package/dist-server/service/checklist-item/checklist-item-query.d.ts +10 -0
  91. package/dist-server/service/checklist-item/checklist-item-query.js +68 -0
  92. package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -0
  93. package/dist-server/service/checklist-item/checklist-item-type.d.ts +5 -0
  94. package/dist-server/service/checklist-item/checklist-item-type.js +21 -0
  95. package/dist-server/service/checklist-item/checklist-item-type.js.map +1 -0
  96. package/dist-server/service/checklist-item/checklist-item.d.ts +26 -0
  97. package/dist-server/service/checklist-item/checklist-item.js +113 -0
  98. package/dist-server/service/checklist-item/checklist-item.js.map +1 -0
  99. package/dist-server/service/checklist-item/index.d.ts +5 -0
  100. package/dist-server/service/checklist-item/index.js +10 -0
  101. package/dist-server/service/checklist-item/index.js.map +1 -0
  102. package/dist-server/service/checklist-template/checklist-template-mutation.d.ts +6 -0
  103. package/dist-server/service/checklist-template/checklist-template-mutation.js +64 -0
  104. package/dist-server/service/checklist-template/checklist-template-mutation.js.map +1 -0
  105. package/dist-server/service/checklist-template/checklist-template-query.d.ts +10 -0
  106. package/dist-server/service/checklist-template/checklist-template-query.js +65 -0
  107. package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -0
  108. package/dist-server/service/checklist-template/checklist-template-type.d.ts +10 -0
  109. package/dist-server/service/checklist-template/checklist-template-type.js +39 -0
  110. package/dist-server/service/checklist-template/checklist-template-type.js.map +1 -0
  111. package/dist-server/service/checklist-template/checklist-template.d.ts +17 -0
  112. package/dist-server/service/checklist-template/checklist-template.js +78 -0
  113. package/dist-server/service/checklist-template/checklist-template.js.map +1 -0
  114. package/dist-server/service/checklist-template/index.d.ts +5 -0
  115. package/dist-server/service/checklist-template/index.js +9 -0
  116. package/dist-server/service/checklist-template/index.js.map +1 -0
  117. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.d.ts +7 -0
  118. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +68 -0
  119. package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js.map +1 -0
  120. package/dist-server/service/checklist-template-item/checklist-template-item-query.d.ts +10 -0
  121. package/dist-server/service/checklist-template-item/checklist-template-item-query.js +66 -0
  122. package/dist-server/service/checklist-template-item/checklist-template-item-query.js.map +1 -0
  123. package/dist-server/service/checklist-template-item/checklist-template-item-type.d.ts +16 -0
  124. package/dist-server/service/checklist-template-item/checklist-template-item-type.js +60 -0
  125. package/dist-server/service/checklist-template-item/checklist-template-item-type.js.map +1 -0
  126. package/dist-server/service/checklist-template-item/checklist-template-item.d.ts +19 -0
  127. package/dist-server/service/checklist-template-item/checklist-template-item.js +87 -0
  128. package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -0
  129. package/dist-server/service/checklist-template-item/index.d.ts +5 -0
  130. package/dist-server/service/checklist-template-item/index.js +9 -0
  131. package/dist-server/service/checklist-template-item/index.js.map +1 -0
  132. package/dist-server/service/checklist-type/checklist-type-mutation.d.ts +6 -0
  133. package/dist-server/service/checklist-type/checklist-type-mutation.js +64 -0
  134. package/dist-server/service/checklist-type/checklist-type-mutation.js.map +1 -0
  135. package/dist-server/service/checklist-type/checklist-type-query.d.ts +10 -0
  136. package/dist-server/service/checklist-type/checklist-type-query.js +65 -0
  137. package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -0
  138. package/dist-server/service/checklist-type/checklist-type-type.d.ts +11 -0
  139. package/dist-server/service/checklist-type/checklist-type-type.js +43 -0
  140. package/dist-server/service/checklist-type/checklist-type-type.js.map +1 -0
  141. package/dist-server/service/checklist-type/checklist-type.d.ts +19 -0
  142. package/dist-server/service/checklist-type/checklist-type.js +78 -0
  143. package/dist-server/service/checklist-type/checklist-type.js.map +1 -0
  144. package/dist-server/service/checklist-type/index.d.ts +5 -0
  145. package/dist-server/service/checklist-type/index.js +9 -0
  146. package/dist-server/service/checklist-type/index.js.map +1 -0
  147. package/dist-server/service/index.d.ts +8 -3
  148. package/dist-server/service/index.js +25 -5
  149. package/dist-server/service/index.js.map +1 -1
  150. package/dist-server/service/issue/issue.d.ts +1 -3
  151. package/dist-server/service/issue/issue.js +1 -7
  152. package/dist-server/service/issue/issue.js.map +1 -1
  153. package/dist-server/service/supervisor/supervisor.d.ts +1 -3
  154. package/dist-server/service/supervisor/supervisor.js +1 -7
  155. package/dist-server/service/supervisor/supervisor.js.map +1 -1
  156. package/dist-server/tsconfig.tsbuildinfo +1 -1
  157. package/helps/supervision/checklist-item.md +160 -0
  158. package/helps/supervision/checklist.md +160 -0
  159. package/package.json +11 -7
  160. package/server/index.ts +1 -1
  161. package/server/service/building-inspection/building-inspection-history.ts +70 -0
  162. package/server/service/building-inspection/building-inspection-mutation.ts +147 -0
  163. package/server/service/building-inspection/building-inspection-query.ts +202 -0
  164. package/server/service/building-inspection/building-inspection-type.ts +101 -0
  165. package/server/service/building-inspection/building-inspection.ts +106 -0
  166. package/server/service/building-inspection/event-subscriber.ts +20 -0
  167. package/server/service/building-inspection/index.ts +11 -0
  168. package/server/service/checklist/checklist-history.ts +96 -0
  169. package/server/service/checklist/checklist-mutation.ts +103 -0
  170. package/server/service/checklist/checklist-query.ts +52 -0
  171. package/server/service/{check-item/check-item-type.ts → checklist/checklist-type.ts} +6 -18
  172. package/server/service/checklist/checklist.ts +127 -0
  173. package/server/service/checklist/event-subscriber.ts +17 -0
  174. package/server/service/checklist/index.ts +9 -0
  175. package/server/service/checklist-item/checklist-item-mutation.ts +5 -0
  176. package/server/service/checklist-item/checklist-item-query.ts +43 -0
  177. package/server/service/checklist-item/checklist-item-type.ts +12 -0
  178. package/server/service/checklist-item/checklist-item.ts +100 -0
  179. package/server/service/checklist-item/index.ts +7 -0
  180. package/server/service/checklist-template/checklist-template-mutation.ts +66 -0
  181. package/server/service/checklist-template/checklist-template-query.ts +39 -0
  182. package/server/service/checklist-template/checklist-template-type.ts +23 -0
  183. package/server/service/checklist-template/checklist-template.ts +71 -0
  184. package/server/service/checklist-template/index.ts +6 -0
  185. package/server/service/checklist-template-item/checklist-template-item-mutation.ts +64 -0
  186. package/server/service/checklist-template-item/checklist-template-item-query.ts +39 -0
  187. package/server/service/checklist-template-item/checklist-template-item-type.ts +39 -0
  188. package/server/service/checklist-template-item/checklist-template-item.ts +67 -0
  189. package/server/service/checklist-template-item/index.ts +6 -0
  190. package/server/service/checklist-type/checklist-type-mutation.ts +66 -0
  191. package/server/service/checklist-type/checklist-type-query.ts +39 -0
  192. package/server/service/checklist-type/checklist-type-type.ts +26 -0
  193. package/server/service/checklist-type/checklist-type.ts +64 -0
  194. package/server/service/checklist-type/index.ts +6 -0
  195. package/server/service/index.ts +59 -23
  196. package/server/service/issue/issue.ts +1 -6
  197. package/server/service/supervisor/supervisor.ts +1 -6
  198. package/things-factory.config.js +11 -7
  199. package/client/pages/check-item/check-item-importer.ts +0 -94
  200. package/client/pages/check-item/check-item-list-page.ts +0 -340
  201. package/dist-client/pages/check-item/check-item-importer.d.ts +0 -10
  202. package/dist-client/pages/check-item/check-item-importer.js +0 -101
  203. package/dist-client/pages/check-item/check-item-importer.js.map +0 -1
  204. package/dist-client/pages/check-item/check-item-list-page.js +0 -323
  205. package/dist-client/pages/check-item/check-item-list-page.js.map +0 -1
  206. package/dist-server/service/check-item/check-item-mutation.d.ts +0 -10
  207. package/dist-server/service/check-item/check-item-mutation.js +0 -168
  208. package/dist-server/service/check-item/check-item-mutation.js.map +0 -1
  209. package/dist-server/service/check-item/check-item-query.d.ts +0 -12
  210. package/dist-server/service/check-item/check-item-query.js +0 -97
  211. package/dist-server/service/check-item/check-item-query.js.map +0 -1
  212. package/dist-server/service/check-item/check-item-type.d.ts +0 -23
  213. package/dist-server/service/check-item/check-item-type.js +0 -86
  214. package/dist-server/service/check-item/check-item-type.js.map +0 -1
  215. package/dist-server/service/check-item/check-item.d.ts +0 -28
  216. package/dist-server/service/check-item/check-item.js +0 -117
  217. package/dist-server/service/check-item/check-item.js.map +0 -1
  218. package/dist-server/service/check-item/index.d.ts +0 -6
  219. package/dist-server/service/check-item/index.js +0 -10
  220. package/dist-server/service/check-item/index.js.map +0 -1
  221. package/server/service/check-item/check-item-mutation.ts +0 -198
  222. package/server/service/check-item/check-item-query.ts +0 -62
  223. package/server/service/check-item/check-item.ts +0 -111
  224. package/server/service/check-item/index.ts +0 -7
@@ -0,0 +1,430 @@
1
+ import '@material/web/icon/icon.js'
2
+ import '@operato/data-grist'
3
+
4
+ import { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
5
+ import { PageView, navigate } 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 { DataGrist, FetchOption } from '@operato/data-grist'
11
+ import { client } from '@operato/graphql'
12
+ import { notify } from '@operato/layout'
13
+ import gql from 'graphql-tag'
14
+ import { openPopup } from '@operato/layout'
15
+ import './inspection-create-popup'
16
+ import '@operato/event-view/ox-event-view.js'
17
+
18
+ export enum ChecklistTypeMainType {
19
+ BASIC = '10',
20
+ NON_BASIC = '20'
21
+ }
22
+ export const CHECKLIST_MAIN_TYPE_LIST = {
23
+ [ChecklistTypeMainType.BASIC]: '기본 업무',
24
+ [ChecklistTypeMainType.NON_BASIC]: '기본 외 업무'
25
+ }
26
+
27
+ export enum BuildingInspectionStatus {
28
+ WAIT = 'WAIT',
29
+ REQUEST = 'REQUEST',
30
+ PASS = 'PASS',
31
+ FAIL = 'FAIL'
32
+ }
33
+ export const BUILDING_INSPECTION_STATUS = {
34
+ [BuildingInspectionStatus.WAIT]: '검측 대기',
35
+ [BuildingInspectionStatus.REQUEST]: '검측 요청',
36
+ [BuildingInspectionStatus.PASS]: '합격',
37
+ [BuildingInspectionStatus.FAIL]: '불합격'
38
+ }
39
+
40
+ @customElement('building-inspection-list')
41
+ export class BuildingInspectionList extends ScopedElementsMixin(PageView) {
42
+ static styles = [
43
+ ScrollbarStyles,
44
+ CommonGristStyles,
45
+ css`
46
+ :host {
47
+ display: grid;
48
+ grid-template-rows: 75px auto;
49
+ color: #4e5055;
50
+
51
+ width: 100%;
52
+ background-color: #f7f7f7;
53
+ overflow-y: auto;
54
+
55
+ --grid-record-emphasized-background-color: red;
56
+ --grid-record-emphasized-color: yellow;
57
+ }
58
+
59
+ md-filled-button {
60
+ --md-filled-button-container-color: #0595e5;
61
+ --md-filled-button-container-height: 30px;
62
+ --md-filled-button-trailing-space: 15px;
63
+ --md-filled-button-leading-space: 15px;
64
+ }
65
+ md-outlined-button {
66
+ --md-outlined-button-container-height: 30px;
67
+ --md-outlined-button-trailing-space: 15px;
68
+ --md-outlined-button-leading-space: 15px;
69
+ }
70
+
71
+ *[bold] {
72
+ font-weight: bold;
73
+ }
74
+
75
+ div[header] {
76
+ display: flex;
77
+ margin: 0px 20px;
78
+
79
+ h2 {
80
+ flex: 0.5;
81
+ color: #3f71a0;
82
+ }
83
+ }
84
+
85
+ div[body] {
86
+ display: flex;
87
+ flex-direction: column;
88
+ margin: 0px 25px 25px 25px;
89
+ gap: 10px;
90
+ min-height: fit-content;
91
+
92
+ h3 {
93
+ color: #2e79be;
94
+ font-size: 18px;
95
+ margin: 0px;
96
+ }
97
+
98
+ & > div {
99
+ display: flex;
100
+ gap: 10px;
101
+ padding: 15px;
102
+ border-radius: 5px;
103
+ }
104
+
105
+ div[top] {
106
+ background-color: #ffffff;
107
+ border: 1px solid #cccccc80;
108
+
109
+ img[drawing] {
110
+ width: 400px;
111
+ height: 400px;
112
+ }
113
+
114
+ div[inspection-data] {
115
+ display: flex;
116
+ }
117
+ }
118
+
119
+ div[bottom] {
120
+ height: auto;
121
+ overflow-y: auto;
122
+ display: flex;
123
+ flex-direction: column;
124
+ }
125
+ }
126
+ `
127
+ ]
128
+
129
+ private defaultProject = {
130
+ name: '',
131
+ buildingComplex: {
132
+ buildings: []
133
+ }
134
+ }
135
+
136
+ @state() private gristConfig: any
137
+ @state() buildingLevelId: string = ''
138
+ @state() project: any = { ...this.defaultProject }
139
+ @state() location: string = ''
140
+ @state() building: any = {}
141
+ @state() drawingImage: string = ''
142
+ @state() buildingInspectionSummary: any = {}
143
+
144
+ @query('ox-grist') private grist!: DataGrist
145
+ @query('ox-event-view') private eventView!: HTMLElement
146
+
147
+ get context() {
148
+ return {
149
+ title: '검측 관리',
150
+ actions: [
151
+ {
152
+ title: '검측 등록',
153
+ action: this._openCreateInspection.bind(this),
154
+ ...CommonButtonStyles.submit
155
+ },
156
+ {
157
+ title: '삭제',
158
+ action: this._deleteChecklistType.bind(this),
159
+ ...CommonButtonStyles.delete
160
+ }
161
+ ]
162
+ }
163
+ }
164
+
165
+ render() {
166
+ return html`
167
+ <div header>
168
+ <h2>${this.project.name} ${this.location}</h2>
169
+ </div>
170
+
171
+ <div body>
172
+ <div top>
173
+ <img drawing src=${this.drawingImage || '/assets/images/img-drawing-default.png'} />
174
+ <div>
175
+ <h3>${this.location} 검측 현황</h3>
176
+ <div inspection-data>
177
+ <div>
178
+ ${Object.entries(BUILDING_INSPECTION_STATUS).map(
179
+ status => html` <div>${status[1]} ${this.buildingInspectionSummary[status[0].toLowerCase()]}건</div> `
180
+ )}
181
+ </div>
182
+ <ox-event-view mode=${'monthly'}> </ox-event-view>
183
+ </div>
184
+ </div>
185
+ </div>
186
+
187
+ <div bottom>
188
+ <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>
189
+ </div>
190
+ </div>
191
+ `
192
+ }
193
+
194
+ async pageUpdated(changes: any, lifecycle: PageLifecycle) {
195
+ if (this.active) {
196
+ this.buildingLevelId = lifecycle.resourceId || ''
197
+
198
+ await this.initProject(this.buildingLevelId)
199
+ this.grist.fetch()
200
+ }
201
+ }
202
+
203
+ async initProject(buildingLevelId: string = '') {
204
+ const response = await client.query({
205
+ query: gql`
206
+ query ProjectByBuildingLevelId($buildingLevelId: String!) {
207
+ projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {
208
+ id
209
+ name
210
+ mainPhoto {
211
+ fullpath
212
+ }
213
+ buildingComplex {
214
+ id
215
+ drawing {
216
+ id
217
+ name
218
+ fullpath
219
+ }
220
+ buildings {
221
+ id
222
+ name
223
+ }
224
+ }
225
+ }
226
+
227
+ buildingInspectionSummaryOfBuildingLevel(buildingLevelId: $buildingLevelId) {
228
+ wait
229
+ request
230
+ pass
231
+ fail
232
+ }
233
+ }
234
+ `,
235
+ variables: {
236
+ buildingLevelId
237
+ }
238
+ })
239
+
240
+ if (response.errors) return
241
+
242
+ this.project = response.data?.projectByBuildingLevelId
243
+ this.buildingInspectionSummary = response.data?.buildingInspectionSummaryOfBuildingLevel
244
+
245
+ // 캘린더 최소 높이 속성 수정
246
+ this.eventView.style.setProperty('--calendar-monthly-date-min-height', '50px')
247
+ }
248
+
249
+ async pageInitialized(lifecycle: any) {
250
+ this.gristConfig = {
251
+ columns: [
252
+ { type: 'gutter', gutterName: 'sequence' },
253
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
254
+ {
255
+ type: 'string',
256
+ name: 'id',
257
+ hidden: true
258
+ },
259
+ {
260
+ type: 'string',
261
+ name: 'location',
262
+ header: '위치',
263
+ width: 150
264
+ },
265
+ {
266
+ type: 'string',
267
+ name: 'constructionType',
268
+ header: '공종',
269
+ width: 120
270
+ },
271
+ {
272
+ type: 'string',
273
+ name: 'inspectionParts',
274
+ header: '검측 부위',
275
+ record: {
276
+ renderer: value => value?.join(', ') || ''
277
+ },
278
+ width: 200
279
+ },
280
+ {
281
+ type: 'string',
282
+ name: 'requestDate',
283
+ header: '검측 요청일',
284
+ width: 120
285
+ },
286
+ {
287
+ type: 'string',
288
+ name: 'status',
289
+ header: '검측 결과',
290
+ record: {
291
+ renderer: value => BUILDING_INSPECTION_STATUS[value]
292
+ },
293
+ width: 120
294
+ },
295
+ {
296
+ type: 'datetime',
297
+ name: '',
298
+ header: '검측 결과 데이터',
299
+ width: 180
300
+ }
301
+ ],
302
+ rows: {
303
+ selectable: {
304
+ multiple: true
305
+ },
306
+ appendable: false,
307
+ handlers: {
308
+ click: (columns, data, column, record, rowIndex) => {
309
+ navigate(`building-inspection-detail-drawing/${record.id}`)
310
+ }
311
+ }
312
+ },
313
+ sorters: [{ name: 'requestDate' }]
314
+ }
315
+ }
316
+
317
+ async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
318
+ if (!this.buildingLevelId) return
319
+
320
+ const response = await client.query({
321
+ query: gql`
322
+ query BuildingInspectionsOfBuildingLevel($params: BuildingInspectionsOfBuildingLevel!) {
323
+ buildingInspectionsOfBuildingLevel(params: $params) {
324
+ items {
325
+ id
326
+ status
327
+ requestDate
328
+ buildingLevel {
329
+ floor
330
+ building {
331
+ id
332
+ name
333
+ }
334
+ mainDrawing {
335
+ id
336
+ name
337
+ fullpath
338
+ }
339
+ mainDrawingImage
340
+ }
341
+ checklist {
342
+ checklistId: id
343
+ name
344
+ constructionType
345
+ constructionDetailType
346
+ location
347
+ inspectionParts
348
+ }
349
+ }
350
+ total
351
+ }
352
+ }
353
+ `,
354
+ variables: {
355
+ params: {
356
+ buildingLevelId: this.buildingLevelId,
357
+ limit: 0
358
+ }
359
+ }
360
+ })
361
+
362
+ let items = response.data?.buildingInspectionsOfBuildingLevel?.items || []
363
+ items = items.map(item => ({
364
+ ...item,
365
+ ...item.checklist,
366
+ requestDate: this._formatDate(item.requestDate)
367
+ }))
368
+
369
+ this.location = items[0]?.checklist?.location || ''
370
+ this.drawingImage = items[0]?.buildingLevel?.mainDrawingImage || ''
371
+ this.building = items[0]?.buildingLevel?.building || {}
372
+
373
+ return {
374
+ total: response.data?.buildingInspectionsOfBuildingLevel?.total || 0,
375
+ records: items
376
+ }
377
+ }
378
+
379
+ private async _deleteChecklistType() {
380
+ if (confirm('삭제하시겠습니까?')) {
381
+ const ids = this.grist.selected.map(record => record.id)
382
+ if (ids && ids.length > 0) {
383
+ const response = await client.mutate({
384
+ mutation: gql`
385
+ mutation ($ids: [String!]!) {
386
+ deleteBuildingInspections(ids: $ids)
387
+ }
388
+ `,
389
+ variables: {
390
+ ids
391
+ }
392
+ })
393
+
394
+ if (!response.errors) {
395
+ this.grist.fetch()
396
+ notify({ message: '삭제되었습니다.' })
397
+ }
398
+ }
399
+ }
400
+ }
401
+
402
+ private _openCreateInspection() {
403
+ openPopup(
404
+ html`
405
+ <inspection-create-popup
406
+ .projectId=${this.project.id}
407
+ .selectedBuildingId=${this.building.id}
408
+ .selectedBuildingLevelId=${this.buildingLevelId}
409
+ @requestRefresh="${() => this.grist.fetch()}"
410
+ ></inspection-create-popup>
411
+ `,
412
+ {
413
+ backdrop: true,
414
+ size: 'large',
415
+ title: '검측 요청서 등록'
416
+ }
417
+ )
418
+ }
419
+
420
+ private _formatDate(date: Date | undefined) {
421
+ return date
422
+ ? new Intl.DateTimeFormat('en-CA', {
423
+ timeZone: 'Asia/Seoul',
424
+ year: 'numeric',
425
+ month: '2-digit',
426
+ day: '2-digit'
427
+ }).format(new Date(date))
428
+ : ''
429
+ }
430
+ }
@@ -0,0 +1,94 @@
1
+ import '@material/web/icon/icon.js'
2
+ import { css, html, LitElement } from 'lit'
3
+ import { customElement, property, state } from 'lit/decorators.js'
4
+ import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
5
+
6
+ @customElement('building-inspection-detail-header')
7
+ class buildingInspectionDetailHeader extends LitElement {
8
+ static styles = [
9
+ ButtonContainerStyles,
10
+ ScrollbarStyles,
11
+ css`
12
+ :host {
13
+ }
14
+
15
+ md-filled-button {
16
+ --md-filled-button-container-color: #0595e5;
17
+ --md-filled-button-container-height: 30px;
18
+ --md-filled-button-trailing-space: 15px;
19
+ --md-filled-button-leading-space: 15px;
20
+ }
21
+ md-outlined-button {
22
+ --md-outlined-button-container-height: 30px;
23
+ --md-outlined-button-trailing-space: 15px;
24
+ --md-outlined-button-leading-space: 15px;
25
+ }
26
+
27
+ *[bold] {
28
+ font-weight: bold;
29
+ }
30
+
31
+ div[header] {
32
+ display: flex;
33
+ margin: 0px 20px;
34
+
35
+ h2 {
36
+ flex: 0.5;
37
+ color: #3f71a0;
38
+ }
39
+
40
+ div[button-container] {
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: end;
44
+ flex: 0.5;
45
+
46
+ md-elevated-button {
47
+ margin: 0px 3px;
48
+
49
+ --md-elevated-button-container-height: 35px;
50
+ --md-elevated-button-label-text-size: 16px;
51
+ --md-elevated-button-container-color: #0595e5;
52
+
53
+ --md-elevated-button-label-text-color: #fff;
54
+ --md-elevated-button-hover-label-text-color: #fff;
55
+ --md-elevated-button-pressed-label-text-color: #fff;
56
+ --md-elevated-button-focus-label-text-color: #fff;
57
+ --md-elevated-button-icon-color: #fff;
58
+ --md-elevated-button-hover-icon-color: #fff;
59
+ --md-elevated-button-pressed-icon-color: #fff;
60
+ --md-elevated-button-focus-icon-color: #fff;
61
+ }
62
+ }
63
+ }
64
+ `
65
+ ]
66
+
67
+ @property({ type: String }) buildingInspectionId: string = ''
68
+ @property({ type: String }) buildingLevelId: string = ''
69
+ @property({ type: String }) projectName: string = ''
70
+ @property({ type: String }) buildingName: string = ''
71
+ @property({ type: String }) buildingLevelFloor: string = ''
72
+
73
+ render() {
74
+ return html`
75
+ <div header>
76
+ <h2>${this.projectName || ''} ${this.buildingName || ''} ${this.buildingLevelFloor || ''}층</h2>
77
+ <div button-container>
78
+ <md-elevated-button href=${`building-inspection-list/${this.buildingLevelId}`}>
79
+ <md-icon slot="icon">assignment</md-icon>검측 리스트
80
+ </md-elevated-button>
81
+ <md-elevated-button href=${`building-inspection-detail-drawing/${this.buildingInspectionId}`}>
82
+ <md-icon slot="icon">assignment</md-icon>검측도면
83
+ </md-elevated-button>
84
+ <md-elevated-button href=${`building-inspection-detail-checklist/${this.buildingInspectionId}`}>
85
+ <md-icon slot="icon">description</md-icon>검측 체크리스트
86
+ </md-elevated-button>
87
+ <md-elevated-button href=${`building-inspection-detail-photo/${this.buildingInspectionId}`}>
88
+ <md-icon slot="icon">description</md-icon>사진촬영
89
+ </md-elevated-button>
90
+ </div>
91
+ </div>
92
+ `
93
+ }
94
+ }