@things-factory/dataset 9.0.0-beta.45 → 9.0.0-beta.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/activities/activity-data-collect-edit.d.ts +1 -1
- package/dist-client/activities/activity-data-collect-edit.js +18 -34
- package/dist-client/activities/activity-data-collect-edit.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 +7 -12
- package/dist-client/activities/activity-data-review-edit.js.map +1 -1
- package/dist-client/activities/activity-data-review-view.js +5 -8
- package/dist-client/activities/activity-data-review-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-edit.js +7 -15
- package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
- package/dist-client/components/checklist-entry-form.d.ts +21 -0
- package/dist-client/components/checklist-entry-form.js +108 -0
- package/dist-client/components/checklist-entry-form.js.map +1 -0
- package/dist-client/components/data-entry-form.d.ts +0 -6
- package/dist-client/components/data-entry-form.js +1 -51
- package/dist-client/components/data-entry-form.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.d.ts +1 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js +9 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +2 -2
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-view.d.ts +1 -1
- package/dist-client/pages/data-sample/data-sample-view.js +6 -10
- package/dist-client/pages/data-sample/data-sample-view.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 +11 -0
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/route.js +0 -3
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/dist-client/pages/data-entry/checklist-entry-page.d.ts +0 -21
- package/dist-client/pages/data-entry/checklist-entry-page.js +0 -209
- package/dist-client/pages/data-entry/checklist-entry-page.js.map +0 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/dataset",
|
3
|
-
"version": "9.0.0-beta.
|
3
|
+
"version": "9.0.0-beta.48",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "dist-client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -40,21 +40,21 @@
|
|
40
40
|
"@operato/shell": "^9.0.0-beta",
|
41
41
|
"@operato/styles": "^9.0.0-beta",
|
42
42
|
"@operato/utils": "^9.0.0-beta",
|
43
|
-
"@things-factory/auth-base": "^9.0.0-beta.
|
44
|
-
"@things-factory/aws-base": "^9.0.0-beta.
|
45
|
-
"@things-factory/board-service": "^9.0.0-beta.
|
43
|
+
"@things-factory/auth-base": "^9.0.0-beta.47",
|
44
|
+
"@things-factory/aws-base": "^9.0.0-beta.47",
|
45
|
+
"@things-factory/board-service": "^9.0.0-beta.48",
|
46
46
|
"@things-factory/env": "^9.0.0-beta.38",
|
47
|
-
"@things-factory/integration-base": "^9.0.0-beta.
|
48
|
-
"@things-factory/organization": "^9.0.0-beta.
|
49
|
-
"@things-factory/personalization": "^9.0.0-beta.
|
50
|
-
"@things-factory/scheduler-client": "^9.0.0-beta.
|
51
|
-
"@things-factory/shell": "^9.0.0-beta.
|
52
|
-
"@things-factory/work-shift": "^9.0.0-beta.
|
53
|
-
"@things-factory/worklist": "^9.0.0-beta.
|
47
|
+
"@things-factory/integration-base": "^9.0.0-beta.48",
|
48
|
+
"@things-factory/organization": "^9.0.0-beta.47",
|
49
|
+
"@things-factory/personalization": "^9.0.0-beta.47",
|
50
|
+
"@things-factory/scheduler-client": "^9.0.0-beta.47",
|
51
|
+
"@things-factory/shell": "^9.0.0-beta.47",
|
52
|
+
"@things-factory/work-shift": "^9.0.0-beta.47",
|
53
|
+
"@things-factory/worklist": "^9.0.0-beta.48",
|
54
54
|
"cron-parser": "^4.3.0",
|
55
55
|
"moment-timezone": "^0.5.45",
|
56
56
|
"simple-statistics": "^7.8.3",
|
57
57
|
"statistics": "^3.3.0"
|
58
58
|
},
|
59
|
-
"gitHead": "
|
59
|
+
"gitHead": "1511282b625093648bc378c071b39cce7a233378"
|
60
60
|
}
|
@@ -1,21 +0,0 @@
|
|
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
|
-
import { PageView } from '@operato/shell';
|
5
|
-
declare const ChecklistEntryPage_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
6
|
-
export declare class ChecklistEntryPage extends ChecklistEntryPage_base {
|
7
|
-
static styles: import("lit").CSSResult[];
|
8
|
-
get context(): {
|
9
|
-
title: string;
|
10
|
-
help: string;
|
11
|
-
toolbar: boolean;
|
12
|
-
};
|
13
|
-
private dataSetId?;
|
14
|
-
private dataSet?;
|
15
|
-
private dataSample?;
|
16
|
-
render(): import("lit-html").TemplateResult<1>;
|
17
|
-
pageUpdated(changes: any, lifecycle: any, before: any): void;
|
18
|
-
fetchDataSet(): Promise<void>;
|
19
|
-
private updateDataItems;
|
20
|
-
}
|
21
|
-
export {};
|
@@ -1,209 +0,0 @@
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
2
|
-
import '@material/web/icon/icon.js';
|
3
|
-
import '@operato/context/ox-context-page-toolbar.js';
|
4
|
-
import '@operato/board/ox-board-viewer.js';
|
5
|
-
import gql from 'graphql-tag';
|
6
|
-
import { css, html } from 'lit';
|
7
|
-
import { customElement, state } from 'lit/decorators.js';
|
8
|
-
import { client } from '@operato/graphql';
|
9
|
-
import { i18next, localize } from '@operato/i18n';
|
10
|
-
import { PageView } from '@operato/shell';
|
11
|
-
import { ScrollbarStyles } from '@operato/styles';
|
12
|
-
let ChecklistEntryPage = class ChecklistEntryPage extends localize(i18next)(PageView) {
|
13
|
-
get context() {
|
14
|
-
return {
|
15
|
-
title: i18next.t('title.checklist entry page'),
|
16
|
-
help: 'dataset/checklist-entry-page',
|
17
|
-
toolbar: false
|
18
|
-
};
|
19
|
-
}
|
20
|
-
render() {
|
21
|
-
var _a, _b;
|
22
|
-
return html `
|
23
|
-
<div class="checklist">
|
24
|
-
<table>
|
25
|
-
<thead>
|
26
|
-
<tr>
|
27
|
-
<th>주기</th>
|
28
|
-
<th>관리</th>
|
29
|
-
<th>점검 내용</th>
|
30
|
-
<th>기록</th>
|
31
|
-
</tr>
|
32
|
-
</thead>
|
33
|
-
<tbody>
|
34
|
-
<tr>
|
35
|
-
<td rowspan="3">일일 (작업전)</td>
|
36
|
-
<td rowspan="3">개인 위생</td>
|
37
|
-
<td>위생복장과 외출복장이 구분하여 보관되고 있는가?</td>
|
38
|
-
<td><input type="checkbox" name="check1" /></td>
|
39
|
-
</tr>
|
40
|
-
<tr>
|
41
|
-
<td>
|
42
|
-
종사자의 건강상태가 양호하고 개인장신구 등을 소지하지 않으며, 청결한 위생복장을 착용하고 작업하고
|
43
|
-
있는가?
|
44
|
-
</td>
|
45
|
-
<td><input type="checkbox" name="check2" /></td>
|
46
|
-
</tr>
|
47
|
-
<tr>
|
48
|
-
<td>위생설비(손세척기 등) 중 이상이 있는 것이 없으며, 종사자는 위생처리를 하고 입실하는가?</td>
|
49
|
-
<td><input type="checkbox" name="check3" /></td>
|
50
|
-
</tr>
|
51
|
-
<tr>
|
52
|
-
<td rowspan="2">일일 (작업전)</td>
|
53
|
-
<td rowspan="2">방충 방서</td>
|
54
|
-
<td>작업장은 밀폐가 잘 이루어지고 있으며, 방충시설(방충망 등)에는 이상이 없는가?</td>
|
55
|
-
<td><input type="checkbox" name="check4" /></td>
|
56
|
-
</tr>
|
57
|
-
<tr>
|
58
|
-
<td>파손되거나 고장 난 제조설비가 없는가?</td>
|
59
|
-
<td><input type="checkbox" name="check5" /></td>
|
60
|
-
</tr>
|
61
|
-
<tr>
|
62
|
-
<td rowspan="3">일일 (작업중)</td>
|
63
|
-
<td rowspan="3">공정 관리</td>
|
64
|
-
<td>청결구역작업과 일반구역작업이 분리되어 있으며 오염되지 않도록 관리되고 있는가?</td>
|
65
|
-
<td><input type="checkbox" name="check6" /></td>
|
66
|
-
</tr>
|
67
|
-
<tr>
|
68
|
-
<td>건조 후 냉각 공정이 적절히 관리되고 있는가? (기준: -5℃ ~ 10℃)</td>
|
69
|
-
<td><input type="checkbox" name="check7" /></td>
|
70
|
-
</tr>
|
71
|
-
<tr>
|
72
|
-
<td>완제품이 포장 상태가 양호한가?</td>
|
73
|
-
<td><input type="checkbox" name="check8" /></td>
|
74
|
-
</tr>
|
75
|
-
</tbody>
|
76
|
-
</table>
|
77
|
-
</div>
|
78
|
-
<div class="footer">
|
79
|
-
<div filler></div>
|
80
|
-
${!this.dataSample
|
81
|
-
? html `
|
82
|
-
<button @click=${this.updateDataItems.bind(this)} done>
|
83
|
-
<md-icon>save</md-icon>${i18next.t('button.save')}
|
84
|
-
</button>
|
85
|
-
`
|
86
|
-
: html ` <span>${i18next.t('field.collected-at')}: ${(_b = (_a = this.dataSample) === null || _a === void 0 ? void 0 : _a.collectedAt) === null || _b === void 0 ? void 0 : _b.toLocaleString()}</span> `}
|
87
|
-
</div>
|
88
|
-
`;
|
89
|
-
}
|
90
|
-
pageUpdated(changes, lifecycle, before) {
|
91
|
-
if (this.active) {
|
92
|
-
if (this.dataSetId !== lifecycle.resourceId) {
|
93
|
-
this.dataSetId = lifecycle.resourceId;
|
94
|
-
this.fetchDataSet();
|
95
|
-
}
|
96
|
-
}
|
97
|
-
}
|
98
|
-
async fetchDataSet() {
|
99
|
-
if (this.dataSetId) {
|
100
|
-
const response = await client.query({
|
101
|
-
query: gql `
|
102
|
-
query ($id: String!) {
|
103
|
-
dataSet(id: $id) {
|
104
|
-
id
|
105
|
-
name
|
106
|
-
description
|
107
|
-
useCase
|
108
|
-
dataItems {
|
109
|
-
name
|
110
|
-
description
|
111
|
-
active
|
112
|
-
hidden
|
113
|
-
tag
|
114
|
-
group
|
115
|
-
type
|
116
|
-
unit
|
117
|
-
options
|
118
|
-
quota
|
119
|
-
spec
|
120
|
-
stat
|
121
|
-
}
|
122
|
-
}
|
123
|
-
}
|
124
|
-
`,
|
125
|
-
variables: {
|
126
|
-
id: this.dataSetId
|
127
|
-
}
|
128
|
-
});
|
129
|
-
this.dataSet = response.data.dataSet;
|
130
|
-
}
|
131
|
-
}
|
132
|
-
async updateDataItems() {
|
133
|
-
var _a;
|
134
|
-
//gather user entry data from inputs
|
135
|
-
const data = {};
|
136
|
-
const dataSample = {
|
137
|
-
dataSet: {
|
138
|
-
id: this.dataSetId
|
139
|
-
},
|
140
|
-
data
|
141
|
-
};
|
142
|
-
if ((_a = this.dataSample) === null || _a === void 0 ? void 0 : _a.collectedAt) {
|
143
|
-
dataSample.collectedAt = this.dataSample.collectedAt;
|
144
|
-
}
|
145
|
-
const response = await client.mutate({
|
146
|
-
mutation: gql `
|
147
|
-
mutation ($dataSample: NewDataSample!) {
|
148
|
-
createDataSample(dataSample: $dataSample) {
|
149
|
-
id
|
150
|
-
collectedAt
|
151
|
-
}
|
152
|
-
}
|
153
|
-
`,
|
154
|
-
variables: {
|
155
|
-
dataSample
|
156
|
-
},
|
157
|
-
context: {
|
158
|
-
hasUpload: true
|
159
|
-
}
|
160
|
-
});
|
161
|
-
if (!response.errors) {
|
162
|
-
const { id, collectedAt } = response.data.createDataSample;
|
163
|
-
this.dataSample = {
|
164
|
-
id,
|
165
|
-
collectedAt: new Date(collectedAt)
|
166
|
-
};
|
167
|
-
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.data sample created successfully') } }));
|
168
|
-
}
|
169
|
-
}
|
170
|
-
};
|
171
|
-
ChecklistEntryPage.styles = [
|
172
|
-
ScrollbarStyles,
|
173
|
-
css `
|
174
|
-
:host {
|
175
|
-
display: flex;
|
176
|
-
flex-direction: column;
|
177
|
-
|
178
|
-
width: 100%;
|
179
|
-
}
|
180
|
-
|
181
|
-
div.checklist {
|
182
|
-
flex: 1;
|
183
|
-
}
|
184
|
-
|
185
|
-
.footer span {
|
186
|
-
font-size: 0.8em;
|
187
|
-
color: var(--md-sys-color-on-surface);
|
188
|
-
line-height: 1.5;
|
189
|
-
padding: 10px;
|
190
|
-
}
|
191
|
-
`
|
192
|
-
];
|
193
|
-
__decorate([
|
194
|
-
state(),
|
195
|
-
__metadata("design:type", String)
|
196
|
-
], ChecklistEntryPage.prototype, "dataSetId", void 0);
|
197
|
-
__decorate([
|
198
|
-
state(),
|
199
|
-
__metadata("design:type", Object)
|
200
|
-
], ChecklistEntryPage.prototype, "dataSet", void 0);
|
201
|
-
__decorate([
|
202
|
-
state(),
|
203
|
-
__metadata("design:type", Object)
|
204
|
-
], ChecklistEntryPage.prototype, "dataSample", void 0);
|
205
|
-
ChecklistEntryPage = __decorate([
|
206
|
-
customElement('checklist-entry-page')
|
207
|
-
], ChecklistEntryPage);
|
208
|
-
export { ChecklistEntryPage };
|
209
|
-
//# sourceMappingURL=checklist-entry-page.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"checklist-entry-page.js","sourceRoot":"","sources":["../../../client/pages/data-entry/checklist-entry-page.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,6CAA6C,CAAA;AACpD,OAAO,mCAAmC,CAAA;AAE1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAmB,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAA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B,KAAK,EAAE;;mDAA0B;AACjB;IAAhB,KAAK,EAAE;;sDAAoE;AAlCjE,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAmM9B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/context/ox-context-page-toolbar.js'\nimport '@operato/board/ox-board-viewer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { DataSample, DataSet } from '@operato/dataset'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('checklist-entry-page')\nexport class ChecklistEntryPage extends localize(i18next)(PageView) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n width: 100%;\n }\n\n div.checklist {\n flex: 1;\n }\n\n .footer span {\n font-size: 0.8em;\n color: var(--md-sys-color-on-surface);\n line-height: 1.5;\n padding: 10px;\n }\n `\n ]\n\n get context() {\n return {\n title: i18next.t('title.checklist entry page'),\n help: 'dataset/checklist-entry-page',\n toolbar: false\n }\n }\n\n @state() private dataSetId?: string\n @state() private dataSet?: DataSet\n @state() private dataSample?: DataSample | { id: string; collectedAt: Date }\n\n render() {\n return html`\n <div class=\"checklist\">\n <table>\n <thead>\n <tr>\n <th>주기</th>\n <th>관리</th>\n <th>점검 내용</th>\n <th>기록</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td rowspan=\"3\">일일 (작업전)</td>\n <td rowspan=\"3\">개인 위생</td>\n <td>위생복장과 외출복장이 구분하여 보관되고 있는가?</td>\n <td><input type=\"checkbox\" name=\"check1\" /></td>\n </tr>\n <tr>\n <td>\n 종사자의 건강상태가 양호하고 개인장신구 등을 소지하지 않으며, 청결한 위생복장을 착용하고 작업하고\n 있는가?\n </td>\n <td><input type=\"checkbox\" name=\"check2\" /></td>\n </tr>\n <tr>\n <td>위생설비(손세척기 등) 중 이상이 있는 것이 없으며, 종사자는 위생처리를 하고 입실하는가?</td>\n <td><input type=\"checkbox\" name=\"check3\" /></td>\n </tr>\n <tr>\n <td rowspan=\"2\">일일 (작업전)</td>\n <td rowspan=\"2\">방충 방서</td>\n <td>작업장은 밀폐가 잘 이루어지고 있으며, 방충시설(방충망 등)에는 이상이 없는가?</td>\n <td><input type=\"checkbox\" name=\"check4\" /></td>\n </tr>\n <tr>\n <td>파손되거나 고장 난 제조설비가 없는가?</td>\n <td><input type=\"checkbox\" name=\"check5\" /></td>\n </tr>\n <tr>\n <td rowspan=\"3\">일일 (작업중)</td>\n <td rowspan=\"3\">공정 관리</td>\n <td>청결구역작업과 일반구역작업이 분리되어 있으며 오염되지 않도록 관리되고 있는가?</td>\n <td><input type=\"checkbox\" name=\"check6\" /></td>\n </tr>\n <tr>\n <td>건조 후 냉각 공정이 적절히 관리되고 있는가? (기준: -5℃ ~ 10℃)</td>\n <td><input type=\"checkbox\" name=\"check7\" /></td>\n </tr>\n <tr>\n <td>완제품이 포장 상태가 양호한가?</td>\n <td><input type=\"checkbox\" name=\"check8\" /></td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"footer\">\n <div filler></div>\n ${!this.dataSample\n ? html`\n <button @click=${this.updateDataItems.bind(this)} done>\n <md-icon>save</md-icon>${i18next.t('button.save')}\n </button>\n `\n : html` <span>${i18next.t('field.collected-at')}: ${this.dataSample?.collectedAt?.toLocaleString()}</span> `}\n </div>\n `\n }\n\n pageUpdated(changes: any, lifecycle: any, before: any) {\n if (this.active) {\n if (this.dataSetId !== lifecycle.resourceId) {\n this.dataSetId = lifecycle.resourceId\n this.fetchDataSet()\n }\n }\n }\n\n async fetchDataSet() {\n if (this.dataSetId) {\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n dataSet(id: $id) {\n id\n name\n description\n useCase\n dataItems {\n name\n description\n active\n hidden\n tag\n group\n type\n unit\n options\n quota\n spec\n stat\n }\n }\n }\n `,\n variables: {\n id: this.dataSetId\n }\n })\n\n this.dataSet = response.data.dataSet\n }\n }\n\n private async updateDataItems() {\n //gather user entry data from inputs\n const data = {}\n\n const dataSample = {\n dataSet: {\n id: this.dataSetId\n },\n data\n } as any\n\n if (this.dataSample?.collectedAt) {\n dataSample.collectedAt = this.dataSample.collectedAt\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($dataSample: NewDataSample!) {\n createDataSample(dataSample: $dataSample) {\n id\n collectedAt\n }\n }\n `,\n variables: {\n dataSample\n },\n context: {\n hasUpload: true\n }\n })\n\n if (!response.errors) {\n const { id, collectedAt } = response.data.createDataSample\n this.dataSample = {\n id,\n collectedAt: new Date(collectedAt)\n }\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.data sample created successfully') } })\n )\n }\n }\n}\n"]}
|