@things-factory/dataset 7.0.0-alpha.3 → 7.0.0-alpha.30
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 +1 -7
- package/client/activities/activity-data-collect-view.ts +7 -0
- package/client/activities/activity-data-review-edit.ts +66 -32
- package/client/activities/activity-data-review-view.ts +75 -29
- package/client/activities/activity-ooc-resolve-edit.ts +44 -48
- package/client/activities/activity-ooc-resolve-view.ts +25 -35
- package/client/activities/activity-ooc-review-edit.ts +36 -29
- package/client/activities/activity-ooc-review-view.ts +9 -19
- package/client/bootstrap.ts +5 -9
- package/client/pages/data-entry/data-entry-list-page.ts +8 -23
- package/client/pages/data-ooc/data-ooc-list-page.ts +71 -27
- package/client/pages/data-ooc/{data-ooc-view-page.ts → data-ooc-page.ts} +45 -1
- package/client/pages/data-ooc/data-ooc-view.ts +198 -41
- package/client/pages/data-ooc/data-oocs-page.ts +200 -0
- package/client/pages/data-sample/data-sample-list-page.ts +53 -31
- 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 +34 -29
- package/client/pages/data-sample/data-sample-view.ts +192 -21
- package/client/pages/data-sample/data-samples-page.ts +249 -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/pages/data-summary/data-summary-list-page.ts +12 -24
- package/client/route.ts +10 -2
- package/dist-client/activities/activity-data-collect-edit.js +1 -7
- package/dist-client/activities/activity-data-collect-edit.js.map +1 -1
- 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 -33
- 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 +72 -30
- package/dist-client/activities/activity-data-review-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-edit.d.ts +1 -1
- package/dist-client/activities/activity-ooc-resolve-edit.js +44 -48
- package/dist-client/activities/activity-ooc-resolve-edit.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-view.d.ts +13 -0
- package/dist-client/activities/activity-ooc-resolve-view.js +24 -34
- package/dist-client/activities/activity-ooc-resolve-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-edit.js +39 -29
- package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-view.js +9 -19
- package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
- package/dist-client/bootstrap.d.ts +4 -4
- package/dist-client/bootstrap.js +4 -4
- package/dist-client/bootstrap.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 +67 -24
- 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} +46 -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 +200 -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 +51 -28
- 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 -13
- package/dist-client/pages/data-sample/data-sample-search-page.js +32 -26
- 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 +186 -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 +249 -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/pages/data-summary/data-summary-list-page.js +12 -21
- package/dist-client/pages/data-summary/data-summary-list-page.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-collect.js.map +1 -1
- package/dist-server/activities/activity-data-review.js.map +1 -1
- package/dist-server/activities/activity-ooc-review.js +3 -2
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/create-data-sample.js +28 -30
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/issue-collect-data.js +55 -0
- package/dist-server/controllers/issue-collect-data.js.map +1 -0
- 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 +81 -0
- package/dist-server/engine/task/create-data-sample.js.map +1 -0
- package/dist-server/engine/task/index.js +5 -0
- package/dist-server/engine/task/index.js.map +1 -0
- package/dist-server/engine/task/issue-collect-data.js +40 -0
- package/dist-server/engine/task/issue-collect-data.js.map +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/routes.js +39 -65
- 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/service/data-summary/data-summary.js +8 -8
- package/dist-server/service/data-summary/data-summary.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/helps/dataset/task/issue-collect-data.ja.md +35 -0
- package/helps/dataset/task/issue-collect-data.ko.md +32 -0
- package/helps/dataset/task/issue-collect-data.md +32 -0
- package/helps/dataset/task/issue-collect-data.ms.md +34 -0
- package/helps/dataset/task/issue-collect-data.zh.md +32 -0
- package/package.json +15 -12
- package/server/activities/activity-data-collect.ts +3 -11
- package/server/activities/activity-data-review.ts +1 -5
- package/server/activities/activity-ooc-review.ts +6 -16
- package/server/controllers/create-data-sample.ts +32 -39
- package/server/controllers/issue-collect-data.ts +61 -0
- package/server/engine/index.ts +1 -0
- package/server/engine/task/create-data-sample.ts +93 -0
- package/server/engine/task/index.ts +2 -0
- package/server/engine/task/issue-collect-data.ts +45 -0
- package/server/index.ts +1 -0
- package/server/routes.ts +52 -77
- 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/server/service/data-summary/data-summary.ts +10 -23
- 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
package/client/bootstrap.ts
CHANGED
@@ -1,19 +1,15 @@
|
|
1
1
|
import './activities/activity-data-collect-edit' /* refered by the activity template (activity-data-collect) on server */
|
2
|
-
import './activities/activity-ooc-review-edit' /* refered by the activity template (activity-ooc-review) on server */
|
3
|
-
import './activities/activity-ooc-resolve-edit' /* refered by the activity template (activity-ooc-resolve) on server */
|
4
2
|
import './activities/activity-data-collect-view' /* refered by the activity template (activity-data-collect) on server */
|
5
|
-
import './activities/activity-ooc-review-view' /* refered by the activity template (activity-ooc-review) on server */
|
6
|
-
import './activities/activity-ooc-resolve-view' /* refered by the activity template (activity-ooc-resolve) on server */
|
7
3
|
import './activities/activity-data-review-edit' /* refered by the activity template (activity-data-review) on server */
|
8
4
|
import './activities/activity-data-review-view' /* refered by the activity template (activity-data-review) on server */
|
5
|
+
import './activities/activity-ooc-review-edit' /* refered by the activity template (activity-ooc-review) on server */
|
6
|
+
import './activities/activity-ooc-review-view' /* refered by the activity template (activity-ooc-review) on server */
|
7
|
+
import './activities/activity-ooc-resolve-edit' /* refered by the activity template (activity-ooc-resolve) on server */
|
8
|
+
import './activities/activity-ooc-resolve-view' /* refered by the activity template (activity-ooc-resolve) on server */
|
9
9
|
import '@operato/app/filter-renderer.js' /* register resource-object filter renderer */
|
10
10
|
|
11
11
|
import { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js'
|
12
|
-
import {
|
13
|
-
OxGristRendererJson5,
|
14
|
-
registerEditor as registerGristEditor,
|
15
|
-
registerRenderer as registerGristRenderer
|
16
|
-
} from '@operato/data-grist'
|
12
|
+
import { OxGristRendererJson5, registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'
|
17
13
|
import { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js'
|
18
14
|
import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'
|
19
15
|
import { OxGristRendererPartitionKeys } from '@operato/grist-editor/ox-grist-renderer-partition-keys.js'
|
@@ -46,23 +46,12 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
46
46
|
const board = {
|
47
47
|
id: entryView
|
48
48
|
}
|
49
|
-
openPopup(
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
hide-fullscreen
|
56
|
-
hide-navigation
|
57
|
-
></ox-board-viewer>
|
58
|
-
`,
|
59
|
-
{
|
60
|
-
closable: true,
|
61
|
-
backdrop: true,
|
62
|
-
size: 'large',
|
63
|
-
title
|
64
|
-
}
|
65
|
-
)
|
49
|
+
openPopup(html` <ox-board-viewer style="background-color: white;" .board=${board} .provider=${provider} hide-fullscreen hide-navigation></ox-board-viewer> `, {
|
50
|
+
closable: true,
|
51
|
+
backdrop: true,
|
52
|
+
size: 'large',
|
53
|
+
title
|
54
|
+
})
|
66
55
|
|
67
56
|
// navigate(`board-viewer/${entryView}?interactive=true&title=${title}`)
|
68
57
|
break
|
@@ -129,12 +118,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
129
118
|
const mode = 'CARD'
|
130
119
|
|
131
120
|
return html`
|
132
|
-
<ox-grist
|
133
|
-
.mode=${mode}
|
134
|
-
.config=${this.gristConfig}
|
135
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
136
|
-
?url-params-sensitive=${this.active}
|
137
|
-
>
|
121
|
+
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
138
122
|
<div slot="headroom" class="header">
|
139
123
|
<div class="title">
|
140
124
|
<mwc-icon>summarize</mwc-icon>
|
@@ -300,6 +284,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
300
284
|
],
|
301
285
|
rows: {
|
302
286
|
appendable: false,
|
287
|
+
editable: false,
|
303
288
|
selectable: {
|
304
289
|
multiple: false
|
305
290
|
},
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import '@operato/data-grist'
|
2
2
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
3
|
import '@operato/input/ox-input-select-buttons.js'
|
4
|
+
|
4
5
|
import './data-ooc-view.js'
|
5
6
|
|
6
7
|
import gql from 'graphql-tag'
|
@@ -8,6 +9,8 @@ import { css, html } from 'lit'
|
|
8
9
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
9
10
|
import { connect } from 'pwa-helpers/connect-mixin'
|
10
11
|
|
12
|
+
import { GhostPrint } from '@operato/ghost-print'
|
13
|
+
|
11
14
|
function getOocStatus() {
|
12
15
|
return [
|
13
16
|
{
|
@@ -44,6 +47,8 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
44
47
|
flex-direction: column;
|
45
48
|
|
46
49
|
overflow: hidden;
|
50
|
+
|
51
|
+
--grid-header-padding: 2px 0 2px 9px;
|
47
52
|
}
|
48
53
|
|
49
54
|
ox-grist {
|
@@ -74,6 +79,13 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
74
79
|
}
|
75
80
|
},
|
76
81
|
help: 'dataset/data-ooc',
|
82
|
+
actions: [
|
83
|
+
{
|
84
|
+
title: i18next.t('button.print'),
|
85
|
+
action: this.printOocs.bind(this),
|
86
|
+
icon: 'print'
|
87
|
+
}
|
88
|
+
],
|
77
89
|
exportable: {
|
78
90
|
name: i18next.t('title.data-ooc list'),
|
79
91
|
data: this._exportableData.bind(this)
|
@@ -123,22 +135,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
123
135
|
gutterName: 'button',
|
124
136
|
fixed: true,
|
125
137
|
icon: 'assignment_turned_in',
|
126
|
-
title: i18next.t('title.view detail ooc data')
|
127
|
-
handlers: {
|
128
|
-
click: (columns, data, column, record, rowIndex) => {
|
129
|
-
const popup = openPopup(
|
130
|
-
html` <data-ooc-view .dataOoc=${record} style="background-color: white;"></data-ooc-view> `,
|
131
|
-
{
|
132
|
-
backdrop: true,
|
133
|
-
size: 'large',
|
134
|
-
title: i18next.t('title.data-ooc view')
|
135
|
-
}
|
136
|
-
)
|
137
|
-
popup.onclosed = () => {
|
138
|
-
this.grist.fetch()
|
139
|
-
}
|
140
|
-
}
|
141
|
-
}
|
138
|
+
title: i18next.t('title.view detail ooc data')
|
142
139
|
},
|
143
140
|
{
|
144
141
|
type: 'string',
|
@@ -147,7 +144,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
147
144
|
label: true,
|
148
145
|
header: i18next.t('field.name'),
|
149
146
|
record: {
|
150
|
-
editable:
|
147
|
+
editable: false
|
151
148
|
},
|
152
149
|
filter: 'search',
|
153
150
|
sortable: true,
|
@@ -160,7 +157,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
160
157
|
label: true,
|
161
158
|
header: i18next.t('field.description'),
|
162
159
|
record: {
|
163
|
-
editable:
|
160
|
+
editable: false
|
164
161
|
},
|
165
162
|
filter: 'search',
|
166
163
|
width: 150,
|
@@ -203,13 +200,25 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
203
200
|
filter: true,
|
204
201
|
imex: true
|
205
202
|
},
|
203
|
+
{
|
204
|
+
type: 'textarea',
|
205
|
+
name: 'correctiveInstruction',
|
206
|
+
label: true,
|
207
|
+
header: i18next.t('field.corrective-instruction'),
|
208
|
+
record: {
|
209
|
+
editable: false,
|
210
|
+
language: 'text'
|
211
|
+
},
|
212
|
+
width: 150,
|
213
|
+
imex: true
|
214
|
+
},
|
206
215
|
{
|
207
216
|
type: 'textarea',
|
208
217
|
name: 'correctiveAction',
|
209
218
|
label: true,
|
210
219
|
header: i18next.t('field.corrective-action'),
|
211
220
|
record: {
|
212
|
-
editable:
|
221
|
+
editable: false,
|
213
222
|
language: 'text'
|
214
223
|
},
|
215
224
|
width: 150,
|
@@ -226,7 +235,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
226
235
|
{
|
227
236
|
type: 'string',
|
228
237
|
name: 'key01',
|
229
|
-
header:
|
238
|
+
header: {
|
239
|
+
renderer: i18next.t('field.key-01'),
|
240
|
+
group: i18next.t('field.key')
|
241
|
+
},
|
230
242
|
record: {
|
231
243
|
editable: false
|
232
244
|
},
|
@@ -237,7 +249,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
237
249
|
{
|
238
250
|
type: 'string',
|
239
251
|
name: 'key02',
|
240
|
-
header:
|
252
|
+
header: {
|
253
|
+
renderer: i18next.t('field.key-02'),
|
254
|
+
group: i18next.t('field.key')
|
255
|
+
},
|
241
256
|
record: {
|
242
257
|
editable: false
|
243
258
|
},
|
@@ -248,7 +263,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
248
263
|
{
|
249
264
|
type: 'string',
|
250
265
|
name: 'key03',
|
251
|
-
header:
|
266
|
+
header: {
|
267
|
+
renderer: i18next.t('field.key-03'),
|
268
|
+
group: i18next.t('field.key')
|
269
|
+
},
|
252
270
|
record: {
|
253
271
|
editable: false
|
254
272
|
},
|
@@ -259,7 +277,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
259
277
|
{
|
260
278
|
type: 'string',
|
261
279
|
name: 'key04',
|
262
|
-
header:
|
280
|
+
header: {
|
281
|
+
renderer: i18next.t('field.key-04'),
|
282
|
+
group: i18next.t('field.key')
|
283
|
+
},
|
263
284
|
record: {
|
264
285
|
editable: false
|
265
286
|
},
|
@@ -270,7 +291,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
270
291
|
{
|
271
292
|
type: 'string',
|
272
293
|
name: 'key05',
|
273
|
-
header:
|
294
|
+
header: {
|
295
|
+
renderer: i18next.t('field.key-05'),
|
296
|
+
group: i18next.t('field.key')
|
297
|
+
},
|
274
298
|
record: {
|
275
299
|
editable: false
|
276
300
|
},
|
@@ -353,6 +377,18 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
353
377
|
appendable: false,
|
354
378
|
selectable: {
|
355
379
|
multiple: true
|
380
|
+
},
|
381
|
+
handlers: {
|
382
|
+
click: (columns, data, column, record, rowIndex) => {
|
383
|
+
const popup = openPopup(html` <data-ooc-view data-ooc-id=${record.id} style="background-color: white;"></data-ooc-view> `, {
|
384
|
+
backdrop: true,
|
385
|
+
size: 'large',
|
386
|
+
title: i18next.t('title.data-ooc view')
|
387
|
+
})
|
388
|
+
popup.onclosed = () => {
|
389
|
+
this.grist.fetch()
|
390
|
+
}
|
391
|
+
}
|
356
392
|
}
|
357
393
|
},
|
358
394
|
sorters: [
|
@@ -479,9 +515,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
479
515
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
480
516
|
.reduce((record, column) => {
|
481
517
|
const key = column.imex === true ? column.name : column.imex.key
|
482
|
-
record[key] = key
|
483
|
-
.split('.')
|
484
|
-
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
518
|
+
record[key] = key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
485
519
|
return record
|
486
520
|
}, {})
|
487
521
|
}
|
@@ -489,4 +523,14 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
489
523
|
|
490
524
|
return { header: headerSetting, data: data }
|
491
525
|
}
|
526
|
+
|
527
|
+
printOocs() {
|
528
|
+
const selected = this.grist.selected
|
529
|
+
const ids = selected.map(record => record.id).join('|')
|
530
|
+
|
531
|
+
GhostPrint.print({
|
532
|
+
src: `./data-oocs?ids=${ids}`
|
533
|
+
// pending: 200 * selected.length
|
534
|
+
})
|
535
|
+
}
|
492
536
|
}
|
@@ -8,7 +8,7 @@ import { client } from '@operato/graphql'
|
|
8
8
|
|
9
9
|
import './data-ooc-view.js'
|
10
10
|
|
11
|
-
@customElement('data-ooc-
|
11
|
+
@customElement('data-ooc-page')
|
12
12
|
export class DataOocViewPage extends localize(i18next)(PageView) {
|
13
13
|
static styles = [
|
14
14
|
css`
|
@@ -19,6 +19,13 @@ export class DataOocViewPage extends localize(i18next)(PageView) {
|
|
19
19
|
data-ooc-view {
|
20
20
|
flex: 1;
|
21
21
|
}
|
22
|
+
|
23
|
+
@media print {
|
24
|
+
:host {
|
25
|
+
display: block;
|
26
|
+
overflow: visible;
|
27
|
+
}
|
28
|
+
}
|
22
29
|
`
|
23
30
|
]
|
24
31
|
|
@@ -72,6 +79,7 @@ export class DataOocViewPage extends localize(i18next)(PageView) {
|
|
72
79
|
name
|
73
80
|
description
|
74
81
|
active
|
82
|
+
hidden
|
75
83
|
tag
|
76
84
|
group
|
77
85
|
type
|
@@ -79,6 +87,7 @@ export class DataOocViewPage extends localize(i18next)(PageView) {
|
|
79
87
|
options
|
80
88
|
quota
|
81
89
|
spec
|
90
|
+
stat
|
82
91
|
}
|
83
92
|
data
|
84
93
|
rawData
|
@@ -107,6 +116,41 @@ export class DataOocViewPage extends localize(i18next)(PageView) {
|
|
107
116
|
}
|
108
117
|
updatedAt
|
109
118
|
collectedAt
|
119
|
+
reviewActivityInstance {
|
120
|
+
...ActivityInstanceFragment
|
121
|
+
}
|
122
|
+
resolveActivityInstance {
|
123
|
+
...ActivityInstanceFragment
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
fragment ActivityInstanceFragment on ActivityInstance {
|
129
|
+
activityThreads {
|
130
|
+
assignee {
|
131
|
+
name
|
132
|
+
}
|
133
|
+
output
|
134
|
+
activityApprovals {
|
135
|
+
judgment
|
136
|
+
approver {
|
137
|
+
name
|
138
|
+
}
|
139
|
+
comment
|
140
|
+
createdAt
|
141
|
+
updatedAt
|
142
|
+
terminatedAt
|
143
|
+
}
|
144
|
+
activityThreadHistories {
|
145
|
+
transaction
|
146
|
+
reason
|
147
|
+
updater {
|
148
|
+
name
|
149
|
+
}
|
150
|
+
updatedAt
|
151
|
+
state
|
152
|
+
output
|
153
|
+
}
|
110
154
|
}
|
111
155
|
}
|
112
156
|
`,
|
@@ -1,10 +1,15 @@
|
|
1
1
|
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
2
|
+
import '@material/mwc-fab'
|
3
|
+
import '@things-factory/worklist/dist-client/components/activity-thread-timeline.js'
|
2
4
|
|
3
|
-
import
|
4
|
-
import {
|
5
|
+
import gql from 'graphql-tag'
|
6
|
+
import { css, html, LitElement, nothing } from 'lit'
|
7
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
5
8
|
|
9
|
+
import { client } from '@operato/graphql'
|
6
10
|
import { i18next, localize } from '@operato/i18n'
|
7
11
|
import { ScrollbarStyles } from '@operato/styles'
|
12
|
+
import { GhostPrint } from '@operato/ghost-print'
|
8
13
|
|
9
14
|
@customElement('data-ooc-view')
|
10
15
|
export class DataOocView extends localize(i18next)(LitElement) {
|
@@ -12,67 +17,219 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
12
17
|
ScrollbarStyles,
|
13
18
|
css`
|
14
19
|
:host {
|
15
|
-
display:
|
16
|
-
|
17
|
-
|
20
|
+
display: block;
|
21
|
+
position: relative;
|
18
22
|
background-color: #fff;
|
19
|
-
}
|
20
23
|
|
21
|
-
div[content] {
|
22
|
-
flex: 1;
|
23
|
-
|
24
|
-
display: flex;
|
25
24
|
overflow: auto;
|
26
25
|
}
|
27
26
|
|
28
27
|
ox-data-ooc-brief-view {
|
29
|
-
flex: 1;
|
30
28
|
padding: var(--padding-wide);
|
31
|
-
overflow: auto;
|
32
29
|
}
|
33
30
|
|
34
|
-
|
35
|
-
|
36
|
-
flex-direction: column;
|
37
|
-
|
38
|
-
padding: var(--padding-wide);
|
31
|
+
activity-thread-timeline {
|
32
|
+
margin: var(--margin-default);
|
39
33
|
}
|
40
34
|
|
41
|
-
|
42
|
-
|
35
|
+
mwc-fab {
|
36
|
+
position: fixed;
|
37
|
+
bottom: 15px;
|
38
|
+
right: 16px;
|
39
|
+
text-decoration: auto;
|
40
|
+
opacity: 0.5;
|
43
41
|
}
|
44
42
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
textarea {
|
50
|
-
border: var(--input-field-border);
|
51
|
-
border-radius: var(--input-border-radius);
|
52
|
-
padding: var(--input-field-padding);
|
53
|
-
font: var(--input-field-font);
|
54
|
-
}
|
55
|
-
|
56
|
-
.button-container {
|
57
|
-
display: flex;
|
58
|
-
margin-left: auto;
|
59
|
-
padding: var(--padding-default);
|
43
|
+
@media print {
|
44
|
+
mwc-fab {
|
45
|
+
display: none;
|
46
|
+
}
|
60
47
|
}
|
61
48
|
`
|
62
49
|
]
|
63
50
|
|
64
|
-
@property({
|
51
|
+
@property({
|
52
|
+
type: String,
|
53
|
+
attribute: 'data-ooc-id'
|
54
|
+
})
|
55
|
+
dataOocId?: string
|
65
56
|
|
66
|
-
@
|
67
|
-
|
57
|
+
@state() dataOoc?: any
|
58
|
+
|
59
|
+
private printHandler = this.handlePrint.bind(this)
|
68
60
|
|
69
61
|
render() {
|
70
|
-
|
62
|
+
if (!this.dataOoc) {
|
63
|
+
return nothing
|
64
|
+
}
|
65
|
+
|
66
|
+
const reviewActivityThread = this.dataOoc?.reviewActivityInstance?.activityThreads?.[0]
|
67
|
+
const resolveActivityThread = this.dataOoc?.resolveActivityInstance?.activityThreads?.[0]
|
71
68
|
|
72
69
|
return html`
|
73
|
-
<
|
74
|
-
|
75
|
-
|
70
|
+
<ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
|
71
|
+
${reviewActivityThread
|
72
|
+
? html`
|
73
|
+
<activity-thread-timeline
|
74
|
+
subtitle=${String(i18next.t('label.ooc review timeline'))}
|
75
|
+
.activityThread=${reviewActivityThread}
|
76
|
+
short-form
|
77
|
+
></activity-thread-timeline>
|
78
|
+
`
|
79
|
+
: nothing}
|
80
|
+
${resolveActivityThread
|
81
|
+
? html`
|
82
|
+
<activity-thread-timeline
|
83
|
+
subtitle=${String(i18next.t('label.ooc resolve timeline'))}
|
84
|
+
.activityThread=${resolveActivityThread}
|
85
|
+
short-form
|
86
|
+
></activity-thread-timeline>
|
87
|
+
`
|
88
|
+
: nothing}
|
89
|
+
|
90
|
+
<mwc-fab
|
91
|
+
icon="print"
|
92
|
+
title="print"
|
93
|
+
@click=${() =>
|
94
|
+
GhostPrint.print({
|
95
|
+
src: `./data-ooc/${this.dataOoc.id}`
|
96
|
+
})}
|
97
|
+
>print</mwc-fab
|
98
|
+
>
|
76
99
|
`
|
77
100
|
}
|
101
|
+
|
102
|
+
updated(changes) {
|
103
|
+
if (changes.has('dataOocId')) {
|
104
|
+
this.fetchDataOoc()
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
async fetchDataOoc() {
|
109
|
+
const id = this.dataOocId
|
110
|
+
|
111
|
+
const response = await client.query({
|
112
|
+
query: gql`
|
113
|
+
query ($id: String!) {
|
114
|
+
dataOoc(id: $id) {
|
115
|
+
id
|
116
|
+
name
|
117
|
+
description
|
118
|
+
useCase
|
119
|
+
dataSet {
|
120
|
+
id
|
121
|
+
name
|
122
|
+
}
|
123
|
+
key01
|
124
|
+
key02
|
125
|
+
key03
|
126
|
+
key04
|
127
|
+
key05
|
128
|
+
partitionKeys
|
129
|
+
dataItems {
|
130
|
+
name
|
131
|
+
description
|
132
|
+
active
|
133
|
+
hidden
|
134
|
+
tag
|
135
|
+
group
|
136
|
+
type
|
137
|
+
unit
|
138
|
+
options
|
139
|
+
quota
|
140
|
+
spec
|
141
|
+
stat
|
142
|
+
}
|
143
|
+
data
|
144
|
+
rawData
|
145
|
+
judgment
|
146
|
+
ooc
|
147
|
+
oos
|
148
|
+
state
|
149
|
+
history
|
150
|
+
workDate
|
151
|
+
workShift
|
152
|
+
correctiveInstruction
|
153
|
+
correctiveAction
|
154
|
+
reviewedAt
|
155
|
+
reviewer {
|
156
|
+
id
|
157
|
+
name
|
158
|
+
}
|
159
|
+
correctedAt
|
160
|
+
corrector {
|
161
|
+
id
|
162
|
+
name
|
163
|
+
}
|
164
|
+
updater {
|
165
|
+
id
|
166
|
+
name
|
167
|
+
}
|
168
|
+
updatedAt
|
169
|
+
collectedAt
|
170
|
+
reviewActivityInstance {
|
171
|
+
...ActivityInstanceFragment
|
172
|
+
}
|
173
|
+
resolveActivityInstance {
|
174
|
+
...ActivityInstanceFragment
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
fragment ActivityInstanceFragment on ActivityInstance {
|
180
|
+
activityThreads {
|
181
|
+
assignee {
|
182
|
+
name
|
183
|
+
}
|
184
|
+
output
|
185
|
+
activityApprovals {
|
186
|
+
judgment
|
187
|
+
approver {
|
188
|
+
name
|
189
|
+
}
|
190
|
+
comment
|
191
|
+
createdAt
|
192
|
+
updatedAt
|
193
|
+
terminatedAt
|
194
|
+
}
|
195
|
+
activityThreadHistories {
|
196
|
+
transaction
|
197
|
+
reason
|
198
|
+
updater {
|
199
|
+
name
|
200
|
+
}
|
201
|
+
updatedAt
|
202
|
+
state
|
203
|
+
output
|
204
|
+
}
|
205
|
+
}
|
206
|
+
}
|
207
|
+
`,
|
208
|
+
variables: {
|
209
|
+
id
|
210
|
+
}
|
211
|
+
})
|
212
|
+
|
213
|
+
this.dataOoc = response.data.dataOoc
|
214
|
+
}
|
215
|
+
|
216
|
+
handlePrint(event) {
|
217
|
+
if ((event.ctrlKey || event.metaKey) && event.key === 'p') {
|
218
|
+
event.preventDefault()
|
219
|
+
|
220
|
+
GhostPrint.print({
|
221
|
+
src: `./data-ooc/${this.dataOoc.id}`
|
222
|
+
})
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
connectedCallback(): void {
|
227
|
+
super.connectedCallback()
|
228
|
+
window.addEventListener('keydown', this.printHandler)
|
229
|
+
}
|
230
|
+
|
231
|
+
disconnectedCallback(): void {
|
232
|
+
super.disconnectedCallback()
|
233
|
+
window.removeEventListener('keydown', this.printHandler)
|
234
|
+
}
|
78
235
|
}
|