@things-factory/dataset 7.0.0-alpha.5 → 7.0.0-alpha.7
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-view.ts +7 -0
- package/client/activities/activity-data-review-edit.ts +66 -4
- package/client/activities/activity-data-review-view.ts +78 -4
- package/client/activities/activity-ooc-resolve-view.ts +12 -0
- package/client/activities/activity-ooc-review-view.ts +12 -0
- package/client/pages/data-entry/data-entry-list-page.ts +8 -23
- package/client/pages/data-ooc/data-ooc-list-page.ts +63 -19
- package/client/pages/data-ooc/{data-ooc-view-page.ts → data-ooc-page.ts} +43 -1
- package/client/pages/data-ooc/data-ooc-view.ts +198 -41
- package/client/pages/data-ooc/data-oocs-page.ts +198 -0
- package/client/pages/data-sample/data-sample-list-page.ts +48 -26
- package/client/pages/data-sample/{data-sample-view-page.ts → data-sample-page.ts} +8 -1
- package/client/pages/data-sample/data-sample-search-page.ts +25 -20
- package/client/pages/data-sample/data-sample-view.ts +191 -21
- package/client/pages/data-sample/data-samples-page.ts +247 -0
- package/client/pages/data-sensor/data-sensor-list-page.ts +28 -6
- package/client/pages/data-set/data-item-list.ts +2 -2
- package/client/route.ts +10 -2
- package/dist-client/activities/activity-data-collect-view.js +7 -0
- package/dist-client/activities/activity-data-collect-view.js.map +1 -1
- package/dist-client/activities/activity-data-review-edit.d.ts +1 -1
- package/dist-client/activities/activity-data-review-edit.js +63 -5
- package/dist-client/activities/activity-data-review-edit.js.map +1 -1
- package/dist-client/activities/activity-data-review-view.d.ts +1 -1
- package/dist-client/activities/activity-data-review-view.js +75 -5
- package/dist-client/activities/activity-data-review-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-view.js +12 -0
- package/dist-client/activities/activity-ooc-resolve-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-view.js +12 -0
- package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.js +3 -15
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +6 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +55 -12
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/{data-ooc-view-page.js → data-ooc-page.js} +44 -2
- package/dist-client/pages/data-ooc/data-ooc-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view.d.ts +11 -4
- package/dist-client/pages/data-ooc/data-ooc-view.js +193 -48
- package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -1
- package/dist-client/pages/data-ooc/data-oocs-page.d.ts +18 -0
- package/dist-client/pages/data-ooc/data-oocs-page.js +198 -0
- package/dist-client/pages/data-ooc/data-oocs-page.js.map +1 -0
- package/dist-client/pages/data-sample/data-sample-list-page.d.ts +6 -1
- package/dist-client/pages/data-sample/data-sample-list-page.js +42 -19
- package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -1
- package/dist-client/pages/data-sample/{data-sample-view-page.js → data-sample-page.js} +9 -2
- package/dist-client/pages/data-sample/data-sample-page.js.map +1 -0
- package/dist-client/pages/data-sample/data-sample-search-page.d.ts +6 -1
- package/dist-client/pages/data-sample/data-sample-search-page.js +19 -13
- package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-view.d.ts +18 -0
- package/dist-client/pages/data-sample/data-sample-view.js +185 -19
- package/dist-client/pages/data-sample/data-sample-view.js.map +1 -1
- package/dist-client/pages/data-sample/data-samples-page.d.ts +21 -0
- package/dist-client/pages/data-sample/data-samples-page.js +247 -0
- package/dist-client/pages/data-sample/data-samples-page.js.map +1 -0
- package/dist-client/pages/data-sensor/data-sensor-list-page.js +28 -6
- package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -1
- package/dist-client/pages/data-set/data-item-list.js +2 -2
- package/dist-client/pages/data-set/data-item-list.js.map +1 -1
- package/dist-client/route.js +8 -2
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/activities/activity-data-review.js.map +1 -1
- package/dist-server/activities/activity-ooc-review.js +2 -1
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/create-data-sample.js +27 -29
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/engine/index.js +4 -0
- package/dist-server/engine/index.js.map +1 -0
- package/dist-server/engine/task/create-data-sample.js +80 -0
- package/dist-server/engine/task/create-data-sample.js.map +1 -0
- package/dist-server/engine/task/index.js +4 -0
- package/dist-server/engine/task/index.js.map +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/routes.js +35 -27
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc-query.js +32 -0
- package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc.js +44 -37
- package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
- package/dist-server/service/data-sample/data-sample-query.js +24 -0
- package/dist-server/service/data-sample/data-sample-query.js.map +1 -1
- package/dist-server/service/data-sample/data-sample.js +30 -31
- package/dist-server/service/data-sample/data-sample.js.map +1 -1
- package/dist-server/service/data-sensor/data-sensor-query.js +16 -1
- package/dist-server/service/data-sensor/data-sensor-query.js.map +1 -1
- package/dist-server/service/data-sensor/data-sensor-type.js +8 -0
- package/dist-server/service/data-sensor/data-sensor-type.js.map +1 -1
- package/dist-server/service/data-sensor/data-sensor.js +15 -1
- package/dist-server/service/data-sensor/data-sensor.js.map +1 -1
- package/dist-server/service/data-set/data-item-type.js +1 -0
- package/dist-server/service/data-set/data-item-type.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +2 -2
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/dataset/task/create-data-sample.ja.md +28 -0
- package/helps/dataset/task/create-data-sample.ko.md +28 -0
- package/helps/dataset/task/create-data-sample.md +28 -0
- package/helps/dataset/task/create-data-sample.ms.md +30 -0
- package/helps/dataset/task/create-data-sample.zh.md +28 -0
- package/package.json +14 -11
- package/server/activities/activity-data-review.ts +1 -5
- package/server/activities/activity-ooc-review.ts +5 -15
- package/server/controllers/create-data-sample.ts +31 -38
- package/server/engine/index.ts +1 -0
- package/server/engine/task/create-data-sample.ts +92 -0
- package/server/engine/task/index.ts +1 -0
- package/server/index.ts +1 -0
- package/server/routes.ts +47 -31
- package/server/service/data-ooc/data-ooc-query.ts +17 -0
- package/server/service/data-ooc/data-ooc.ts +39 -51
- package/server/service/data-sample/data-sample-query.ts +17 -17
- package/server/service/data-sample/data-sample.ts +29 -52
- package/server/service/data-sensor/data-sensor-query.ts +13 -1
- package/server/service/data-sensor/data-sensor-type.ts +6 -0
- package/server/service/data-sensor/data-sensor.ts +13 -11
- package/server/service/data-set/data-item-type.ts +1 -0
- package/server/service/data-set/data-set-query.ts +7 -7
- package/things-factory.config.js +10 -2
- package/translations/en.json +15 -2
- package/translations/ja.json +12 -1
- package/translations/ko.json +14 -1
- package/translations/ms.json +11 -0
- package/translations/zh.json +12 -1
- package/dist-client/pages/data-ooc/data-ooc-view-page.js.map +0 -1
- package/dist-client/pages/data-sample/data-sample-view-page.js.map +0 -1
- /package/dist-client/pages/data-ooc/{data-ooc-view-page.d.ts → data-ooc-page.d.ts} +0 -0
- /package/dist-client/pages/data-sample/{data-sample-view-page.d.ts → data-sample-page.d.ts} +0 -0
@@ -15,6 +15,7 @@ import { openPopup } from '@operato/layout'
|
|
15
15
|
import { PageView, store } from '@operato/shell'
|
16
16
|
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
17
17
|
import { isMobileDevice } from '@operato/utils'
|
18
|
+
import { GhostPrint } from '@operato/ghost-print'
|
18
19
|
|
19
20
|
@customElement('data-sample-search-page')
|
20
21
|
export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageView)) {
|
@@ -60,7 +61,13 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
60
61
|
}
|
61
62
|
},
|
62
63
|
help: 'dataset/data-sample-search',
|
63
|
-
actions: [
|
64
|
+
actions: [
|
65
|
+
{
|
66
|
+
title: i18next.t('button.print'),
|
67
|
+
action: this.printSamples.bind(this),
|
68
|
+
icon: 'print'
|
69
|
+
}
|
70
|
+
],
|
64
71
|
exportable: {
|
65
72
|
name: i18next.t('title.data-sample search'),
|
66
73
|
data: this._exportableData.bind(this)
|
@@ -170,16 +177,11 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
170
177
|
title: i18next.t('title.open data sample view'),
|
171
178
|
handlers: {
|
172
179
|
click: (columns, data, column, record, rowIndex) => {
|
173
|
-
openPopup(
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
backdrop: true,
|
179
|
-
size: 'large',
|
180
|
-
title: i18next.t('title.data-sample view')
|
181
|
-
}
|
182
|
-
)
|
180
|
+
openPopup(html` <data-sample-view data-sample-id=${record.id} style="background-color: white;"></data-sample-view> `, {
|
181
|
+
backdrop: true,
|
182
|
+
size: 'large',
|
183
|
+
title: i18next.t('title.data-sample view')
|
184
|
+
})
|
183
185
|
}
|
184
186
|
}
|
185
187
|
},
|
@@ -319,12 +321,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
319
321
|
const response = await client.query({
|
320
322
|
query: gql`
|
321
323
|
query ($dataSetId: String!, $filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
322
|
-
responses: dataSamplesByDataSet(
|
323
|
-
dataSetId: $dataSetId
|
324
|
-
filters: $filters
|
325
|
-
pagination: $pagination
|
326
|
-
sortings: $sortings
|
327
|
-
) {
|
324
|
+
responses: dataSamplesByDataSet(dataSetId: $dataSetId, filters: $filters, pagination: $pagination, sortings: $sortings) {
|
328
325
|
items {
|
329
326
|
id
|
330
327
|
name
|
@@ -394,9 +391,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
394
391
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
395
392
|
.reduce((record, column) => {
|
396
393
|
const key = column.imex === true ? column.name : column.imex.key
|
397
|
-
record[key] = key
|
398
|
-
.split('.')
|
399
|
-
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
394
|
+
record[key] = key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
400
395
|
return record
|
401
396
|
}, {})
|
402
397
|
}
|
@@ -404,4 +399,14 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
404
399
|
|
405
400
|
return { header: headerSetting, data: data }
|
406
401
|
}
|
402
|
+
|
403
|
+
printSamples() {
|
404
|
+
const selected = this.grist.selected
|
405
|
+
const ids = selected.map(record => record.id).join('|')
|
406
|
+
|
407
|
+
GhostPrint.print({
|
408
|
+
src: `./data-samples?ids=${ids}`
|
409
|
+
// pending: 200 * selected.length
|
410
|
+
})
|
411
|
+
}
|
407
412
|
}
|
@@ -1,37 +1,50 @@
|
|
1
1
|
import '@operato/dataset/ox-data-sample-view.js'
|
2
|
+
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
3
|
+
import '@things-factory/worklist/dist-client/components/activity-thread-timeline.js'
|
2
4
|
|
3
5
|
import gql from 'graphql-tag'
|
4
|
-
import { css, html, LitElement } from 'lit'
|
5
|
-
import { customElement, property,
|
6
|
+
import { css, html, LitElement, nothing } from 'lit'
|
7
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
6
8
|
|
7
9
|
import { client } from '@operato/graphql'
|
8
10
|
import { i18next, localize } from '@operato/i18n'
|
9
11
|
import { ScrollbarStyles } from '@operato/styles'
|
10
12
|
import { DataSample } from '@operato/dataset'
|
13
|
+
import { GhostPrint } from '@operato/ghost-print'
|
11
14
|
|
12
15
|
@customElement('data-sample-view')
|
13
|
-
class DataSampleView extends localize(i18next)(LitElement) {
|
16
|
+
export class DataSampleView extends localize(i18next)(LitElement) {
|
14
17
|
static styles = [
|
15
18
|
ScrollbarStyles,
|
16
19
|
css`
|
17
20
|
:host {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
position: relative;
|
22
|
+
display: block;
|
23
|
+
overflow: auto;
|
21
24
|
background-color: #fff;
|
22
25
|
}
|
23
26
|
|
24
|
-
|
25
|
-
|
27
|
+
ox-data-sample-view,
|
28
|
+
ox-data-ooc-brief-view {
|
29
|
+
padding: var(--padding-wide);
|
30
|
+
}
|
26
31
|
|
27
|
-
|
28
|
-
|
32
|
+
activity-thread-timeline {
|
33
|
+
margin: var(--margin-default);
|
29
34
|
}
|
30
35
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
36
|
+
mwc-fab {
|
37
|
+
position: fixed;
|
38
|
+
bottom: 15px;
|
39
|
+
right: 16px;
|
40
|
+
text-decoration: auto;
|
41
|
+
opacity: 0.5;
|
42
|
+
}
|
43
|
+
|
44
|
+
@media print {
|
45
|
+
mwc-fab {
|
46
|
+
display: none;
|
47
|
+
}
|
35
48
|
}
|
36
49
|
`
|
37
50
|
]
|
@@ -41,13 +54,57 @@ class DataSampleView extends localize(i18next)(LitElement) {
|
|
41
54
|
attribute: 'data-sample-id'
|
42
55
|
})
|
43
56
|
dataSampleId?: string
|
57
|
+
|
44
58
|
@state() dataSample?: DataSample
|
45
59
|
|
60
|
+
private printHandler = this.handlePrint.bind(this)
|
61
|
+
|
46
62
|
render() {
|
63
|
+
const dataSample = this.dataSample
|
64
|
+
|
65
|
+
if (!dataSample) {
|
66
|
+
return nothing
|
67
|
+
}
|
68
|
+
|
69
|
+
if (dataSample.dataOoc) {
|
70
|
+
var reviewActivityThread = dataSample.dataOoc.reviewActivityInstance?.activityThreads?.[0]
|
71
|
+
var resolveActivityThread = dataSample.dataOoc.resolveActivityInstance?.activityThreads?.[0]
|
72
|
+
} else {
|
73
|
+
var reviewActivityThread = dataSample?.reviewActivityInstance?.activityThreads?.[0]
|
74
|
+
}
|
75
|
+
|
47
76
|
return html`
|
48
|
-
|
49
|
-
|
50
|
-
|
77
|
+
${!dataSample?.dataOoc
|
78
|
+
? html` <ox-data-sample-view .dataSample=${dataSample}></ox-data-sample-view> `
|
79
|
+
: html` <ox-data-ooc-brief-view .dataOoc=${dataSample!.dataOoc}></ox-data-ooc-brief-view>`}
|
80
|
+
${reviewActivityThread
|
81
|
+
? html`
|
82
|
+
<activity-thread-timeline
|
83
|
+
subtitle=${String(i18next.t(dataSample?.dataOoc ? 'label.ooc review timeline' : 'label.datasample review timeline'))}
|
84
|
+
.activityThread=${reviewActivityThread}
|
85
|
+
short-form
|
86
|
+
></activity-thread-timeline>
|
87
|
+
`
|
88
|
+
: nothing}
|
89
|
+
${resolveActivityThread
|
90
|
+
? html`
|
91
|
+
<activity-thread-timeline
|
92
|
+
subtitle=${String(i18next.t('label.ooc resolve timeline'))}
|
93
|
+
.activityThread=${resolveActivityThread}
|
94
|
+
short-form
|
95
|
+
></activity-thread-timeline>
|
96
|
+
`
|
97
|
+
: nothing}
|
98
|
+
|
99
|
+
<mwc-fab
|
100
|
+
icon="print"
|
101
|
+
title="print"
|
102
|
+
@click=${() =>
|
103
|
+
GhostPrint.print({
|
104
|
+
src: `./data-sample/${this.dataSampleId}`
|
105
|
+
})}
|
106
|
+
>print</mwc-fab
|
107
|
+
>
|
51
108
|
`
|
52
109
|
}
|
53
110
|
|
@@ -76,6 +133,12 @@ class DataSampleView extends localize(i18next)(LitElement) {
|
|
76
133
|
data
|
77
134
|
ooc
|
78
135
|
oos
|
136
|
+
updatedAt
|
137
|
+
collectedAt
|
138
|
+
updater {
|
139
|
+
id
|
140
|
+
name
|
141
|
+
}
|
79
142
|
dataSet {
|
80
143
|
id
|
81
144
|
name
|
@@ -98,12 +161,99 @@ class DataSampleView extends localize(i18next)(LitElement) {
|
|
98
161
|
judgment
|
99
162
|
workDate
|
100
163
|
workShift
|
101
|
-
|
102
|
-
|
164
|
+
reviewActivityInstance {
|
165
|
+
...ActivityInstanceFragment
|
166
|
+
}
|
167
|
+
dataOoc {
|
103
168
|
name
|
169
|
+
description
|
170
|
+
useCase
|
171
|
+
dataSet {
|
172
|
+
id
|
173
|
+
name
|
174
|
+
}
|
175
|
+
key01
|
176
|
+
key02
|
177
|
+
key03
|
178
|
+
key04
|
179
|
+
key05
|
180
|
+
partitionKeys
|
181
|
+
dataItems {
|
182
|
+
name
|
183
|
+
description
|
184
|
+
active
|
185
|
+
tag
|
186
|
+
group
|
187
|
+
type
|
188
|
+
unit
|
189
|
+
options
|
190
|
+
quota
|
191
|
+
spec
|
192
|
+
}
|
193
|
+
data
|
194
|
+
rawData
|
195
|
+
judgment
|
196
|
+
ooc
|
197
|
+
oos
|
198
|
+
state
|
199
|
+
history
|
200
|
+
workDate
|
201
|
+
workShift
|
202
|
+
correctiveInstruction
|
203
|
+
correctiveAction
|
204
|
+
reviewedAt
|
205
|
+
reviewer {
|
206
|
+
id
|
207
|
+
name
|
208
|
+
}
|
209
|
+
correctedAt
|
210
|
+
corrector {
|
211
|
+
id
|
212
|
+
name
|
213
|
+
}
|
214
|
+
updater {
|
215
|
+
id
|
216
|
+
name
|
217
|
+
}
|
218
|
+
updatedAt
|
219
|
+
collectedAt
|
220
|
+
|
221
|
+
reviewActivityInstance {
|
222
|
+
...ActivityInstanceFragment
|
223
|
+
}
|
224
|
+
resolveActivityInstance {
|
225
|
+
...ActivityInstanceFragment
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
229
|
+
}
|
230
|
+
|
231
|
+
fragment ActivityInstanceFragment on ActivityInstance {
|
232
|
+
activityThreads {
|
233
|
+
assignee {
|
234
|
+
name
|
235
|
+
}
|
236
|
+
output
|
237
|
+
activityApprovals {
|
238
|
+
judgment
|
239
|
+
approver {
|
240
|
+
name
|
241
|
+
}
|
242
|
+
comment
|
243
|
+
createdAt
|
244
|
+
updatedAt
|
245
|
+
terminatedAt
|
246
|
+
}
|
247
|
+
activityThreadHistories {
|
248
|
+
transaction
|
249
|
+
reason
|
250
|
+
updater {
|
251
|
+
name
|
252
|
+
}
|
253
|
+
updatedAt
|
254
|
+
state
|
255
|
+
output
|
104
256
|
}
|
105
|
-
updatedAt
|
106
|
-
collectedAt
|
107
257
|
}
|
108
258
|
}
|
109
259
|
`,
|
@@ -114,4 +264,24 @@ class DataSampleView extends localize(i18next)(LitElement) {
|
|
114
264
|
|
115
265
|
this.dataSample = response.data.dataSample
|
116
266
|
}
|
267
|
+
|
268
|
+
handlePrint(event) {
|
269
|
+
if ((event.ctrlKey || event.metaKey) && event.key === 'p') {
|
270
|
+
event.preventDefault()
|
271
|
+
|
272
|
+
GhostPrint.print({
|
273
|
+
src: `./data-sample/${this.dataSampleId}`
|
274
|
+
})
|
275
|
+
}
|
276
|
+
}
|
277
|
+
|
278
|
+
connectedCallback(): void {
|
279
|
+
super.connectedCallback()
|
280
|
+
window.addEventListener('keydown', this.printHandler)
|
281
|
+
}
|
282
|
+
|
283
|
+
disconnectedCallback(): void {
|
284
|
+
super.disconnectedCallback()
|
285
|
+
window.removeEventListener('keydown', this.printHandler)
|
286
|
+
}
|
117
287
|
}
|
@@ -0,0 +1,247 @@
|
|
1
|
+
import '@operato/dataset/ox-data-sample-view.js'
|
2
|
+
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
3
|
+
import '@things-factory/worklist/dist-client/components/activity-thread-timeline.js'
|
4
|
+
|
5
|
+
import gql from 'graphql-tag'
|
6
|
+
import { PropertyValues, html, css, nothing } from 'lit'
|
7
|
+
import { customElement, state } from 'lit/decorators.js'
|
8
|
+
import { PageView } from '@operato/shell'
|
9
|
+
import { i18next, localize } from '@operato/i18n'
|
10
|
+
import { client } from '@operato/graphql'
|
11
|
+
|
12
|
+
/**
|
13
|
+
* 이 페이지는 여러개의 Data Sample을 한번에 프린트하기 위한 용도로 사용되는 페이지이다.
|
14
|
+
*/
|
15
|
+
@customElement('data-samples-page')
|
16
|
+
export class DataSamplesPage extends localize(i18next)(PageView) {
|
17
|
+
static styles = [
|
18
|
+
css`
|
19
|
+
:host {
|
20
|
+
display: block;
|
21
|
+
overflow: auto;
|
22
|
+
}
|
23
|
+
|
24
|
+
.end {
|
25
|
+
page-break-after: always;
|
26
|
+
break-after: always;
|
27
|
+
}
|
28
|
+
`
|
29
|
+
]
|
30
|
+
|
31
|
+
@state() dataSamples?: any[]
|
32
|
+
|
33
|
+
get context() {
|
34
|
+
return {
|
35
|
+
title: i18next.t('title.data-sample view')
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
render() {
|
40
|
+
return this.dataSamples?.map(dataSample => {
|
41
|
+
if (dataSample?.dataOoc) {
|
42
|
+
var reviewActivityThread = dataSample.dataOoc.reviewActivityInstance?.activityThreads?.[0]
|
43
|
+
var resolveActivityThread = dataSample.dataOoc.resolveActivityInstance?.activityThreads?.[0]
|
44
|
+
} else {
|
45
|
+
var reviewActivityThread = dataSample?.reviewActivityInstance?.activityThreads?.[0]
|
46
|
+
}
|
47
|
+
|
48
|
+
return html`
|
49
|
+
${!dataSample.dataOoc
|
50
|
+
? html` <ox-data-sample-view .dataSample=${dataSample}></ox-data-sample-view> `
|
51
|
+
: html` <ox-data-ooc-brief-view .dataOoc=${dataSample.dataOoc}></ox-data-ooc-brief-view>`}
|
52
|
+
${reviewActivityThread
|
53
|
+
? html`
|
54
|
+
<activity-thread-timeline
|
55
|
+
subtitle=${String(i18next.t(dataSample?.dataOoc ? 'label.ooc review timeline' : 'label.datasample review timeline'))}
|
56
|
+
.activityThread=${reviewActivityThread}
|
57
|
+
short-form
|
58
|
+
></activity-thread-timeline>
|
59
|
+
`
|
60
|
+
: nothing}
|
61
|
+
${resolveActivityThread
|
62
|
+
? html`
|
63
|
+
<activity-thread-timeline
|
64
|
+
subtitle=${String(i18next.t('label.ooc resolve timeline'))}
|
65
|
+
.activityThread=${resolveActivityThread}
|
66
|
+
short-form
|
67
|
+
></activity-thread-timeline>
|
68
|
+
`
|
69
|
+
: nothing}
|
70
|
+
<div class="end"></div>
|
71
|
+
`
|
72
|
+
})
|
73
|
+
}
|
74
|
+
|
75
|
+
updated(changes: PropertyValues<this>) {}
|
76
|
+
|
77
|
+
pageUpdated(changes: any, lifecycle: any, before: any) {
|
78
|
+
if (this.active) {
|
79
|
+
/*
|
80
|
+
* this page is activated
|
81
|
+
*/
|
82
|
+
const { ids = '' } = lifecycle.params
|
83
|
+
|
84
|
+
this.fetchSamples(ids.split('|').map(id => id.trim()))
|
85
|
+
} else {
|
86
|
+
/* this page is deactivated */
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
async fetchSamples(ids: string[]) {
|
91
|
+
const filters = [
|
92
|
+
{
|
93
|
+
name: 'id',
|
94
|
+
operator: 'in',
|
95
|
+
value: ids
|
96
|
+
}
|
97
|
+
]
|
98
|
+
|
99
|
+
const response = await client.query({
|
100
|
+
query: gql`
|
101
|
+
query ($filters: [Filter!]) {
|
102
|
+
dataSamples(filters: $filters) {
|
103
|
+
items {
|
104
|
+
id
|
105
|
+
name
|
106
|
+
description
|
107
|
+
useCase
|
108
|
+
key01
|
109
|
+
key02
|
110
|
+
key03
|
111
|
+
key04
|
112
|
+
key05
|
113
|
+
data
|
114
|
+
ooc
|
115
|
+
oos
|
116
|
+
updatedAt
|
117
|
+
collectedAt
|
118
|
+
updater {
|
119
|
+
id
|
120
|
+
name
|
121
|
+
}
|
122
|
+
dataSet {
|
123
|
+
id
|
124
|
+
name
|
125
|
+
description
|
126
|
+
}
|
127
|
+
dataItems {
|
128
|
+
name
|
129
|
+
description
|
130
|
+
active
|
131
|
+
hidden
|
132
|
+
tag
|
133
|
+
group
|
134
|
+
type
|
135
|
+
unit
|
136
|
+
options
|
137
|
+
quota
|
138
|
+
spec
|
139
|
+
stat
|
140
|
+
}
|
141
|
+
judgment
|
142
|
+
workDate
|
143
|
+
workShift
|
144
|
+
reviewActivityInstance {
|
145
|
+
...ActivityInstanceFragment
|
146
|
+
}
|
147
|
+
dataOoc {
|
148
|
+
name
|
149
|
+
description
|
150
|
+
useCase
|
151
|
+
dataSet {
|
152
|
+
id
|
153
|
+
name
|
154
|
+
}
|
155
|
+
key01
|
156
|
+
key02
|
157
|
+
key03
|
158
|
+
key04
|
159
|
+
key05
|
160
|
+
partitionKeys
|
161
|
+
dataItems {
|
162
|
+
name
|
163
|
+
description
|
164
|
+
active
|
165
|
+
tag
|
166
|
+
group
|
167
|
+
type
|
168
|
+
unit
|
169
|
+
options
|
170
|
+
quota
|
171
|
+
spec
|
172
|
+
}
|
173
|
+
data
|
174
|
+
rawData
|
175
|
+
judgment
|
176
|
+
ooc
|
177
|
+
oos
|
178
|
+
state
|
179
|
+
history
|
180
|
+
workDate
|
181
|
+
workShift
|
182
|
+
correctiveInstruction
|
183
|
+
correctiveAction
|
184
|
+
reviewedAt
|
185
|
+
reviewer {
|
186
|
+
id
|
187
|
+
name
|
188
|
+
}
|
189
|
+
correctedAt
|
190
|
+
corrector {
|
191
|
+
id
|
192
|
+
name
|
193
|
+
}
|
194
|
+
updater {
|
195
|
+
id
|
196
|
+
name
|
197
|
+
}
|
198
|
+
updatedAt
|
199
|
+
collectedAt
|
200
|
+
reviewActivityInstance {
|
201
|
+
...ActivityInstanceFragment
|
202
|
+
}
|
203
|
+
resolveActivityInstance {
|
204
|
+
...ActivityInstanceFragment
|
205
|
+
}
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
fragment ActivityInstanceFragment on ActivityInstance {
|
212
|
+
activityThreads {
|
213
|
+
assignee {
|
214
|
+
name
|
215
|
+
}
|
216
|
+
output
|
217
|
+
activityApprovals {
|
218
|
+
judgment
|
219
|
+
approver {
|
220
|
+
name
|
221
|
+
}
|
222
|
+
comment
|
223
|
+
createdAt
|
224
|
+
updatedAt
|
225
|
+
terminatedAt
|
226
|
+
}
|
227
|
+
activityThreadHistories {
|
228
|
+
transaction
|
229
|
+
reason
|
230
|
+
updater {
|
231
|
+
name
|
232
|
+
}
|
233
|
+
updatedAt
|
234
|
+
state
|
235
|
+
output
|
236
|
+
}
|
237
|
+
}
|
238
|
+
}
|
239
|
+
`,
|
240
|
+
variables: {
|
241
|
+
filters
|
242
|
+
}
|
243
|
+
})
|
244
|
+
|
245
|
+
this.dataSamples = response.data.dataSamples.items
|
246
|
+
}
|
247
|
+
}
|
@@ -90,12 +90,7 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
90
90
|
const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')
|
91
91
|
|
92
92
|
return html`
|
93
|
-
<ox-grist
|
94
|
-
.mode=${mode}
|
95
|
-
.config=${this.gristConfig}
|
96
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
97
|
-
?url-params-sensitive=${this.active}
|
98
|
-
>
|
93
|
+
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
99
94
|
<div slot="headroom" class="header">
|
100
95
|
<div class="title">
|
101
96
|
<mwc-icon>summarize</mwc-icon>
|
@@ -191,6 +186,28 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
191
186
|
sortable: true,
|
192
187
|
width: 120
|
193
188
|
},
|
189
|
+
{
|
190
|
+
type: 'resource-object',
|
191
|
+
name: 'decoder',
|
192
|
+
header: {
|
193
|
+
renderer: i18next.t('field.decoder-scenario')
|
194
|
+
},
|
195
|
+
record: {
|
196
|
+
editable: true,
|
197
|
+
options: {
|
198
|
+
title: i18next.t('title.lookup scenario'),
|
199
|
+
queryName: 'scenarios',
|
200
|
+
columns: [
|
201
|
+
{ name: 'id', hidden: true },
|
202
|
+
{ name: 'name', header: i18next.t('field.name'), filter: 'search' },
|
203
|
+
{ name: 'description', header: i18next.t('field.description'), filter: 'search' }
|
204
|
+
],
|
205
|
+
list: { fields: ['name', 'description'] }
|
206
|
+
}
|
207
|
+
},
|
208
|
+
filter: false,
|
209
|
+
width: 120
|
210
|
+
},
|
194
211
|
{
|
195
212
|
type: 'object',
|
196
213
|
name: 'dataSet',
|
@@ -315,6 +332,11 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
315
332
|
name
|
316
333
|
description
|
317
334
|
}
|
335
|
+
decoder {
|
336
|
+
id
|
337
|
+
name
|
338
|
+
description
|
339
|
+
}
|
318
340
|
refBy
|
319
341
|
brand
|
320
342
|
model
|
@@ -153,7 +153,7 @@ class DataItemList extends localize(i18next)(LitElement) {
|
|
153
153
|
name: 'type',
|
154
154
|
header: i18next.t('field.type'),
|
155
155
|
record: {
|
156
|
-
options: ['', 'number', 'text', 'select', 'boolean', 'date', 'datetime', 'file'],
|
156
|
+
options: ['', 'number', 'text', 'select', 'radio', 'boolean', 'date', 'datetime', 'file'],
|
157
157
|
editable: true
|
158
158
|
},
|
159
159
|
width: 120
|
@@ -170,7 +170,7 @@ class DataItemList extends localize(i18next)(LitElement) {
|
|
170
170
|
name: record.type,
|
171
171
|
help: '',
|
172
172
|
spec:
|
173
|
-
record.type === 'select'
|
173
|
+
record.type === 'select' || record.type === 'radio'
|
174
174
|
? [
|
175
175
|
{
|
176
176
|
type: 'options' /* property-editor type */,
|
package/client/route.ts
CHANGED
@@ -9,7 +9,11 @@ export default function route(page) {
|
|
9
9
|
return page
|
10
10
|
|
11
11
|
case 'data-sample':
|
12
|
-
import('./pages/data-sample/data-sample-
|
12
|
+
import('./pages/data-sample/data-sample-page.js')
|
13
|
+
return page
|
14
|
+
|
15
|
+
case 'data-samples':
|
16
|
+
import('./pages/data-sample/data-samples-page.js')
|
13
17
|
return page
|
14
18
|
|
15
19
|
case 'data-sample-list':
|
@@ -37,7 +41,11 @@ export default function route(page) {
|
|
37
41
|
return page
|
38
42
|
|
39
43
|
case 'data-ooc':
|
40
|
-
import('./pages/data-ooc/data-ooc-
|
44
|
+
import('./pages/data-ooc/data-ooc-page.js')
|
45
|
+
return page
|
46
|
+
|
47
|
+
case 'data-oocs':
|
48
|
+
import('./pages/data-ooc/data-oocs-page.js')
|
41
49
|
return page
|
42
50
|
|
43
51
|
case 'data-ooc-list':
|