@operato/dataset 2.0.0-alpha.6 → 2.0.0-alpha.61
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/CHANGELOG.md +360 -0
- package/demo/favicon.ico +0 -0
- package/demo/index.html +338 -0
- package/demo/ox-data-ooc-brief-view-test.html +338 -0
- package/dist/src/grist-editor/ox-grist-editor-data-item-spec.d.ts +1 -1
- package/dist/src/grist-editor/ox-popup-data-item-spec.d.ts +1 -1
- package/dist/src/ox-data-entry-form.js +48 -36
- package/dist/src/ox-data-entry-form.js.map +1 -1
- package/dist/src/ox-data-entry-subgroup-form.d.ts +1 -1
- package/dist/src/ox-data-entry-subgroup-form.js +2 -0
- package/dist/src/ox-data-entry-subgroup-form.js.map +1 -1
- package/dist/src/ox-data-entry-view.d.ts +3 -3
- package/dist/src/ox-data-entry-view.js +12 -2
- package/dist/src/ox-data-entry-view.js.map +1 -1
- package/dist/src/ox-data-item-spec.d.ts +1 -1
- package/dist/src/ox-data-ooc-badge.d.ts +9 -0
- package/dist/src/ox-data-ooc-badge.js +66 -0
- package/dist/src/ox-data-ooc-badge.js.map +1 -0
- package/dist/src/ox-data-ooc-brief-view.d.ts +3 -1
- package/dist/src/ox-data-ooc-brief-view.js +8 -110
- package/dist/src/ox-data-ooc-brief-view.js.map +1 -1
- package/dist/src/ox-data-ooc-correction-part.d.ts +9 -0
- package/dist/src/ox-data-ooc-correction-part.js +99 -0
- package/dist/src/ox-data-ooc-correction-part.js.map +1 -0
- package/dist/src/ox-data-ooc-history.d.ts +10 -0
- package/dist/src/ox-data-ooc-history.js +72 -0
- package/dist/src/ox-data-ooc-history.js.map +1 -0
- package/dist/src/ox-data-ooc-view.d.ts +2 -1
- package/dist/src/ox-data-ooc-view.js +6 -89
- package/dist/src/ox-data-ooc-view.js.map +1 -1
- package/dist/src/ox-data-sample-subgroup-view.d.ts +1 -1
- package/dist/src/ox-data-sample-subgroup-view.js +1 -1
- package/dist/src/ox-data-sample-subgroup-view.js.map +1 -1
- package/dist/src/ox-data-sample-view.d.ts +1 -1
- package/dist/src/ox-data-sample-view.js +47 -30
- package/dist/src/ox-data-sample-view.js.map +1 -1
- package/dist/src/ox-data-summary-view.d.ts +1 -1
- package/dist/src/ox-data-summary-view.js +7 -1
- package/dist/src/ox-data-summary-view.js.map +1 -1
- package/dist/src/types.d.ts +57 -9
- package/dist/src/types.js.map +1 -1
- package/dist/src/usecase/ccp/ox-input-ccp-limits.d.ts +1 -1
- package/dist/src/usecase/qc/ox-input-qc-limits.d.ts +1 -1
- package/dist/src/usecase/spc/index.d.ts +1 -0
- package/dist/src/usecase/spc/index.js +8 -0
- package/dist/src/usecase/spc/index.js.map +1 -0
- package/dist/src/usecase/spc/ox-data-use-case-spc.d.ts +7 -0
- package/dist/src/usecase/spc/ox-data-use-case-spc.js +102 -0
- package/dist/src/usecase/spc/ox-data-use-case-spc.js.map +1 -0
- package/dist/src/usecase/spc/ox-input-spc-limits.d.ts +44 -0
- package/dist/src/usecase/spc/ox-input-spc-limits.js +193 -0
- package/dist/src/usecase/spc/ox-input-spc-limits.js.map +1 -0
- package/dist/src/usecase/spc/ox-property-editor-spc-limits.d.ts +6 -0
- package/dist/src/usecase/spc/ox-property-editor-spc-limits.js +24 -0
- package/dist/src/usecase/spc/ox-property-editor-spc-limits.js.map +1 -0
- package/dist/stories/ox-data-entry-form.stories.js +60 -16
- package/dist/stories/ox-data-entry-form.stories.js.map +1 -1
- package/dist/stories/ox-data-ooc-view.stories.js +2 -0
- package/dist/stories/ox-data-ooc-view.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -23
- package/src/ox-data-entry-form.ts +65 -46
- package/src/ox-data-entry-subgroup-form.ts +2 -0
- package/src/ox-data-entry-view.ts +13 -2
- package/src/ox-data-ooc-badge.ts +64 -0
- package/src/ox-data-ooc-brief-view.ts +9 -120
- package/src/ox-data-ooc-correction-part.ts +107 -0
- package/src/ox-data-ooc-history.ts +74 -0
- package/src/ox-data-ooc-view.ts +6 -91
- package/src/ox-data-sample-subgroup-view.ts +1 -1
- package/src/ox-data-sample-view.ts +47 -30
- package/src/ox-data-summary-view.ts +7 -1
- package/src/types.ts +76 -27
- package/src/usecase/spc/index.ts +10 -0
- package/src/usecase/spc/ox-data-use-case-spc.ts +147 -0
- package/src/usecase/spc/ox-input-spc-limits.ts +182 -0
- package/src/usecase/spc/ox-property-editor-spc-limits.ts +23 -0
- package/stories/ox-data-entry-form.stories.ts +65 -21
- package/stories/ox-data-ooc-view.stories.ts +2 -0
- package/themes/grist-theme.css +1 -1
- package/translations/en.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +142 -70
- package/translations/zh.json +146 -75
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import '@operato/input/ox-input-file.js'
|
|
2
|
+
import '@material/mwc-icon'
|
|
3
|
+
|
|
4
|
+
import { css, html, LitElement, nothing } from 'lit'
|
|
5
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
6
|
+
|
|
7
|
+
import { i18next } from '@operato/i18n'
|
|
8
|
+
|
|
9
|
+
import { DataOoc } from './types.js'
|
|
10
|
+
|
|
11
|
+
@customElement('ox-data-ooc-correction-part')
|
|
12
|
+
export class OxDataOocCorrectionPart extends LitElement {
|
|
13
|
+
static styles = css`
|
|
14
|
+
:host {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
|
|
18
|
+
position: relative;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
h3 {
|
|
22
|
+
margin: var(--title-margin);
|
|
23
|
+
padding-top: 12px;
|
|
24
|
+
font: var(--title-font);
|
|
25
|
+
color: var(--title-text-color);
|
|
26
|
+
font-size: 20px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
mwc-icon {
|
|
30
|
+
font-size: 16px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[field-state] {
|
|
34
|
+
border-radius: 2px;
|
|
35
|
+
background-color: var(--primary-color);
|
|
36
|
+
margin-left: var(--margin-default);
|
|
37
|
+
padding: 1px 2px;
|
|
38
|
+
font-size: 0.7rem;
|
|
39
|
+
color: var(--theme-white-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
p {
|
|
43
|
+
background-color: var(--theme-white-color);
|
|
44
|
+
box-shadow: var(--box-shadow);
|
|
45
|
+
border-radius: var(--border-radius);
|
|
46
|
+
margin: var(--page-description-margin);
|
|
47
|
+
padding: var(--padding-default);
|
|
48
|
+
font: var(--page-description-font);
|
|
49
|
+
color: var(--secondary-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
mwc-icon {
|
|
53
|
+
position: relative;
|
|
54
|
+
top: 3px;
|
|
55
|
+
margin: 0 2px 0 10px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[field-info] {
|
|
59
|
+
opacity: 0.7;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
strong {
|
|
63
|
+
display: block;
|
|
64
|
+
font-weight: bold;
|
|
65
|
+
font-size: 0.9rem;
|
|
66
|
+
}
|
|
67
|
+
`
|
|
68
|
+
|
|
69
|
+
@property({ type: Object }) dataOoc?: DataOoc
|
|
70
|
+
|
|
71
|
+
render() {
|
|
72
|
+
const {
|
|
73
|
+
correctiveInstruction = '',
|
|
74
|
+
correctiveAction = '',
|
|
75
|
+
reviewer,
|
|
76
|
+
reviewedAt,
|
|
77
|
+
corrector,
|
|
78
|
+
correctedAt
|
|
79
|
+
} = this.dataOoc || {}
|
|
80
|
+
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
|
|
81
|
+
|
|
82
|
+
return html`
|
|
83
|
+
${reviewer
|
|
84
|
+
? html`
|
|
85
|
+
<h3>${i18next.t('label.corrective instruction')}</h3>
|
|
86
|
+
<p>
|
|
87
|
+
<span field-info
|
|
88
|
+
>${formatter.format(new Date(reviewedAt!))} <mwc-icon>account_circle</mwc-icon>${reviewer.name}</span
|
|
89
|
+
>
|
|
90
|
+
<strong>${correctiveInstruction}</strong>
|
|
91
|
+
</p>
|
|
92
|
+
`
|
|
93
|
+
: nothing}
|
|
94
|
+
${corrector
|
|
95
|
+
? html`
|
|
96
|
+
<h3>${i18next.t('label.corrective action')}</h3>
|
|
97
|
+
<p>
|
|
98
|
+
<span field-info
|
|
99
|
+
>${formatter.format(new Date(correctedAt!))} <mwc-icon>account_circle</mwc-icon>${corrector.name}</span
|
|
100
|
+
>
|
|
101
|
+
<strong>${correctiveAction}</strong>
|
|
102
|
+
</p>
|
|
103
|
+
`
|
|
104
|
+
: nothing}
|
|
105
|
+
`
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import '@operato/input/ox-input-file.js'
|
|
2
|
+
import './ox-data-sample-view'
|
|
3
|
+
import '@material/mwc-icon'
|
|
4
|
+
|
|
5
|
+
import { css, html, LitElement } from 'lit'
|
|
6
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
7
|
+
|
|
8
|
+
import { DataOoc } from './types.js'
|
|
9
|
+
|
|
10
|
+
@customElement('ox-data-ooc-history')
|
|
11
|
+
export class OxDataOocHistory extends LitElement {
|
|
12
|
+
static styles = css`
|
|
13
|
+
mwc-icon {
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[field-state] {
|
|
18
|
+
border-radius: 2px;
|
|
19
|
+
background-color: var(--primary-color);
|
|
20
|
+
margin-left: var(--margin-default);
|
|
21
|
+
padding: 1px 2px;
|
|
22
|
+
font-size: 0.7rem;
|
|
23
|
+
color: var(--theme-white-color);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
p {
|
|
27
|
+
background-color: var(--theme-white-color);
|
|
28
|
+
box-shadow: var(--box-shadow);
|
|
29
|
+
border-radius: var(--border-radius);
|
|
30
|
+
margin: var(--page-description-margin);
|
|
31
|
+
padding: var(--padding-default);
|
|
32
|
+
font: var(--page-description-font);
|
|
33
|
+
color: var(--secondary-color);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
mwc-icon {
|
|
37
|
+
position: relative;
|
|
38
|
+
top: 3px;
|
|
39
|
+
margin: 0 2px 0 10px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[field-info] {
|
|
43
|
+
opacity: 0.7;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
strong {
|
|
47
|
+
display: block;
|
|
48
|
+
font-weight: bold;
|
|
49
|
+
font-size: 0.9rem;
|
|
50
|
+
}
|
|
51
|
+
`
|
|
52
|
+
|
|
53
|
+
@property({ type: Object }) dataOoc?: DataOoc
|
|
54
|
+
|
|
55
|
+
render() {
|
|
56
|
+
const { history = [] } = this.dataOoc || {}
|
|
57
|
+
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
|
|
58
|
+
|
|
59
|
+
return html`
|
|
60
|
+
${history.map(
|
|
61
|
+
({ user, state, comment, timestamp }) => html`
|
|
62
|
+
<p page-history>
|
|
63
|
+
<!--상태에 따라 추가로 danger, complete를 어트리뷰트로 추가시 배경컬러 변경되도록 해두었습니다-->
|
|
64
|
+
<span field-info
|
|
65
|
+
>${formatter.format(new Date(timestamp))} <mwc-icon>account_circle</mwc-icon>${user.name}</span
|
|
66
|
+
>
|
|
67
|
+
<span field-state>${state}</span>
|
|
68
|
+
<strong>${comment}</strong>
|
|
69
|
+
</p>
|
|
70
|
+
`
|
|
71
|
+
)}
|
|
72
|
+
`
|
|
73
|
+
}
|
|
74
|
+
}
|
package/src/ox-data-ooc-view.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '@operato/input/ox-input-file.js'
|
|
2
2
|
import './ox-data-sample-view'
|
|
3
|
+
import './ox-data-ooc-history'
|
|
3
4
|
import '@material/mwc-icon'
|
|
4
5
|
|
|
5
6
|
import { css, html, LitElement } from 'lit'
|
|
@@ -18,88 +19,17 @@ export class OxDataOocView extends LitElement {
|
|
|
18
19
|
:host {
|
|
19
20
|
display: flex;
|
|
20
21
|
flex-direction: column;
|
|
21
|
-
background-color: var(--main-section-background-color);
|
|
22
22
|
|
|
23
23
|
position: relative;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
margin: var(--title-margin);
|
|
28
|
-
padding-top: 12px;
|
|
29
|
-
font: var(--title-font);
|
|
30
|
-
color: var(--title-text-color);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
h3[state] {
|
|
26
|
+
ox-data-ooc-badge {
|
|
34
27
|
position: absolute;
|
|
28
|
+
|
|
35
29
|
margin: 0;
|
|
36
30
|
padding: 0;
|
|
37
31
|
right: 10px;
|
|
38
32
|
width: 90px;
|
|
39
|
-
text-align: center;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
mwc-icon {
|
|
43
|
-
font-size: 16px;
|
|
44
|
-
}
|
|
45
|
-
[state] mwc-icon {
|
|
46
|
-
font-size: 80px;
|
|
47
|
-
opacity: 0.4;
|
|
48
|
-
color: var(--primary-background-color);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
[state] div {
|
|
52
|
-
position: absolute;
|
|
53
|
-
top: 22px;
|
|
54
|
-
left: 0;
|
|
55
|
-
right: 0;
|
|
56
|
-
font-size: 10px;
|
|
57
|
-
color: var(--theme-white-color);
|
|
58
|
-
}
|
|
59
|
-
[state] [field-state] {
|
|
60
|
-
display: block;
|
|
61
|
-
border-radius: 4px;
|
|
62
|
-
background-color: var(--primary-color);
|
|
63
|
-
box-shadow: var(--box-shadow);
|
|
64
|
-
margin-top: var(--margin-narrow);
|
|
65
|
-
padding: 1px 3px;
|
|
66
|
-
font-size: 0.8rem;
|
|
67
|
-
}
|
|
68
|
-
[danger] [field-state] {
|
|
69
|
-
background-color: var(--status-danger-color);
|
|
70
|
-
}
|
|
71
|
-
[complete] [field-state] {
|
|
72
|
-
background-color: var(--status-info-color);
|
|
73
|
-
}
|
|
74
|
-
[page-history] [field-state] {
|
|
75
|
-
border-radius: 2px;
|
|
76
|
-
background-color: var(--primary-color);
|
|
77
|
-
margin-left: var(--margin-default);
|
|
78
|
-
padding: 1px 2px;
|
|
79
|
-
font-size: 0.7rem;
|
|
80
|
-
color: var(--theme-white-color);
|
|
81
|
-
}
|
|
82
|
-
[page-history] {
|
|
83
|
-
background-color: var(--theme-white-color);
|
|
84
|
-
box-shadow: var(--box-shadow);
|
|
85
|
-
border-radius: var(--border-radius);
|
|
86
|
-
margin: var(--page-description-margin);
|
|
87
|
-
padding: var(--padding-default);
|
|
88
|
-
font: var(--page-description-font);
|
|
89
|
-
color: var(--secondary-color);
|
|
90
|
-
}
|
|
91
|
-
[page-history] mwc-icon {
|
|
92
|
-
position: relative;
|
|
93
|
-
top: 3px;
|
|
94
|
-
margin: 0 2px 0 10px;
|
|
95
|
-
}
|
|
96
|
-
[field-info] {
|
|
97
|
-
opacity: 0.7;
|
|
98
|
-
}
|
|
99
|
-
[page-history] strong {
|
|
100
|
-
display: block;
|
|
101
|
-
font-weight: bold;
|
|
102
|
-
font-size: 0.9rem;
|
|
103
33
|
}
|
|
104
34
|
`
|
|
105
35
|
|
|
@@ -107,30 +37,15 @@ export class OxDataOocView extends LitElement {
|
|
|
107
37
|
@property({ type: Object }) dataOoc?: DataOoc
|
|
108
38
|
|
|
109
39
|
render() {
|
|
110
|
-
const {
|
|
111
|
-
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
|
|
40
|
+
const { state } = this.dataOoc || {}
|
|
112
41
|
|
|
113
42
|
return html`
|
|
114
43
|
<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>
|
|
115
44
|
|
|
116
|
-
<
|
|
117
|
-
<mwc-icon>shield</mwc-icon>
|
|
118
|
-
<div>DATA OOC <span field-state>${state || ''}</span></div>
|
|
119
|
-
</h3>
|
|
45
|
+
<ox-data-ooc-badge .state=${state}></ox-data-ooc-badge>
|
|
120
46
|
|
|
121
47
|
<h3>${i18next.t('title.history')}</h3>
|
|
122
|
-
|
|
123
|
-
({ user, state, comment, timestamp }) => html`
|
|
124
|
-
<p page-history>
|
|
125
|
-
<!--상태에 따라 추가로 danger, complete를 어트리뷰트로 추가시 배경컬러 변경되도록 해두었습니다-->
|
|
126
|
-
<span field-info
|
|
127
|
-
>${formatter.format(new Date(timestamp))} <mwc-icon>account_circle</mwc-icon>${user.name}</span
|
|
128
|
-
>
|
|
129
|
-
<span field-state>${state}</span>
|
|
130
|
-
<strong>${comment}</strong>
|
|
131
|
-
</p>
|
|
132
|
-
`
|
|
133
|
-
)}
|
|
48
|
+
<ox-data-ooc-history .dataOoc=${this.dataOoc}></ox-data-ooc-history>
|
|
134
49
|
`
|
|
135
50
|
}
|
|
136
51
|
}
|
|
@@ -39,6 +39,7 @@ export class OxDataSampleSubgroupView extends LitElement {
|
|
|
39
39
|
font-weight: bold;
|
|
40
40
|
color: var(--th-color);
|
|
41
41
|
text-align: center;
|
|
42
|
+
white-space: nowrap;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
th.label,
|
|
@@ -75,7 +76,6 @@ export class OxDataSampleSubgroupView extends LitElement {
|
|
|
75
76
|
|
|
76
77
|
pre {
|
|
77
78
|
tab-size: 2;
|
|
78
|
-
text-wrap: wrap;
|
|
79
79
|
text-align: left;
|
|
80
80
|
}
|
|
81
81
|
`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@operato/input/ox-input-file.js'
|
|
2
2
|
import './ox-data-sample-subgroup-view.js'
|
|
3
3
|
|
|
4
|
-
import { css, html, LitElement } from 'lit'
|
|
4
|
+
import { css, html, LitElement, nothing } from 'lit'
|
|
5
5
|
import { customElement, property } from 'lit/decorators.js'
|
|
6
6
|
|
|
7
7
|
import { i18next } from '@operato/i18n'
|
|
@@ -58,6 +58,7 @@ export class OxDataSampleView extends LitElement {
|
|
|
58
58
|
font: var(--th-font);
|
|
59
59
|
color: var(--th-color);
|
|
60
60
|
text-align: left;
|
|
61
|
+
white-space: nowrap;
|
|
61
62
|
}
|
|
62
63
|
th[item] {
|
|
63
64
|
min-width: 100px;
|
|
@@ -94,6 +95,18 @@ export class OxDataSampleView extends LitElement {
|
|
|
94
95
|
pre {
|
|
95
96
|
tab-size: 2;
|
|
96
97
|
}
|
|
98
|
+
|
|
99
|
+
@media print {
|
|
100
|
+
:host {
|
|
101
|
+
display: block;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media screen and (max-width: 480px) {
|
|
106
|
+
th {
|
|
107
|
+
min-width: 50px;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
97
110
|
`
|
|
98
111
|
|
|
99
112
|
@property({ type: Object }) dataSample?: DataSample
|
|
@@ -128,36 +141,40 @@ export class OxDataSampleView extends LitElement {
|
|
|
128
141
|
</p>
|
|
129
142
|
|
|
130
143
|
<form>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
144
|
+
${nonGroupDataItems.length > 0
|
|
145
|
+
? html`
|
|
146
|
+
<table>
|
|
147
|
+
<tr>
|
|
148
|
+
<th item>${i18next.t('field.item')}</th>
|
|
149
|
+
<th>${i18next.t('field.description')}</th>
|
|
150
|
+
<th>${i18next.t('field.finalizing-function')}</th>
|
|
151
|
+
<th>${i18next.t('field.unit')}</th>
|
|
152
|
+
<th value>${i18next.t('field.value')}</th>
|
|
153
|
+
<th>${i18next.t('field.spec')}</th>
|
|
154
|
+
<th>${i18next.t('field.ooc')}</th>
|
|
155
|
+
<th>${i18next.t('field.oos')}</th>
|
|
156
|
+
</tr>
|
|
157
|
+
${nonGroupDataItems.map(dataItem => {
|
|
158
|
+
const { name = '', tag = '', description = '', stat, unit = '', spec = {}, type } = dataItem
|
|
159
|
+
const value = data[tag]
|
|
160
|
+
const { ooc, oos } = judgment?.[tag] || {}
|
|
161
|
+
|
|
162
|
+
return html`
|
|
163
|
+
<tr ?ooc=${ooc} ?oos=${oos}>
|
|
164
|
+
<td name>${name}</td>
|
|
165
|
+
<td>${description}</td>
|
|
166
|
+
<td>${stat}</td>
|
|
167
|
+
<td>${unit}</td>
|
|
168
|
+
<td>${this.buildValue(type, value)}</td>
|
|
169
|
+
<td><pre>${this.buildSpec(useCaseNames, spec)}</pre></td>
|
|
170
|
+
<td>${ooc ? html`<mwc-icon>done</mwc-icon>` : ''}</td>
|
|
171
|
+
<td>${oos ? html`<mwc-icon>done</mwc-icon>` : ''}</td>
|
|
172
|
+
</tr>
|
|
173
|
+
`
|
|
174
|
+
})}
|
|
175
|
+
</table>
|
|
158
176
|
`
|
|
159
|
-
}
|
|
160
|
-
</table>
|
|
177
|
+
: nothing}
|
|
161
178
|
${Object.keys(dataItemSubgroups).map(subgroup => {
|
|
162
179
|
return html`
|
|
163
180
|
<ox-data-sample-subgroup-view
|
|
@@ -93,6 +93,12 @@ export class OxDataSummaryView extends LitElement {
|
|
|
93
93
|
pre {
|
|
94
94
|
tab-size: 2;
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
@media screen and (max-width: 480px) {
|
|
98
|
+
th {
|
|
99
|
+
min-width: 50px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
96
102
|
`
|
|
97
103
|
|
|
98
104
|
@property({ type: Object }) dataSummary?: DataSummary
|
|
@@ -116,7 +122,7 @@ export class OxDataSummaryView extends LitElement {
|
|
|
116
122
|
<tr>
|
|
117
123
|
<th item>${i18next.t('field.item')}</th>
|
|
118
124
|
<th>${i18next.t('field.description')}</th>
|
|
119
|
-
<th>${i18next.t('field.
|
|
125
|
+
<th>${i18next.t('field.finalizing-function')}</th>
|
|
120
126
|
<th>${i18next.t('field.unit')}</th>
|
|
121
127
|
<th value>${i18next.t('field.value')}</th>
|
|
122
128
|
<th>${i18next.t('field.spec')}</th>
|
package/src/types.ts
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Represents a selectable option with a text label and a value.
|
|
3
|
+
*/
|
|
4
|
+
export type SelectOption = {
|
|
5
|
+
text: string
|
|
6
|
+
value: string
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* An array of selectable options.
|
|
10
|
+
*/
|
|
2
11
|
export type SelectOptions = SelectOption[]
|
|
12
|
+
/**
|
|
13
|
+
* Defines the options and additional properties for a type.
|
|
14
|
+
*/
|
|
3
15
|
export type TypeOptions = {
|
|
4
16
|
options?: SelectOptions
|
|
5
17
|
[prop: string]: any
|
|
6
18
|
}
|
|
7
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Describes the structure and properties of a data item.
|
|
21
|
+
*/
|
|
8
22
|
export type DataItem = {
|
|
9
23
|
name: string
|
|
10
24
|
description: string
|
|
@@ -24,7 +38,9 @@ export type DataItem = {
|
|
|
24
38
|
}
|
|
25
39
|
}
|
|
26
40
|
}
|
|
27
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Defines the structure of a dataset, including its name, description, type, use case, and data items.
|
|
43
|
+
*/
|
|
28
44
|
export type DataSet = {
|
|
29
45
|
name: string
|
|
30
46
|
description: string
|
|
@@ -32,59 +48,82 @@ export type DataSet = {
|
|
|
32
48
|
useCase: string
|
|
33
49
|
active: boolean
|
|
34
50
|
dataItems: DataItem[]
|
|
35
|
-
spec: {
|
|
51
|
+
spec: {
|
|
52
|
+
[dataItem: string]: {
|
|
53
|
+
[useCase: string]: any
|
|
54
|
+
}
|
|
55
|
+
}
|
|
36
56
|
}
|
|
37
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Describes the definition of a data specification, including its type, label, name, and optional properties.
|
|
59
|
+
*/
|
|
38
60
|
export type DataSpecDefinition = {
|
|
39
61
|
type: string
|
|
40
62
|
label: string
|
|
41
63
|
name: string
|
|
42
|
-
property?: {
|
|
64
|
+
property?: {
|
|
65
|
+
[option: string]: any
|
|
66
|
+
}
|
|
43
67
|
}
|
|
44
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Describes a use case definition, including its name, description, help text, and specifications.
|
|
70
|
+
*/
|
|
45
71
|
export type UseCaseDefinition = {
|
|
46
72
|
name: string
|
|
47
73
|
description: string
|
|
48
74
|
help: string
|
|
49
75
|
specs: DataSpecDefinition[]
|
|
50
76
|
}
|
|
51
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Represents the limits for a data specification.
|
|
79
|
+
*/
|
|
52
80
|
export type DataSpecLimit = {
|
|
53
81
|
[limit: string]: number | string | string[] | boolean
|
|
54
82
|
}
|
|
55
|
-
|
|
83
|
+
/**
|
|
84
|
+
* A set of data specification limits, keyed by use case.
|
|
85
|
+
*/
|
|
56
86
|
export type DataSpecLimitSet = {
|
|
57
87
|
[useCase: string]: DataSpecLimit
|
|
58
88
|
}
|
|
59
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Represents a collection of data, keyed by a tag.
|
|
91
|
+
*/
|
|
60
92
|
export type DataCollection = {
|
|
61
93
|
[tag: string]: any
|
|
62
94
|
}
|
|
63
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Represents a judgment on data, indicating if it is out of control or out of specification.
|
|
97
|
+
*/
|
|
64
98
|
export type Judgment = {
|
|
65
99
|
[tag: string]: {
|
|
66
100
|
ooc: boolean
|
|
67
101
|
oos: boolean
|
|
68
102
|
}
|
|
69
103
|
}
|
|
70
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Describes a data sample, including its name, description, use case, and associated data and judgments.
|
|
106
|
+
*/
|
|
71
107
|
export type DataSample = {
|
|
72
|
-
name
|
|
73
|
-
description
|
|
74
|
-
useCase
|
|
108
|
+
name?: string
|
|
109
|
+
description?: string
|
|
110
|
+
useCase?: string
|
|
75
111
|
data?: DataCollection
|
|
76
112
|
judgment?: Judgment
|
|
77
113
|
dataItems?: DataItem[]
|
|
78
|
-
quota
|
|
79
|
-
workDate
|
|
80
|
-
workShift
|
|
81
|
-
collectedAt
|
|
114
|
+
quota?: number
|
|
115
|
+
workDate?: string
|
|
116
|
+
workShift?: string
|
|
117
|
+
collectedAt?: Date
|
|
118
|
+
reviewActivityInstance?: any
|
|
119
|
+
dataOoc?: DataOoc
|
|
82
120
|
}
|
|
83
|
-
|
|
84
121
|
export type DataOocState = 'ISSUED' | 'REVIEWED' | 'CORRECTED'
|
|
85
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Extends DataSample with additional fields specific to an out of control state, including state, corrective actions, and review history.
|
|
124
|
+
*/
|
|
86
125
|
export type DataOoc = DataSample & {
|
|
87
|
-
state
|
|
126
|
+
state?: DataOocState
|
|
88
127
|
correctiveInstruction?: string
|
|
89
128
|
correctiveAction?: string
|
|
90
129
|
reviewer?: {
|
|
@@ -97,7 +136,7 @@ export type DataOoc = DataSample & {
|
|
|
97
136
|
name: string
|
|
98
137
|
}
|
|
99
138
|
correctedAt?: Date
|
|
100
|
-
history
|
|
139
|
+
history?: {
|
|
101
140
|
user: {
|
|
102
141
|
id: string
|
|
103
142
|
name: string
|
|
@@ -106,8 +145,11 @@ export type DataOoc = DataSample & {
|
|
|
106
145
|
comment: string
|
|
107
146
|
timestamp: number
|
|
108
147
|
}[]
|
|
148
|
+
resolveActivityInstance?: any
|
|
109
149
|
}
|
|
110
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Describes a summary of data, including its name, description, relevant data items, and key metrics.
|
|
152
|
+
*/
|
|
111
153
|
export type DataSummary = {
|
|
112
154
|
name: string
|
|
113
155
|
description: string
|
|
@@ -123,7 +165,14 @@ export type DataSummary = {
|
|
|
123
165
|
countOoc?: number
|
|
124
166
|
countOos?: number
|
|
125
167
|
useCase?: string
|
|
126
|
-
summary?: {
|
|
168
|
+
summary?: {
|
|
169
|
+
[key: string]: any
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Represents the result of an evaluation, indicating if data is out of specification or out of control.
|
|
174
|
+
*/
|
|
175
|
+
export type EvaluationResult = {
|
|
176
|
+
oos: boolean
|
|
177
|
+
ooc: boolean
|
|
127
178
|
}
|
|
128
|
-
|
|
129
|
-
export type EvaluationResult = { oos: boolean; ooc: boolean }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* Here, only the common module of client and server is imported/exported. Be careful not to use a module dedicated to client or server. */
|
|
2
|
+
|
|
3
|
+
import { OxDataUseCase } from '../ox-data-use-case'
|
|
4
|
+
import { OxDataUseCaseSPC } from './ox-data-use-case-spc'
|
|
5
|
+
|
|
6
|
+
// OxPropertyEditor.register({
|
|
7
|
+
// 'spc-limits': 'ox-property-editor-spc-limits'
|
|
8
|
+
// })
|
|
9
|
+
|
|
10
|
+
OxDataUseCase.registerUseCase('SPC', new OxDataUseCaseSPC())
|