@things-factory/dataset 6.0.27 → 6.0.28
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/assets/images/data-collect.png +0 -0
- package/client/bootstrap.ts +4 -2
- package/client/components/data-collect-activity-view.ts +100 -0
- package/client/components/ooc-resolve-activity-view.ts +174 -0
- package/client/components/{data-ooc-activity-view.ts → ooc-review-activity-view.ts} +16 -16
- package/client/pages/data-ooc/data-ooc-list-page.ts +6 -0
- package/client/pages/data-ooc/data-ooc-view-page.ts +115 -0
- package/client/pages/data-ooc/data-ooc-view.ts +7 -61
- package/client/pages/data-set/data-set-list-page.ts +111 -4
- package/client/route.ts +4 -0
- package/config/config.development.js +30 -30
- package/config/config.production.js +31 -31
- package/dist-client/bootstrap.d.ts +3 -1
- package/dist-client/bootstrap.js +4 -2
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/data-collect-activity-view.d.ts +19 -0
- package/dist-client/components/data-collect-activity-view.js +101 -0
- package/dist-client/components/data-collect-activity-view.js.map +1 -0
- package/dist-client/components/ooc-resolve-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-resolve-activity-view.js +175 -0
- package/dist-client/components/ooc-resolve-activity-view.js.map +1 -0
- package/dist-client/components/ooc-review-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-review-activity-view.js +155 -0
- package/dist-client/components/ooc-review-activity-view.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +6 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-view-page.d.ts +18 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.js +114 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view.d.ts +15 -1
- package/dist-client/pages/data-ooc/data-ooc-view.js +9 -58
- package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -1
- package/dist-client/pages/data-set/data-set-list-page.d.ts +2 -0
- package/dist-client/pages/data-set/data-set-list-page.js +106 -4
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-template/activity-data-collect.js +82 -0
- package/dist-server/controllers/activity-template/activity-data-collect.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js +100 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js +107 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js.map +1 -0
- package/dist-server/controllers/create-data-sample.js +44 -42
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/data-use-case.js +1 -1
- package/dist-server/controllers/data-use-case.js.map +1 -1
- package/dist-server/controllers/index.js +4 -2
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/middlewares/index.js +8 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.js +45 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc-query.js +22 -2
- package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc.js +26 -0
- package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
- package/dist-server/service/data-set/data-set-mutation.js +88 -0
- package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +33 -0
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/service/data-set/data-set-type.js +16 -0
- package/dist-server/service/data-set/data-set-type.js.map +1 -1
- package/dist-server/service/data-set/data-set.js +52 -3
- package/dist-server/service/data-set/data-set.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/dataset/data-ooc.md +5 -4
- package/package.json +10 -8
- package/server/controllers/activity-template/activity-data-collect.ts +84 -0
- package/server/controllers/activity-template/activity-ooc-resolve.ts +114 -0
- package/server/controllers/activity-template/activity-ooc-review.ts +118 -0
- package/server/controllers/create-data-sample.ts +48 -53
- package/server/controllers/data-use-case.ts +1 -1
- package/server/controllers/index.ts +4 -2
- package/server/routes.ts +61 -2
- package/server/service/data-ooc/data-ooc-query.ts +12 -2
- package/server/service/data-ooc/data-ooc.ts +23 -0
- package/server/service/data-set/data-set-mutation.ts +99 -0
- package/server/service/data-set/data-set-query.ts +34 -1
- package/server/service/data-set/data-set-type.ts +14 -0
- package/server/service/data-set/data-set.ts +40 -2
- package/things-factory.config.js +4 -0
- package/translations/en.json +2 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
- package/server/controllers/activity-template/activity-ooc.ts +0 -55
@@ -244,6 +244,24 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
244
244
|
columns: [
|
245
245
|
{ type: 'gutter', gutterName: 'sequence' },
|
246
246
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
247
|
+
{
|
248
|
+
type: 'gutter',
|
249
|
+
gutterName: 'button',
|
250
|
+
icon: record => (!record || !record.name ? '' : record.schedulerHandle ? 'pause' : 'play_arrow'),
|
251
|
+
handlers: {
|
252
|
+
click: (columns, data, column, record, rowIndex) => {
|
253
|
+
if (!record || !record.name) {
|
254
|
+
/* TODO record가 새로 추가된 것이면 리턴하도록 한다. */
|
255
|
+
return
|
256
|
+
}
|
257
|
+
if (record.schedulerHandle) {
|
258
|
+
this.stopDataCollectionSchedule(record)
|
259
|
+
} else {
|
260
|
+
this.startDataCollectionSchedule(record)
|
261
|
+
}
|
262
|
+
}
|
263
|
+
}
|
264
|
+
},
|
247
265
|
{
|
248
266
|
type: 'gutter',
|
249
267
|
gutterName: 'button',
|
@@ -383,7 +401,6 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
383
401
|
queryName: 'dataKeySets'
|
384
402
|
}
|
385
403
|
},
|
386
|
-
sortable: true,
|
387
404
|
filter: false,
|
388
405
|
width: 120
|
389
406
|
},
|
@@ -446,7 +463,6 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
446
463
|
queryName: 'roles'
|
447
464
|
}
|
448
465
|
},
|
449
|
-
sortable: true,
|
450
466
|
filter: false,
|
451
467
|
width: 120
|
452
468
|
},
|
@@ -461,7 +477,24 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
461
477
|
queryName: 'roles'
|
462
478
|
}
|
463
479
|
},
|
464
|
-
|
480
|
+
width: 120
|
481
|
+
},
|
482
|
+
{
|
483
|
+
type: 'assignees',
|
484
|
+
name: 'assignees',
|
485
|
+
header: i18next.t('field.assignees'),
|
486
|
+
record: {
|
487
|
+
editable: true
|
488
|
+
},
|
489
|
+
width: 120
|
490
|
+
},
|
491
|
+
{
|
492
|
+
type: 'approval-line',
|
493
|
+
name: 'approvalLine',
|
494
|
+
header: i18next.t('field.approval-line'),
|
495
|
+
record: {
|
496
|
+
editable: true
|
497
|
+
},
|
465
498
|
width: 120
|
466
499
|
},
|
467
500
|
{
|
@@ -564,7 +597,6 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
564
597
|
record: {
|
565
598
|
editable: false
|
566
599
|
},
|
567
|
-
sortable: true,
|
568
600
|
width: 120
|
569
601
|
},
|
570
602
|
{
|
@@ -606,6 +638,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
606
638
|
useCase
|
607
639
|
schedule
|
608
640
|
timezone
|
641
|
+
schedulerHandle
|
609
642
|
dataKeySet {
|
610
643
|
id
|
611
644
|
name
|
@@ -618,6 +651,26 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
618
651
|
id
|
619
652
|
name
|
620
653
|
}
|
654
|
+
assignees {
|
655
|
+
type
|
656
|
+
value
|
657
|
+
assignee {
|
658
|
+
id
|
659
|
+
name
|
660
|
+
description
|
661
|
+
controlNo
|
662
|
+
}
|
663
|
+
}
|
664
|
+
approvalLine {
|
665
|
+
type
|
666
|
+
value
|
667
|
+
approver {
|
668
|
+
id
|
669
|
+
name
|
670
|
+
description
|
671
|
+
controlNo
|
672
|
+
}
|
673
|
+
}
|
621
674
|
entryType
|
622
675
|
entryView
|
623
676
|
monitorType
|
@@ -747,6 +800,60 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
747
800
|
}
|
748
801
|
}
|
749
802
|
|
803
|
+
async startDataCollectionSchedule(record) {
|
804
|
+
var response = await client.mutate({
|
805
|
+
mutation: gql`
|
806
|
+
mutation ($dataSetId: String!) {
|
807
|
+
startDataCollectionSchedule(dataSetId: $dataSetId) {
|
808
|
+
schedulerHandle
|
809
|
+
}
|
810
|
+
}
|
811
|
+
`,
|
812
|
+
variables: {
|
813
|
+
dataSetId: record.id
|
814
|
+
}
|
815
|
+
})
|
816
|
+
|
817
|
+
const schedulerHandle = response.data.startDataCollectionSchedule.schedulerHandle
|
818
|
+
record.schedulerHandle = schedulerHandle
|
819
|
+
|
820
|
+
notify({
|
821
|
+
level: 'info',
|
822
|
+
message: `${record.schedulerHandle ? 'success' : 'fail'} to start data collection schedule : ${record.name}`
|
823
|
+
})
|
824
|
+
|
825
|
+
this.grist.fetch()
|
826
|
+
}
|
827
|
+
|
828
|
+
async stopDataCollectionSchedule(record) {
|
829
|
+
var response = await client.mutate({
|
830
|
+
mutation: gql`
|
831
|
+
mutation ($dataSetId: String!) {
|
832
|
+
stopDataCollectionSchedule(dataSetId: $dataSetId) {
|
833
|
+
schedulerHandle
|
834
|
+
}
|
835
|
+
}
|
836
|
+
`,
|
837
|
+
variables: {
|
838
|
+
dataSetId: record.id
|
839
|
+
}
|
840
|
+
})
|
841
|
+
|
842
|
+
if (!response.errors) {
|
843
|
+
notify({
|
844
|
+
level: 'info',
|
845
|
+
message: `success to stop data collection schedule : ${record.name}`
|
846
|
+
})
|
847
|
+
} else {
|
848
|
+
notify({
|
849
|
+
level: 'error',
|
850
|
+
message: `${response.errors.map(error => error.message).join('\n')}`
|
851
|
+
})
|
852
|
+
}
|
853
|
+
|
854
|
+
this.grist.fetch()
|
855
|
+
}
|
856
|
+
|
750
857
|
async exportHandler() {
|
751
858
|
var headerSetting = this.grist._config.columns
|
752
859
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
package/client/route.ts
CHANGED
@@ -20,6 +20,10 @@ export default function route(page) {
|
|
20
20
|
import('./pages/data-report/data-report-samples-page.js')
|
21
21
|
return page
|
22
22
|
|
23
|
+
case 'data-ooc':
|
24
|
+
import('./pages/data-ooc/data-ooc-view-page.js')
|
25
|
+
return page
|
26
|
+
|
23
27
|
case 'data-ooc-list':
|
24
28
|
import('./pages/data-ooc/data-ooc-list-page.js')
|
25
29
|
return page
|
@@ -1,34 +1,34 @@
|
|
1
1
|
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
dataArchive: {
|
3
|
+
dataset: {
|
4
|
+
endpoint: {
|
5
|
+
host: 'localhost',
|
6
|
+
port: 80
|
7
|
+
},
|
8
|
+
datasource: {
|
9
|
+
database: ''
|
10
|
+
}
|
11
|
+
}
|
12
|
+
},
|
13
|
+
dataReport: {
|
14
|
+
jasper: {
|
15
|
+
endpoint: {
|
16
|
+
host: 'localhost',
|
17
|
+
port: 8090
|
18
|
+
},
|
19
|
+
datasource: {
|
20
|
+
database: ''
|
21
|
+
},
|
22
|
+
method: 'POST'
|
12
23
|
},
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
},
|
22
|
-
method: 'POST'
|
23
|
-
},
|
24
|
-
shiny: {
|
25
|
-
endpoint: {
|
26
|
-
host: 'localhost',
|
27
|
-
port: 3838
|
28
|
-
},
|
29
|
-
datasource: {
|
30
|
-
database: ''
|
31
|
-
}
|
32
|
-
}
|
24
|
+
shiny: {
|
25
|
+
endpoint: {
|
26
|
+
host: 'localhost',
|
27
|
+
port: 3838
|
28
|
+
},
|
29
|
+
datasource: {
|
30
|
+
database: ''
|
31
|
+
}
|
33
32
|
}
|
33
|
+
}
|
34
34
|
}
|
@@ -1,34 +1,34 @@
|
|
1
1
|
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
dataArchive: {
|
3
|
+
dataset: {
|
4
|
+
endpoint: {
|
5
|
+
host: 'localhost',
|
6
|
+
port: 80
|
7
|
+
},
|
8
|
+
datasource: {
|
9
|
+
database: ''
|
10
|
+
}
|
11
|
+
}
|
12
|
+
},
|
13
|
+
dataReport: {
|
14
|
+
jasper: {
|
15
|
+
endpoint: {
|
16
|
+
host: 'localhost',
|
17
|
+
port: 8090
|
18
|
+
},
|
19
|
+
datasource: {
|
20
|
+
database: ''
|
21
|
+
},
|
22
|
+
method: 'POST'
|
12
23
|
},
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
},
|
22
|
-
method: 'POST'
|
23
|
-
},
|
24
|
-
shiny: {
|
25
|
-
endpoint: {
|
26
|
-
host: 'localhost',
|
27
|
-
port: 3838
|
28
|
-
},
|
29
|
-
datasource: {
|
30
|
-
database: ''
|
31
|
-
}
|
32
|
-
}
|
24
|
+
shiny: {
|
25
|
+
endpoint: {
|
26
|
+
host: 'localhost',
|
27
|
+
port: 3838
|
28
|
+
},
|
29
|
+
datasource: {
|
30
|
+
database: ''
|
31
|
+
}
|
33
32
|
}
|
34
|
-
}
|
33
|
+
}
|
34
|
+
}
|
@@ -1,3 +1,5 @@
|
|
1
|
-
import './components/data-
|
1
|
+
import './components/data-collect-activity-view';
|
2
|
+
import './components/ooc-review-activity-view';
|
3
|
+
import './components/ooc-resolve-activity-view';
|
2
4
|
import '@operato/app/filter-renderer.js';
|
3
5
|
export default function bootstrap(): void;
|
package/dist-client/bootstrap.js
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
import './components/data-
|
1
|
+
import './components/data-collect-activity-view'; /* refered by the activity template (activity-data-collect) on server */
|
2
|
+
import './components/ooc-review-activity-view'; /* refered by the activity template (activity-ooc-review) on server */
|
3
|
+
import './components/ooc-resolve-activity-view'; /* refered by the activity template (activity-ooc-resolve) on server */
|
2
4
|
import '@operato/app/filter-renderer.js'; /* register resource-object filter renderer */
|
3
5
|
import { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js';
|
4
6
|
import { OxGristRendererJson5, registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist';
|
5
|
-
import { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor';
|
7
|
+
import { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js';
|
6
8
|
import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js';
|
7
9
|
export default function bootstrap() {
|
8
10
|
registerGristEditor('data-item-spec', OxGristEditorDataItemSpec);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,yCAAyC,CAAA,CAAC,wEAAwE;AACzH,OAAO,uCAAuC,CAAA,CAAC,sEAAsE;AACrH,OAAO,wCAAwC,CAAA,CAAC,uEAAuE;AAEvH,OAAO,iCAAiC,CAAA,CAAC,8CAA8C;AAEvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAA;AACrF,OAAO,EACL,oBAAoB,EACpB,cAAc,IAAI,mBAAmB,EACrC,gBAAgB,IAAI,qBAAqB,EAC1C,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAA;AAC3G,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAA;AAEpG,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,mBAAmB,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;IAChE,qBAAqB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;IAE7D,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAA;IAEhD,mBAAmB,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,CAAA;IACjE,qBAAqB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;AAC/D,CAAC","sourcesContent":["import './components/data-collect-activity-view' /* refered by the activity template (activity-data-collect) on server */\nimport './components/ooc-review-activity-view' /* refered by the activity template (activity-ooc-review) on server */\nimport './components/ooc-resolve-activity-view' /* refered by the activity template (activity-ooc-resolve) on server */\n\nimport '@operato/app/filter-renderer.js' /* register resource-object filter renderer */\n\nimport { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js'\nimport {\n OxGristRendererJson5,\n registerEditor as registerGristEditor,\n registerRenderer as registerGristRenderer\n} from '@operato/data-grist'\nimport { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js'\nimport { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'\n\nexport default function bootstrap() {\n registerGristEditor('data-item-spec', OxGristEditorDataItemSpec)\n registerGristRenderer('data-item-spec', OxGristRendererJson5)\n\n registerGristEditor('script', OxGristEditorCode)\n\n registerGristEditor('partition-keys', OxGristEditorPartitionKeys)\n registerGristRenderer('partition-keys', OxGristRendererJson5)\n}\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import '@operato/dataset/ox-data-entry-form.js';
|
2
|
+
import { LitElement } from 'lit';
|
3
|
+
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js';
|
4
|
+
import { DataSet } from '@operato/dataset';
|
5
|
+
declare const DataCollectActivityView_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
6
|
+
export declare class DataCollectActivityView extends DataCollectActivityView_base {
|
7
|
+
static styles: import("lit").CSSResult[];
|
8
|
+
input?: any;
|
9
|
+
output?: any;
|
10
|
+
dataSet?: DataSet & {
|
11
|
+
id: string;
|
12
|
+
};
|
13
|
+
entryForm: OxDataEntryForm;
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
15
|
+
_updateDataItems(): Promise<void>;
|
16
|
+
updated(changes: any): void;
|
17
|
+
fetchDataSet(): Promise<void>;
|
18
|
+
}
|
19
|
+
export {};
|
@@ -0,0 +1,101 @@
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
2
|
+
import '@operato/dataset/ox-data-entry-form.js';
|
3
|
+
import gql from 'graphql-tag';
|
4
|
+
import { css, html, LitElement } from 'lit';
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
6
|
+
import { client } from '@operato/graphql';
|
7
|
+
import { i18next, localize } from '@operato/i18n';
|
8
|
+
import { ScrollbarStyles } from '@operato/styles';
|
9
|
+
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js';
|
10
|
+
let DataCollectActivityView = class DataCollectActivityView extends localize(i18next)(LitElement) {
|
11
|
+
render() {
|
12
|
+
return html `
|
13
|
+
<ox-data-entry-form
|
14
|
+
.dataSet=${this.dataSet}
|
15
|
+
.value=${this.output}
|
16
|
+
@change=${this._updateDataItems}
|
17
|
+
></ox-data-entry-form>
|
18
|
+
`;
|
19
|
+
}
|
20
|
+
async _updateDataItems() {
|
21
|
+
this.output = this.entryForm.value;
|
22
|
+
this.dispatchEvent(new CustomEvent('change', {
|
23
|
+
detail: this.output
|
24
|
+
}));
|
25
|
+
}
|
26
|
+
updated(changes) {
|
27
|
+
if (changes.has('input')) {
|
28
|
+
this.fetchDataSet();
|
29
|
+
}
|
30
|
+
}
|
31
|
+
async fetchDataSet() {
|
32
|
+
const id = this.input.dataSetId;
|
33
|
+
if (id) {
|
34
|
+
const response = await client.query({
|
35
|
+
query: gql `
|
36
|
+
query ($id: String!) {
|
37
|
+
dataSet(id: $id) {
|
38
|
+
id
|
39
|
+
name
|
40
|
+
description
|
41
|
+
useCase
|
42
|
+
dataItems {
|
43
|
+
name
|
44
|
+
description
|
45
|
+
active
|
46
|
+
tag
|
47
|
+
type
|
48
|
+
unit
|
49
|
+
options
|
50
|
+
quota
|
51
|
+
spec
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
`,
|
56
|
+
variables: {
|
57
|
+
id
|
58
|
+
}
|
59
|
+
});
|
60
|
+
this.dataSet = response.data.dataSet;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
};
|
64
|
+
DataCollectActivityView.styles = [
|
65
|
+
ScrollbarStyles,
|
66
|
+
css `
|
67
|
+
:host {
|
68
|
+
display: flex;
|
69
|
+
flex-direction: column;
|
70
|
+
|
71
|
+
background-color: #fff;
|
72
|
+
}
|
73
|
+
|
74
|
+
ox-data-entry-form {
|
75
|
+
flex: 1;
|
76
|
+
padding: 10px;
|
77
|
+
overflow: auto;
|
78
|
+
}
|
79
|
+
`
|
80
|
+
];
|
81
|
+
__decorate([
|
82
|
+
property({ type: Object }),
|
83
|
+
__metadata("design:type", Object)
|
84
|
+
], DataCollectActivityView.prototype, "input", void 0);
|
85
|
+
__decorate([
|
86
|
+
property({ type: Object }),
|
87
|
+
__metadata("design:type", Object)
|
88
|
+
], DataCollectActivityView.prototype, "output", void 0);
|
89
|
+
__decorate([
|
90
|
+
state(),
|
91
|
+
__metadata("design:type", Object)
|
92
|
+
], DataCollectActivityView.prototype, "dataSet", void 0);
|
93
|
+
__decorate([
|
94
|
+
query('ox-data-entry-form'),
|
95
|
+
__metadata("design:type", OxDataEntryForm)
|
96
|
+
], DataCollectActivityView.prototype, "entryForm", void 0);
|
97
|
+
DataCollectActivityView = __decorate([
|
98
|
+
customElement('data-collect-activity-view')
|
99
|
+
], DataCollectActivityView);
|
100
|
+
export { DataCollectActivityView };
|
101
|
+
//# sourceMappingURL=data-collect-activity-view.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"data-collect-activity-view.js","sourceRoot":"","sources":["../../client/components/data-collect-activity-view.ts"],"names":[],"mappings":";AAAA,OAAO,wCAAwC,CAAA;AAE/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAIjE,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IA0BxE,MAAM;QACJ,OAAO,IAAI,CAAA;;mBAEI,IAAI,CAAC,OAAO;iBACd,IAAI,CAAC,MAAM;kBACV,IAAI,CAAC,gBAAgB;;KAElC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QAElC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CACH,CAAA;IACH,CAAC;IAED,OAAO,CAAC,OAAO;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,YAAY,EAAE,CAAA;SACpB;IACH,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAA;QAE/B,IAAI,EAAE,EAAE;YACN,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;SAoBT;gBACD,SAAS,EAAE;oBACT,EAAE;iBACH;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAA;SACrC;IACH,CAAC;;AApFM,8BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;KAaF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAY;AACvC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAa;AAExC;IAAC,KAAK,EAAE;;wDAAmC;AAE3C;IAAC,KAAK,CAAC,oBAAoB,CAAC;8BAAa,eAAe;0DAAA;AAxB7C,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CAsFnC;SAtFY,uBAAuB","sourcesContent":["import '@operato/dataset/ox-data-entry-form.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'\nimport { DataSet } from '@operato/dataset'\n\n@customElement('data-collect-activity-view')\nexport class DataCollectActivityView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n ox-data-entry-form {\n flex: 1;\n padding: 10px;\n overflow: auto;\n }\n `\n ]\n\n @property({ type: Object }) input?: any\n @property({ type: Object }) output?: any\n\n @state() dataSet?: DataSet & { id: string }\n\n @query('ox-data-entry-form') entryForm!: OxDataEntryForm\n\n render() {\n return html`\n <ox-data-entry-form\n .dataSet=${this.dataSet}\n .value=${this.output}\n @change=${this._updateDataItems}\n ></ox-data-entry-form>\n `\n }\n\n async _updateDataItems() {\n this.output = this.entryForm.value\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.output\n })\n )\n }\n\n updated(changes) {\n if (changes.has('input')) {\n this.fetchDataSet()\n }\n }\n\n async fetchDataSet() {\n const id = this.input.dataSetId\n\n if (id) {\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 tag\n type\n unit\n options\n quota\n spec\n }\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.dataSet = response.data.dataSet\n }\n }\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@operato/dataset/ox-data-sample-view.js';
|
@@ -0,0 +1,175 @@
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
2
|
+
import '@operato/dataset/ox-data-sample-view.js';
|
3
|
+
import gql from 'graphql-tag';
|
4
|
+
import { css, html, LitElement } from 'lit';
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
6
|
+
import { client } from '@operato/graphql';
|
7
|
+
import { i18next, localize } from '@operato/i18n';
|
8
|
+
import { ScrollbarStyles } from '@operato/styles';
|
9
|
+
let OocResolveActivityView = class OocResolveActivityView extends localize(i18next)(LitElement) {
|
10
|
+
render() {
|
11
|
+
var _a, _b;
|
12
|
+
const action = (_a = this.output) === null || _a === void 0 ? void 0 : _a.action;
|
13
|
+
return html `
|
14
|
+
<div content>
|
15
|
+
<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div instruction>
|
19
|
+
<div><mwc-icon>build_circle</mwc-icon> <span>corrective instruction</span></div>
|
20
|
+
<div content>${(_b = this.input) === null || _b === void 0 ? void 0 : _b.instruction}</div>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<label action>
|
24
|
+
<div><mwc-icon>build_circle</mwc-icon> <span>corrective action</span></div>
|
25
|
+
<textarea
|
26
|
+
placeholder="시정 및 예방을 위한 조치 이행 사항을 입력해주세요."
|
27
|
+
.value=${action || ''}
|
28
|
+
@change=${this.onChangeAction}
|
29
|
+
></textarea>
|
30
|
+
</label>
|
31
|
+
`;
|
32
|
+
}
|
33
|
+
onChangeAction(e) {
|
34
|
+
this.output || (this.output = {});
|
35
|
+
this.output.action = e.target.value;
|
36
|
+
this.dispatchEvent(new CustomEvent('change', {
|
37
|
+
detail: this.output
|
38
|
+
}));
|
39
|
+
}
|
40
|
+
updated(changes) {
|
41
|
+
if (changes.has('input')) {
|
42
|
+
this.fetchDataOoc();
|
43
|
+
}
|
44
|
+
}
|
45
|
+
async fetchDataOoc() {
|
46
|
+
const id = this.input.dataOocId;
|
47
|
+
if (id) {
|
48
|
+
const response = await client.query({
|
49
|
+
query: gql `
|
50
|
+
query ($id: String!) {
|
51
|
+
dataOoc(id: $id) {
|
52
|
+
id
|
53
|
+
name
|
54
|
+
description
|
55
|
+
ooc
|
56
|
+
oos
|
57
|
+
state
|
58
|
+
type
|
59
|
+
useCase
|
60
|
+
data
|
61
|
+
judgment
|
62
|
+
dataItems {
|
63
|
+
name
|
64
|
+
description
|
65
|
+
active
|
66
|
+
tag
|
67
|
+
type
|
68
|
+
unit
|
69
|
+
options
|
70
|
+
quota
|
71
|
+
spec
|
72
|
+
}
|
73
|
+
workDate
|
74
|
+
workShift
|
75
|
+
collectedAt
|
76
|
+
}
|
77
|
+
}
|
78
|
+
`,
|
79
|
+
variables: {
|
80
|
+
id
|
81
|
+
}
|
82
|
+
});
|
83
|
+
this.dataOoc = response.data.dataOoc;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
};
|
87
|
+
OocResolveActivityView.styles = [
|
88
|
+
ScrollbarStyles,
|
89
|
+
css `
|
90
|
+
:host {
|
91
|
+
display: flex;
|
92
|
+
flex-direction: column;
|
93
|
+
|
94
|
+
background-color: #fff;
|
95
|
+
}
|
96
|
+
|
97
|
+
div[content] {
|
98
|
+
flex: 1;
|
99
|
+
flex-direction: column;
|
100
|
+
|
101
|
+
display: flex;
|
102
|
+
overflow: auto;
|
103
|
+
}
|
104
|
+
|
105
|
+
ox-data-sample-view {
|
106
|
+
flex: 1;
|
107
|
+
padding: var(--padding-wide);
|
108
|
+
overflow: auto;
|
109
|
+
}
|
110
|
+
|
111
|
+
div[instruction] {
|
112
|
+
display: flex;
|
113
|
+
flex-direction: column;
|
114
|
+
|
115
|
+
padding: var(--padding-wide);
|
116
|
+
}
|
117
|
+
|
118
|
+
div[instruction] div {
|
119
|
+
display: flex;
|
120
|
+
}
|
121
|
+
|
122
|
+
div[instruction] div[content] {
|
123
|
+
display: flex;
|
124
|
+
min-height: 50px;
|
125
|
+
}
|
126
|
+
|
127
|
+
label[action] {
|
128
|
+
display: flex;
|
129
|
+
flex-direction: column;
|
130
|
+
|
131
|
+
padding: var(--padding-wide);
|
132
|
+
}
|
133
|
+
|
134
|
+
label[action] div {
|
135
|
+
display: flex;
|
136
|
+
}
|
137
|
+
|
138
|
+
mwc-icon {
|
139
|
+
color: var(--status-danger-color);
|
140
|
+
}
|
141
|
+
|
142
|
+
textarea {
|
143
|
+
border: var(--input-field-border);
|
144
|
+
border-radius: var(--input-border-radius);
|
145
|
+
padding: var(--input-field-padding);
|
146
|
+
font: var(--input-field-font);
|
147
|
+
}
|
148
|
+
|
149
|
+
.button-container {
|
150
|
+
display: flex;
|
151
|
+
margin-left: auto;
|
152
|
+
padding: var(--padding-default);
|
153
|
+
}
|
154
|
+
`
|
155
|
+
];
|
156
|
+
__decorate([
|
157
|
+
property({ type: Object }),
|
158
|
+
__metadata("design:type", Object)
|
159
|
+
], OocResolveActivityView.prototype, "input", void 0);
|
160
|
+
__decorate([
|
161
|
+
property({ type: Object }),
|
162
|
+
__metadata("design:type", Object)
|
163
|
+
], OocResolveActivityView.prototype, "output", void 0);
|
164
|
+
__decorate([
|
165
|
+
state(),
|
166
|
+
__metadata("design:type", Object)
|
167
|
+
], OocResolveActivityView.prototype, "dataOoc", void 0);
|
168
|
+
__decorate([
|
169
|
+
query('textarea'),
|
170
|
+
__metadata("design:type", HTMLTextAreaElement)
|
171
|
+
], OocResolveActivityView.prototype, "actionTextArea", void 0);
|
172
|
+
OocResolveActivityView = __decorate([
|
173
|
+
customElement('ooc-resolve-activity-view')
|
174
|
+
], OocResolveActivityView);
|
175
|
+
//# sourceMappingURL=ooc-resolve-activity-view.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ooc-resolve-activity-view.js","sourceRoot":"","sources":["../../client/components/ooc-resolve-activity-view.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAEhD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IA8EhE,MAAM;;QACJ,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,0CAAE,MAAM,CAAA;QAElC,OAAO,IAAI,CAAA;;2CAE4B,IAAI,CAAC,OAAO;;;;;uBAKhC,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW;;;;;;;mBAO3B,MAAM,IAAI,EAAE;oBACX,IAAI,CAAC,cAAc;;;KAGlC,CAAA;IACH,CAAC;IAED,cAAc,CAAC,CAAQ;QACrB,IAAI,CAAC,MAAM,KAAX,IAAI,CAAC,MAAM,GAAK,EAAE,EAAA;QAClB,IAAI,CAAC,MAAM,CAAC,MAAM,GAAI,CAAC,CAAC,MAA8B,CAAC,KAAK,CAAA;QAE5D,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CACH,CAAA;IACH,CAAC;IAED,OAAO,CAAC,OAAO;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,YAAY,EAAE,CAAA;SACpB;IACH,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAA;QAE/B,IAAI,EAAE,EAAE;YACN,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA6BT;gBACD,SAAS,EAAE;oBACT,EAAE;iBACH;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAA;SACrC;IACH,CAAC;;AAhKM,6BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiEF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAY;AACvC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAa;AAExC;IAAC,KAAK,EAAE;;uDAAc;AAEtB;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAkB,mBAAmB;8DAAA;AA5EnD,sBAAsB;IAD3B,aAAa,CAAC,2BAA2B,CAAC;GACrC,sBAAsB,CAkK3B","sourcesContent":["import '@operato/dataset/ox-data-sample-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('ooc-resolve-activity-view')\nclass OocResolveActivityView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n div[content] {\n flex: 1;\n flex-direction: column;\n\n display: flex;\n overflow: auto;\n }\n\n ox-data-sample-view {\n flex: 1;\n padding: var(--padding-wide);\n overflow: auto;\n }\n\n div[instruction] {\n display: flex;\n flex-direction: column;\n\n padding: var(--padding-wide);\n }\n\n div[instruction] div {\n display: flex;\n }\n\n div[instruction] div[content] {\n display: flex;\n min-height: 50px;\n }\n\n label[action] {\n display: flex;\n flex-direction: column;\n\n padding: var(--padding-wide);\n }\n\n label[action] div {\n display: flex;\n }\n\n mwc-icon {\n color: var(--status-danger-color);\n }\n\n textarea {\n border: var(--input-field-border);\n border-radius: var(--input-border-radius);\n padding: var(--input-field-padding);\n font: var(--input-field-font);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n `\n ]\n\n @property({ type: Object }) input?: any\n @property({ type: Object }) output?: any\n\n @state() dataOoc?: any\n\n @query('textarea') actionTextArea!: HTMLTextAreaElement\n\n render() {\n const action = this.output?.action\n\n return html`\n <div content>\n <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>\n </div>\n\n <div instruction>\n <div><mwc-icon>build_circle</mwc-icon> <span>corrective instruction</span></div>\n <div content>${this.input?.instruction}</div>\n </div>\n\n <label action>\n <div><mwc-icon>build_circle</mwc-icon> <span>corrective action</span></div>\n <textarea\n placeholder=\"시정 및 예방을 위한 조치 이행 사항을 입력해주세요.\"\n .value=${action || ''}\n @change=${this.onChangeAction}\n ></textarea>\n </label>\n `\n }\n\n onChangeAction(e: Event) {\n this.output ||= {}\n this.output.action = (e.target as HTMLTextAreaElement).value\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.output\n })\n )\n }\n\n updated(changes) {\n if (changes.has('input')) {\n this.fetchDataOoc()\n }\n }\n\n async fetchDataOoc() {\n const id = this.input.dataOocId\n\n if (id) {\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n dataOoc(id: $id) {\n id\n name\n description\n ooc\n oos\n state\n type\n useCase\n data\n judgment\n dataItems {\n name\n description\n active\n tag\n type\n unit\n options\n quota\n spec\n }\n workDate\n workShift\n collectedAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.dataOoc = response.data.dataOoc\n }\n }\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@operato/dataset/ox-data-sample-view.js';
|