@things-factory/kpi 9.0.31 → 9.0.32
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 +1 -2
- package/client/charts/kpi-boxplot-chart.ts +182 -42
- package/client/charts/kpi-radar-chart.ts +9 -9
- package/client/pages/kpi/kpi-list-page.ts +196 -32
- package/client/pages/kpi/kpi-overview.ts +9 -11
- package/client/pages/kpi/kpi-tree-page.ts +409 -0
- package/client/pages/kpi/kpi-view.ts +187 -0
- package/client/pages/kpi-dashboard/cards/kpi-level1-card.ts +1 -1
- package/client/pages/kpi-dashboard/cards/kpi-level2-comparison.ts +1 -1
- package/client/pages/kpi-dashboard/cards/kpi-level3-comparison.ts +1 -1
- package/client/pages/kpi-dashboard/components/kpi-left-panel.ts +198 -160
- package/client/pages/kpi-dashboard/components/kpi-map-panel.ts +133 -0
- package/client/pages/kpi-dashboard/components/kpi-region-popup.ts +3 -2
- package/client/pages/kpi-dashboard/kpi-dashboard-map.ts +4 -3
- package/client/pages/kpi-dashboard/kpi-dashboard.ts +28 -30
- package/client/pages/kpi-history/kpi-history-list-page.ts +11 -11
- package/client/pages/kpi-metric/kpi-metric-list-page.ts +10 -2
- package/client/pages/kpi-metric-value/kpi-metric-value-editor-page.ts +7 -7
- package/client/pages/kpi-metric-value/kpi-metric-value-importer.ts +2 -2
- package/client/pages/kpi-metric-value/kpi-metric-value-list-page.ts +16 -8
- package/client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.ts +5 -5
- package/client/pages/kpi-statistic/kpi-statistic-editor-page.ts +1 -2
- package/client/pages/kpi-statistic/kpi-statistic-list-page.ts +10 -2
- package/client/pages/kpi-value/kpi-value-editor-page.ts +11 -7
- package/client/pages/kpi-value/kpi-value-list-page.ts +31 -7
- package/client/route.ts +2 -9
- package/design-entities.md +8 -12
- package/dist-client/charts/kpi-boxplot-chart.d.ts +2 -0
- package/dist-client/charts/kpi-boxplot-chart.js +168 -42
- package/dist-client/charts/kpi-boxplot-chart.js.map +1 -1
- package/dist-client/charts/kpi-radar-chart.js +9 -9
- package/dist-client/charts/kpi-radar-chart.js.map +1 -1
- package/dist-client/pages/kpi/kpi-list-page.d.ts +19 -3
- package/dist-client/pages/kpi/kpi-list-page.js +188 -32
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
- package/dist-client/pages/kpi/kpi-overview.js +9 -11
- package/dist-client/pages/kpi/kpi-overview.js.map +1 -1
- package/dist-client/pages/kpi/kpi-tree-page.d.ts +59 -0
- package/dist-client/pages/kpi/kpi-tree-page.js +403 -0
- package/dist-client/pages/kpi/kpi-tree-page.js.map +1 -0
- package/dist-client/pages/kpi/kpi-view.d.ts +12 -0
- package/dist-client/pages/kpi/kpi-view.js +191 -0
- package/dist-client/pages/kpi/kpi-view.js.map +1 -0
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level1-card.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level2-comparison.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js +1 -1
- package/dist-client/pages/kpi-dashboard/cards/kpi-level3-comparison.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.d.ts +3 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js +197 -161
- package/dist-client/pages/kpi-dashboard/components/kpi-left-panel.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.d.ts +5 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js +146 -0
- package/dist-client/pages/kpi-dashboard/components/kpi-map-panel.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js +3 -2
- package/dist-client/pages/kpi-dashboard/components/kpi-region-popup.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js +4 -3
- package/dist-client/pages/kpi-dashboard/kpi-dashboard-map.js.map +1 -1
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +28 -30
- package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -1
- package/dist-client/pages/kpi-history/kpi-history-list-page.d.ts +6 -1
- package/dist-client/pages/kpi-history/kpi-history-list-page.js +11 -11
- package/dist-client/pages/kpi-history/kpi-history-list-page.js.map +1 -1
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.d.ts +5 -0
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +10 -2
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.d.ts +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +8 -8
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js +2 -2
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-importer.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.d.ts +5 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +16 -8
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.d.ts +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +6 -6
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -1
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js +1 -2
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js.map +1 -1
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.d.ts +5 -0
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js +10 -2
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-editor-page.d.ts +2 -1
- package/dist-client/pages/kpi-value/kpi-value-editor-page.js +16 -8
- package/dist-client/pages/kpi-value/kpi-value-editor-page.js.map +1 -1
- package/dist-client/pages/kpi-value/kpi-value-list-page.d.ts +5 -0
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +31 -7
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +2 -8
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/kpi-metric-value-provider.d.ts +1 -1
- package/dist-server/controllers/kpi-metric-value-provider.js +4 -4
- package/dist-server/controllers/kpi-metric-value-provider.js.map +1 -1
- package/dist-server/controllers/kpi-value-provider.d.ts +1 -1
- package/dist-server/controllers/kpi-value-provider.js +3 -3
- package/dist-server/controllers/kpi-value-provider.js.map +1 -1
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.d.ts +6 -0
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.js +101 -0
- package/dist-server/migrations/1752190849680-seed-kpi-metrics.js.map +1 -0
- package/dist-server/migrations/1752190849681-seed-kpi.d.ts +5 -0
- package/dist-server/migrations/1752190849681-seed-kpi.js +315 -0
- package/dist-server/migrations/1752190849681-seed-kpi.js.map +1 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.d.ts +7 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.js +51 -0
- package/dist-server/migrations/1752192090123-add-grades-to-kpi.js.map +1 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.d.ts +5 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.js +710 -0
- package/dist-server/migrations/1752192090124-add-kpi-statistics.js.map +1 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.d.ts +6 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.js +111 -0
- package/dist-server/migrations/1752192090128-seed-kpi-org-scope.js.map +1 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.d.ts +6 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.js +187 -0
- package/dist-server/migrations/1752192090129-seed-kpi-values.js.map +1 -0
- package/dist-server/migrations/grade-data/x11-performance-table.json +962 -0
- package/dist-server/migrations/grade-data/x12-performance-table.json +611 -0
- package/dist-server/migrations/grade-data/x14-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x21-performance-table.json +889 -0
- package/dist-server/migrations/grade-data/x22-performance-table.json +1064 -0
- package/dist-server/migrations/grade-data/x23-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x31-performance-table.json +644 -0
- package/dist-server/migrations/grade-data/x32-performance-table.json +993 -0
- package/dist-server/migrations/grade-data/x33-performance-table.json +195 -0
- package/dist-server/migrations/grade-data/x34-performance-table.json +12 -0
- package/dist-server/migrations/grade-data/x35-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x41-performance-table.json +825 -0
- package/dist-server/migrations/grade-data/x42-performance-table.json +786 -0
- package/dist-server/migrations/grade-data/x43-performance-table.json +12 -0
- package/dist-server/migrations/grade-data/x44-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x51-performance-table.json +924 -0
- package/dist-server/migrations/grade-data/x52-performance-table.json +42 -0
- package/dist-server/migrations/grade-data/x61-performance-table.json +261 -0
- package/dist-server/migrations/grade-data/x62-performance-table.json +42 -0
- package/dist-server/migrations/seed-data/kpi-metrics-seed.json +454 -0
- package/dist-server/migrations/seed-data/kpi-org-scope-seed.json +1676 -0
- package/dist-server/migrations/seed-data/kpi-values-seed.json +402 -0
- package/dist-server/migrations/seed-data/kpis-seed.json +488 -0
- package/dist-server/service/index.d.ts +3 -7
- package/dist-server/service/index.js +5 -12
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/kpi/aggregate-kpi.js +30 -13
- package/dist-server/service/kpi/aggregate-kpi.js.map +1 -1
- package/dist-server/service/kpi/kpi-formula.service.d.ts +15 -0
- package/dist-server/service/kpi/kpi-formula.service.js +90 -0
- package/dist-server/service/kpi/kpi-formula.service.js.map +1 -1
- package/dist-server/service/kpi/kpi-history.d.ts +0 -3
- package/dist-server/service/kpi/kpi-history.js +0 -10
- package/dist-server/service/kpi/kpi-history.js.map +1 -1
- package/dist-server/service/kpi/kpi-mutation.d.ts +1 -1
- package/dist-server/service/kpi/kpi-mutation.js +57 -20
- package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
- package/dist-server/service/kpi/kpi-query.d.ts +7 -3
- package/dist-server/service/kpi/kpi-query.js +126 -10
- package/dist-server/service/kpi/kpi-query.js.map +1 -1
- package/dist-server/service/kpi/kpi-type.d.ts +4 -2
- package/dist-server/service/kpi/kpi-type.js +12 -4
- package/dist-server/service/kpi/kpi-type.js.map +1 -1
- package/dist-server/service/kpi/kpi.d.ts +4 -3
- package/dist-server/service/kpi/kpi.js +20 -8
- package/dist-server/service/kpi/kpi.js.map +1 -1
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js +46 -11
- package/dist-server/service/kpi-metric/aggregate-kpi-metric.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.d.ts +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js +6 -6
- package/dist-server/service/kpi-metric-value/kpi-metric-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.d.ts +2 -2
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.js +4 -4
- package/dist-server/service/kpi-metric-value/kpi-metric-value-type.js.map +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value.d.ts +1 -1
- package/dist-server/service/kpi-metric-value/kpi-metric-value.js +3 -3
- package/dist-server/service/kpi-metric-value/kpi-metric-value.js.map +1 -1
- package/dist-server/service/kpi-org-scope/index.d.ts +9 -0
- package/dist-server/service/kpi-org-scope/index.js +14 -0
- package/dist-server/service/kpi-org-scope/index.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.d.ts +8 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.js +170 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-mutation.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.d.ts +14 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.js +152 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-query.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.d.ts +26 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.js +101 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope-type.js.map +1 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.d.ts +26 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.js +135 -0
- package/dist-server/service/kpi-org-scope/kpi-org-scope.js.map +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.d.ts +1 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.js +11 -0
- package/dist-server/service/kpi-statistic/kpi-statistic.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-mutation.js +71 -7
- package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value-type.d.ts +4 -2
- package/dist-server/service/kpi-value/kpi-value-type.js +12 -4
- package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -1
- package/dist-server/service/kpi-value/kpi-value.d.ts +3 -1
- package/dist-server/service/kpi-value/kpi-value.js +11 -5
- package/dist-server/service/kpi-value/kpi-value.js.map +1 -1
- package/dist-server/service/utils/value-date-util.d.ts +1 -0
- package/dist-server/service/utils/value-date-util.js +41 -0
- package/dist-server/service/utils/value-date-util.js.map +1 -1
- package/dist-server/tsconfig.json +10 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/server/@types/index.d.ts +11 -0
- package/server/controllers/kpi-metric-value-provider.ts +5 -5
- package/server/controllers/kpi-value-provider.ts +4 -4
- package/server/migrations/1752190849680-seed-kpi-metrics.ts +124 -0
- package/server/migrations/1752190849681-seed-kpi.ts +356 -0
- package/server/migrations/1752192090123-add-grades-to-kpi.ts +67 -0
- package/server/migrations/1752192090124-add-kpi-statistics.ts +719 -0
- package/server/migrations/1752192090128-seed-kpi-org-scope.ts +132 -0
- package/server/migrations/1752192090129-seed-kpi-values.ts +207 -0
- package/server/migrations/grade-data/x11-performance-table.json +962 -0
- package/server/migrations/grade-data/x12-performance-table.json +611 -0
- package/server/migrations/grade-data/x14-performance-table.json +42 -0
- package/server/migrations/grade-data/x21-performance-table.json +889 -0
- package/server/migrations/grade-data/x22-performance-table.json +1064 -0
- package/server/migrations/grade-data/x23-performance-table.json +42 -0
- package/server/migrations/grade-data/x31-performance-table.json +644 -0
- package/server/migrations/grade-data/x32-performance-table.json +993 -0
- package/server/migrations/grade-data/x33-performance-table.json +195 -0
- package/server/migrations/grade-data/x34-performance-table.json +12 -0
- package/server/migrations/grade-data/x35-performance-table.json +42 -0
- package/server/migrations/grade-data/x41-performance-table.json +825 -0
- package/server/migrations/grade-data/x42-performance-table.json +786 -0
- package/server/migrations/grade-data/x43-performance-table.json +12 -0
- package/server/migrations/grade-data/x44-performance-table.json +42 -0
- package/server/migrations/grade-data/x51-performance-table.json +924 -0
- package/server/migrations/grade-data/x52-performance-table.json +42 -0
- package/server/migrations/grade-data/x61-performance-table.json +261 -0
- package/server/migrations/grade-data/x62-performance-table.json +42 -0
- package/server/migrations/seed-data/kpi-metrics-seed.json +454 -0
- package/server/migrations/seed-data/kpi-org-scope-seed.json +1676 -0
- package/server/migrations/seed-data/kpi-values-seed.json +402 -0
- package/server/migrations/seed-data/kpis-seed.json +488 -0
- package/server/service/index.ts +5 -12
- package/server/service/kpi/aggregate-kpi.ts +31 -13
- package/server/service/kpi/kpi-formula.service.ts +101 -0
- package/server/service/kpi/kpi-history.ts +0 -8
- package/server/service/kpi/kpi-mutation.ts +59 -19
- package/server/service/kpi/kpi-query.ts +118 -8
- package/server/service/kpi/kpi-type.ts +10 -4
- package/server/service/kpi/kpi.ts +17 -7
- package/server/service/kpi-metric/aggregate-kpi-metric.ts +55 -11
- package/server/service/kpi-metric-value/kpi-metric-value-mutation.ts +6 -6
- package/server/service/kpi-metric-value/kpi-metric-value-type.ts +4 -4
- package/server/service/kpi-metric-value/kpi-metric-value.ts +3 -3
- package/server/service/kpi-org-scope/index.ts +11 -0
- package/server/service/kpi-org-scope/kpi-org-scope-mutation.ts +173 -0
- package/server/service/kpi-org-scope/kpi-org-scope-query.ts +127 -0
- package/server/service/kpi-org-scope/kpi-org-scope-type.ts +68 -0
- package/server/service/kpi-org-scope/kpi-org-scope.ts +123 -0
- package/server/service/kpi-statistic/kpi-statistic.ts +10 -0
- package/server/service/kpi-value/kpi-value-mutation.ts +73 -7
- package/server/service/kpi-value/kpi-value-type.ts +10 -4
- package/server/service/kpi-value/kpi-value.ts +10 -5
- package/server/service/utils/value-date-util.ts +47 -0
- package/server/types/global.d.ts +8 -0
- package/things-factory.config.js +1 -0
- package/translations/en.json +15 -3
- package/translations/ja.json +13 -3
- package/translations/ko.json +15 -3
- package/translations/ms.json +13 -3
- package/translations/zh.json +13 -3
- package/client/pages/kpi-category/kpi-category-importer.ts +0 -90
- package/client/pages/kpi-category/kpi-category-list-page.ts +0 -537
- package/client/pages/kpi-category/kpi-category-value-calculator.ts +0 -233
- package/client/pages/kpi-category-value/kpi-category-value-list-page.ts +0 -404
- package/dist-client/pages/kpi-category/kpi-category-importer.d.ts +0 -23
- package/dist-client/pages/kpi-category/kpi-category-importer.js +0 -92
- package/dist-client/pages/kpi-category/kpi-category-importer.js.map +0 -1
- package/dist-client/pages/kpi-category/kpi-category-list-page.d.ts +0 -74
- package/dist-client/pages/kpi-category/kpi-category-list-page.js +0 -517
- package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +0 -1
- package/dist-client/pages/kpi-category/kpi-category-value-calculator.d.ts +0 -13
- package/dist-client/pages/kpi-category/kpi-category-value-calculator.js +0 -256
- package/dist-client/pages/kpi-category/kpi-category-value-calculator.js.map +0 -1
- package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.d.ts +0 -63
- package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.js +0 -393
- package/dist-client/pages/kpi-category-value/kpi-category-value-list-page.js.map +0 -1
- package/dist-server/service/kpi-category/index.d.ts +0 -6
- package/dist-server/service/kpi-category/index.js +0 -10
- package/dist-server/service/kpi-category/index.js.map +0 -1
- package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +0 -9
- package/dist-server/service/kpi-category/kpi-category-mutation.js +0 -221
- package/dist-server/service/kpi-category/kpi-category-mutation.js.map +0 -1
- package/dist-server/service/kpi-category/kpi-category-query.d.ts +0 -18
- package/dist-server/service/kpi-category/kpi-category-query.js +0 -115
- package/dist-server/service/kpi-category/kpi-category-query.js.map +0 -1
- package/dist-server/service/kpi-category/kpi-category-type.d.ts +0 -24
- package/dist-server/service/kpi-category/kpi-category-type.js +0 -100
- package/dist-server/service/kpi-category/kpi-category-type.js.map +0 -1
- package/dist-server/service/kpi-category/kpi-category.d.ts +0 -22
- package/dist-server/service/kpi-category/kpi-category.js +0 -106
- package/dist-server/service/kpi-category/kpi-category.js.map +0 -1
- package/dist-server/service/kpi-category-value/index.d.ts +0 -6
- package/dist-server/service/kpi-category-value/index.js +0 -10
- package/dist-server/service/kpi-category-value/index.js.map +0 -1
- package/dist-server/service/kpi-category-value/kpi-category-value-mutation.d.ts +0 -8
- package/dist-server/service/kpi-category-value/kpi-category-value-mutation.js +0 -102
- package/dist-server/service/kpi-category-value/kpi-category-value-mutation.js.map +0 -1
- package/dist-server/service/kpi-category-value/kpi-category-value-query.d.ts +0 -13
- package/dist-server/service/kpi-category-value/kpi-category-value-query.js +0 -91
- package/dist-server/service/kpi-category-value/kpi-category-value-query.js.map +0 -1
- package/dist-server/service/kpi-category-value/kpi-category-value-type.d.ts +0 -19
- package/dist-server/service/kpi-category-value/kpi-category-value-type.js +0 -73
- package/dist-server/service/kpi-category-value/kpi-category-value-type.js.map +0 -1
- package/dist-server/service/kpi-category-value/kpi-category-value.d.ts +0 -19
- package/dist-server/service/kpi-category-value/kpi-category-value.js +0 -91
- package/dist-server/service/kpi-category-value/kpi-category-value.js.map +0 -1
- package/helps/kpi/kpi-category.md +0 -160
- package/server/service/kpi-category/index.ts +0 -7
- package/server/service/kpi-category/kpi-category-mutation.ts +0 -217
- package/server/service/kpi-category/kpi-category-query.ts +0 -87
- package/server/service/kpi-category/kpi-category-type.ts +0 -73
- package/server/service/kpi-category/kpi-category.ts +0 -95
- package/server/service/kpi-category-value/index.ts +0 -7
- package/server/service/kpi-category-value/kpi-category-value-mutation.ts +0 -88
- package/server/service/kpi-category-value/kpi-category-value-query.ts +0 -62
- package/server/service/kpi-category-value/kpi-category-value-type.ts +0 -48
- package/server/service/kpi-category-value/kpi-category-value.ts +0 -79
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
|
|
3
|
-
import { css, html, LitElement } from 'lit'
|
|
4
|
-
import { customElement, property, state } from 'lit/decorators.js'
|
|
5
|
-
import { client } from '@operato/graphql'
|
|
6
|
-
import { notify } from '@operato/layout'
|
|
7
|
-
import gql from 'graphql-tag'
|
|
8
|
-
|
|
9
|
-
// KpiPeriodType enum 정의 (서버와 동일하게)
|
|
10
|
-
enum KpiPeriodType {
|
|
11
|
-
DAY = 'DAY',
|
|
12
|
-
WEEK = 'WEEK',
|
|
13
|
-
MONTH = 'MONTH',
|
|
14
|
-
QUARTER = 'QUARTER',
|
|
15
|
-
YEAR = 'YEAR',
|
|
16
|
-
RANGE = 'RANGE',
|
|
17
|
-
ALLTIME = 'ALLTIME'
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// periodType에 따른 마지막 일자 계산 함수
|
|
21
|
-
function getLastValueDate(periodType: KpiPeriodType = KpiPeriodType.DAY): string {
|
|
22
|
-
const now = new Date()
|
|
23
|
-
|
|
24
|
-
switch (periodType) {
|
|
25
|
-
case KpiPeriodType.DAY: {
|
|
26
|
-
const d = new Date(now)
|
|
27
|
-
d.setDate(d.getDate() - 1)
|
|
28
|
-
return d.toISOString().slice(0, 10)
|
|
29
|
-
}
|
|
30
|
-
case KpiPeriodType.MONTH: {
|
|
31
|
-
const d = new Date(now)
|
|
32
|
-
d.setMonth(d.getMonth() - 1)
|
|
33
|
-
return d.toISOString().slice(0, 7)
|
|
34
|
-
}
|
|
35
|
-
case KpiPeriodType.QUARTER: {
|
|
36
|
-
let year = now.getFullYear()
|
|
37
|
-
let quarter = Math.floor(now.getMonth() / 3)
|
|
38
|
-
if (quarter === 0) {
|
|
39
|
-
year -= 1
|
|
40
|
-
quarter = 4
|
|
41
|
-
}
|
|
42
|
-
return `${year}-Q${quarter}`
|
|
43
|
-
}
|
|
44
|
-
case KpiPeriodType.WEEK: {
|
|
45
|
-
const d = new Date(now)
|
|
46
|
-
d.setDate(d.getDate() - 7)
|
|
47
|
-
const year = d.getFullYear()
|
|
48
|
-
const week = getISOWeek(d)
|
|
49
|
-
return `${year}-W${week}`
|
|
50
|
-
}
|
|
51
|
-
case KpiPeriodType.ALLTIME:
|
|
52
|
-
return 'ALLTIME'
|
|
53
|
-
default: {
|
|
54
|
-
const d = new Date(now)
|
|
55
|
-
d.setDate(d.getDate() - 1)
|
|
56
|
-
return d.toISOString().slice(0, 10)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// ISO 주차 계산 함수
|
|
62
|
-
function getISOWeek(date: Date): number {
|
|
63
|
-
const tmp = new Date(date.getTime())
|
|
64
|
-
tmp.setHours(0, 0, 0, 0)
|
|
65
|
-
tmp.setDate(tmp.getDate() + 4 - (tmp.getDay() || 7))
|
|
66
|
-
const yearStart = new Date(tmp.getFullYear(), 0, 1)
|
|
67
|
-
const weekNo = Math.ceil(((tmp.getTime() - yearStart.getTime()) / 86400000 + 1) / 7)
|
|
68
|
-
return weekNo
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@customElement('kpi-category-value-calculator')
|
|
72
|
-
export class KpiCategoryValueCalculator extends LitElement {
|
|
73
|
-
static styles = [
|
|
74
|
-
css`
|
|
75
|
-
:host {
|
|
76
|
-
display: block;
|
|
77
|
-
padding: 20px;
|
|
78
|
-
min-width: 400px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.container {
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
gap: 10px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.form-group {
|
|
88
|
-
display: flex;
|
|
89
|
-
flex-direction: column;
|
|
90
|
-
margin-bottom: 15px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
label {
|
|
94
|
-
display: block;
|
|
95
|
-
margin-bottom: 5px;
|
|
96
|
-
font-weight: bold;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
input,
|
|
100
|
-
select {
|
|
101
|
-
padding: 8px;
|
|
102
|
-
border: 1px solid #ccc;
|
|
103
|
-
border-radius: 4px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.result {
|
|
107
|
-
margin-top: 20px;
|
|
108
|
-
padding: 15px;
|
|
109
|
-
background-color: #f5f5f5;
|
|
110
|
-
border-radius: 4px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.result-value {
|
|
114
|
-
font-size: 18px;
|
|
115
|
-
font-weight: bold;
|
|
116
|
-
color: #2196f3;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.kpi-values {
|
|
120
|
-
margin-top: 10px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.kpi-value-item {
|
|
124
|
-
display: flex;
|
|
125
|
-
justify-content: space-between;
|
|
126
|
-
padding: 5px 0;
|
|
127
|
-
border-bottom: 1px solid #eee;
|
|
128
|
-
}
|
|
129
|
-
`
|
|
130
|
-
]
|
|
131
|
-
|
|
132
|
-
@property({ type: String }) categoryId = ''
|
|
133
|
-
@property({ type: String }) categoryName = ''
|
|
134
|
-
@state() valueDate = getLastValueDate()
|
|
135
|
-
@state() group = ''
|
|
136
|
-
@state() result: any = null
|
|
137
|
-
@state() loading = false
|
|
138
|
-
|
|
139
|
-
render() {
|
|
140
|
-
return html`
|
|
141
|
-
<div class="container">
|
|
142
|
-
<h3>${this.categoryName} - KPI 값 계산</h3>
|
|
143
|
-
|
|
144
|
-
<div class="form-group">
|
|
145
|
-
<label>계산 기준일</label>
|
|
146
|
-
<input type="date" .value=${this.valueDate} @input=${e => (this.valueDate = e.target.value)} />
|
|
147
|
-
</div>
|
|
148
|
-
|
|
149
|
-
<div class="form-group">
|
|
150
|
-
<label>그룹</label>
|
|
151
|
-
<input
|
|
152
|
-
type="text"
|
|
153
|
-
placeholder="그룹명 (선택사항)"
|
|
154
|
-
.value=${this.group}
|
|
155
|
-
@input=${e => (this.group = e.target.value)}
|
|
156
|
-
/>
|
|
157
|
-
</div>
|
|
158
|
-
|
|
159
|
-
<button
|
|
160
|
-
@click=${this.calculateValue}
|
|
161
|
-
?disabled=${this.loading}
|
|
162
|
-
style="width: 100%; padding: 10px; background: #2196f3; color: white; border: none; border-radius: 4px; cursor: pointer;"
|
|
163
|
-
>
|
|
164
|
-
${this.loading ? '계산 중...' : '계산하기'}
|
|
165
|
-
</button>
|
|
166
|
-
|
|
167
|
-
${this.result
|
|
168
|
-
? html`
|
|
169
|
-
<div class="result">
|
|
170
|
-
<div class="result-value">
|
|
171
|
-
계산 결과: ${this.result.value !== null ? this.result.value.toFixed(2) : 'N/A'}
|
|
172
|
-
</div>
|
|
173
|
-
${this.result.kpiValues && this.result.kpiValues.length > 0
|
|
174
|
-
? html`
|
|
175
|
-
<div class="kpi-values">
|
|
176
|
-
<h4>개별 KPI 값:</h4>
|
|
177
|
-
${this.result.kpiValues.map(
|
|
178
|
-
item => html`
|
|
179
|
-
<div class="kpi-value-item">
|
|
180
|
-
<span>KPI ID: ${item.kpiId}</span>
|
|
181
|
-
<span>${item.value !== null ? item.value.toFixed(2) : 'N/A'}</span>
|
|
182
|
-
</div>
|
|
183
|
-
`
|
|
184
|
-
)}
|
|
185
|
-
</div>
|
|
186
|
-
`
|
|
187
|
-
: ''}
|
|
188
|
-
</div>
|
|
189
|
-
`
|
|
190
|
-
: ''}
|
|
191
|
-
</div>
|
|
192
|
-
`
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
async calculateValue() {
|
|
196
|
-
if (!this.categoryId) return
|
|
197
|
-
|
|
198
|
-
this.loading = true
|
|
199
|
-
try {
|
|
200
|
-
const response = await client.query({
|
|
201
|
-
query: gql`
|
|
202
|
-
query ($categoryId: String!, $valueDate: String, $group: String) {
|
|
203
|
-
calculateKpiValue(categoryId: $categoryId, valueDate: $valueDate, group: $group) {
|
|
204
|
-
value
|
|
205
|
-
valueDate
|
|
206
|
-
group
|
|
207
|
-
kpiValues {
|
|
208
|
-
kpiId
|
|
209
|
-
value
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
`,
|
|
214
|
-
variables: {
|
|
215
|
-
categoryId: this.categoryId,
|
|
216
|
-
valueDate: this.valueDate || null,
|
|
217
|
-
group: this.group || null
|
|
218
|
-
}
|
|
219
|
-
})
|
|
220
|
-
|
|
221
|
-
if (!response.errors) {
|
|
222
|
-
this.result = response.data.calculateKpiValue
|
|
223
|
-
}
|
|
224
|
-
} catch (error) {
|
|
225
|
-
console.error('KPI 값 계산 중 오류:', error)
|
|
226
|
-
notify({
|
|
227
|
-
message: 'KPI 값 계산 중 오류가 발생했습니다.'
|
|
228
|
-
})
|
|
229
|
-
} finally {
|
|
230
|
-
this.loading = false
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@material/web/button/elevated-button.js'
|
|
3
|
-
import '@operato/data-grist/ox-grist.js'
|
|
4
|
-
import '@operato/data-grist/ox-filters-form.js'
|
|
5
|
-
import '@operato/data-grist/ox-record-creator.js'
|
|
6
|
-
|
|
7
|
-
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
8
|
-
import { PageView, store } from '@operato/shell'
|
|
9
|
-
import { css, html } from 'lit'
|
|
10
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
|
11
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
12
|
-
import { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'
|
|
13
|
-
import { client } from '@operato/graphql'
|
|
14
|
-
import { i18next, localize } from '@operato/i18n'
|
|
15
|
-
import { notify, openPopup } from '@operato/layout'
|
|
16
|
-
import { OxPopup, OxPrompt } from '@operato/popup'
|
|
17
|
-
import { isMobileDevice } from '@operato/utils'
|
|
18
|
-
|
|
19
|
-
import { connect } from 'pwa-helpers/connect-mixin'
|
|
20
|
-
import gql from 'graphql-tag'
|
|
21
|
-
|
|
22
|
-
@customElement('kpi-category-value-list-page')
|
|
23
|
-
export class KpiCategoryValueListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
|
|
24
|
-
static styles = [
|
|
25
|
-
ScrollbarStyles,
|
|
26
|
-
CommonGristStyles,
|
|
27
|
-
CommonHeaderStyles,
|
|
28
|
-
css`
|
|
29
|
-
:host {
|
|
30
|
-
display: flex;
|
|
31
|
-
|
|
32
|
-
width: 100%;
|
|
33
|
-
|
|
34
|
-
--grid-record-emphasized-background-color: #8b0000;
|
|
35
|
-
--grid-record-emphasized-color: #ff6b6b;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
ox-grist {
|
|
39
|
-
overflow-y: auto;
|
|
40
|
-
flex: 1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
ox-filters-form {
|
|
44
|
-
flex: 1;
|
|
45
|
-
}
|
|
46
|
-
`
|
|
47
|
-
]
|
|
48
|
-
|
|
49
|
-
@property({ type: Object }) gristConfig: any
|
|
50
|
-
@property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
51
|
-
|
|
52
|
-
@query('ox-grist') private grist!: DataGrist
|
|
53
|
-
|
|
54
|
-
get context() {
|
|
55
|
-
return {
|
|
56
|
-
title: i18next.t('title.kpi category value list'),
|
|
57
|
-
search: {
|
|
58
|
-
handler: (search: string) => {
|
|
59
|
-
this.grist.searchText = search
|
|
60
|
-
},
|
|
61
|
-
value: this.grist.searchText
|
|
62
|
-
},
|
|
63
|
-
filter: {
|
|
64
|
-
handler: () => {
|
|
65
|
-
this.grist.toggleHeadroom()
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
help: 'kpi/kpi-category-value',
|
|
69
|
-
actions: [
|
|
70
|
-
{
|
|
71
|
-
title: i18next.t('button.save'),
|
|
72
|
-
action: this._updateKpiCategoryValue.bind(this),
|
|
73
|
-
...CommonButtonStyles.save
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
title: i18next.t('button.delete'),
|
|
77
|
-
action: this._deleteKpiCategoryValue.bind(this),
|
|
78
|
-
...CommonButtonStyles.delete
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
exportable: {
|
|
82
|
-
name: i18next.t('title.kpi category value list'),
|
|
83
|
-
data: this.exportHandler.bind(this)
|
|
84
|
-
},
|
|
85
|
-
importable: {
|
|
86
|
-
handler: this.importHandler.bind(this)
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
render() {
|
|
92
|
-
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
|
|
93
|
-
|
|
94
|
-
return html`
|
|
95
|
-
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
96
|
-
<div slot="headroom" class="header">
|
|
97
|
-
<div class="filters">
|
|
98
|
-
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
99
|
-
|
|
100
|
-
<div id="modes">
|
|
101
|
-
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
102
|
-
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
103
|
-
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
<ox-record-creator id="add" .callback=${this.creationCallback.bind(this)}>
|
|
107
|
-
<button>
|
|
108
|
-
<md-icon>add</md-icon>
|
|
109
|
-
</button>
|
|
110
|
-
</ox-record-creator>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
</ox-grist>
|
|
114
|
-
`
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
async pageInitialized(lifecycle: any) {
|
|
118
|
-
this.gristConfig = {
|
|
119
|
-
list: {
|
|
120
|
-
fields: ['category', 'valueDate', 'score', 'group', 'createdAt', 'updatedAt', 'creator', 'updater'],
|
|
121
|
-
details: ['category', 'valueDate', 'score', 'group', 'createdAt', 'updatedAt', 'creator', 'updater']
|
|
122
|
-
},
|
|
123
|
-
columns: [
|
|
124
|
-
{ type: 'gutter', gutterName: 'sequence' },
|
|
125
|
-
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
126
|
-
// KPI Category Value 계산 버튼 추가
|
|
127
|
-
{
|
|
128
|
-
type: 'gutter',
|
|
129
|
-
gutterName: 'button',
|
|
130
|
-
icon: 'calculate',
|
|
131
|
-
title: '계산',
|
|
132
|
-
handlers: {
|
|
133
|
-
click: (columns, data, column, record, rowIndex) => {
|
|
134
|
-
this._calculateKpiCategoryValue(record)
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
type: 'string',
|
|
140
|
-
name: 'category',
|
|
141
|
-
header: '카테고리',
|
|
142
|
-
record: { editable: false, renderer: (v, c, r) => r.category?.name },
|
|
143
|
-
width: 150
|
|
144
|
-
},
|
|
145
|
-
{ type: 'string', name: 'valueDate', header: '실적일', record: { editable: true }, width: 120 },
|
|
146
|
-
{ type: 'number', name: 'score', header: '성과점수', record: { editable: false }, width: 120 },
|
|
147
|
-
{ type: 'string', name: 'group', header: '그룹', record: { editable: false }, width: 120 },
|
|
148
|
-
{ type: 'datetime', name: 'createdAt', header: '생성일', record: { editable: false }, width: 180 },
|
|
149
|
-
{ type: 'datetime', name: 'updatedAt', header: '수정일', record: { editable: false }, width: 180 },
|
|
150
|
-
{
|
|
151
|
-
type: 'resource-object',
|
|
152
|
-
name: 'creator',
|
|
153
|
-
header: '생성자',
|
|
154
|
-
record: { editable: false, renderer: (v, c, r) => r.creator?.name },
|
|
155
|
-
width: 120
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
type: 'resource-object',
|
|
159
|
-
name: 'updater',
|
|
160
|
-
header: '수정자',
|
|
161
|
-
record: { editable: false, renderer: (v, c, r) => r.updater?.name },
|
|
162
|
-
width: 120
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
async pageUpdated(changes: any, lifecycle: any) {
|
|
169
|
-
if (changes.has('mode')) {
|
|
170
|
-
this.grist.mode = this.mode
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
|
|
175
|
-
const response = await client.query({
|
|
176
|
-
query: gql`
|
|
177
|
-
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
178
|
-
responses: kpiCategoryValues(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
179
|
-
items {
|
|
180
|
-
id
|
|
181
|
-
category {
|
|
182
|
-
id
|
|
183
|
-
name
|
|
184
|
-
}
|
|
185
|
-
valueDate
|
|
186
|
-
score
|
|
187
|
-
group
|
|
188
|
-
updater {
|
|
189
|
-
id
|
|
190
|
-
name
|
|
191
|
-
}
|
|
192
|
-
updatedAt
|
|
193
|
-
creator {
|
|
194
|
-
id
|
|
195
|
-
name
|
|
196
|
-
}
|
|
197
|
-
createdAt
|
|
198
|
-
}
|
|
199
|
-
total
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
`,
|
|
203
|
-
variables: {
|
|
204
|
-
filters,
|
|
205
|
-
pagination: { page, limit },
|
|
206
|
-
sortings
|
|
207
|
-
}
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
return {
|
|
211
|
-
total: response.data.responses.total || 0,
|
|
212
|
-
records: response.data.responses.items || []
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
async _deleteKpiCategoryValue() {
|
|
217
|
-
if (
|
|
218
|
-
await OxPrompt.open({
|
|
219
|
-
title: i18next.t('text.are_you_sure'),
|
|
220
|
-
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
221
|
-
confirmButton: { text: i18next.t('button.confirm') },
|
|
222
|
-
cancelButton: { text: i18next.t('button.cancel') }
|
|
223
|
-
})
|
|
224
|
-
) {
|
|
225
|
-
const ids = this.grist.selected.map(record => record.id)
|
|
226
|
-
if (ids && ids.length > 0) {
|
|
227
|
-
const response = await client.mutate({
|
|
228
|
-
mutation: gql`
|
|
229
|
-
mutation ($ids: [String!]!) {
|
|
230
|
-
deleteKpiCategoryValues(ids: $ids)
|
|
231
|
-
}
|
|
232
|
-
`,
|
|
233
|
-
variables: {
|
|
234
|
-
ids
|
|
235
|
-
}
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
if (!response.errors) {
|
|
239
|
-
this.grist.fetch()
|
|
240
|
-
notify({
|
|
241
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
242
|
-
})
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
async _updateKpiCategoryValue() {
|
|
249
|
-
let patches = this.grist.dirtyRecords
|
|
250
|
-
if (patches && patches.length) {
|
|
251
|
-
patches = patches.map(patch => {
|
|
252
|
-
let patchField: any = patch.id ? { id: patch.id } : {}
|
|
253
|
-
const dirtyFields = patch.__dirtyfields__
|
|
254
|
-
for (let key in dirtyFields) {
|
|
255
|
-
patchField[key] = dirtyFields[key].after
|
|
256
|
-
}
|
|
257
|
-
patchField.cuFlag = patch.__dirty__
|
|
258
|
-
|
|
259
|
-
return patchField
|
|
260
|
-
})
|
|
261
|
-
|
|
262
|
-
const response = await client.mutate({
|
|
263
|
-
mutation: gql`
|
|
264
|
-
mutation ($patches: [KpiCategoryValuePatch!]!) {
|
|
265
|
-
updateMultipleKpiCategoryValue(patches: $patches) {
|
|
266
|
-
id
|
|
267
|
-
category {
|
|
268
|
-
id
|
|
269
|
-
name
|
|
270
|
-
}
|
|
271
|
-
valueDate
|
|
272
|
-
score
|
|
273
|
-
group
|
|
274
|
-
updater {
|
|
275
|
-
id
|
|
276
|
-
name
|
|
277
|
-
}
|
|
278
|
-
updatedAt
|
|
279
|
-
creator {
|
|
280
|
-
id
|
|
281
|
-
name
|
|
282
|
-
}
|
|
283
|
-
createdAt
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
`,
|
|
287
|
-
variables: {
|
|
288
|
-
patches
|
|
289
|
-
}
|
|
290
|
-
})
|
|
291
|
-
|
|
292
|
-
if (!response.errors) {
|
|
293
|
-
this.grist.fetch()
|
|
294
|
-
notify({
|
|
295
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.save') })
|
|
296
|
-
})
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
async _calculateKpiCategoryValue(kpiCategoryValue) {
|
|
302
|
-
try {
|
|
303
|
-
const response = await client.mutate({
|
|
304
|
-
mutation: gql`
|
|
305
|
-
mutation ($categoryId: String!, $valueDate: String, $group: String) {
|
|
306
|
-
calculateKpiValue(categoryId: $categoryId, valueDate: $valueDate, group: $group) {
|
|
307
|
-
score
|
|
308
|
-
valueDate
|
|
309
|
-
group
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
`,
|
|
313
|
-
variables: {
|
|
314
|
-
categoryId: kpiCategoryValue.category.id,
|
|
315
|
-
valueDate: kpiCategoryValue.valueDate,
|
|
316
|
-
group: kpiCategoryValue.group
|
|
317
|
-
}
|
|
318
|
-
})
|
|
319
|
-
|
|
320
|
-
if (!response.errors) {
|
|
321
|
-
const result = response.data.calculateKpiValue
|
|
322
|
-
|
|
323
|
-
// 팝업으로 결과 표시
|
|
324
|
-
await openPopup(html`
|
|
325
|
-
<div style="padding: 20px;">
|
|
326
|
-
<h3>KPI Category Value 계산 결과</h3>
|
|
327
|
-
<p><strong>성과점수:</strong> ${result.score || 'N/A'}</p>
|
|
328
|
-
<p><strong>실적일:</strong> ${result.valueDate || 'N/A'}</p>
|
|
329
|
-
<p><strong>그룹:</strong> ${result.group || 'N/A'}</p>
|
|
330
|
-
</div>
|
|
331
|
-
`)
|
|
332
|
-
|
|
333
|
-
// 목록 새로고침
|
|
334
|
-
this.grist.fetch()
|
|
335
|
-
|
|
336
|
-
notify({
|
|
337
|
-
message: 'KPI Category Value 계산이 완료되었습니다.'
|
|
338
|
-
})
|
|
339
|
-
}
|
|
340
|
-
} catch (error) {
|
|
341
|
-
console.error('KPI Category Value 계산 중 오류:', error)
|
|
342
|
-
notify({
|
|
343
|
-
message: 'KPI Category Value 계산 중 오류가 발생했습니다.'
|
|
344
|
-
})
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
async creationCallback(kpiCategoryValue) {
|
|
349
|
-
const response = await client.mutate({
|
|
350
|
-
mutation: gql`
|
|
351
|
-
mutation ($kpiCategoryValue: NewKpiCategoryValue!) {
|
|
352
|
-
createKpiCategoryValue(kpiCategoryValue: $kpiCategoryValue) {
|
|
353
|
-
id
|
|
354
|
-
category {
|
|
355
|
-
id
|
|
356
|
-
name
|
|
357
|
-
}
|
|
358
|
-
valueDate
|
|
359
|
-
score
|
|
360
|
-
group
|
|
361
|
-
updater {
|
|
362
|
-
id
|
|
363
|
-
name
|
|
364
|
-
}
|
|
365
|
-
updatedAt
|
|
366
|
-
creator {
|
|
367
|
-
id
|
|
368
|
-
name
|
|
369
|
-
}
|
|
370
|
-
createdAt
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
`,
|
|
374
|
-
variables: {
|
|
375
|
-
kpiCategoryValue
|
|
376
|
-
}
|
|
377
|
-
})
|
|
378
|
-
|
|
379
|
-
if (!response.errors) {
|
|
380
|
-
this.grist.fetch()
|
|
381
|
-
notify({
|
|
382
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.create') })
|
|
383
|
-
})
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
async exportHandler() {
|
|
388
|
-
// 임시로 빈 배열 반환
|
|
389
|
-
return []
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
async importHandler(records) {
|
|
393
|
-
const kpiCategoryValues = records.map(record => ({
|
|
394
|
-
categoryId: record.category?.id || record.category,
|
|
395
|
-
valueDate: record.valueDate,
|
|
396
|
-
score: record.score,
|
|
397
|
-
group: record.group
|
|
398
|
-
}))
|
|
399
|
-
|
|
400
|
-
for (const kpiCategoryValue of kpiCategoryValues) {
|
|
401
|
-
await this.creationCallback(kpiCategoryValue)
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js';
|
|
2
|
-
import '@operato/data-grist';
|
|
3
|
-
import { LitElement } from 'lit';
|
|
4
|
-
export declare class KpiCategoryImporter extends LitElement {
|
|
5
|
-
static styles: import("lit").CSSResult[];
|
|
6
|
-
kpiCategories: any[];
|
|
7
|
-
columns: {
|
|
8
|
-
list: {
|
|
9
|
-
fields: string[];
|
|
10
|
-
};
|
|
11
|
-
pagination: {
|
|
12
|
-
infinite: boolean;
|
|
13
|
-
};
|
|
14
|
-
columns: {
|
|
15
|
-
type: string;
|
|
16
|
-
name: string;
|
|
17
|
-
header: string;
|
|
18
|
-
width: number;
|
|
19
|
-
}[];
|
|
20
|
-
};
|
|
21
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
-
save(): Promise<void>;
|
|
23
|
-
}
|