@things-factory/kpi 1.0.0-alpha.5 → 9.0.9
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/README.md +74 -0
- package/client/pages/kpi/kpi-list-page.ts +97 -47
- package/client/pages/kpi/kpi-overview-sample.ts +260 -0
- package/client/pages/kpi/kpi-overview.ts +271 -0
- package/client/pages/kpi-category/kpi-category-list-page.ts +39 -50
- package/client/pages/kpi-dashboard/kpi-alert-panel.ts +114 -0
- package/client/pages/kpi-dashboard/kpi-dashboard.ts +285 -0
- package/client/pages/kpi-dashboard/kpi-grade-visualization.ts +75 -0
- package/client/pages/kpi-dashboard/kpi-history-viewer.ts +58 -0
- package/client/pages/kpi-dashboard/kpi-list-summary.ts +100 -0
- package/client/pages/kpi-dashboard/kpi-performance-summary.ts +124 -0
- package/client/pages/kpi-dashboard/kpi-value-entry.ts +78 -0
- package/client/pages/kpi-grade/kpi-grade-list-page.ts +58 -68
- package/client/pages/kpi-history/kpi-history-list-page.ts +146 -0
- package/client/pages/kpi-metric/kpi-metric-list-page.ts +67 -63
- package/client/pages/kpi-value/kpi-value-list-page.ts +73 -72
- package/client/pages/kpi-value/kpi-value-manual-entry-form.ts +168 -0
- package/client/pages/kpi-value/kpi-value-manual-entry-page.ts +173 -0
- package/client/route.ts +35 -0
- package/dist-client/pages/kpi/kpi-importer.js +16 -17
- package/dist-client/pages/kpi/kpi-importer.js.map +1 -1
- package/dist-client/pages/kpi/kpi-list-page.js +128 -68
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
- package/dist-client/pages/kpi/kpi-overview-sample.d.ts +36 -0
- package/dist-client/pages/kpi/kpi-overview-sample.js +264 -0
- package/dist-client/pages/kpi/kpi-overview-sample.js.map +1 -0
- package/dist-client/pages/kpi/kpi-overview.d.ts +14 -0
- package/dist-client/pages/kpi/kpi-overview.js +290 -0
- package/dist-client/pages/kpi/kpi-overview.js.map +1 -0
- package/dist-client/pages/kpi-category/kpi-category-importer.js +16 -17
- package/dist-client/pages/kpi-category/kpi-category-importer.js.map +1 -1
- package/dist-client/pages/kpi-category/kpi-category-list-page.js +70 -71
- package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +128 -0
- package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +24 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +305 -0
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
- package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
- package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
- package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +139 -0
- package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
- package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js +16 -17
- package/dist-client/pages/kpi-grade/kpi-grade-importer.js.map +1 -1
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js +89 -89
- package/dist-client/pages/kpi-grade/kpi-grade-list-page.js.map +1 -1
- package/dist-client/pages/kpi-history/kpi-history-list-page.d.ts +16 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.js +155 -0
- package/dist-client/pages/kpi-history/kpi-history-list-page.js.map +1 -0
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js +16 -17
- package/dist-client/pages/kpi-metric/kpi-metric-importer.js.map +1 -1
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +98 -84
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-importer.js +16 -17
- package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +104 -93
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.d.ts +14 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js +201 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js.map +1 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.d.ts +41 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js +180 -0
- package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +27 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +2 -1
- package/dist-server/index.js +2 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1752188906708-SeedKpiCategory.d.ts +5 -0
- package/dist-server/migrations/1752188906708-SeedKpiCategory.js +56 -0
- package/dist-server/migrations/1752188906708-SeedKpiCategory.js.map +1 -0
- package/dist-server/migrations/1752190849681-SeedKpi.d.ts +5 -0
- package/dist-server/migrations/1752190849681-SeedKpi.js +107 -0
- package/dist-server/migrations/1752190849681-SeedKpi.js.map +1 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.d.ts +5 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.js +271 -0
- package/dist-server/migrations/1752191090459-SeedKpiGrade.js.map +1 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +48 -0
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/index.d.ts +3 -4
- package/dist-server/service/index.js +4 -6
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/kpi/aggregate-kpi.d.ts +8 -0
- package/dist-server/service/kpi/aggregate-kpi.js +88 -0
- package/dist-server/service/kpi/aggregate-kpi.js.map +1 -0
- package/dist-server/service/kpi/event-subscriber.d.ts +2 -0
- package/dist-server/service/kpi/event-subscriber.js +10 -0
- package/dist-server/service/kpi/event-subscriber.js.map +1 -1
- package/dist-server/service/kpi/index.d.ts +2 -1
- package/dist-server/service/kpi/kpi-formula.service.d.ts +24 -0
- package/dist-server/service/kpi/kpi-formula.service.js +64 -0
- package/dist-server/service/kpi/kpi-formula.service.js.map +1 -0
- package/dist-server/service/kpi/kpi-history.d.ts +6 -2
- package/dist-server/service/kpi/kpi-history.js +29 -11
- package/dist-server/service/kpi/kpi-history.js.map +1 -1
- package/dist-server/service/kpi/kpi-mutation.d.ts +2 -0
- package/dist-server/service/kpi/kpi-mutation.js +215 -10
- package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
- package/dist-server/service/kpi/kpi-query.d.ts +10 -0
- package/dist-server/service/kpi/kpi-query.js +87 -3
- package/dist-server/service/kpi/kpi-query.js.map +1 -1
- package/dist-server/service/kpi/kpi-type.d.ts +14 -3
- package/dist-server/service/kpi/kpi-type.js +81 -18
- package/dist-server/service/kpi/kpi-type.js.map +1 -1
- package/dist-server/service/kpi/kpi.d.ts +14 -3
- package/dist-server/service/kpi/kpi.js +96 -19
- package/dist-server/service/kpi/kpi.js.map +1 -1
- package/dist-server/service/kpi-alert/index.d.ts +2 -0
- package/dist-server/service/kpi-alert/index.js +6 -0
- package/dist-server/service/kpi-alert/index.js.map +1 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.d.ts +4 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.js +71 -0
- package/dist-server/service/kpi-alert/kpi-alert-query.js.map +1 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.d.ts +8 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.js +33 -0
- package/dist-server/service/kpi-alert/kpi-alert-type.js.map +1 -0
- package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +1 -1
- package/dist-server/service/kpi-category/kpi-category-mutation.js +36 -10
- package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category-query.d.ts +2 -0
- package/dist-server/service/kpi-category/kpi-category-query.js +18 -2
- package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category-type.d.ts +3 -5
- package/dist-server/service/kpi-category/kpi-category-type.js +16 -20
- package/dist-server/service/kpi-category/kpi-category-type.js.map +1 -1
- package/dist-server/service/kpi-category/kpi-category.d.ts +7 -9
- package/dist-server/service/kpi-category/kpi-category.js +40 -38
- package/dist-server/service/kpi-category/kpi-category.js.map +1 -1
- package/dist-server/service/kpi-grade/index.d.ts +1 -2
- package/dist-server/service/kpi-grade/index.js +2 -4
- package/dist-server/service/kpi-grade/index.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-mutation.d.ts +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js +33 -10
- package/dist-server/service/kpi-grade/kpi-grade-mutation.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-query.js +2 -2
- package/dist-server/service/kpi-grade/kpi-grade-query.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade-type.d.ts +13 -4
- package/dist-server/service/kpi-grade/kpi-grade-type.js +54 -18
- package/dist-server/service/kpi-grade/kpi-grade-type.js.map +1 -1
- package/dist-server/service/kpi-grade/kpi-grade.d.ts +8 -8
- package/dist-server/service/kpi-grade/kpi-grade.js +48 -40
- package/dist-server/service/kpi-grade/kpi-grade.js.map +1 -1
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.d.ts +8 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js +134 -0
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js.map +1 -0
- package/dist-server/service/kpi-metric/index.d.ts +1 -2
- package/dist-server/service/kpi-metric/index.js +2 -4
- package/dist-server/service/kpi-metric/index.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-mutation.d.ts +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js +139 -13
- package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-query.js +3 -3
- package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +17 -4
- package/dist-server/service/kpi-metric/kpi-metric-type.js +69 -11
- package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -1
- package/dist-server/service/kpi-metric/kpi-metric.d.ts +11 -8
- package/dist-server/service/kpi-metric/kpi-metric.js +62 -37
- package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-mutation.js +66 -11
- package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-query.d.ts +2 -0
- package/dist-server/service/kpi-value/kpi-value-query.js +15 -2
- package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-type.d.ts +19 -10
- package/dist-server/service/kpi-value/kpi-value-type.js +87 -24
- package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value.d.ts +15 -9
- package/dist-server/service/kpi-value/kpi-value.js +86 -32
- package/dist-server/service/kpi-value/kpi-value.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/implement-plan/01-entity-type-resolver.md +57 -0
- package/implement-plan/02-dataset-integration.md +35 -0
- package/implement-plan/03-kpivalue-automation.md +34 -0
- package/implement-plan/04-version-history.md +33 -0
- package/implement-plan/05-grade-visualization.md +33 -0
- package/implement-plan/06-graphql-frontend.md +30 -0
- package/implement-plan/07-test-docs.md +35 -0
- package/implement-plan/TODO.md +41 -0
- package/package.json +18 -6
- package/server/index.ts +2 -1
- package/server/migrations/1752188906708-SeedKpiCategory.ts +61 -0
- package/server/migrations/1752190849681-SeedKpi.ts +112 -0
- package/server/migrations/1752191090459-SeedKpiGrade.ts +270 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +55 -0
- package/server/service/index.ts +4 -6
- package/server/service/kpi/aggregate-kpi.ts +82 -0
- package/server/service/kpi/event-subscriber.ts +12 -0
- package/server/service/kpi/kpi-formula.service.ts +63 -0
- package/server/service/kpi/kpi-history.ts +29 -21
- package/server/service/kpi/kpi-mutation.ts +194 -12
- package/server/service/kpi/kpi-query.ts +57 -2
- package/server/service/kpi/kpi-type.ts +72 -19
- package/server/service/kpi/kpi.ts +96 -20
- package/server/service/kpi-alert/index.ts +3 -0
- package/server/service/kpi-alert/kpi-alert-query.ts +59 -0
- package/server/service/kpi-alert/kpi-alert-type.ts +20 -0
- package/server/service/kpi-category/kpi-category-mutation.ts +17 -4
- package/server/service/kpi-category/kpi-category-query.ts +20 -3
- package/server/service/kpi-category/kpi-category-type.ts +17 -19
- package/server/service/kpi-category/kpi-category.ts +39 -37
- package/server/service/kpi-grade/index.ts +2 -4
- package/server/service/kpi-grade/kpi-grade-mutation.ts +13 -4
- package/server/service/kpi-grade/kpi-grade-query.ts +5 -2
- package/server/service/kpi-grade/kpi-grade-type.ts +46 -19
- package/server/service/kpi-grade/kpi-grade.ts +44 -38
- package/server/service/kpi-metric/aggregate-kpi-metric.ts +128 -0
- package/server/service/kpi-metric/index.ts +2 -4
- package/server/service/kpi-metric/kpi-metric-mutation.ts +123 -7
- package/server/service/kpi-metric/kpi-metric-query.ts +9 -3
- package/server/service/kpi-metric/kpi-metric-type.ts +56 -13
- package/server/service/kpi-metric/kpi-metric.ts +55 -35
- package/server/service/kpi-value/kpi-value-mutation.ts +52 -14
- package/server/service/kpi-value/kpi-value-query.ts +12 -2
- package/server/service/kpi-value/kpi-value-type.ts +80 -25
- package/server/service/kpi-value/kpi-value.ts +81 -29
- package/things-factory.config.js +12 -4
- package/translations/en.json +12 -1
- package/translations/ja.json +12 -1
- package/translations/ko.json +12 -1
- package/translations/ms.json +12 -1
- package/translations/zh.json +12 -1
- package/client/pages/kpe-metric/kpe-metric-importer.ts +0 -90
- package/client/pages/kpe-metric/kpe-metric-list-page.ts +0 -398
- package/client/pages/kpi-formula/kpi-formula-importer.ts +0 -90
- package/client/pages/kpi-formula/kpi-formula-list-page.ts +0 -398
- package/client/pages/metric/metric-importer.ts +0 -90
- package/client/pages/metric/metric-list-page.ts +0 -398
- package/dist-client/pages/kpe-metric/kpe-metric-importer.d.ts +0 -23
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js +0 -93
- package/dist-client/pages/kpe-metric/kpe-metric-importer.js.map +0 -1
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.d.ts +0 -66
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js +0 -370
- package/dist-client/pages/kpe-metric/kpe-metric-list-page.js.map +0 -1
- package/dist-client/pages/kpi-formula/kpi-formula-importer.d.ts +0 -23
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js +0 -93
- package/dist-client/pages/kpi-formula/kpi-formula-importer.js.map +0 -1
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.d.ts +0 -66
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js +0 -370
- package/dist-client/pages/kpi-formula/kpi-formula-list-page.js.map +0 -1
- package/dist-client/pages/metric/metric-importer.d.ts +0 -23
- package/dist-client/pages/metric/metric-importer.js +0 -93
- package/dist-client/pages/metric/metric-importer.js.map +0 -1
- package/dist-client/pages/metric/metric-list-page.d.ts +0 -66
- package/dist-client/pages/metric/metric-list-page.js +0 -370
- package/dist-client/pages/metric/metric-list-page.js.map +0 -1
- package/dist-server/service/kpi-formula/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-formula/event-subscriber.js +0 -21
- package/dist-server/service/kpi-formula/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-formula/index.d.ts +0 -7
- package/dist-server/service/kpi-formula/index.js +0 -12
- package/dist-server/service/kpi-formula/index.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-history.d.ts +0 -25
- package/dist-server/service/kpi-formula/kpi-formula-history.js +0 -128
- package/dist-server/service/kpi-formula/kpi-formula-history.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-mutation.d.ts +0 -10
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js +0 -128
- package/dist-server/service/kpi-formula/kpi-formula-mutation.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-query.d.ts +0 -11
- package/dist-server/service/kpi-formula/kpi-formula-query.js +0 -79
- package/dist-server/service/kpi-formula/kpi-formula-query.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula-type.d.ts +0 -20
- package/dist-server/service/kpi-formula/kpi-formula-type.js +0 -77
- package/dist-server/service/kpi-formula/kpi-formula-type.js.map +0 -1
- package/dist-server/service/kpi-formula/kpi-formula.d.ts +0 -24
- package/dist-server/service/kpi-formula/kpi-formula.js +0 -109
- package/dist-server/service/kpi-formula/kpi-formula.js.map +0 -1
- package/dist-server/service/kpi-grade/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-grade/event-subscriber.js +0 -21
- package/dist-server/service/kpi-grade/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-grade/kpi-grade-history.d.ts +0 -25
- package/dist-server/service/kpi-grade/kpi-grade-history.js +0 -128
- package/dist-server/service/kpi-grade/kpi-grade-history.js.map +0 -1
- package/dist-server/service/kpi-metric/event-subscriber.d.ts +0 -7
- package/dist-server/service/kpi-metric/event-subscriber.js +0 -21
- package/dist-server/service/kpi-metric/event-subscriber.js.map +0 -1
- package/dist-server/service/kpi-metric/kpi-metric-history.d.ts +0 -25
- package/dist-server/service/kpi-metric/kpi-metric-history.js +0 -128
- package/dist-server/service/kpi-metric/kpi-metric-history.js.map +0 -1
- package/server/service/kpi-formula/event-subscriber.ts +0 -17
- package/server/service/kpi-formula/index.ts +0 -9
- package/server/service/kpi-formula/kpi-formula-history.ts +0 -116
- package/server/service/kpi-formula/kpi-formula-mutation.ts +0 -137
- package/server/service/kpi-formula/kpi-formula-query.ts +0 -48
- package/server/service/kpi-formula/kpi-formula-type.ts +0 -55
- package/server/service/kpi-formula/kpi-formula.ts +0 -95
- package/server/service/kpi-grade/event-subscriber.ts +0 -17
- package/server/service/kpi-grade/kpi-grade-history.ts +0 -116
- package/server/service/kpi-metric/event-subscriber.ts +0 -17
- package/server/service/kpi-metric/kpi-metric-history.ts +0 -116
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { html, css, nothing } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { PageView } from '@operato/shell';
|
|
5
|
+
import { ScrollbarStyles } from '@operato/styles';
|
|
6
|
+
import { client } from '@operato/graphql';
|
|
7
|
+
import gql from 'graphql-tag';
|
|
8
|
+
import { state } from 'lit/decorators.js';
|
|
9
|
+
import './kpi-performance-summary';
|
|
10
|
+
import './kpi-grade-visualization';
|
|
11
|
+
import './kpi-history-viewer';
|
|
12
|
+
import './kpi-list-summary';
|
|
13
|
+
import './kpi-value-entry';
|
|
14
|
+
import './kpi-alert-panel';
|
|
15
|
+
let KpiDashboardPage = class KpiDashboardPage extends PageView {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.categories = [];
|
|
19
|
+
this.loading = true;
|
|
20
|
+
this.error = '';
|
|
21
|
+
this.alerts = [];
|
|
22
|
+
this.showHistoryModal = false;
|
|
23
|
+
this.modalHistories = [];
|
|
24
|
+
this.modalKpiName = '';
|
|
25
|
+
}
|
|
26
|
+
static { this.styles = [
|
|
27
|
+
ScrollbarStyles,
|
|
28
|
+
css `
|
|
29
|
+
:host {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
overflow-y: auto;
|
|
33
|
+
}
|
|
34
|
+
.dashboard-root {
|
|
35
|
+
flex: 1;
|
|
36
|
+
padding: 24px;
|
|
37
|
+
}
|
|
38
|
+
.category-section {
|
|
39
|
+
margin-bottom: 40px;
|
|
40
|
+
}
|
|
41
|
+
.category-title {
|
|
42
|
+
font-size: 1.3rem;
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
margin-bottom: 16px;
|
|
45
|
+
}
|
|
46
|
+
.kpi-cards {
|
|
47
|
+
display: flex;
|
|
48
|
+
gap: 24px;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
}
|
|
51
|
+
.kpi-card {
|
|
52
|
+
background: #fff;
|
|
53
|
+
border-radius: 12px;
|
|
54
|
+
padding: 24px 32px;
|
|
55
|
+
min-width: 220px;
|
|
56
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: flex-start;
|
|
60
|
+
margin-bottom: 8px;
|
|
61
|
+
border: 1px solid #ececec;
|
|
62
|
+
}
|
|
63
|
+
.kpi-name {
|
|
64
|
+
font-size: 1.1rem;
|
|
65
|
+
font-weight: 500;
|
|
66
|
+
margin-bottom: 8px;
|
|
67
|
+
}
|
|
68
|
+
.kpi-value {
|
|
69
|
+
font-size: 2.2rem;
|
|
70
|
+
font-weight: bold;
|
|
71
|
+
color: #3a3ad6;
|
|
72
|
+
margin-bottom: 4px;
|
|
73
|
+
}
|
|
74
|
+
.kpi-target {
|
|
75
|
+
font-size: 1rem;
|
|
76
|
+
color: #888;
|
|
77
|
+
}
|
|
78
|
+
`
|
|
79
|
+
]; }
|
|
80
|
+
connectedCallback() {
|
|
81
|
+
super.connectedCallback();
|
|
82
|
+
this.fetchCategories();
|
|
83
|
+
}
|
|
84
|
+
async fetchCategories() {
|
|
85
|
+
this.loading = true;
|
|
86
|
+
this.error = '';
|
|
87
|
+
try {
|
|
88
|
+
const response = await client.query({
|
|
89
|
+
query: gql `
|
|
90
|
+
query {
|
|
91
|
+
kpiCategories {
|
|
92
|
+
items {
|
|
93
|
+
id
|
|
94
|
+
name
|
|
95
|
+
kpis {
|
|
96
|
+
id
|
|
97
|
+
name
|
|
98
|
+
value {
|
|
99
|
+
value
|
|
100
|
+
valueDate
|
|
101
|
+
}
|
|
102
|
+
targetValue
|
|
103
|
+
unit
|
|
104
|
+
grades {
|
|
105
|
+
name
|
|
106
|
+
minValue
|
|
107
|
+
maxValue
|
|
108
|
+
score
|
|
109
|
+
color
|
|
110
|
+
}
|
|
111
|
+
histories(limit: 1) {
|
|
112
|
+
version
|
|
113
|
+
updatedAt
|
|
114
|
+
updater {
|
|
115
|
+
name
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
kpiAlerts {
|
|
122
|
+
id
|
|
123
|
+
kpi {
|
|
124
|
+
id
|
|
125
|
+
}
|
|
126
|
+
message
|
|
127
|
+
level
|
|
128
|
+
createdAt
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
`
|
|
132
|
+
});
|
|
133
|
+
this.categories = response.data.kpiCategories.items || [];
|
|
134
|
+
this.alerts = response.data.kpiAlerts || [];
|
|
135
|
+
}
|
|
136
|
+
catch (e) {
|
|
137
|
+
this.error = 'KPI 카테고리 데이터를 불러오지 못했습니다.';
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
this.loading = false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async openHistoryModal(kpi) {
|
|
144
|
+
// 전체 이력 fetch (limit 없이)
|
|
145
|
+
try {
|
|
146
|
+
const response = await client.query({
|
|
147
|
+
query: gql `
|
|
148
|
+
query ($kpiId: String!) {
|
|
149
|
+
kpi(id: $kpiId) {
|
|
150
|
+
name
|
|
151
|
+
histories {
|
|
152
|
+
version
|
|
153
|
+
updatedAt
|
|
154
|
+
updater {
|
|
155
|
+
name
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
`,
|
|
161
|
+
variables: { kpiId: kpi.id }
|
|
162
|
+
});
|
|
163
|
+
this.modalHistories = response.data.kpi.histories || [];
|
|
164
|
+
this.modalKpiName = response.data.kpi.name || '';
|
|
165
|
+
this.showHistoryModal = true;
|
|
166
|
+
}
|
|
167
|
+
catch (e) {
|
|
168
|
+
alert('이력 데이터를 불러오지 못했습니다.');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
closeHistoryModal() {
|
|
172
|
+
this.showHistoryModal = false;
|
|
173
|
+
this.modalHistories = [];
|
|
174
|
+
this.modalKpiName = '';
|
|
175
|
+
}
|
|
176
|
+
get context() {
|
|
177
|
+
return {
|
|
178
|
+
title: 'KPI 대시보드',
|
|
179
|
+
description: '조직 KPI 실적, 등급, 이력, 시각화 등 KPI 전용 대시보드'
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
render() {
|
|
183
|
+
if (this.loading)
|
|
184
|
+
return nothing;
|
|
185
|
+
if (this.error)
|
|
186
|
+
return html `<div>${this.error}</div>`;
|
|
187
|
+
return html `
|
|
188
|
+
<div class="dashboard-root">
|
|
189
|
+
${this.showHistoryModal
|
|
190
|
+
? html `
|
|
191
|
+
<div
|
|
192
|
+
style="position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.25);z-index:1000;display:flex;align-items:center;justify-content:center;"
|
|
193
|
+
>
|
|
194
|
+
<div
|
|
195
|
+
style="background:#fff;padding:32px 40px;border-radius:16px;min-width:340px;max-width:90vw;max-height:80vh;overflow:auto;box-shadow:0 4px 24px rgba(0,0,0,0.15);"
|
|
196
|
+
>
|
|
197
|
+
<div style="font-size:1.2rem;font-weight:bold;margin-bottom:16px;">
|
|
198
|
+
${this.modalKpiName} 변경 이력
|
|
199
|
+
</div>
|
|
200
|
+
<ul style="padding:0;list-style:none;">
|
|
201
|
+
${this.modalHistories.length === 0
|
|
202
|
+
? html `<li style="color:#bbb;">이력이 없습니다.</li>`
|
|
203
|
+
: this.modalHistories.map(h => html `<li style="margin-bottom:8px;">
|
|
204
|
+
v${h.version} (${h.updatedAt?.slice(0, 10) ?? ''} ${h.updater?.name ?? ''})
|
|
205
|
+
</li>`)}
|
|
206
|
+
</ul>
|
|
207
|
+
<button style="margin-top:16px;padding:6px 18px;" @click=${() => this.closeHistoryModal()}>
|
|
208
|
+
닫기
|
|
209
|
+
</button>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
`
|
|
213
|
+
: nothing}
|
|
214
|
+
${this.categories.map(cat => html `
|
|
215
|
+
<div class="category-section">
|
|
216
|
+
<div class="category-title">${cat.name}</div>
|
|
217
|
+
<div class="kpi-cards">
|
|
218
|
+
${(cat.kpis || []).map(kpi => html `
|
|
219
|
+
<div class="kpi-card">
|
|
220
|
+
<div class="kpi-name">${kpi.name}</div>
|
|
221
|
+
<div class="kpi-value">${kpi.value?.value ?? '데이터 없음'}${kpi.unit ?? ''}</div>
|
|
222
|
+
<div class="kpi-target">목표: ${kpi.targetValue ?? '-'}${kpi.unit ?? ''}</div>
|
|
223
|
+
<!-- 등급 시각화 -->
|
|
224
|
+
<div style="margin-top:8px;">
|
|
225
|
+
<b>등급:</b>
|
|
226
|
+
${(kpi.grades || []).map(g => html `<span
|
|
227
|
+
style="display:inline-block;margin-right:8px;padding:2px 8px;border-radius:8px;background:${g.color ??
|
|
228
|
+
'#eee'};color:#222;font-size:0.95em;"
|
|
229
|
+
>${g.name}(${g.minValue}~${g.maxValue}${kpi.unit ?? ''}, ${g.score ?? ''}점)</span
|
|
230
|
+
>`)}
|
|
231
|
+
</div>
|
|
232
|
+
<!-- 최근 변경 이력(1건만) -->
|
|
233
|
+
<div style="margin-top:8px;font-size:0.95em;color:#888;">
|
|
234
|
+
<b>최근 변경:</b>
|
|
235
|
+
${kpi.histories && kpi.histories.length > 0
|
|
236
|
+
? html `<span style="margin-right:8px;"
|
|
237
|
+
>v${kpi.histories[0].version} (${kpi.histories[0].updatedAt?.slice(0, 10) ?? ''}
|
|
238
|
+
${kpi.histories[0].updater?.name ?? ''})</span
|
|
239
|
+
>`
|
|
240
|
+
: html `<span style="color:#bbb">없음</span>`}
|
|
241
|
+
<button
|
|
242
|
+
style="margin-left:8px;font-size:0.95em;padding:2px 8px;"
|
|
243
|
+
@click=${() => this.openHistoryModal(kpi)}
|
|
244
|
+
>
|
|
245
|
+
더보기
|
|
246
|
+
</button>
|
|
247
|
+
</div>
|
|
248
|
+
<!-- 경고/알림 -->
|
|
249
|
+
<div style="margin-top:8px;">
|
|
250
|
+
${this.alerts.filter(a => a.kpi?.id === kpi.id).length > 0
|
|
251
|
+
? this.alerts
|
|
252
|
+
.filter(a => a.kpi?.id === kpi.id)
|
|
253
|
+
.map(a => html `<span
|
|
254
|
+
style="display:inline-block;margin-right:8px;padding:2px 8px;border-radius:8px;background:${a.level ===
|
|
255
|
+
'critical'
|
|
256
|
+
? '#ffb3b3'
|
|
257
|
+
: a.level === 'warning'
|
|
258
|
+
? '#ffe082'
|
|
259
|
+
: '#e0e0e0'};color:#b71c1c;font-size:0.95em;"
|
|
260
|
+
>${a.message}</span
|
|
261
|
+
>`)
|
|
262
|
+
: html `<span style="color:#4caf50;font-size:0.95em;">이상/경고 없음</span>`}
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
`)}
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
`)}
|
|
269
|
+
</div>
|
|
270
|
+
`;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
__decorate([
|
|
274
|
+
state(),
|
|
275
|
+
__metadata("design:type", Array)
|
|
276
|
+
], KpiDashboardPage.prototype, "categories", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
state(),
|
|
279
|
+
__metadata("design:type", Object)
|
|
280
|
+
], KpiDashboardPage.prototype, "loading", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
state(),
|
|
283
|
+
__metadata("design:type", Object)
|
|
284
|
+
], KpiDashboardPage.prototype, "error", void 0);
|
|
285
|
+
__decorate([
|
|
286
|
+
state(),
|
|
287
|
+
__metadata("design:type", Array)
|
|
288
|
+
], KpiDashboardPage.prototype, "alerts", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
state(),
|
|
291
|
+
__metadata("design:type", Boolean)
|
|
292
|
+
], KpiDashboardPage.prototype, "showHistoryModal", void 0);
|
|
293
|
+
__decorate([
|
|
294
|
+
state(),
|
|
295
|
+
__metadata("design:type", Array)
|
|
296
|
+
], KpiDashboardPage.prototype, "modalHistories", void 0);
|
|
297
|
+
__decorate([
|
|
298
|
+
state(),
|
|
299
|
+
__metadata("design:type", String)
|
|
300
|
+
], KpiDashboardPage.prototype, "modalKpiName", void 0);
|
|
301
|
+
KpiDashboardPage = __decorate([
|
|
302
|
+
customElement('kpi-dashboard')
|
|
303
|
+
], KpiDashboardPage);
|
|
304
|
+
export { KpiDashboardPage };
|
|
305
|
+
//# sourceMappingURL=kpi-dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-dashboard.js","sourceRoot":"","sources":["../../../client/pages/kpi-dashboard/kpi-dashboard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB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,EAAE;;iDAAe;AACd;IAAR,KAAK,EAAE;;+CAAW;AACV;IAAR,KAAK,EAAE;;gDAAmB;AAClB;IAAR,KAAK,EAAE;;0DAAkC;AACjC;IAAR,KAAK,EAAE;;wDAA2B;AAC1B;IAAR,KAAK,EAAE;;sDAA0B;AA9DvB,gBAAgB;IAD5B,aAAa,CAAC,eAAe,CAAC;GAClB,gBAAgB,CA4Q5B","sourcesContent":["import { html, css, nothing } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { PageView } from '@operato/shell'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\nimport { state } from 'lit/decorators.js'\n\nimport './kpi-performance-summary'\nimport './kpi-grade-visualization'\nimport './kpi-history-viewer'\nimport './kpi-list-summary'\nimport './kpi-value-entry'\nimport './kpi-alert-panel'\n\n@customElement('kpi-dashboard')\nexport class KpiDashboardPage extends PageView {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n }\n .dashboard-root {\n flex: 1;\n padding: 24px;\n }\n .category-section {\n margin-bottom: 40px;\n }\n .category-title {\n font-size: 1.3rem;\n font-weight: bold;\n margin-bottom: 16px;\n }\n .kpi-cards {\n display: flex;\n gap: 24px;\n flex-wrap: wrap;\n }\n .kpi-card {\n background: #fff;\n border-radius: 12px;\n padding: 24px 32px;\n min-width: 220px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-bottom: 8px;\n border: 1px solid #ececec;\n }\n .kpi-name {\n font-size: 1.1rem;\n font-weight: 500;\n margin-bottom: 8px;\n }\n .kpi-value {\n font-size: 2.2rem;\n font-weight: bold;\n color: #3a3ad6;\n margin-bottom: 4px;\n }\n .kpi-target {\n font-size: 1rem;\n color: #888;\n }\n `\n ]\n\n @state() categories: any[] = []\n @state() loading = true\n @state() error = ''\n @state() alerts: any[] = []\n @state() showHistoryModal: boolean = false\n @state() modalHistories: any[] = []\n @state() modalKpiName: string = ''\n\n connectedCallback() {\n super.connectedCallback()\n this.fetchCategories()\n }\n\n async fetchCategories() {\n this.loading = true\n this.error = ''\n try {\n const response = await client.query({\n query: gql`\n query {\n kpiCategories {\n items {\n id\n name\n kpis {\n id\n name\n value {\n value\n valueDate\n }\n targetValue\n unit\n grades {\n name\n minValue\n maxValue\n score\n color\n }\n histories(limit: 1) {\n version\n updatedAt\n updater {\n name\n }\n }\n }\n }\n }\n kpiAlerts {\n id\n kpi {\n id\n }\n message\n level\n createdAt\n }\n }\n `\n })\n this.categories = response.data.kpiCategories.items || []\n this.alerts = response.data.kpiAlerts || []\n } catch (e) {\n this.error = 'KPI 카테고리 데이터를 불러오지 못했습니다.'\n } finally {\n this.loading = false\n }\n }\n\n async openHistoryModal(kpi) {\n // 전체 이력 fetch (limit 없이)\n try {\n const response = await client.query({\n query: gql`\n query ($kpiId: String!) {\n kpi(id: $kpiId) {\n name\n histories {\n version\n updatedAt\n updater {\n name\n }\n }\n }\n }\n `,\n variables: { kpiId: kpi.id }\n })\n this.modalHistories = response.data.kpi.histories || []\n this.modalKpiName = response.data.kpi.name || ''\n this.showHistoryModal = true\n } catch (e) {\n alert('이력 데이터를 불러오지 못했습니다.')\n }\n }\n closeHistoryModal() {\n this.showHistoryModal = false\n this.modalHistories = []\n this.modalKpiName = ''\n }\n\n get context() {\n return {\n title: 'KPI 대시보드',\n description: '조직 KPI 실적, 등급, 이력, 시각화 등 KPI 전용 대시보드'\n } as any\n }\n\n render() {\n if (this.loading) return nothing\n if (this.error) return html`<div>${this.error}</div>`\n return html`\n <div class=\"dashboard-root\">\n ${this.showHistoryModal\n ? html`\n <div\n style=\"position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.25);z-index:1000;display:flex;align-items:center;justify-content:center;\"\n >\n <div\n style=\"background:#fff;padding:32px 40px;border-radius:16px;min-width:340px;max-width:90vw;max-height:80vh;overflow:auto;box-shadow:0 4px 24px rgba(0,0,0,0.15);\"\n >\n <div style=\"font-size:1.2rem;font-weight:bold;margin-bottom:16px;\">\n ${this.modalKpiName} 변경 이력\n </div>\n <ul style=\"padding:0;list-style:none;\">\n ${this.modalHistories.length === 0\n ? html`<li style=\"color:#bbb;\">이력이 없습니다.</li>`\n : this.modalHistories.map(\n h =>\n html`<li style=\"margin-bottom:8px;\">\n v${h.version} (${h.updatedAt?.slice(0, 10) ?? ''} ${h.updater?.name ?? ''})\n </li>`\n )}\n </ul>\n <button style=\"margin-top:16px;padding:6px 18px;\" @click=${() => this.closeHistoryModal()}>\n 닫기\n </button>\n </div>\n </div>\n `\n : nothing}\n ${this.categories.map(\n cat => html`\n <div class=\"category-section\">\n <div class=\"category-title\">${cat.name}</div>\n <div class=\"kpi-cards\">\n ${(cat.kpis || []).map(\n kpi => html`\n <div class=\"kpi-card\">\n <div class=\"kpi-name\">${kpi.name}</div>\n <div class=\"kpi-value\">${kpi.value?.value ?? '데이터 없음'}${kpi.unit ?? ''}</div>\n <div class=\"kpi-target\">목표: ${kpi.targetValue ?? '-'}${kpi.unit ?? ''}</div>\n <!-- 등급 시각화 -->\n <div style=\"margin-top:8px;\">\n <b>등급:</b>\n ${(kpi.grades || []).map(\n g =>\n html`<span\n style=\"display:inline-block;margin-right:8px;padding:2px 8px;border-radius:8px;background:${g.color ??\n '#eee'};color:#222;font-size:0.95em;\"\n >${g.name}(${g.minValue}~${g.maxValue}${kpi.unit ?? ''}, ${g.score ?? ''}점)</span\n >`\n )}\n </div>\n <!-- 최근 변경 이력(1건만) -->\n <div style=\"margin-top:8px;font-size:0.95em;color:#888;\">\n <b>최근 변경:</b>\n ${kpi.histories && kpi.histories.length > 0\n ? html`<span style=\"margin-right:8px;\"\n >v${kpi.histories[0].version} (${kpi.histories[0].updatedAt?.slice(0, 10) ?? ''}\n ${kpi.histories[0].updater?.name ?? ''})</span\n >`\n : html`<span style=\"color:#bbb\">없음</span>`}\n <button\n style=\"margin-left:8px;font-size:0.95em;padding:2px 8px;\"\n @click=${() => this.openHistoryModal(kpi)}\n >\n 더보기\n </button>\n </div>\n <!-- 경고/알림 -->\n <div style=\"margin-top:8px;\">\n ${this.alerts.filter(a => a.kpi?.id === kpi.id).length > 0\n ? this.alerts\n .filter(a => a.kpi?.id === kpi.id)\n .map(\n a =>\n html`<span\n style=\"display:inline-block;margin-right:8px;padding:2px 8px;border-radius:8px;background:${a.level ===\n 'critical'\n ? '#ffb3b3'\n : a.level === 'warning'\n ? '#ffe082'\n : '#e0e0e0'};color:#b71c1c;font-size:0.95em;\"\n >${a.message}</span\n >`\n )\n : html`<span style=\"color:#4caf50;font-size:0.95em;\">이상/경고 없음</span>`}\n </div>\n </div>\n `\n )}\n </div>\n </div>\n `\n )}\n </div>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class KpiGradeVisualization extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
grades: {
|
|
5
|
+
kpi: string;
|
|
6
|
+
grade: string;
|
|
7
|
+
color: string;
|
|
8
|
+
desc: string;
|
|
9
|
+
value: number;
|
|
10
|
+
}[];
|
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { html, css, LitElement } from 'lit';
|
|
3
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
4
|
+
let KpiGradeVisualization = class KpiGradeVisualization extends LitElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.grades = [
|
|
8
|
+
{ kpi: '불량률', grade: 'A', color: '#4caf50', desc: '우수', value: 0.8 },
|
|
9
|
+
{ kpi: '불량률', grade: 'B', color: '#ff9800', desc: '양호', value: 1.5 },
|
|
10
|
+
{ kpi: '불량률', grade: 'C', color: '#f44336', desc: '주의', value: 2.7 }
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
static { this.styles = css `
|
|
14
|
+
.grade-container {
|
|
15
|
+
background: #fff;
|
|
16
|
+
border-radius: 16px;
|
|
17
|
+
padding: 32px;
|
|
18
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
|
19
|
+
margin-bottom: 16px;
|
|
20
|
+
}
|
|
21
|
+
.grade-title {
|
|
22
|
+
font-size: 1.5rem;
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
margin-bottom: 16px;
|
|
25
|
+
}
|
|
26
|
+
.grade-cards {
|
|
27
|
+
display: flex;
|
|
28
|
+
gap: 24px;
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
}
|
|
31
|
+
.grade-card {
|
|
32
|
+
background: #f0f7fa;
|
|
33
|
+
border-radius: 12px;
|
|
34
|
+
padding: 20px 28px;
|
|
35
|
+
min-width: 180px;
|
|
36
|
+
flex: 1;
|
|
37
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
align-items: flex-start;
|
|
41
|
+
}
|
|
42
|
+
.grade-label {
|
|
43
|
+
font-size: 1.1rem;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
margin-bottom: 8px;
|
|
46
|
+
}
|
|
47
|
+
.grade-value {
|
|
48
|
+
font-size: 2rem;
|
|
49
|
+
font-weight: bold;
|
|
50
|
+
margin-bottom: 4px;
|
|
51
|
+
}
|
|
52
|
+
.grade-desc {
|
|
53
|
+
font-size: 1rem;
|
|
54
|
+
color: #888;
|
|
55
|
+
}
|
|
56
|
+
`; }
|
|
57
|
+
render() {
|
|
58
|
+
return html `
|
|
59
|
+
<div class="grade-container">
|
|
60
|
+
<div class="grade-title">KPI 등급/구간 시각화</div>
|
|
61
|
+
<div class="grade-cards">
|
|
62
|
+
${this.grades.map(g => html `
|
|
63
|
+
<div class="grade-card" style="border-left: 8px solid ${g.color}">
|
|
64
|
+
<div class="grade-label">${g.kpi} - ${g.grade}등급</div>
|
|
65
|
+
<div class="grade-value" style="color:${g.color}">${g.value}</div>
|
|
66
|
+
<div class="grade-desc">${g.desc}</div>
|
|
67
|
+
</div>
|
|
68
|
+
`)}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__decorate([
|
|
75
|
+
state(),
|
|
76
|
+
__metadata("design:type", Object)
|
|
77
|
+
], KpiGradeVisualization.prototype, "grades", void 0);
|
|
78
|
+
KpiGradeVisualization = __decorate([
|
|
79
|
+
customElement('kpi-grade-visualization')
|
|
80
|
+
], KpiGradeVisualization);
|
|
81
|
+
export { KpiGradeVisualization };
|
|
82
|
+
//# sourceMappingURL=kpi-grade-visualization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-grade-visualization.js","sourceRoot":"","sources":["../../../client/pages/kpi-dashboard/kpi-grade-visualization.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGjD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;IAA9C;;QA8CI,WAAM,GAAG;YAChB,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE;YACpE,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE;YACpE,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE;SACrE,CAAA;IAoBH,CAAC;aArEQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2ClB,AA3CY,CA2CZ;IAQD,MAAM;QACJ,OAAO,IAAI,CAAA;;;;YAIH,IAAI,CAAC,MAAM,CAAC,GAAG,CACf,CAAC,CAAC,EAAE,CAAC,IAAI,CAAA;sEACiD,CAAC,CAAC,KAAK;2CAClC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK;wDACL,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;0CACjC,CAAC,CAAC,IAAI;;aAEnC,CACF;;;KAGN,CAAA;IACH,CAAC;;AAvBQ;IAAR,KAAK,EAAE;;qDAIP;AAlDU,qBAAqB;IADjC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,qBAAqB,CAsEjC","sourcesContent":["import { html, css, LitElement } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\n\n@customElement('kpi-grade-visualization')\nexport class KpiGradeVisualization extends LitElement {\n static styles = css`\n .grade-container {\n background: #fff;\n border-radius: 16px;\n padding: 32px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);\n margin-bottom: 16px;\n }\n .grade-title {\n font-size: 1.5rem;\n font-weight: bold;\n margin-bottom: 16px;\n }\n .grade-cards {\n display: flex;\n gap: 24px;\n flex-wrap: wrap;\n }\n .grade-card {\n background: #f0f7fa;\n border-radius: 12px;\n padding: 20px 28px;\n min-width: 180px;\n flex: 1;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n .grade-label {\n font-size: 1.1rem;\n font-weight: 500;\n margin-bottom: 8px;\n }\n .grade-value {\n font-size: 2rem;\n font-weight: bold;\n margin-bottom: 4px;\n }\n .grade-desc {\n font-size: 1rem;\n color: #888;\n }\n `\n\n @state() grades = [\n { kpi: '불량률', grade: 'A', color: '#4caf50', desc: '우수', value: 0.8 },\n { kpi: '불량률', grade: 'B', color: '#ff9800', desc: '양호', value: 1.5 },\n { kpi: '불량률', grade: 'C', color: '#f44336', desc: '주의', value: 2.7 }\n ]\n\n render() {\n return html`\n <div class=\"grade-container\">\n <div class=\"grade-title\">KPI 등급/구간 시각화</div>\n <div class=\"grade-cards\">\n ${this.grades.map(\n g => html`\n <div class=\"grade-card\" style=\"border-left: 8px solid ${g.color}\">\n <div class=\"grade-label\">${g.kpi} - ${g.grade}등급</div>\n <div class=\"grade-value\" style=\"color:${g.color}\">${g.value}</div>\n <div class=\"grade-desc\">${g.desc}</div>\n </div>\n `\n )}\n </div>\n </div>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class KpiHistoryViewer extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
histories: {
|
|
5
|
+
date: string;
|
|
6
|
+
action: string;
|
|
7
|
+
user: string;
|
|
8
|
+
desc: string;
|
|
9
|
+
}[];
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { html, css, LitElement } from 'lit';
|
|
3
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
4
|
+
let KpiHistoryViewer = class KpiHistoryViewer extends LitElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.histories = [
|
|
8
|
+
{ date: '2024-06-01', action: 'Release', user: '홍길동', desc: '불량률 KPI 산식 변경 및 버전 Release' },
|
|
9
|
+
{ date: '2024-05-15', action: 'Revert', user: '김감리', desc: '불량률 KPI 이전 버전 복원' },
|
|
10
|
+
{ date: '2024-05-01', action: 'Release', user: '홍길동', desc: '불량률 KPI 신규 등록 및 Release' }
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
static { this.styles = css `
|
|
14
|
+
.history-container {
|
|
15
|
+
background: #fff;
|
|
16
|
+
border-radius: 16px;
|
|
17
|
+
padding: 32px;
|
|
18
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
|
19
|
+
margin-bottom: 16px;
|
|
20
|
+
}
|
|
21
|
+
.history-title {
|
|
22
|
+
font-size: 1.5rem;
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
margin-bottom: 16px;
|
|
25
|
+
}
|
|
26
|
+
.history-list {
|
|
27
|
+
list-style: none;
|
|
28
|
+
padding: 0;
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
.history-item {
|
|
32
|
+
padding: 12px 0;
|
|
33
|
+
border-bottom: 1px solid #eee;
|
|
34
|
+
font-size: 1.1rem;
|
|
35
|
+
}
|
|
36
|
+
.history-meta {
|
|
37
|
+
color: #888;
|
|
38
|
+
font-size: 0.95rem;
|
|
39
|
+
}
|
|
40
|
+
`; }
|
|
41
|
+
render() {
|
|
42
|
+
return html `
|
|
43
|
+
<div class="history-container">
|
|
44
|
+
<div class="history-title">KPI 이력/버전 관리</div>
|
|
45
|
+
<ul class="history-list">
|
|
46
|
+
${this.histories.map(h => html `
|
|
47
|
+
<li class="history-item">
|
|
48
|
+
<div>${h.action} - ${h.desc}</div>
|
|
49
|
+
<div class="history-meta">${h.date} / ${h.user}</div>
|
|
50
|
+
</li>
|
|
51
|
+
`)}
|
|
52
|
+
</ul>
|
|
53
|
+
</div>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
__decorate([
|
|
58
|
+
state(),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], KpiHistoryViewer.prototype, "histories", void 0);
|
|
61
|
+
KpiHistoryViewer = __decorate([
|
|
62
|
+
customElement('kpi-history-viewer')
|
|
63
|
+
], KpiHistoryViewer);
|
|
64
|
+
export { KpiHistoryViewer };
|
|
65
|
+
//# sourceMappingURL=kpi-history-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-history-viewer.js","sourceRoot":"","sources":["../../../client/pages/kpi-dashboard/kpi-history-viewer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGjD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QA8BI,cAAS,GAAG;YACnB,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,4BAA4B,EAAE;YAC1F,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE;YAC/E,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE;SACxF,CAAA;IAmBH,CAAC;aApDQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BlB,AA3BY,CA2BZ;IAQD,MAAM;QACJ,OAAO,IAAI,CAAA;;;;YAIH,IAAI,CAAC,SAAS,CAAC,GAAG,CAClB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAA;;uBAEE,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI;4CACC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,IAAI;;aAEjD,CACF;;;KAGN,CAAA;IACH,CAAC;;AAtBQ;IAAR,KAAK,EAAE;;mDAIP;AAlCU,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAqD5B","sourcesContent":["import { html, css, LitElement } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\n\n@customElement('kpi-history-viewer')\nexport class KpiHistoryViewer extends LitElement {\n static styles = css`\n .history-container {\n background: #fff;\n border-radius: 16px;\n padding: 32px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);\n margin-bottom: 16px;\n }\n .history-title {\n font-size: 1.5rem;\n font-weight: bold;\n margin-bottom: 16px;\n }\n .history-list {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n .history-item {\n padding: 12px 0;\n border-bottom: 1px solid #eee;\n font-size: 1.1rem;\n }\n .history-meta {\n color: #888;\n font-size: 0.95rem;\n }\n `\n\n @state() histories = [\n { date: '2024-06-01', action: 'Release', user: '홍길동', desc: '불량률 KPI 산식 변경 및 버전 Release' },\n { date: '2024-05-15', action: 'Revert', user: '김감리', desc: '불량률 KPI 이전 버전 복원' },\n { date: '2024-05-01', action: 'Release', user: '홍길동', desc: '불량률 KPI 신규 등록 및 Release' }\n ]\n\n render() {\n return html`\n <div class=\"history-container\">\n <div class=\"history-title\">KPI 이력/버전 관리</div>\n <ul class=\"history-list\">\n ${this.histories.map(\n h => html`\n <li class=\"history-item\">\n <div>${h.action} - ${h.desc}</div>\n <div class=\"history-meta\">${h.date} / ${h.user}</div>\n </li>\n `\n )}\n </ul>\n </div>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class KpiListSummary extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
kpis: Array<{
|
|
5
|
+
name: string;
|
|
6
|
+
desc: string;
|
|
7
|
+
}>;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
error: string;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
fetchKpis(): Promise<void>;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { html, css, LitElement } from 'lit';
|
|
3
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
4
|
+
import { client } from '@operato/graphql';
|
|
5
|
+
import gql from 'graphql-tag';
|
|
6
|
+
let KpiListSummary = class KpiListSummary extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.kpis = [];
|
|
10
|
+
this.loading = true;
|
|
11
|
+
this.error = '';
|
|
12
|
+
}
|
|
13
|
+
static { this.styles = css `
|
|
14
|
+
.list-container {
|
|
15
|
+
background: #fff;
|
|
16
|
+
border-radius: 16px;
|
|
17
|
+
padding: 32px;
|
|
18
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
|
19
|
+
margin-bottom: 16px;
|
|
20
|
+
}
|
|
21
|
+
.list-title {
|
|
22
|
+
font-size: 1.5rem;
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
margin-bottom: 16px;
|
|
25
|
+
}
|
|
26
|
+
.kpi-list {
|
|
27
|
+
list-style: none;
|
|
28
|
+
padding: 0;
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
.kpi-item {
|
|
32
|
+
padding: 10px 0;
|
|
33
|
+
border-bottom: 1px solid #eee;
|
|
34
|
+
font-size: 1.1rem;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
transition: background 0.2s;
|
|
37
|
+
}
|
|
38
|
+
.kpi-item:hover {
|
|
39
|
+
background: #f0f0f0;
|
|
40
|
+
}
|
|
41
|
+
`; }
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
super.connectedCallback();
|
|
44
|
+
this.fetchKpis();
|
|
45
|
+
}
|
|
46
|
+
async fetchKpis() {
|
|
47
|
+
this.loading = true;
|
|
48
|
+
this.error = '';
|
|
49
|
+
try {
|
|
50
|
+
const response = await client.query({
|
|
51
|
+
query: gql `
|
|
52
|
+
query {
|
|
53
|
+
kpis {
|
|
54
|
+
items {
|
|
55
|
+
id
|
|
56
|
+
name
|
|
57
|
+
description
|
|
58
|
+
formula
|
|
59
|
+
}
|
|
60
|
+
total
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`
|
|
64
|
+
});
|
|
65
|
+
this.kpis = (response.data.kpis.items || []).map(kpi => ({
|
|
66
|
+
name: kpi.name,
|
|
67
|
+
desc: kpi.formula || kpi.description || ''
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
this.error = 'KPI 목록을 불러오지 못했습니다.';
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
this.loading = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
if (this.loading) {
|
|
79
|
+
return html `<div class="list-container">로딩 중...</div>`;
|
|
80
|
+
}
|
|
81
|
+
if (this.error) {
|
|
82
|
+
return html `<div class="list-container">${this.error}</div>`;
|
|
83
|
+
}
|
|
84
|
+
return html `
|
|
85
|
+
<div class="list-container">
|
|
86
|
+
<div class="list-title">KPI 목록/검색/상세</div>
|
|
87
|
+
<ul class="kpi-list">
|
|
88
|
+
${this.kpis.map(kpi => html `
|
|
89
|
+
<li class="kpi-item">
|
|
90
|
+
<div><b>${kpi.name}</b></div>
|
|
91
|
+
<div style="font-size:0.95rem;color:#888;">${kpi.desc}</div>
|
|
92
|
+
</li>
|
|
93
|
+
`)}
|
|
94
|
+
</ul>
|
|
95
|
+
</div>
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
__decorate([
|
|
100
|
+
state(),
|
|
101
|
+
__metadata("design:type", Array)
|
|
102
|
+
], KpiListSummary.prototype, "kpis", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
state(),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], KpiListSummary.prototype, "loading", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
state(),
|
|
109
|
+
__metadata("design:type", Object)
|
|
110
|
+
], KpiListSummary.prototype, "error", void 0);
|
|
111
|
+
KpiListSummary = __decorate([
|
|
112
|
+
customElement('kpi-list-summary')
|
|
113
|
+
], KpiListSummary);
|
|
114
|
+
export { KpiListSummary };
|
|
115
|
+
//# sourceMappingURL=kpi-list-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-list-summary.js","sourceRoot":"","sources":["../../../client/pages/kpi-dashboard/kpi-list-summary.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAGtB,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QA+BI,SAAI,GAA0C,EAAE,CAAA;QAChD,YAAO,GAAG,IAAI,CAAA;QACd,UAAK,GAAG,EAAE,CAAA;IA4DrB,CAAC;aA5FQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BlB,AA5BY,CA4BZ;IAMD,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QACzB,IAAI,CAAC,SAAS,EAAE,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,SAAS;QACb,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;SAYT;aACF,CAAC,CAAA;YACF,IAAI,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACvD,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,IAAI,EAAE,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,WAAW,IAAI,EAAE;aAC3C,CAAC,CAAC,CAAA;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,qBAAqB,CAAA;QACpC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACtB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAA,2CAA2C,CAAA;QACxD,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAA,+BAA+B,IAAI,CAAC,KAAK,QAAQ,CAAA;QAC9D,CAAC;QACD,OAAO,IAAI,CAAA;;;;YAIH,IAAI,CAAC,IAAI,CAAC,GAAG,CACb,GAAG,CAAC,EAAE,CAAC,IAAI,CAAA;;0BAEG,GAAG,CAAC,IAAI;6DAC2B,GAAG,CAAC,IAAI;;aAExD,CACF;;;KAGN,CAAA;IACH,CAAC;;AA7DQ;IAAR,KAAK,EAAE;8BAAO,KAAK;4CAAqC;AAChD;IAAR,KAAK,EAAE;;+CAAe;AACd;IAAR,KAAK,EAAE;;6CAAW;AAjCR,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA6F1B","sourcesContent":["import { html, css, LitElement } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\n\n@customElement('kpi-list-summary')\nexport class KpiListSummary extends LitElement {\n static styles = css`\n .list-container {\n background: #fff;\n border-radius: 16px;\n padding: 32px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);\n margin-bottom: 16px;\n }\n .list-title {\n font-size: 1.5rem;\n font-weight: bold;\n margin-bottom: 16px;\n }\n .kpi-list {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n .kpi-item {\n padding: 10px 0;\n border-bottom: 1px solid #eee;\n font-size: 1.1rem;\n cursor: pointer;\n transition: background 0.2s;\n }\n .kpi-item:hover {\n background: #f0f0f0;\n }\n `\n\n @state() kpis: Array<{ name: string; desc: string }> = []\n @state() loading = true\n @state() error = ''\n\n connectedCallback() {\n super.connectedCallback()\n this.fetchKpis()\n }\n\n async fetchKpis() {\n this.loading = true\n this.error = ''\n try {\n const response = await client.query({\n query: gql`\n query {\n kpis {\n items {\n id\n name\n description\n formula\n }\n total\n }\n }\n `\n })\n this.kpis = (response.data.kpis.items || []).map(kpi => ({\n name: kpi.name,\n desc: kpi.formula || kpi.description || ''\n }))\n } catch (e) {\n this.error = 'KPI 목록을 불러오지 못했습니다.'\n } finally {\n this.loading = false\n }\n }\n\n render() {\n if (this.loading) {\n return html`<div class=\"list-container\">로딩 중...</div>`\n }\n if (this.error) {\n return html`<div class=\"list-container\">${this.error}</div>`\n }\n return html`\n <div class=\"list-container\">\n <div class=\"list-title\">KPI 목록/검색/상세</div>\n <ul class=\"kpi-list\">\n ${this.kpis.map(\n kpi => html`\n <li class=\"kpi-item\">\n <div><b>${kpi.name}</b></div>\n <div style=\"font-size:0.95rem;color:#888;\">${kpi.desc}</div>\n </li>\n `\n )}\n </ul>\n </div>\n `\n }\n}\n"]}
|