@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,92 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@material/web/icon/icon.js';
|
|
3
|
-
import '@operato/data-grist';
|
|
4
|
-
import gql from 'graphql-tag';
|
|
5
|
-
import { css, html, LitElement } from 'lit';
|
|
6
|
-
import { property } from 'lit/decorators.js';
|
|
7
|
-
import { client } from '@operato/graphql';
|
|
8
|
-
import { i18next } from '@operato/i18n';
|
|
9
|
-
import { isMobileDevice } from '@operato/utils';
|
|
10
|
-
import { ButtonContainerStyles } from '@operato/styles';
|
|
11
|
-
export class KpiCategoryImporter extends LitElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.kpiCategories = [];
|
|
15
|
-
this.columns = {
|
|
16
|
-
list: { fields: ['name', 'description'] },
|
|
17
|
-
pagination: { infinite: true },
|
|
18
|
-
columns: [
|
|
19
|
-
{
|
|
20
|
-
type: 'string',
|
|
21
|
-
name: 'name',
|
|
22
|
-
header: i18next.t('field.name'),
|
|
23
|
-
width: 150
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'string',
|
|
27
|
-
name: 'description',
|
|
28
|
-
header: i18next.t('field.description'),
|
|
29
|
-
width: 200
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
type: 'checkbox',
|
|
33
|
-
name: 'active',
|
|
34
|
-
header: i18next.t('field.active'),
|
|
35
|
-
width: 60
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
static { this.styles = [
|
|
41
|
-
ButtonContainerStyles,
|
|
42
|
-
css `
|
|
43
|
-
:host {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
|
|
47
|
-
background-color: #fff;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
ox-grist {
|
|
51
|
-
flex: 1;
|
|
52
|
-
}
|
|
53
|
-
`
|
|
54
|
-
]; }
|
|
55
|
-
render() {
|
|
56
|
-
return html `
|
|
57
|
-
<ox-grist
|
|
58
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
59
|
-
.config=${this.columns}
|
|
60
|
-
.data=${{
|
|
61
|
-
records: this.kpiCategories
|
|
62
|
-
}}
|
|
63
|
-
></ox-grist>
|
|
64
|
-
|
|
65
|
-
<div class="button-container">
|
|
66
|
-
<button @click="${this.save.bind(this)}"><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
|
67
|
-
</div>
|
|
68
|
-
`;
|
|
69
|
-
}
|
|
70
|
-
async save() {
|
|
71
|
-
const response = await client.mutate({
|
|
72
|
-
mutation: gql `
|
|
73
|
-
mutation importKpiCategories($kpiCategories: [KpiCategoryPatch!]!) {
|
|
74
|
-
importKpiCategories(kpiCategories: $kpiCategories)
|
|
75
|
-
}
|
|
76
|
-
`,
|
|
77
|
-
variables: { kpiCategories: this.kpiCategories }
|
|
78
|
-
});
|
|
79
|
-
if (response.errors?.length)
|
|
80
|
-
return;
|
|
81
|
-
this.dispatchEvent(new CustomEvent('imported'));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
__decorate([
|
|
85
|
-
property({ type: Array }),
|
|
86
|
-
__metadata("design:type", Array)
|
|
87
|
-
], KpiCategoryImporter.prototype, "kpiCategories", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
property({ type: Object }),
|
|
90
|
-
__metadata("design:type", Object)
|
|
91
|
-
], KpiCategoryImporter.prototype, "columns", void 0);
|
|
92
|
-
//# sourceMappingURL=kpi-category-importer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-category-importer.js","sourceRoot":"","sources":["../../../client/pages/kpi-category/kpi-category-importer.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IAAnD;;QAiB6B,kBAAa,GAAU,EAAE,CAAA;QACxB,YAAO,GAAG;YACpC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE;YACzC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;oBAC/B,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBACtC,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;oBACjC,KAAK,EAAE,EAAE;iBACV;aACF;SACF,CAAA;IAmCH,CAAC;aA3EQ,WAAM,GAAG;QACd,qBAAqB;QACrB,GAAG,CAAA;;;;;;;;;;;KAWF;KACF,AAdY,CAcZ;IA6BD,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,OAAO;gBAEpB;YACE,OAAO,EAAE,IAAI,CAAC,aAAa;SAE/B;;;;0BAIkB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;;KAE7F,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE;SACjD,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM;YAAE,OAAM;QAEnC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;IACjD,CAAC;;AA1D0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;0DAA0B;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAuB1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\nimport { ButtonContainerStyles } from '@operato/styles'\n\nexport class KpiCategoryImporter extends LitElement {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n ox-grist {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Array }) kpiCategories: any[] = []\n @property({ type: Object }) columns = {\n list: { fields: ['name', 'description'] },\n pagination: { infinite: true },\n columns: [\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n header: i18next.t('field.active'),\n width: 60\n }\n ]\n }\n\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.columns}\n .data=${\n { \n records: this.kpiCategories \n }\n }\n ></ox-grist>\n\n <div class=\"button-container\">\n <button @click=\"${this.save.bind(this)}\"><md-icon>save</md-icon>${i18next.t('button.save')}</button>\n </div>\n `\n }\n\n async save() {\n const response = await client.mutate({\n mutation: gql`\n mutation importKpiCategories($kpiCategories: [KpiCategoryPatch!]!) {\n importKpiCategories(kpiCategories: $kpiCategories)\n }\n `,\n variables: { kpiCategories: this.kpiCategories }\n })\n\n if (response.errors?.length) return\n\n this.dispatchEvent(new CustomEvent('imported'))\n }\n}\n\n"]}
|
|
@@ -1,74 +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
|
-
import { PageView } from '@operato/shell';
|
|
7
|
-
import { FetchOption } from '@operato/data-grist';
|
|
8
|
-
import { KpiCategoryImporter } from './kpi-category-importer';
|
|
9
|
-
import { KpiCategoryValueCalculator } from './kpi-category-value-calculator';
|
|
10
|
-
declare const KpiCategoryListPage_base: (new (...args: any[]) => {
|
|
11
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
12
|
-
connectedCallback(): void;
|
|
13
|
-
disconnectedCallback(): void;
|
|
14
|
-
stateChanged(_state: unknown): void;
|
|
15
|
-
readonly isConnected: boolean;
|
|
16
|
-
}) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
17
|
-
export declare class KpiCategoryListPage extends KpiCategoryListPage_base {
|
|
18
|
-
static styles: import("lit").CSSResult[];
|
|
19
|
-
static get scopedElements(): {
|
|
20
|
-
'kpi-category-importer': typeof KpiCategoryImporter;
|
|
21
|
-
'kpi-category-value-calculator': typeof KpiCategoryValueCalculator;
|
|
22
|
-
};
|
|
23
|
-
gristConfig: any;
|
|
24
|
-
mode: 'CARD' | 'GRID' | 'LIST';
|
|
25
|
-
private grist;
|
|
26
|
-
availableVariables: any[];
|
|
27
|
-
availableVariablesLoaded: boolean;
|
|
28
|
-
getAvailableVariables(): Promise<any[]>;
|
|
29
|
-
get context(): {
|
|
30
|
-
title: string;
|
|
31
|
-
search: {
|
|
32
|
-
handler: (search: string) => void;
|
|
33
|
-
value: string;
|
|
34
|
-
};
|
|
35
|
-
filter: {
|
|
36
|
-
handler: () => void;
|
|
37
|
-
};
|
|
38
|
-
help: string;
|
|
39
|
-
actions: {
|
|
40
|
-
icon: string;
|
|
41
|
-
emphasis: {
|
|
42
|
-
raised: boolean;
|
|
43
|
-
outlined: boolean;
|
|
44
|
-
dense: boolean;
|
|
45
|
-
danger: boolean;
|
|
46
|
-
};
|
|
47
|
-
title: string;
|
|
48
|
-
action: () => Promise<void>;
|
|
49
|
-
}[];
|
|
50
|
-
exportable: {
|
|
51
|
-
name: string;
|
|
52
|
-
data: () => Promise<{}[]>;
|
|
53
|
-
};
|
|
54
|
-
importable: {
|
|
55
|
-
handler: (records: any) => Promise<void>;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
59
|
-
connectedCallback(): void;
|
|
60
|
-
pageInitialized(lifecycle: any): Promise<void>;
|
|
61
|
-
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
|
62
|
-
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
|
63
|
-
total: any;
|
|
64
|
-
records: any;
|
|
65
|
-
}>;
|
|
66
|
-
fetchKpis(): Promise<void>;
|
|
67
|
-
_deleteKpiCategory(): Promise<void>;
|
|
68
|
-
_updateKpiCategory(): Promise<void>;
|
|
69
|
-
creationCallback(kpiCategory: any): Promise<boolean>;
|
|
70
|
-
exportHandler(): Promise<{}[]>;
|
|
71
|
-
importHandler(records: any): Promise<void>;
|
|
72
|
-
private openCalculator;
|
|
73
|
-
}
|
|
74
|
-
export {};
|
|
@@ -1,517 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@material/web/icon/icon.js';
|
|
3
|
-
import '@material/web/button/elevated-button.js';
|
|
4
|
-
import '@operato/data-grist/ox-grist.js';
|
|
5
|
-
import '@operato/data-grist/ox-filters-form.js';
|
|
6
|
-
import '@operato/data-grist/ox-record-creator.js';
|
|
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, state } from 'lit/decorators.js';
|
|
11
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
12
|
-
import { DataGrist } 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 { OxPrompt } from '@operato/popup';
|
|
17
|
-
import { isMobileDevice } from '@operato/utils';
|
|
18
|
-
import { connect } from 'pwa-helpers/connect-mixin';
|
|
19
|
-
import gql from 'graphql-tag';
|
|
20
|
-
import { KpiCategoryImporter } from './kpi-category-importer';
|
|
21
|
-
import { KpiCategoryValueCalculator } from './kpi-category-value-calculator';
|
|
22
|
-
let KpiCategoryListPage = class KpiCategoryListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.mode = isMobileDevice() ? 'CARD' : 'GRID';
|
|
26
|
-
this.availableVariables = [];
|
|
27
|
-
this.availableVariablesLoaded = false;
|
|
28
|
-
}
|
|
29
|
-
static { this.styles = [
|
|
30
|
-
ScrollbarStyles,
|
|
31
|
-
CommonGristStyles,
|
|
32
|
-
CommonHeaderStyles,
|
|
33
|
-
css `
|
|
34
|
-
:host {
|
|
35
|
-
display: flex;
|
|
36
|
-
|
|
37
|
-
width: 100%;
|
|
38
|
-
|
|
39
|
-
--grid-record-emphasized-background-color: #8b0000;
|
|
40
|
-
--grid-record-emphasized-color: #ff6b6b;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
ox-grist {
|
|
44
|
-
overflow-y: auto;
|
|
45
|
-
flex: 1;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
ox-filters-form {
|
|
49
|
-
flex: 1;
|
|
50
|
-
}
|
|
51
|
-
`
|
|
52
|
-
]; }
|
|
53
|
-
static get scopedElements() {
|
|
54
|
-
return {
|
|
55
|
-
'kpi-category-importer': KpiCategoryImporter,
|
|
56
|
-
'kpi-category-value-calculator': KpiCategoryValueCalculator
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
async getAvailableVariables() {
|
|
60
|
-
if (this.availableVariablesLoaded) {
|
|
61
|
-
return this.availableVariables;
|
|
62
|
-
}
|
|
63
|
-
const response = await client.query({
|
|
64
|
-
query: gql `
|
|
65
|
-
query {
|
|
66
|
-
kpis {
|
|
67
|
-
items {
|
|
68
|
-
name
|
|
69
|
-
description
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`
|
|
74
|
-
});
|
|
75
|
-
this.availableVariables = (response.data.kpis.items || []).map(kpi => ({
|
|
76
|
-
name: kpi.name,
|
|
77
|
-
description: kpi.description,
|
|
78
|
-
type: 'kpi',
|
|
79
|
-
unit: ''
|
|
80
|
-
}));
|
|
81
|
-
this.availableVariablesLoaded = true;
|
|
82
|
-
return this.availableVariables;
|
|
83
|
-
}
|
|
84
|
-
get context() {
|
|
85
|
-
return {
|
|
86
|
-
title: i18next.t('title.kpi category list'),
|
|
87
|
-
search: {
|
|
88
|
-
handler: (search) => {
|
|
89
|
-
this.grist.searchText = search;
|
|
90
|
-
},
|
|
91
|
-
value: this.grist.searchText
|
|
92
|
-
},
|
|
93
|
-
filter: {
|
|
94
|
-
handler: () => {
|
|
95
|
-
this.grist.toggleHeadroom();
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
help: 'kpi/kpi-category',
|
|
99
|
-
actions: [
|
|
100
|
-
{
|
|
101
|
-
title: i18next.t('button.save'),
|
|
102
|
-
action: this._updateKpiCategory.bind(this),
|
|
103
|
-
...CommonButtonStyles.save
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
title: i18next.t('button.delete'),
|
|
107
|
-
action: this._deleteKpiCategory.bind(this),
|
|
108
|
-
...CommonButtonStyles.delete
|
|
109
|
-
}
|
|
110
|
-
],
|
|
111
|
-
exportable: {
|
|
112
|
-
name: i18next.t('title.kpi category list'),
|
|
113
|
-
data: this.exportHandler.bind(this)
|
|
114
|
-
},
|
|
115
|
-
importable: {
|
|
116
|
-
handler: this.importHandler.bind(this)
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
render() {
|
|
121
|
-
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
|
|
122
|
-
return html `
|
|
123
|
-
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
124
|
-
<div slot="headroom" class="header">
|
|
125
|
-
<div class="filters">
|
|
126
|
-
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
127
|
-
|
|
128
|
-
<div id="modes">
|
|
129
|
-
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
130
|
-
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
131
|
-
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<ox-record-creator id="add" .callback=${this.creationCallback.bind(this)}>
|
|
135
|
-
<button>
|
|
136
|
-
<md-icon>add</md-icon>
|
|
137
|
-
</button>
|
|
138
|
-
</ox-record-creator>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
</ox-grist>
|
|
142
|
-
`;
|
|
143
|
-
}
|
|
144
|
-
connectedCallback() {
|
|
145
|
-
super.connectedCallback();
|
|
146
|
-
this.fetchKpis();
|
|
147
|
-
}
|
|
148
|
-
async pageInitialized(lifecycle) {
|
|
149
|
-
this.gristConfig = {
|
|
150
|
-
list: {
|
|
151
|
-
fields: [
|
|
152
|
-
'name',
|
|
153
|
-
'description',
|
|
154
|
-
'active',
|
|
155
|
-
'formula',
|
|
156
|
-
'weight',
|
|
157
|
-
'periodType',
|
|
158
|
-
'createdAt',
|
|
159
|
-
'updatedAt',
|
|
160
|
-
'creator',
|
|
161
|
-
'updater'
|
|
162
|
-
],
|
|
163
|
-
details: [
|
|
164
|
-
'name',
|
|
165
|
-
'description',
|
|
166
|
-
'active',
|
|
167
|
-
'formula',
|
|
168
|
-
'weight',
|
|
169
|
-
'periodType',
|
|
170
|
-
'createdAt',
|
|
171
|
-
'updatedAt',
|
|
172
|
-
'creator',
|
|
173
|
-
'updater'
|
|
174
|
-
]
|
|
175
|
-
},
|
|
176
|
-
columns: [
|
|
177
|
-
{ type: 'gutter', gutterName: 'sequence' },
|
|
178
|
-
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
179
|
-
{
|
|
180
|
-
type: 'gutter',
|
|
181
|
-
gutterName: 'button',
|
|
182
|
-
icon: 'calculate',
|
|
183
|
-
title: '실적값 계산',
|
|
184
|
-
handlers: {
|
|
185
|
-
click: (columns, data, column, record, rowIndex) => {
|
|
186
|
-
this.openCalculator(record);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
type: 'string',
|
|
192
|
-
name: 'name',
|
|
193
|
-
header: '이름',
|
|
194
|
-
record: { editable: true },
|
|
195
|
-
filter: 'search',
|
|
196
|
-
sortable: true,
|
|
197
|
-
width: 120
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
type: 'string',
|
|
201
|
-
name: 'description',
|
|
202
|
-
header: i18next.t('field.description'),
|
|
203
|
-
record: { editable: true },
|
|
204
|
-
filter: 'search',
|
|
205
|
-
width: 200
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
type: 'formula',
|
|
209
|
-
name: 'formula',
|
|
210
|
-
header: '산식',
|
|
211
|
-
record: {
|
|
212
|
-
editable: true,
|
|
213
|
-
availableVariables: async () => {
|
|
214
|
-
return await this.getAvailableVariables();
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
width: 320
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
type: 'number',
|
|
221
|
-
name: 'weight',
|
|
222
|
-
header: '가중치',
|
|
223
|
-
record: { editable: true },
|
|
224
|
-
width: 80
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
type: 'select',
|
|
228
|
-
name: 'periodType',
|
|
229
|
-
header: '계산주기',
|
|
230
|
-
record: {
|
|
231
|
-
editable: true,
|
|
232
|
-
options: [
|
|
233
|
-
{ value: '', display: '' },
|
|
234
|
-
{ value: 'DAY', display: '일' },
|
|
235
|
-
{ value: 'WEEK', display: '주' },
|
|
236
|
-
{ value: 'MONTH', display: '월' },
|
|
237
|
-
{ value: 'QUARTER', display: '분기' },
|
|
238
|
-
{ value: 'YEAR', display: '년' },
|
|
239
|
-
{ value: 'RANGE', display: '범위' },
|
|
240
|
-
{ value: 'ALLTIME', display: '전체' }
|
|
241
|
-
]
|
|
242
|
-
},
|
|
243
|
-
width: 80
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
type: 'checkbox',
|
|
247
|
-
name: 'active',
|
|
248
|
-
label: true,
|
|
249
|
-
header: i18next.t('field.active'),
|
|
250
|
-
record: { editable: true },
|
|
251
|
-
filter: true,
|
|
252
|
-
sortable: true,
|
|
253
|
-
width: 60
|
|
254
|
-
},
|
|
255
|
-
{ type: 'datetime', name: 'createdAt', header: '생성일', record: { editable: false }, width: 180 },
|
|
256
|
-
{
|
|
257
|
-
type: 'datetime',
|
|
258
|
-
name: 'updatedAt',
|
|
259
|
-
header: i18next.t('field.updated_at'),
|
|
260
|
-
record: { editable: false },
|
|
261
|
-
sortable: true,
|
|
262
|
-
width: 180
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
type: 'resource-object',
|
|
266
|
-
name: 'creator',
|
|
267
|
-
header: '생성자',
|
|
268
|
-
record: { editable: false, renderer: (v, c, r) => r.creator?.name },
|
|
269
|
-
width: 120
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
type: 'resource-object',
|
|
273
|
-
name: 'updater',
|
|
274
|
-
header: i18next.t('field.updater'),
|
|
275
|
-
record: { editable: false, renderer: (v, c, r) => r.updater?.name },
|
|
276
|
-
sortable: true,
|
|
277
|
-
width: 120
|
|
278
|
-
}
|
|
279
|
-
],
|
|
280
|
-
rows: {
|
|
281
|
-
appendable: false,
|
|
282
|
-
selectable: {
|
|
283
|
-
multiple: true
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
sorters: [{ name: 'name' }]
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
async pageUpdated(changes, lifecycle) {
|
|
290
|
-
if (this.active) {
|
|
291
|
-
// do something here when this page just became as active
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
|
|
295
|
-
const response = await client.query({
|
|
296
|
-
query: gql `
|
|
297
|
-
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
298
|
-
responses: kpiCategories(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
299
|
-
items {
|
|
300
|
-
id
|
|
301
|
-
name
|
|
302
|
-
description
|
|
303
|
-
active
|
|
304
|
-
formula
|
|
305
|
-
weight
|
|
306
|
-
periodType
|
|
307
|
-
updater {
|
|
308
|
-
id
|
|
309
|
-
name
|
|
310
|
-
}
|
|
311
|
-
updatedAt
|
|
312
|
-
creator {
|
|
313
|
-
id
|
|
314
|
-
name
|
|
315
|
-
}
|
|
316
|
-
createdAt
|
|
317
|
-
}
|
|
318
|
-
total
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
`,
|
|
322
|
-
variables: {
|
|
323
|
-
filters,
|
|
324
|
-
pagination: { page, limit },
|
|
325
|
-
sortings
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
return {
|
|
329
|
-
total: response.data.responses.total || 0,
|
|
330
|
-
records: response.data.responses.items || []
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
async fetchKpis() {
|
|
334
|
-
const response = await client.query({
|
|
335
|
-
query: gql `
|
|
336
|
-
query {
|
|
337
|
-
kpis {
|
|
338
|
-
items {
|
|
339
|
-
name
|
|
340
|
-
description
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
`
|
|
345
|
-
});
|
|
346
|
-
if (!response.errors) {
|
|
347
|
-
this.availableVariables = (response.data.kpis.items || []).map(kpi => ({
|
|
348
|
-
name: kpi.name,
|
|
349
|
-
description: kpi.description,
|
|
350
|
-
type: 'kpi',
|
|
351
|
-
unit: ''
|
|
352
|
-
}));
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
async _deleteKpiCategory() {
|
|
356
|
-
if (await OxPrompt.open({
|
|
357
|
-
title: i18next.t('text.are_you_sure'),
|
|
358
|
-
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
359
|
-
confirmButton: { text: i18next.t('button.confirm') },
|
|
360
|
-
cancelButton: { text: i18next.t('button.cancel') }
|
|
361
|
-
})) {
|
|
362
|
-
const ids = this.grist.selected.map(record => record.id);
|
|
363
|
-
if (ids && ids.length > 0) {
|
|
364
|
-
const response = await client.mutate({
|
|
365
|
-
mutation: gql `
|
|
366
|
-
mutation ($ids: [String!]!) {
|
|
367
|
-
deleteKpiCategories(ids: $ids)
|
|
368
|
-
}
|
|
369
|
-
`,
|
|
370
|
-
variables: {
|
|
371
|
-
ids
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
if (!response.errors) {
|
|
375
|
-
this.grist.fetch();
|
|
376
|
-
notify({
|
|
377
|
-
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
async _updateKpiCategory() {
|
|
384
|
-
let patches = this.grist.dirtyRecords;
|
|
385
|
-
if (patches && patches.length) {
|
|
386
|
-
patches = patches.map(patch => {
|
|
387
|
-
let patchField = patch.id ? { id: patch.id } : {};
|
|
388
|
-
const dirtyFields = patch.__dirtyfields__;
|
|
389
|
-
for (let key in dirtyFields) {
|
|
390
|
-
patchField[key] = dirtyFields[key].after;
|
|
391
|
-
}
|
|
392
|
-
patchField.cuFlag = patch.__dirty__;
|
|
393
|
-
return patchField;
|
|
394
|
-
});
|
|
395
|
-
const response = await client.mutate({
|
|
396
|
-
mutation: gql `
|
|
397
|
-
mutation ($patches: [KpiCategoryPatch!]!) {
|
|
398
|
-
updateMultipleKpiCategory(patches: $patches) {
|
|
399
|
-
name
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
`,
|
|
403
|
-
variables: {
|
|
404
|
-
patches
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
if (!response.errors) {
|
|
408
|
-
this.grist.fetch();
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
async creationCallback(kpiCategory) {
|
|
413
|
-
try {
|
|
414
|
-
const response = await client.query({
|
|
415
|
-
query: gql `
|
|
416
|
-
mutation ($kpiCategory: NewKpiCategory!) {
|
|
417
|
-
createKpiCategory(kpiCategory: $kpiCategory) {
|
|
418
|
-
id
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
`,
|
|
422
|
-
variables: {
|
|
423
|
-
kpiCategory
|
|
424
|
-
},
|
|
425
|
-
context: {
|
|
426
|
-
hasUpload: true
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
if (!response.errors) {
|
|
430
|
-
this.grist.fetch();
|
|
431
|
-
document.dispatchEvent(new CustomEvent('notify', {
|
|
432
|
-
detail: {
|
|
433
|
-
message: i18next.t('text.data_created_successfully')
|
|
434
|
-
}
|
|
435
|
-
}));
|
|
436
|
-
}
|
|
437
|
-
return true;
|
|
438
|
-
}
|
|
439
|
-
catch (ex) {
|
|
440
|
-
console.error(ex);
|
|
441
|
-
document.dispatchEvent(new CustomEvent('notify', {
|
|
442
|
-
detail: {
|
|
443
|
-
type: 'error',
|
|
444
|
-
message: i18next.t('text.error')
|
|
445
|
-
}
|
|
446
|
-
}));
|
|
447
|
-
return false;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
async exportHandler() {
|
|
451
|
-
const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records;
|
|
452
|
-
const targetFieldSet = new Set(['id', 'name', 'description', 'active']);
|
|
453
|
-
return exportTargets.map(kpiCategory => {
|
|
454
|
-
let tempObj = {};
|
|
455
|
-
for (const field of targetFieldSet) {
|
|
456
|
-
tempObj[field] = kpiCategory[field];
|
|
457
|
-
}
|
|
458
|
-
return tempObj;
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
async importHandler(records) {
|
|
462
|
-
const popup = openPopup(html `
|
|
463
|
-
<kpi-category-importer
|
|
464
|
-
.kpiCategories=${records}
|
|
465
|
-
@imported=${() => {
|
|
466
|
-
history.back();
|
|
467
|
-
this.grist.fetch();
|
|
468
|
-
}}
|
|
469
|
-
></kpi-category-importer>
|
|
470
|
-
`, {
|
|
471
|
-
backdrop: true,
|
|
472
|
-
size: 'large',
|
|
473
|
-
title: i18next.t('title.import kpi-category')
|
|
474
|
-
});
|
|
475
|
-
popup.onclosed = () => {
|
|
476
|
-
this.grist.fetch();
|
|
477
|
-
};
|
|
478
|
-
}
|
|
479
|
-
async openCalculator(record) {
|
|
480
|
-
const popup = openPopup(html `
|
|
481
|
-
<kpi-category-value-calculator
|
|
482
|
-
.categoryId=${record.id}
|
|
483
|
-
.categoryName=${record.name}
|
|
484
|
-
@closed=${() => popup.close()}
|
|
485
|
-
></kpi-category-value-calculator>
|
|
486
|
-
`, {
|
|
487
|
-
backdrop: true,
|
|
488
|
-
size: 'large',
|
|
489
|
-
title: i18next.t('title.calculate kpi value')
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
__decorate([
|
|
494
|
-
property({ type: Object }),
|
|
495
|
-
__metadata("design:type", Object)
|
|
496
|
-
], KpiCategoryListPage.prototype, "gristConfig", void 0);
|
|
497
|
-
__decorate([
|
|
498
|
-
property({ type: String }),
|
|
499
|
-
__metadata("design:type", String)
|
|
500
|
-
], KpiCategoryListPage.prototype, "mode", void 0);
|
|
501
|
-
__decorate([
|
|
502
|
-
query('ox-grist'),
|
|
503
|
-
__metadata("design:type", DataGrist)
|
|
504
|
-
], KpiCategoryListPage.prototype, "grist", void 0);
|
|
505
|
-
__decorate([
|
|
506
|
-
state(),
|
|
507
|
-
__metadata("design:type", Array)
|
|
508
|
-
], KpiCategoryListPage.prototype, "availableVariables", void 0);
|
|
509
|
-
__decorate([
|
|
510
|
-
state(),
|
|
511
|
-
__metadata("design:type", Object)
|
|
512
|
-
], KpiCategoryListPage.prototype, "availableVariablesLoaded", void 0);
|
|
513
|
-
KpiCategoryListPage = __decorate([
|
|
514
|
-
customElement('kpi-category-list-page')
|
|
515
|
-
], KpiCategoryListPage);
|
|
516
|
-
export { KpiCategoryListPage };
|
|
517
|
-
//# sourceMappingURL=kpi-category-list-page.js.map
|