@things-factory/dataset 8.0.13 → 8.0.20
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/activities/activity-data-collect-edit.ts +71 -4
- package/client/activities/activity-data-review-edit.ts +28 -3
- package/client/activities/activity-data-review-view.ts +28 -3
- package/client/activities/activity-ooc-resolve-edit.ts +7 -0
- package/client/activities/activity-ooc-resolve-view.ts +7 -0
- package/client/activities/activity-ooc-review-edit.ts +33 -2
- package/client/activities/activity-ooc-review-view.ts +7 -0
- package/client/components/data-entry-form.ts +51 -4
- package/client/pages/data-entry/checklist-entry-page.ts +211 -0
- package/client/pages/data-entry/data-entry-list-page.ts +2 -1
- package/client/pages/data-ooc/data-ooc-page.ts +3 -0
- package/client/pages/data-ooc/data-ooc-view.ts +3 -0
- package/client/pages/data-sample/data-sample-view.ts +31 -1
- package/client/pages/data-set/data-item-list.ts +9 -0
- package/client/pages/data-set/data-set-list-page.ts +52 -11
- package/client/route.ts +4 -0
- package/dist-client/activities/activity-data-collect-edit.d.ts +8 -1
- package/dist-client/activities/activity-data-collect-edit.js +72 -3
- package/dist-client/activities/activity-data-collect-edit.js.map +1 -1
- package/dist-client/activities/activity-data-review-edit.d.ts +2 -0
- package/dist-client/activities/activity-data-review-edit.js +28 -3
- package/dist-client/activities/activity-data-review-edit.js.map +1 -1
- package/dist-client/activities/activity-data-review-view.d.ts +2 -0
- package/dist-client/activities/activity-data-review-view.js +28 -3
- package/dist-client/activities/activity-data-review-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-edit.js +7 -0
- package/dist-client/activities/activity-ooc-resolve-edit.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-view.js +7 -0
- package/dist-client/activities/activity-ooc-resolve-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-edit.d.ts +1 -0
- package/dist-client/activities/activity-ooc-review-edit.js +33 -1
- package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-view.js +7 -0
- package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
- package/dist-client/components/data-entry-form.d.ts +9 -2
- package/dist-client/components/data-entry-form.js +52 -2
- package/dist-client/components/data-entry-form.js.map +1 -1
- package/dist-client/pages/data-entry/checklist-entry-page.d.ts +21 -0
- package/dist-client/pages/data-entry/checklist-entry-page.js +209 -0
- package/dist-client/pages/data-entry/checklist-entry-page.js.map +1 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js +2 -1
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-page.js +3 -0
- package/dist-client/pages/data-ooc/data-ooc-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-view.js +3 -0
- package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-view.d.ts +2 -0
- package/dist-client/pages/data-sample/data-sample-view.js +31 -1
- package/dist-client/pages/data-sample/data-sample-view.js.map +1 -1
- package/dist-client/pages/data-set/data-item-list.js +9 -0
- package/dist-client/pages/data-set/data-item-list.js.map +1 -1
- package/dist-client/pages/data-set/data-set-list-page.d.ts +1 -0
- package/dist-client/pages/data-set/data-set-list-page.js +44 -8
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/data-set/data-item-type.d.ts +2 -0
- package/dist-server/service/data-set/data-item-type.js +14 -0
- package/dist-server/service/data-set/data-item-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/server/service/data-set/data-item-type.ts +14 -0
- package/things-factory.config.js +4 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
import '@operato/dataset/ox-checklist-entry-form.js'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
4
5
|
import { css, html, LitElement } from 'lit'
|
@@ -8,6 +9,8 @@ import { client } from '@operato/graphql'
|
|
8
9
|
import { i18next, localize } from '@operato/i18n'
|
9
10
|
import { ScrollbarStyles } from '@operato/styles'
|
10
11
|
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
12
|
+
import { OxChecklistEntryForm } from '@operato/dataset/ox-checklist-entry-form.js'
|
13
|
+
|
11
14
|
import { DataSet } from '@operato/dataset'
|
12
15
|
|
13
16
|
@customElement('activity-data-collect-edit')
|
@@ -33,23 +36,84 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
|
|
33
36
|
@property({ type: Object }) input?: any
|
34
37
|
@property({ type: Object }) output?: any
|
35
38
|
|
36
|
-
@state() dataSet?: DataSet & { id: string }
|
39
|
+
@state() dataSet?: DataSet & { id: string; entryType?: string; entryView?: string }
|
40
|
+
|
41
|
+
@query('ox-data-entry-form') dataEntryForm?: OxDataEntryForm
|
42
|
+
@query('ox-checklist-entry-form') checklistEntryForm?: OxChecklistEntryForm
|
43
|
+
|
44
|
+
get entryForm() {
|
45
|
+
const entryType = this.dataSet?.entryType
|
46
|
+
const entryView = this.dataSet?.entryView
|
37
47
|
|
38
|
-
|
48
|
+
switch (entryType) {
|
49
|
+
case 'generated':
|
50
|
+
if (!entryView || entryView === 'DEFAULT') {
|
51
|
+
return this.dataEntryForm
|
52
|
+
} else if (entryView === 'CHECKLIST') {
|
53
|
+
return this.checklistEntryForm
|
54
|
+
}
|
55
|
+
break
|
56
|
+
case 'board':
|
57
|
+
break
|
58
|
+
case 'page':
|
59
|
+
break
|
60
|
+
default:
|
61
|
+
return this.dataEntryForm
|
62
|
+
break
|
63
|
+
}
|
64
|
+
}
|
39
65
|
|
40
66
|
render() {
|
41
67
|
return html`
|
42
|
-
<
|
68
|
+
<div class="container">
|
69
|
+
<!-- <ox-data-entry-form
|
43
70
|
.dataSet=${this.dataSet}
|
44
71
|
.value=${this.output}
|
45
72
|
@change=${this._updateDataItems}
|
46
|
-
></ox-data-entry-form>
|
73
|
+
></ox-data-entry-form> -->
|
74
|
+
${this.showEntryView()}
|
75
|
+
</div>
|
47
76
|
`
|
48
77
|
}
|
49
78
|
|
79
|
+
private showEntryView() {
|
80
|
+
const entryType = this.dataSet?.entryType
|
81
|
+
const entryView = this.dataSet?.entryView
|
82
|
+
|
83
|
+
switch (entryType) {
|
84
|
+
case 'generated':
|
85
|
+
if (!entryView || entryView === 'DEFAULT') {
|
86
|
+
return html`<ox-data-entry-form
|
87
|
+
.dataSet=${this.dataSet}
|
88
|
+
.value=${this.output}
|
89
|
+
@change=${this._updateDataItems}
|
90
|
+
></ox-data-entry-form>`
|
91
|
+
} else if (entryView === 'CHECKLIST') {
|
92
|
+
return html`<ox-checklist-entry-form
|
93
|
+
.dataSet=${this.dataSet}
|
94
|
+
.value=${this.output}
|
95
|
+
@change=${this._updateDataItems}
|
96
|
+
></ox-checklist-entry-form>`
|
97
|
+
}
|
98
|
+
break
|
99
|
+
case 'board':
|
100
|
+
break
|
101
|
+
case 'page':
|
102
|
+
break
|
103
|
+
default:
|
104
|
+
return html`<ox-data-entry-form
|
105
|
+
.dataSet=${this.dataSet}
|
106
|
+
.value=${this.output}
|
107
|
+
@change=${this._updateDataItems}
|
108
|
+
></ox-data-entry-form>`
|
109
|
+
break
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
50
113
|
async _updateDataItems(e: CustomEvent) {
|
51
114
|
e.stopPropagation()
|
52
115
|
|
116
|
+
//@ts-ignore TODO replace with following line and confirm
|
53
117
|
this.output = this.entryForm.value
|
54
118
|
|
55
119
|
this.dispatchEvent(
|
@@ -77,6 +141,8 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
|
|
77
141
|
name
|
78
142
|
description
|
79
143
|
useCase
|
144
|
+
entryType
|
145
|
+
entryView
|
80
146
|
dataItems {
|
81
147
|
name
|
82
148
|
description
|
@@ -84,6 +150,7 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
|
|
84
150
|
hidden
|
85
151
|
tag
|
86
152
|
group
|
153
|
+
subgroup
|
87
154
|
type
|
88
155
|
unit
|
89
156
|
options
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import '@material/web/icon/icon.js'
|
2
2
|
import '@material/web/radio/radio.js'
|
3
3
|
import '@operato/dataset/ox-data-entry-form.js'
|
4
|
+
import '@operato/dataset/ox-checklist-sample-view.js'
|
4
5
|
|
5
6
|
import gql from 'graphql-tag'
|
6
7
|
import { css, html, LitElement } from 'lit'
|
@@ -113,9 +114,7 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
113
114
|
const editable = state == 'unassigned' || state == 'assigned' || state == 'started' || state == 'submitted'
|
114
115
|
|
115
116
|
return html`
|
116
|
-
<div content>
|
117
|
-
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
118
|
-
</div>
|
117
|
+
<div content>${this.showDataSampleView()}</div>
|
119
118
|
|
120
119
|
<form @change=${this.onChangeInstruction}>
|
121
120
|
${editable
|
@@ -188,6 +187,29 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
188
187
|
`
|
189
188
|
}
|
190
189
|
|
190
|
+
private showDataSampleView() {
|
191
|
+
const dataSet = this.dataSample?.dataSet
|
192
|
+
const monitorType = dataSet?.monitorType
|
193
|
+
const monitorView = dataSet?.monitorView
|
194
|
+
|
195
|
+
switch (monitorType) {
|
196
|
+
case 'generated':
|
197
|
+
if (!monitorView || monitorView === 'DEFAULT') {
|
198
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
199
|
+
} else if (monitorView === 'CHECKLIST') {
|
200
|
+
return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
|
201
|
+
}
|
202
|
+
break
|
203
|
+
case 'board':
|
204
|
+
break
|
205
|
+
case 'page':
|
206
|
+
break
|
207
|
+
default:
|
208
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
209
|
+
break
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
191
213
|
onChangeInstruction(e: Event) {
|
192
214
|
var output = {}
|
193
215
|
|
@@ -238,6 +260,8 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
238
260
|
id
|
239
261
|
name
|
240
262
|
description
|
263
|
+
monitorType
|
264
|
+
monitorView
|
241
265
|
}
|
242
266
|
dataItems {
|
243
267
|
name
|
@@ -246,6 +270,7 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
246
270
|
hidden
|
247
271
|
tag
|
248
272
|
group
|
273
|
+
subgroup
|
249
274
|
type
|
250
275
|
unit
|
251
276
|
options
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
import '@operato/dataset/ox-checklist-sample-view.js'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
4
5
|
import { css, html, LitElement } from 'lit'
|
@@ -103,9 +104,7 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
103
104
|
const { judgment, instruction } = this.output || {}
|
104
105
|
|
105
106
|
return html`
|
106
|
-
<div content>
|
107
|
-
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
108
|
-
</div>
|
107
|
+
<div content>${this.showDataSampleView()}</div>
|
109
108
|
|
110
109
|
<form>
|
111
110
|
<label>
|
@@ -186,6 +185,8 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
186
185
|
id
|
187
186
|
name
|
188
187
|
description
|
188
|
+
monitorType
|
189
|
+
monitorView
|
189
190
|
}
|
190
191
|
dataItems {
|
191
192
|
name
|
@@ -194,6 +195,7 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
194
195
|
hidden
|
195
196
|
tag
|
196
197
|
group
|
198
|
+
subgroup
|
197
199
|
type
|
198
200
|
unit
|
199
201
|
options
|
@@ -223,4 +225,27 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
223
225
|
}
|
224
226
|
}
|
225
227
|
}
|
228
|
+
|
229
|
+
private showDataSampleView() {
|
230
|
+
const dataSet = this.dataSample?.dataSet
|
231
|
+
const monitorType = dataSet?.monitorType
|
232
|
+
const monitorView = dataSet?.monitorView
|
233
|
+
|
234
|
+
switch (monitorType) {
|
235
|
+
case 'generated':
|
236
|
+
if (!monitorView || monitorView === 'DEFAULT') {
|
237
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
238
|
+
} else if (monitorView === 'CHECKLIST') {
|
239
|
+
return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
|
240
|
+
}
|
241
|
+
break
|
242
|
+
case 'board':
|
243
|
+
break
|
244
|
+
case 'page':
|
245
|
+
break
|
246
|
+
default:
|
247
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
248
|
+
break
|
249
|
+
}
|
250
|
+
}
|
226
251
|
}
|
@@ -144,6 +144,12 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
|
|
144
144
|
history
|
145
145
|
correctiveAction
|
146
146
|
correctiveInstruction
|
147
|
+
dataSet {
|
148
|
+
id
|
149
|
+
name
|
150
|
+
monitorType
|
151
|
+
monitorView
|
152
|
+
}
|
147
153
|
dataItems {
|
148
154
|
name
|
149
155
|
description
|
@@ -151,6 +157,7 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
|
|
151
157
|
hidden
|
152
158
|
tag
|
153
159
|
group
|
160
|
+
subgroup
|
154
161
|
type
|
155
162
|
unit
|
156
163
|
options
|
@@ -89,6 +89,12 @@ export class OocResolveActivityView extends localize(i18next)(LitElement) {
|
|
89
89
|
history
|
90
90
|
correctiveAction
|
91
91
|
correctiveInstruction
|
92
|
+
dataSet {
|
93
|
+
id
|
94
|
+
name
|
95
|
+
monitorType
|
96
|
+
monitorView
|
97
|
+
}
|
92
98
|
dataItems {
|
93
99
|
name
|
94
100
|
description
|
@@ -96,6 +102,7 @@ export class OocResolveActivityView extends localize(i18next)(LitElement) {
|
|
96
102
|
hidden
|
97
103
|
tag
|
98
104
|
group
|
105
|
+
subgroup
|
99
106
|
type
|
100
107
|
unit
|
101
108
|
options
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import '@material/web/icon/icon.js'
|
2
2
|
import '@operato/dataset/ox-data-sample-view.js'
|
3
|
-
|
3
|
+
import '@operato/dataset/ox-checklist-sample-view.js'
|
4
4
|
import gql from 'graphql-tag'
|
5
5
|
import { css, html, LitElement } from 'lit'
|
6
6
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
@@ -89,7 +89,8 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
89
89
|
|
90
90
|
return html`
|
91
91
|
<div content>
|
92
|
-
|
92
|
+
${this.showDataSampleView()}
|
93
|
+
<!-- <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view> -->
|
93
94
|
</div>
|
94
95
|
|
95
96
|
<label instruction>
|
@@ -142,6 +143,12 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
142
143
|
useCase
|
143
144
|
data
|
144
145
|
judgment
|
146
|
+
dataSet {
|
147
|
+
id
|
148
|
+
name
|
149
|
+
monitorType
|
150
|
+
monitorView
|
151
|
+
}
|
145
152
|
dataItems {
|
146
153
|
name
|
147
154
|
description
|
@@ -149,6 +156,7 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
149
156
|
hidden
|
150
157
|
tag
|
151
158
|
group
|
159
|
+
subgroup
|
152
160
|
type
|
153
161
|
unit
|
154
162
|
options
|
@@ -170,4 +178,27 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
170
178
|
this.dataOoc = response.data.dataOoc
|
171
179
|
}
|
172
180
|
}
|
181
|
+
|
182
|
+
private showDataSampleView() {
|
183
|
+
const dataSet = this.dataOoc?.dataSet
|
184
|
+
const monitorType = dataSet?.monitorType
|
185
|
+
const monitorView = dataSet?.monitorView
|
186
|
+
|
187
|
+
switch (monitorType) {
|
188
|
+
case 'generated':
|
189
|
+
if (!monitorView || monitorView === 'DEFAULT') {
|
190
|
+
return html`<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>`
|
191
|
+
} else if (monitorView === 'CHECKLIST') {
|
192
|
+
return html`<ox-checklist-sample-view .dataSample=${this.dataOoc}></ox-checklist-sample-view>`
|
193
|
+
}
|
194
|
+
break
|
195
|
+
case 'board':
|
196
|
+
break
|
197
|
+
case 'page':
|
198
|
+
break
|
199
|
+
default:
|
200
|
+
return html`<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>`
|
201
|
+
break
|
202
|
+
}
|
203
|
+
}
|
173
204
|
}
|
@@ -88,6 +88,12 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
|
|
88
88
|
history
|
89
89
|
correctiveAction
|
90
90
|
correctiveInstruction
|
91
|
+
dataSet {
|
92
|
+
id
|
93
|
+
name
|
94
|
+
monitorType
|
95
|
+
monitorView
|
96
|
+
}
|
91
97
|
dataItems {
|
92
98
|
name
|
93
99
|
description
|
@@ -95,6 +101,7 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
|
|
95
101
|
hidden
|
96
102
|
tag
|
97
103
|
group
|
104
|
+
subgroup
|
98
105
|
type
|
99
106
|
unit
|
100
107
|
options
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import '@material/web/icon/icon.js'
|
2
2
|
import '@operato/dataset/ox-data-entry-form.js'
|
3
|
+
import '@operato/dataset/ox-checklist-entry-form.js'
|
3
4
|
|
4
5
|
import gql from 'graphql-tag'
|
5
6
|
import { css, html, LitElement } from 'lit'
|
@@ -8,8 +9,9 @@ import { customElement, property, query, state } from 'lit/decorators.js'
|
|
8
9
|
import { client } from '@operato/graphql'
|
9
10
|
import { i18next, localize } from '@operato/i18n'
|
10
11
|
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
11
|
-
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
12
12
|
import { DataSet } from '@operato/dataset'
|
13
|
+
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
14
|
+
import { OxChecklistEntryForm } from '@operato/dataset/ox-checklist-entry-form.js'
|
13
15
|
|
14
16
|
@customElement('data-entry-form')
|
15
17
|
export class DataEntryForm extends localize(i18next)(LitElement) {
|
@@ -39,15 +41,38 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
|
|
39
41
|
`
|
40
42
|
]
|
41
43
|
|
42
|
-
@property({ type: Object }) dataSet?: DataSet & { id: string }
|
44
|
+
@property({ type: Object }) dataSet?: DataSet & { id: string; entryType?: string; entryView?: string }
|
43
45
|
|
44
46
|
@state() dataSample?: { id: string; collectedAt: Date }
|
45
47
|
|
46
|
-
@query('ox-data-entry-form')
|
48
|
+
@query('ox-data-entry-form') dataEntryForm?: OxDataEntryForm
|
49
|
+
@query('ox-checklist-entry-form') checklistEntryForm?: OxChecklistEntryForm
|
50
|
+
|
51
|
+
get entryForm() {
|
52
|
+
const entryType = this.dataSet?.entryType
|
53
|
+
const entryView = this.dataSet?.entryView
|
54
|
+
|
55
|
+
switch (entryType) {
|
56
|
+
case 'generated':
|
57
|
+
if (!entryView || entryView === 'DEFAULT') {
|
58
|
+
return this.dataEntryForm
|
59
|
+
} else if (entryView === 'CHECKLIST') {
|
60
|
+
return this.checklistEntryForm
|
61
|
+
}
|
62
|
+
break
|
63
|
+
case 'board':
|
64
|
+
break
|
65
|
+
case 'page':
|
66
|
+
break
|
67
|
+
default:
|
68
|
+
return this.dataEntryForm
|
69
|
+
break
|
70
|
+
}
|
71
|
+
}
|
47
72
|
|
48
73
|
render() {
|
49
74
|
return html`
|
50
|
-
|
75
|
+
${this.showEntryView()}
|
51
76
|
|
52
77
|
<div class="footer">
|
53
78
|
<div filler></div>
|
@@ -62,6 +87,28 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
|
|
62
87
|
`
|
63
88
|
}
|
64
89
|
|
90
|
+
private showEntryView() {
|
91
|
+
const entryType = this.dataSet?.entryType
|
92
|
+
const entryView = this.dataSet?.entryView
|
93
|
+
|
94
|
+
switch (entryType) {
|
95
|
+
case 'generated':
|
96
|
+
if (!entryView || entryView === 'DEFAULT') {
|
97
|
+
return html`<ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>`
|
98
|
+
} else if (entryView === 'CHECKLIST') {
|
99
|
+
return html`<ox-checklist-entry-form .dataSet=${this.dataSet}></ox-checklist-entry-form>`
|
100
|
+
}
|
101
|
+
break
|
102
|
+
case 'board':
|
103
|
+
break
|
104
|
+
case 'page':
|
105
|
+
break
|
106
|
+
default:
|
107
|
+
return html`<ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>`
|
108
|
+
break
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
65
112
|
private async updateDataItems() {
|
66
113
|
//@ts-ignore TODO replace with following line and confirm
|
67
114
|
const data = this.entryForm.buildValue()
|
@@ -0,0 +1,211 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
2
|
+
import '@operato/context/ox-context-page-toolbar.js'
|
3
|
+
import '@operato/board/ox-board-viewer.js'
|
4
|
+
|
5
|
+
import gql from 'graphql-tag'
|
6
|
+
import { css, html } from 'lit'
|
7
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
8
|
+
|
9
|
+
import { DataSample, DataSet } from '@operato/dataset'
|
10
|
+
import { client } from '@operato/graphql'
|
11
|
+
import { i18next, localize } from '@operato/i18n'
|
12
|
+
import { PageView } from '@operato/shell'
|
13
|
+
import { ScrollbarStyles } from '@operato/styles'
|
14
|
+
|
15
|
+
@customElement('checklist-entry-page')
|
16
|
+
export class ChecklistEntryPage extends localize(i18next)(PageView) {
|
17
|
+
static styles = [
|
18
|
+
ScrollbarStyles,
|
19
|
+
css`
|
20
|
+
:host {
|
21
|
+
display: flex;
|
22
|
+
flex-direction: column;
|
23
|
+
|
24
|
+
width: 100%;
|
25
|
+
}
|
26
|
+
|
27
|
+
div.checklist {
|
28
|
+
flex: 1;
|
29
|
+
}
|
30
|
+
|
31
|
+
.footer span {
|
32
|
+
font-size: 0.8em;
|
33
|
+
color: var(--md-sys-color-on-surface);
|
34
|
+
line-height: 1.5;
|
35
|
+
padding: 10px;
|
36
|
+
}
|
37
|
+
`
|
38
|
+
]
|
39
|
+
|
40
|
+
get context() {
|
41
|
+
return {
|
42
|
+
title: i18next.t('title.checklist entry page'),
|
43
|
+
help: 'dataset/checklist-entry-page',
|
44
|
+
toolbar: false
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
@state() private dataSetId?: string
|
49
|
+
@state() private dataSet?: DataSet
|
50
|
+
@state() private dataSample?: DataSample | { id: string; collectedAt: Date }
|
51
|
+
|
52
|
+
render() {
|
53
|
+
return html`
|
54
|
+
<div class="checklist">
|
55
|
+
<table>
|
56
|
+
<thead>
|
57
|
+
<tr>
|
58
|
+
<th>주기</th>
|
59
|
+
<th>관리</th>
|
60
|
+
<th>점검 내용</th>
|
61
|
+
<th>기록</th>
|
62
|
+
</tr>
|
63
|
+
</thead>
|
64
|
+
<tbody>
|
65
|
+
<tr>
|
66
|
+
<td rowspan="3">일일 (작업전)</td>
|
67
|
+
<td rowspan="3">개인 위생</td>
|
68
|
+
<td>위생복장과 외출복장이 구분하여 보관되고 있는가?</td>
|
69
|
+
<td><input type="checkbox" name="check1" /></td>
|
70
|
+
</tr>
|
71
|
+
<tr>
|
72
|
+
<td>
|
73
|
+
종사자의 건강상태가 양호하고 개인장신구 등을 소지하지 않으며, 청결한 위생복장을 착용하고 작업하고
|
74
|
+
있는가?
|
75
|
+
</td>
|
76
|
+
<td><input type="checkbox" name="check2" /></td>
|
77
|
+
</tr>
|
78
|
+
<tr>
|
79
|
+
<td>위생설비(손세척기 등) 중 이상이 있는 것이 없으며, 종사자는 위생처리를 하고 입실하는가?</td>
|
80
|
+
<td><input type="checkbox" name="check3" /></td>
|
81
|
+
</tr>
|
82
|
+
<tr>
|
83
|
+
<td rowspan="2">일일 (작업전)</td>
|
84
|
+
<td rowspan="2">방충 방서</td>
|
85
|
+
<td>작업장은 밀폐가 잘 이루어지고 있으며, 방충시설(방충망 등)에는 이상이 없는가?</td>
|
86
|
+
<td><input type="checkbox" name="check4" /></td>
|
87
|
+
</tr>
|
88
|
+
<tr>
|
89
|
+
<td>파손되거나 고장 난 제조설비가 없는가?</td>
|
90
|
+
<td><input type="checkbox" name="check5" /></td>
|
91
|
+
</tr>
|
92
|
+
<tr>
|
93
|
+
<td rowspan="3">일일 (작업중)</td>
|
94
|
+
<td rowspan="3">공정 관리</td>
|
95
|
+
<td>청결구역작업과 일반구역작업이 분리되어 있으며 오염되지 않도록 관리되고 있는가?</td>
|
96
|
+
<td><input type="checkbox" name="check6" /></td>
|
97
|
+
</tr>
|
98
|
+
<tr>
|
99
|
+
<td>건조 후 냉각 공정이 적절히 관리되고 있는가? (기준: -5℃ ~ 10℃)</td>
|
100
|
+
<td><input type="checkbox" name="check7" /></td>
|
101
|
+
</tr>
|
102
|
+
<tr>
|
103
|
+
<td>완제품이 포장 상태가 양호한가?</td>
|
104
|
+
<td><input type="checkbox" name="check8" /></td>
|
105
|
+
</tr>
|
106
|
+
</tbody>
|
107
|
+
</table>
|
108
|
+
</div>
|
109
|
+
<div class="footer">
|
110
|
+
<div filler></div>
|
111
|
+
${!this.dataSample
|
112
|
+
? html`
|
113
|
+
<button @click=${this.updateDataItems.bind(this)} done>
|
114
|
+
<md-icon>save</md-icon>${i18next.t('button.save')}
|
115
|
+
</button>
|
116
|
+
`
|
117
|
+
: html` <span>${i18next.t('field.collected-at')}: ${this.dataSample?.collectedAt?.toLocaleString()}</span> `}
|
118
|
+
</div>
|
119
|
+
`
|
120
|
+
}
|
121
|
+
|
122
|
+
pageUpdated(changes: any, lifecycle: any, before: any) {
|
123
|
+
if (this.active) {
|
124
|
+
if (this.dataSetId !== lifecycle.resourceId) {
|
125
|
+
this.dataSetId = lifecycle.resourceId
|
126
|
+
this.fetchDataSet()
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
async fetchDataSet() {
|
132
|
+
if (this.dataSetId) {
|
133
|
+
const response = await client.query({
|
134
|
+
query: gql`
|
135
|
+
query ($id: String!) {
|
136
|
+
dataSet(id: $id) {
|
137
|
+
id
|
138
|
+
name
|
139
|
+
description
|
140
|
+
useCase
|
141
|
+
dataItems {
|
142
|
+
name
|
143
|
+
description
|
144
|
+
active
|
145
|
+
hidden
|
146
|
+
tag
|
147
|
+
group
|
148
|
+
type
|
149
|
+
unit
|
150
|
+
options
|
151
|
+
quota
|
152
|
+
spec
|
153
|
+
stat
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
`,
|
158
|
+
variables: {
|
159
|
+
id: this.dataSetId
|
160
|
+
}
|
161
|
+
})
|
162
|
+
|
163
|
+
this.dataSet = response.data.dataSet
|
164
|
+
}
|
165
|
+
}
|
166
|
+
|
167
|
+
private async updateDataItems() {
|
168
|
+
//gather user entry data from inputs
|
169
|
+
const data = {}
|
170
|
+
|
171
|
+
const dataSample = {
|
172
|
+
dataSet: {
|
173
|
+
id: this.dataSetId
|
174
|
+
},
|
175
|
+
data
|
176
|
+
} as any
|
177
|
+
|
178
|
+
if (this.dataSample?.collectedAt) {
|
179
|
+
dataSample.collectedAt = this.dataSample.collectedAt
|
180
|
+
}
|
181
|
+
|
182
|
+
const response = await client.mutate({
|
183
|
+
mutation: gql`
|
184
|
+
mutation ($dataSample: NewDataSample!) {
|
185
|
+
createDataSample(dataSample: $dataSample) {
|
186
|
+
id
|
187
|
+
collectedAt
|
188
|
+
}
|
189
|
+
}
|
190
|
+
`,
|
191
|
+
variables: {
|
192
|
+
dataSample
|
193
|
+
},
|
194
|
+
context: {
|
195
|
+
hasUpload: true
|
196
|
+
}
|
197
|
+
})
|
198
|
+
|
199
|
+
if (!response.errors) {
|
200
|
+
const { id, collectedAt } = response.data.createDataSample
|
201
|
+
this.dataSample = {
|
202
|
+
id,
|
203
|
+
collectedAt: new Date(collectedAt)
|
204
|
+
}
|
205
|
+
|
206
|
+
document.dispatchEvent(
|
207
|
+
new CustomEvent('notify', { detail: { message: i18next.t('text.data sample created successfully') } })
|
208
|
+
)
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
@@ -80,7 +80,7 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
80
80
|
break
|
81
81
|
|
82
82
|
case 'page':
|
83
|
-
navigate(entryView)
|
83
|
+
navigate(`${entryView}/${record.id}`)
|
84
84
|
break
|
85
85
|
|
86
86
|
case 'external':
|
@@ -432,6 +432,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
432
432
|
hidden
|
433
433
|
tag
|
434
434
|
group
|
435
|
+
subgroup
|
435
436
|
type
|
436
437
|
unit
|
437
438
|
options
|