@dssp/supervision 1.0.0-alpha.0 → 1.0.0-alpha.2
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/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/client/bootstrap.ts +0 -1
- package/client/index.ts +0 -0
- package/client/pages/action-plan/action-plan-importer.ts +0 -94
- package/client/pages/action-plan/action-plan-list-page.ts +0 -340
- package/client/pages/building-inspection/building-inspection-detail-camera.ts +0 -277
- package/client/pages/building-inspection/building-inspection-detail-checklist.ts +0 -258
- package/client/pages/building-inspection/building-inspection-detail-drawing.ts +0 -288
- package/client/pages/building-inspection/building-inspection-list.ts +0 -565
- package/client/pages/building-inspection/component/building-inspection-detail-header.ts +0 -123
- package/client/pages/building-inspection/component/inspection-event-provider.ts +0 -81
- package/client/pages/building-inspection/inspection-create-popup.ts +0 -785
- package/client/pages/checklist/attachment-list-popup.ts +0 -301
- package/client/pages/checklist/checklist-view.ts +0 -581
- package/client/pages/checklist/comment-list-popup.ts +0 -328
- package/client/pages/checklist/file-preview-popup.ts +0 -70
- package/client/pages/checklist-template/checklist-template-item.ts +0 -240
- package/client/pages/checklist-template/checklist-template-list.ts +0 -368
- package/client/pages/checklist-template/checklist-type-management.ts +0 -262
- package/client/pages/issue/issue-importer.ts +0 -94
- package/client/pages/issue/issue-list-page.ts +0 -340
- package/client/pages/project-report/project-report-importer.ts +0 -94
- package/client/pages/project-report/project-report-list-page.ts +0 -340
- package/client/pages/supervisor/supervisor-importer.ts +0 -94
- package/client/pages/supervisor/supervisor-list-page.ts +0 -340
- package/client/route.ts +0 -27
- package/client/tsconfig.json +0 -11
- package/server/controllers/index.ts +0 -0
- package/server/index.ts +0 -4
- package/server/middlewares/index.ts +0 -3
- package/server/migrations/index.ts +0 -9
- package/server/routes.ts +0 -28
- package/server/service/action-plan/action-plan-mutation.ts +0 -198
- package/server/service/action-plan/action-plan-query.ts +0 -62
- package/server/service/action-plan/action-plan-type.ts +0 -61
- package/server/service/action-plan/action-plan.ts +0 -103
- package/server/service/action-plan/index.ts +0 -7
- package/server/service/building-inspection/building-inspection-history.ts +0 -72
- package/server/service/building-inspection/building-inspection-mutation.ts +0 -276
- package/server/service/building-inspection/building-inspection-query.ts +0 -242
- package/server/service/building-inspection/building-inspection-type.ts +0 -145
- package/server/service/building-inspection/building-inspection.ts +0 -108
- package/server/service/building-inspection/event-subscriber.ts +0 -20
- package/server/service/building-inspection/index.ts +0 -11
- package/server/service/checklist/checklist-history.ts +0 -96
- package/server/service/checklist/checklist-mutation.ts +0 -103
- package/server/service/checklist/checklist-query.ts +0 -58
- package/server/service/checklist/checklist-type.ts +0 -49
- package/server/service/checklist/checklist.ts +0 -127
- package/server/service/checklist/event-subscriber.ts +0 -17
- package/server/service/checklist/index.ts +0 -9
- package/server/service/checklist-item/checklist-item-mutation.ts +0 -5
- package/server/service/checklist-item/checklist-item-query.ts +0 -84
- package/server/service/checklist-item/checklist-item-type.ts +0 -12
- package/server/service/checklist-item/checklist-item.ts +0 -103
- package/server/service/checklist-item/index.ts +0 -7
- package/server/service/checklist-item-comment/checklist-item-comment-history.ts +0 -69
- package/server/service/checklist-item-comment/checklist-item-comment-mutation.ts +0 -80
- package/server/service/checklist-item-comment/checklist-item-comment-query.ts +0 -36
- package/server/service/checklist-item-comment/checklist-item-comment-type.ts +0 -32
- package/server/service/checklist-item-comment/checklist-item-comment.ts +0 -56
- package/server/service/checklist-item-comment/event-subscriber.ts +0 -17
- package/server/service/checklist-item-comment/index.ts +0 -9
- package/server/service/checklist-template/checklist-template-mutation.ts +0 -66
- package/server/service/checklist-template/checklist-template-query.ts +0 -39
- package/server/service/checklist-template/checklist-template-type.ts +0 -23
- package/server/service/checklist-template/checklist-template.ts +0 -71
- package/server/service/checklist-template/index.ts +0 -6
- package/server/service/checklist-template-item/checklist-template-item-mutation.ts +0 -64
- package/server/service/checklist-template-item/checklist-template-item-query.ts +0 -44
- package/server/service/checklist-template-item/checklist-template-item-type.ts +0 -39
- package/server/service/checklist-template-item/checklist-template-item.ts +0 -68
- package/server/service/checklist-template-item/index.ts +0 -6
- package/server/service/checklist-type/checklist-type-mutation.ts +0 -66
- package/server/service/checklist-type/checklist-type-query.ts +0 -39
- package/server/service/checklist-type/checklist-type-type.ts +0 -26
- package/server/service/checklist-type/checklist-type.ts +0 -64
- package/server/service/checklist-type/index.ts +0 -6
- package/server/service/index.ts +0 -88
- package/server/service/issue/index.ts +0 -7
- package/server/service/issue/issue-mutation.ts +0 -198
- package/server/service/issue/issue-query.ts +0 -62
- package/server/service/issue/issue-type.ts +0 -61
- package/server/service/issue/issue.ts +0 -100
- package/server/service/project-report/index.ts +0 -7
- package/server/service/project-report/project-report-mutation.ts +0 -198
- package/server/service/project-report/project-report-query.ts +0 -62
- package/server/service/project-report/project-report-type.ts +0 -61
- package/server/service/project-report/project-report.ts +0 -113
- package/server/service/supervisor/index.ts +0 -7
- package/server/service/supervisor/supervisor-mutation.ts +0 -198
- package/server/service/supervisor/supervisor-query.ts +0 -62
- package/server/service/supervisor/supervisor-type.ts +0 -61
- package/server/service/supervisor/supervisor.ts +0 -108
- package/server/tsconfig.json +0 -10
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import gql from 'graphql-tag'
|
|
3
|
-
import { client } from '@operato/graphql'
|
|
4
|
-
import { css, html, LitElement } from 'lit'
|
|
5
|
-
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
6
|
-
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
|
7
|
-
import { notify } from '@operato/layout'
|
|
8
|
-
import { store, User } from '@operato/shell'
|
|
9
|
-
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
10
|
-
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
|
11
|
-
import { openPopup } from '@operato/layout'
|
|
12
|
-
import './file-preview-popup'
|
|
13
|
-
import { BuildingInspectionStatus } from '../building-inspection/building-inspection-list'
|
|
14
|
-
|
|
15
|
-
@customElement('attachment-list-popup')
|
|
16
|
-
class AttachmentListPopup extends connect(store)(LitElement) {
|
|
17
|
-
static styles = [
|
|
18
|
-
ButtonContainerStyles,
|
|
19
|
-
ScrollbarStyles,
|
|
20
|
-
css`
|
|
21
|
-
:host {
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
padding: 15px 20px;
|
|
25
|
-
background-color: var(--md-sys-color-surface);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
div[body] {
|
|
29
|
-
height: 100%;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
gap: 12px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
div[attachment-container] {
|
|
36
|
-
overflow-y: auto;
|
|
37
|
-
gap: 10px;
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
flex: 1;
|
|
41
|
-
|
|
42
|
-
div[attachment-row] {
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
|
|
46
|
-
div[creator-container] {
|
|
47
|
-
display: flex;
|
|
48
|
-
justify-content: space-between;
|
|
49
|
-
|
|
50
|
-
span[creator] {
|
|
51
|
-
font-weight: 600;
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
gap: 3px;
|
|
55
|
-
}
|
|
56
|
-
span[createdAt] {
|
|
57
|
-
display: flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
gap: 3px;
|
|
60
|
-
|
|
61
|
-
md-icon[delete] {
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
a[button-download] {
|
|
66
|
-
display: flex;
|
|
67
|
-
color: #000;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
a[attachment] {
|
|
73
|
-
margin-left: 20px;
|
|
74
|
-
text-decoration: none;
|
|
75
|
-
color: #000;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
h3 {
|
|
81
|
-
position: relative;
|
|
82
|
-
color: rgb(5, 149, 229);
|
|
83
|
-
font-size: 17px;
|
|
84
|
-
font-weight: 700;
|
|
85
|
-
background-color: var(--md-sys-color-surface);
|
|
86
|
-
margin-top: 0px;
|
|
87
|
-
margin-bottom: 5px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
div[button-container] {
|
|
91
|
-
display: flex;
|
|
92
|
-
justify-content: flex-end;
|
|
93
|
-
gap: 10px;
|
|
94
|
-
}
|
|
95
|
-
`
|
|
96
|
-
]
|
|
97
|
-
|
|
98
|
-
@property({ type: String }) checklistItemId: string = ''
|
|
99
|
-
@property({ type: String }) status: BuildingInspectionStatus = BuildingInspectionStatus.WAIT
|
|
100
|
-
|
|
101
|
-
@state() item: any = { count: 0 }
|
|
102
|
-
@state() checklistItemAttachments: any = []
|
|
103
|
-
@state() checklistItemAttachmentCount: number = 0
|
|
104
|
-
@state() user: User = {}
|
|
105
|
-
@query('div[attachment-container]') attachmentContainer!: HTMLDivElement
|
|
106
|
-
|
|
107
|
-
render() {
|
|
108
|
-
return html`
|
|
109
|
-
<div body>
|
|
110
|
-
<h3>제품검사에 대한 파일: ${this.checklistItemAttachmentCount || 0}건</h3>
|
|
111
|
-
|
|
112
|
-
<div attachment-container>
|
|
113
|
-
${this.checklistItemAttachments.map(attachment => {
|
|
114
|
-
return html`
|
|
115
|
-
<div attachment-row>
|
|
116
|
-
<div creator-container>
|
|
117
|
-
<span creator><md-icon slot="icon">account_circle</md-icon> ${attachment.creator.name}</span>
|
|
118
|
-
<span createdAt>
|
|
119
|
-
<md-icon slot="icon">schedule</md-icon> ${this._formatDate(attachment.createdAt)}
|
|
120
|
-
${attachment.creator.email === this.user.email && this.status != BuildingInspectionStatus.PASS
|
|
121
|
-
? html` <md-icon delete slot="icon" @click=${() => this._deleteAttachment(attachment.id)}>delete</md-icon>`
|
|
122
|
-
: ''}
|
|
123
|
-
<a button-download href=${attachment.fullpath} download=${attachment.name}>
|
|
124
|
-
<md-icon slot="icon">download</md-icon></a
|
|
125
|
-
>
|
|
126
|
-
</span>
|
|
127
|
-
</div>
|
|
128
|
-
<a attachment @click=${() => this._onClickPreview(attachment.fullpath)}>${attachment.name}</a>
|
|
129
|
-
</div>
|
|
130
|
-
`
|
|
131
|
-
})}
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<ox-input-file
|
|
135
|
-
accept="*/*"
|
|
136
|
-
multiple="true"
|
|
137
|
-
hide-filelist
|
|
138
|
-
?disabled=${this.status == BuildingInspectionStatus.PASS}
|
|
139
|
-
@change=${this.onCreateAttachment.bind(this)}
|
|
140
|
-
></ox-input-file>
|
|
141
|
-
|
|
142
|
-
<div button-container>
|
|
143
|
-
<md-elevated-button @click=${this._close}> <md-icon slot="icon">cancel</md-icon>취소 </md-elevated-button>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
`
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
async firstUpdated() {
|
|
150
|
-
this.user = (store.getState() as any).auth?.user
|
|
151
|
-
|
|
152
|
-
await this._loadAttachments()
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
private async _loadAttachments() {
|
|
156
|
-
const response = await client.query({
|
|
157
|
-
query: gql`
|
|
158
|
-
query ChecklistItem($id: String!) {
|
|
159
|
-
checklistItem(id: $id) {
|
|
160
|
-
id
|
|
161
|
-
checklistItemAttachmentCount
|
|
162
|
-
checklistItemAttachments {
|
|
163
|
-
id
|
|
164
|
-
name
|
|
165
|
-
fullpath
|
|
166
|
-
creator {
|
|
167
|
-
id
|
|
168
|
-
name
|
|
169
|
-
email
|
|
170
|
-
}
|
|
171
|
-
createdAt
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
`,
|
|
176
|
-
variables: {
|
|
177
|
-
id: this.checklistItemId
|
|
178
|
-
}
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
if (response.errors) return
|
|
182
|
-
|
|
183
|
-
this.checklistItemAttachments = response.data.checklistItem.checklistItemAttachments || []
|
|
184
|
-
this.checklistItemAttachmentCount = response.data.checklistItem.checklistItemAttachmentCount
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
private async _deleteAttachment(attachmentId: string) {
|
|
188
|
-
if (this.status == BuildingInspectionStatus.PASS) {
|
|
189
|
-
notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })
|
|
190
|
-
return
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if (
|
|
194
|
-
await OxPrompt.open({
|
|
195
|
-
title: '첨부 자료를 삭제',
|
|
196
|
-
text: '첨부 자료를 삭제 하시겠습니까?',
|
|
197
|
-
confirmButton: { text: '삭제' },
|
|
198
|
-
cancelButton: { text: '취소' }
|
|
199
|
-
})
|
|
200
|
-
) {
|
|
201
|
-
const response = await client.mutate({
|
|
202
|
-
mutation: gql`
|
|
203
|
-
mutation DeleteAttachment($deleteAttachmentId: String!) {
|
|
204
|
-
deleteAttachment(id: $deleteAttachmentId)
|
|
205
|
-
}
|
|
206
|
-
`,
|
|
207
|
-
variables: {
|
|
208
|
-
deleteAttachmentId: attachmentId
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
|
|
212
|
-
if (!response.errors) {
|
|
213
|
-
this.checklistItemAttachments = [...this.checklistItemAttachments.filter(attachment => attachment.id != attachmentId)]
|
|
214
|
-
notify({ message: '첨부 자료를 삭제하였습니다.', level: 'info' })
|
|
215
|
-
} else {
|
|
216
|
-
notify({ message: response.errors?.[0]?.message || '첨부 자료 삭제에 실패하였습니다.', level: 'error' })
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
this._dispatchEvent()
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
private _close() {
|
|
224
|
-
history.back()
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// 파일 변경 시 파일을 저장할 핸들러
|
|
228
|
-
private async onCreateAttachment(e: CustomEvent) {
|
|
229
|
-
if (this.status == BuildingInspectionStatus.PASS) {
|
|
230
|
-
notify({ message: '완료 상태인 검측정보를 변경할 수 없습니다.', level: 'error' })
|
|
231
|
-
return
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
const files = e.detail
|
|
235
|
-
|
|
236
|
-
await this._createAttachments(files)
|
|
237
|
-
|
|
238
|
-
this._dispatchEvent()
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
async _createAttachments(files: File[]) {
|
|
242
|
-
const checklistItemId = this.checklistItemId
|
|
243
|
-
|
|
244
|
-
const response = await client.mutate({
|
|
245
|
-
mutation: gql`
|
|
246
|
-
mutation ($attachments: [NewAttachment!]!) {
|
|
247
|
-
createAttachments(attachments: $attachments) {
|
|
248
|
-
id
|
|
249
|
-
name
|
|
250
|
-
fullpath
|
|
251
|
-
creator {
|
|
252
|
-
id
|
|
253
|
-
name
|
|
254
|
-
email
|
|
255
|
-
}
|
|
256
|
-
createdAt
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
`,
|
|
260
|
-
variables: {
|
|
261
|
-
attachments: files.map(file => {
|
|
262
|
-
return { file, refBy: checklistItemId, refType: 'ChecklistItem' }
|
|
263
|
-
})
|
|
264
|
-
},
|
|
265
|
-
context: {
|
|
266
|
-
hasUpload: true
|
|
267
|
-
}
|
|
268
|
-
})
|
|
269
|
-
|
|
270
|
-
const attachments = response.data.createAttachments
|
|
271
|
-
|
|
272
|
-
this.checklistItemAttachments = [...attachments, ...this.checklistItemAttachments]
|
|
273
|
-
this.checklistItemAttachmentCount = this.checklistItemAttachmentCount + attachments.length
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
private _formatDate(date) {
|
|
277
|
-
const _date = new Date(date.toLocaleString('en-US', { timeZone: 'Asia/Seoul' }))
|
|
278
|
-
|
|
279
|
-
const year = _date.getFullYear()
|
|
280
|
-
const month = String(_date.getMonth() + 1).padStart(2, '0')
|
|
281
|
-
const day = String(_date.getDate()).padStart(2, '0')
|
|
282
|
-
const hours = String(_date.getHours()).padStart(2, '0')
|
|
283
|
-
const minutes = String(_date.getMinutes()).padStart(2, '0')
|
|
284
|
-
const seconds = String(_date.getSeconds()).padStart(2, '0')
|
|
285
|
-
|
|
286
|
-
return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// 첨부 자료 변경 이벤트 디스패치
|
|
290
|
-
_dispatchEvent() {
|
|
291
|
-
this.dispatchEvent(new CustomEvent('change-attachment', { detail: { checklistItemId: this.checklistItemId } }))
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
private _onClickPreview(filepath: string) {
|
|
295
|
-
openPopup(html` <file-preview-popup .filepath=${filepath}></file-preview-popup> `, {
|
|
296
|
-
backdrop: true,
|
|
297
|
-
size: 'large',
|
|
298
|
-
title: '미리보기'
|
|
299
|
-
})
|
|
300
|
-
}
|
|
301
|
-
}
|