@things-factory/kpi 1.0.0-alpha.5 → 9.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/README.md +74 -0
  2. package/client/pages/kpi/kpi-list-page.ts +97 -47
  3. package/client/pages/kpi/kpi-overview-sample.ts +260 -0
  4. package/client/pages/kpi/kpi-overview.ts +271 -0
  5. package/client/pages/kpi-category/kpi-category-list-page.ts +39 -50
  6. package/client/pages/kpi-dashboard/kpi-alert-panel.ts +114 -0
  7. package/client/pages/kpi-dashboard/kpi-dashboard.ts +285 -0
  8. package/client/pages/kpi-dashboard/kpi-grade-visualization.ts +75 -0
  9. package/client/pages/kpi-dashboard/kpi-history-viewer.ts +58 -0
  10. package/client/pages/kpi-dashboard/kpi-list-summary.ts +100 -0
  11. package/client/pages/kpi-dashboard/kpi-performance-summary.ts +124 -0
  12. package/client/pages/kpi-dashboard/kpi-value-entry.ts +78 -0
  13. package/client/pages/kpi-grade/kpi-grade-list-page.ts +58 -68
  14. package/client/pages/kpi-history/kpi-history-list-page.ts +146 -0
  15. package/client/pages/kpi-metric/kpi-metric-list-page.ts +67 -63
  16. package/client/pages/kpi-value/kpi-value-list-page.ts +73 -72
  17. package/client/pages/kpi-value/kpi-value-manual-entry-form.ts +168 -0
  18. package/client/pages/kpi-value/kpi-value-manual-entry-page.ts +173 -0
  19. package/client/route.ts +35 -0
  20. package/dist-client/pages/kpi/kpi-importer.js +16 -17
  21. package/dist-client/pages/kpi/kpi-importer.js.map +1 -1
  22. package/dist-client/pages/kpi/kpi-list-page.js +128 -68
  23. package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
  24. package/dist-client/pages/kpi/kpi-overview-sample.d.ts +36 -0
  25. package/dist-client/pages/kpi/kpi-overview-sample.js +264 -0
  26. package/dist-client/pages/kpi/kpi-overview-sample.js.map +1 -0
  27. package/dist-client/pages/kpi/kpi-overview.d.ts +14 -0
  28. package/dist-client/pages/kpi/kpi-overview.js +290 -0
  29. package/dist-client/pages/kpi/kpi-overview.js.map +1 -0
  30. package/dist-client/pages/kpi-category/kpi-category-importer.js +16 -17
  31. package/dist-client/pages/kpi-category/kpi-category-importer.js.map +1 -1
  32. package/dist-client/pages/kpi-category/kpi-category-list-page.js +70 -71
  33. package/dist-client/pages/kpi-category/kpi-category-list-page.js.map +1 -1
  34. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.d.ts +18 -0
  35. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js +128 -0
  36. package/dist-client/pages/kpi-dashboard/kpi-alert-panel.js.map +1 -0
  37. package/dist-client/pages/kpi-dashboard/kpi-dashboard.d.ts +24 -0
  38. package/dist-client/pages/kpi-dashboard/kpi-dashboard.js +305 -0
  39. package/dist-client/pages/kpi-dashboard/kpi-dashboard.js.map +1 -0
  40. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.d.ts +12 -0
  41. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js +82 -0
  42. package/dist-client/pages/kpi-dashboard/kpi-grade-visualization.js.map +1 -0
  43. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.d.ts +11 -0
  44. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js +65 -0
  45. package/dist-client/pages/kpi-dashboard/kpi-history-viewer.js.map +1 -0
  46. package/dist-client/pages/kpi-dashboard/kpi-list-summary.d.ts +13 -0
  47. package/dist-client/pages/kpi-dashboard/kpi-list-summary.js +115 -0
  48. package/dist-client/pages/kpi-dashboard/kpi-list-summary.js.map +1 -0
  49. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.d.ts +15 -0
  50. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js +139 -0
  51. package/dist-client/pages/kpi-dashboard/kpi-performance-summary.js.map +1 -0
  52. package/dist-client/pages/kpi-dashboard/kpi-value-entry.d.ts +7 -0
  53. package/dist-client/pages/kpi-dashboard/kpi-value-entry.js +86 -0
  54. package/dist-client/pages/kpi-dashboard/kpi-value-entry.js.map +1 -0
  55. package/dist-client/pages/kpi-grade/kpi-grade-importer.js +16 -17
  56. package/dist-client/pages/kpi-grade/kpi-grade-importer.js.map +1 -1
  57. package/dist-client/pages/kpi-grade/kpi-grade-list-page.js +89 -89
  58. package/dist-client/pages/kpi-grade/kpi-grade-list-page.js.map +1 -1
  59. package/dist-client/pages/kpi-history/kpi-history-list-page.d.ts +16 -0
  60. package/dist-client/pages/kpi-history/kpi-history-list-page.js +155 -0
  61. package/dist-client/pages/kpi-history/kpi-history-list-page.js.map +1 -0
  62. package/dist-client/pages/kpi-metric/kpi-metric-importer.js +16 -17
  63. package/dist-client/pages/kpi-metric/kpi-metric-importer.js.map +1 -1
  64. package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +98 -84
  65. package/dist-client/pages/kpi-metric/kpi-metric-list-page.js.map +1 -1
  66. package/dist-client/pages/kpi-value/kpi-value-importer.js +16 -17
  67. package/dist-client/pages/kpi-value/kpi-value-importer.js.map +1 -1
  68. package/dist-client/pages/kpi-value/kpi-value-list-page.js +104 -93
  69. package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
  70. package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.d.ts +14 -0
  71. package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js +201 -0
  72. package/dist-client/pages/kpi-value/kpi-value-manual-entry-form.js.map +1 -0
  73. package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.d.ts +41 -0
  74. package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js +180 -0
  75. package/dist-client/pages/kpi-value/kpi-value-manual-entry-page.js.map +1 -0
  76. package/dist-client/route.d.ts +1 -1
  77. package/dist-client/route.js +27 -0
  78. package/dist-client/route.js.map +1 -1
  79. package/dist-client/tsconfig.tsbuildinfo +1 -1
  80. package/dist-server/index.d.ts +2 -1
  81. package/dist-server/index.js +2 -1
  82. package/dist-server/index.js.map +1 -1
  83. package/dist-server/migrations/1752188906708-SeedKpiCategory.d.ts +5 -0
  84. package/dist-server/migrations/1752188906708-SeedKpiCategory.js +56 -0
  85. package/dist-server/migrations/1752188906708-SeedKpiCategory.js.map +1 -0
  86. package/dist-server/migrations/1752190849681-SeedKpi.d.ts +5 -0
  87. package/dist-server/migrations/1752190849681-SeedKpi.js +107 -0
  88. package/dist-server/migrations/1752190849681-SeedKpi.js.map +1 -0
  89. package/dist-server/migrations/1752191090459-SeedKpiGrade.d.ts +5 -0
  90. package/dist-server/migrations/1752191090459-SeedKpiGrade.js +271 -0
  91. package/dist-server/migrations/1752191090459-SeedKpiGrade.js.map +1 -0
  92. package/dist-server/migrations/index.d.ts +1 -0
  93. package/dist-server/migrations/index.js +12 -0
  94. package/dist-server/migrations/index.js.map +1 -0
  95. package/dist-server/routes.d.ts +1 -0
  96. package/dist-server/routes.js +48 -0
  97. package/dist-server/routes.js.map +1 -1
  98. package/dist-server/service/index.d.ts +3 -4
  99. package/dist-server/service/index.js +4 -6
  100. package/dist-server/service/index.js.map +1 -1
  101. package/dist-server/service/kpi/aggregate-kpi.d.ts +8 -0
  102. package/dist-server/service/kpi/aggregate-kpi.js +88 -0
  103. package/dist-server/service/kpi/aggregate-kpi.js.map +1 -0
  104. package/dist-server/service/kpi/event-subscriber.d.ts +2 -0
  105. package/dist-server/service/kpi/event-subscriber.js +10 -0
  106. package/dist-server/service/kpi/event-subscriber.js.map +1 -1
  107. package/dist-server/service/kpi/index.d.ts +2 -1
  108. package/dist-server/service/kpi/kpi-formula.service.d.ts +24 -0
  109. package/dist-server/service/kpi/kpi-formula.service.js +64 -0
  110. package/dist-server/service/kpi/kpi-formula.service.js.map +1 -0
  111. package/dist-server/service/kpi/kpi-history.d.ts +6 -2
  112. package/dist-server/service/kpi/kpi-history.js +29 -11
  113. package/dist-server/service/kpi/kpi-history.js.map +1 -1
  114. package/dist-server/service/kpi/kpi-mutation.d.ts +2 -0
  115. package/dist-server/service/kpi/kpi-mutation.js +215 -10
  116. package/dist-server/service/kpi/kpi-mutation.js.map +1 -1
  117. package/dist-server/service/kpi/kpi-query.d.ts +10 -0
  118. package/dist-server/service/kpi/kpi-query.js +87 -3
  119. package/dist-server/service/kpi/kpi-query.js.map +1 -1
  120. package/dist-server/service/kpi/kpi-type.d.ts +14 -3
  121. package/dist-server/service/kpi/kpi-type.js +81 -18
  122. package/dist-server/service/kpi/kpi-type.js.map +1 -1
  123. package/dist-server/service/kpi/kpi.d.ts +14 -3
  124. package/dist-server/service/kpi/kpi.js +96 -19
  125. package/dist-server/service/kpi/kpi.js.map +1 -1
  126. package/dist-server/service/kpi-alert/index.d.ts +2 -0
  127. package/dist-server/service/kpi-alert/index.js +6 -0
  128. package/dist-server/service/kpi-alert/index.js.map +1 -0
  129. package/dist-server/service/kpi-alert/kpi-alert-query.d.ts +4 -0
  130. package/dist-server/service/kpi-alert/kpi-alert-query.js +71 -0
  131. package/dist-server/service/kpi-alert/kpi-alert-query.js.map +1 -0
  132. package/dist-server/service/kpi-alert/kpi-alert-type.d.ts +8 -0
  133. package/dist-server/service/kpi-alert/kpi-alert-type.js +33 -0
  134. package/dist-server/service/kpi-alert/kpi-alert-type.js.map +1 -0
  135. package/dist-server/service/kpi-category/kpi-category-mutation.d.ts +1 -1
  136. package/dist-server/service/kpi-category/kpi-category-mutation.js +36 -10
  137. package/dist-server/service/kpi-category/kpi-category-mutation.js.map +1 -1
  138. package/dist-server/service/kpi-category/kpi-category-query.d.ts +2 -0
  139. package/dist-server/service/kpi-category/kpi-category-query.js +18 -2
  140. package/dist-server/service/kpi-category/kpi-category-query.js.map +1 -1
  141. package/dist-server/service/kpi-category/kpi-category-type.d.ts +3 -5
  142. package/dist-server/service/kpi-category/kpi-category-type.js +16 -20
  143. package/dist-server/service/kpi-category/kpi-category-type.js.map +1 -1
  144. package/dist-server/service/kpi-category/kpi-category.d.ts +7 -9
  145. package/dist-server/service/kpi-category/kpi-category.js +40 -38
  146. package/dist-server/service/kpi-category/kpi-category.js.map +1 -1
  147. package/dist-server/service/kpi-grade/index.d.ts +1 -2
  148. package/dist-server/service/kpi-grade/index.js +2 -4
  149. package/dist-server/service/kpi-grade/index.js.map +1 -1
  150. package/dist-server/service/kpi-grade/kpi-grade-mutation.d.ts +1 -1
  151. package/dist-server/service/kpi-grade/kpi-grade-mutation.js +33 -10
  152. package/dist-server/service/kpi-grade/kpi-grade-mutation.js.map +1 -1
  153. package/dist-server/service/kpi-grade/kpi-grade-query.js +2 -2
  154. package/dist-server/service/kpi-grade/kpi-grade-query.js.map +1 -1
  155. package/dist-server/service/kpi-grade/kpi-grade-type.d.ts +13 -4
  156. package/dist-server/service/kpi-grade/kpi-grade-type.js +54 -18
  157. package/dist-server/service/kpi-grade/kpi-grade-type.js.map +1 -1
  158. package/dist-server/service/kpi-grade/kpi-grade.d.ts +8 -8
  159. package/dist-server/service/kpi-grade/kpi-grade.js +48 -40
  160. package/dist-server/service/kpi-grade/kpi-grade.js.map +1 -1
  161. package/dist-server/service/kpi-metric/aggregate-kpi-metric.d.ts +8 -0
  162. package/dist-server/service/kpi-metric/aggregate-kpi-metric.js +134 -0
  163. package/dist-server/service/kpi-metric/aggregate-kpi-metric.js.map +1 -0
  164. package/dist-server/service/kpi-metric/index.d.ts +1 -2
  165. package/dist-server/service/kpi-metric/index.js +2 -4
  166. package/dist-server/service/kpi-metric/index.js.map +1 -1
  167. package/dist-server/service/kpi-metric/kpi-metric-mutation.d.ts +1 -1
  168. package/dist-server/service/kpi-metric/kpi-metric-mutation.js +139 -13
  169. package/dist-server/service/kpi-metric/kpi-metric-mutation.js.map +1 -1
  170. package/dist-server/service/kpi-metric/kpi-metric-query.js +3 -3
  171. package/dist-server/service/kpi-metric/kpi-metric-query.js.map +1 -1
  172. package/dist-server/service/kpi-metric/kpi-metric-type.d.ts +17 -4
  173. package/dist-server/service/kpi-metric/kpi-metric-type.js +69 -11
  174. package/dist-server/service/kpi-metric/kpi-metric-type.js.map +1 -1
  175. package/dist-server/service/kpi-metric/kpi-metric.d.ts +11 -8
  176. package/dist-server/service/kpi-metric/kpi-metric.js +62 -37
  177. package/dist-server/service/kpi-metric/kpi-metric.js.map +1 -1
  178. package/dist-server/service/kpi-value/kpi-value-mutation.js +66 -11
  179. package/dist-server/service/kpi-value/kpi-value-mutation.js.map +1 -1
  180. package/dist-server/service/kpi-value/kpi-value-query.d.ts +2 -0
  181. package/dist-server/service/kpi-value/kpi-value-query.js +15 -2
  182. package/dist-server/service/kpi-value/kpi-value-query.js.map +1 -1
  183. package/dist-server/service/kpi-value/kpi-value-type.d.ts +19 -10
  184. package/dist-server/service/kpi-value/kpi-value-type.js +87 -24
  185. package/dist-server/service/kpi-value/kpi-value-type.js.map +1 -1
  186. package/dist-server/service/kpi-value/kpi-value.d.ts +15 -9
  187. package/dist-server/service/kpi-value/kpi-value.js +86 -32
  188. package/dist-server/service/kpi-value/kpi-value.js.map +1 -1
  189. package/dist-server/tsconfig.tsbuildinfo +1 -1
  190. package/implement-plan/01-entity-type-resolver.md +57 -0
  191. package/implement-plan/02-dataset-integration.md +35 -0
  192. package/implement-plan/03-kpivalue-automation.md +34 -0
  193. package/implement-plan/04-version-history.md +33 -0
  194. package/implement-plan/05-grade-visualization.md +33 -0
  195. package/implement-plan/06-graphql-frontend.md +30 -0
  196. package/implement-plan/07-test-docs.md +35 -0
  197. package/implement-plan/TODO.md +41 -0
  198. package/package.json +18 -6
  199. package/server/index.ts +2 -1
  200. package/server/migrations/1752188906708-SeedKpiCategory.ts +61 -0
  201. package/server/migrations/1752190849681-SeedKpi.ts +112 -0
  202. package/server/migrations/1752191090459-SeedKpiGrade.ts +270 -0
  203. package/server/migrations/index.ts +9 -0
  204. package/server/routes.ts +55 -0
  205. package/server/service/index.ts +4 -6
  206. package/server/service/kpi/aggregate-kpi.ts +82 -0
  207. package/server/service/kpi/event-subscriber.ts +12 -0
  208. package/server/service/kpi/kpi-formula.service.ts +63 -0
  209. package/server/service/kpi/kpi-history.ts +29 -21
  210. package/server/service/kpi/kpi-mutation.ts +194 -12
  211. package/server/service/kpi/kpi-query.ts +57 -2
  212. package/server/service/kpi/kpi-type.ts +72 -19
  213. package/server/service/kpi/kpi.ts +96 -20
  214. package/server/service/kpi-alert/index.ts +3 -0
  215. package/server/service/kpi-alert/kpi-alert-query.ts +59 -0
  216. package/server/service/kpi-alert/kpi-alert-type.ts +20 -0
  217. package/server/service/kpi-category/kpi-category-mutation.ts +17 -4
  218. package/server/service/kpi-category/kpi-category-query.ts +20 -3
  219. package/server/service/kpi-category/kpi-category-type.ts +17 -19
  220. package/server/service/kpi-category/kpi-category.ts +39 -37
  221. package/server/service/kpi-grade/index.ts +2 -4
  222. package/server/service/kpi-grade/kpi-grade-mutation.ts +13 -4
  223. package/server/service/kpi-grade/kpi-grade-query.ts +5 -2
  224. package/server/service/kpi-grade/kpi-grade-type.ts +46 -19
  225. package/server/service/kpi-grade/kpi-grade.ts +44 -38
  226. package/server/service/kpi-metric/aggregate-kpi-metric.ts +128 -0
  227. package/server/service/kpi-metric/index.ts +2 -4
  228. package/server/service/kpi-metric/kpi-metric-mutation.ts +123 -7
  229. package/server/service/kpi-metric/kpi-metric-query.ts +9 -3
  230. package/server/service/kpi-metric/kpi-metric-type.ts +56 -13
  231. package/server/service/kpi-metric/kpi-metric.ts +55 -35
  232. package/server/service/kpi-value/kpi-value-mutation.ts +52 -14
  233. package/server/service/kpi-value/kpi-value-query.ts +12 -2
  234. package/server/service/kpi-value/kpi-value-type.ts +80 -25
  235. package/server/service/kpi-value/kpi-value.ts +81 -29
  236. package/things-factory.config.js +12 -4
  237. package/translations/en.json +12 -1
  238. package/translations/ja.json +12 -1
  239. package/translations/ko.json +12 -1
  240. package/translations/ms.json +12 -1
  241. package/translations/zh.json +12 -1
  242. package/client/pages/kpe-metric/kpe-metric-importer.ts +0 -90
  243. package/client/pages/kpe-metric/kpe-metric-list-page.ts +0 -398
  244. package/client/pages/kpi-formula/kpi-formula-importer.ts +0 -90
  245. package/client/pages/kpi-formula/kpi-formula-list-page.ts +0 -398
  246. package/client/pages/metric/metric-importer.ts +0 -90
  247. package/client/pages/metric/metric-list-page.ts +0 -398
  248. package/dist-client/pages/kpe-metric/kpe-metric-importer.d.ts +0 -23
  249. package/dist-client/pages/kpe-metric/kpe-metric-importer.js +0 -93
  250. package/dist-client/pages/kpe-metric/kpe-metric-importer.js.map +0 -1
  251. package/dist-client/pages/kpe-metric/kpe-metric-list-page.d.ts +0 -66
  252. package/dist-client/pages/kpe-metric/kpe-metric-list-page.js +0 -370
  253. package/dist-client/pages/kpe-metric/kpe-metric-list-page.js.map +0 -1
  254. package/dist-client/pages/kpi-formula/kpi-formula-importer.d.ts +0 -23
  255. package/dist-client/pages/kpi-formula/kpi-formula-importer.js +0 -93
  256. package/dist-client/pages/kpi-formula/kpi-formula-importer.js.map +0 -1
  257. package/dist-client/pages/kpi-formula/kpi-formula-list-page.d.ts +0 -66
  258. package/dist-client/pages/kpi-formula/kpi-formula-list-page.js +0 -370
  259. package/dist-client/pages/kpi-formula/kpi-formula-list-page.js.map +0 -1
  260. package/dist-client/pages/metric/metric-importer.d.ts +0 -23
  261. package/dist-client/pages/metric/metric-importer.js +0 -93
  262. package/dist-client/pages/metric/metric-importer.js.map +0 -1
  263. package/dist-client/pages/metric/metric-list-page.d.ts +0 -66
  264. package/dist-client/pages/metric/metric-list-page.js +0 -370
  265. package/dist-client/pages/metric/metric-list-page.js.map +0 -1
  266. package/dist-server/service/kpi-formula/event-subscriber.d.ts +0 -7
  267. package/dist-server/service/kpi-formula/event-subscriber.js +0 -21
  268. package/dist-server/service/kpi-formula/event-subscriber.js.map +0 -1
  269. package/dist-server/service/kpi-formula/index.d.ts +0 -7
  270. package/dist-server/service/kpi-formula/index.js +0 -12
  271. package/dist-server/service/kpi-formula/index.js.map +0 -1
  272. package/dist-server/service/kpi-formula/kpi-formula-history.d.ts +0 -25
  273. package/dist-server/service/kpi-formula/kpi-formula-history.js +0 -128
  274. package/dist-server/service/kpi-formula/kpi-formula-history.js.map +0 -1
  275. package/dist-server/service/kpi-formula/kpi-formula-mutation.d.ts +0 -10
  276. package/dist-server/service/kpi-formula/kpi-formula-mutation.js +0 -128
  277. package/dist-server/service/kpi-formula/kpi-formula-mutation.js.map +0 -1
  278. package/dist-server/service/kpi-formula/kpi-formula-query.d.ts +0 -11
  279. package/dist-server/service/kpi-formula/kpi-formula-query.js +0 -79
  280. package/dist-server/service/kpi-formula/kpi-formula-query.js.map +0 -1
  281. package/dist-server/service/kpi-formula/kpi-formula-type.d.ts +0 -20
  282. package/dist-server/service/kpi-formula/kpi-formula-type.js +0 -77
  283. package/dist-server/service/kpi-formula/kpi-formula-type.js.map +0 -1
  284. package/dist-server/service/kpi-formula/kpi-formula.d.ts +0 -24
  285. package/dist-server/service/kpi-formula/kpi-formula.js +0 -109
  286. package/dist-server/service/kpi-formula/kpi-formula.js.map +0 -1
  287. package/dist-server/service/kpi-grade/event-subscriber.d.ts +0 -7
  288. package/dist-server/service/kpi-grade/event-subscriber.js +0 -21
  289. package/dist-server/service/kpi-grade/event-subscriber.js.map +0 -1
  290. package/dist-server/service/kpi-grade/kpi-grade-history.d.ts +0 -25
  291. package/dist-server/service/kpi-grade/kpi-grade-history.js +0 -128
  292. package/dist-server/service/kpi-grade/kpi-grade-history.js.map +0 -1
  293. package/dist-server/service/kpi-metric/event-subscriber.d.ts +0 -7
  294. package/dist-server/service/kpi-metric/event-subscriber.js +0 -21
  295. package/dist-server/service/kpi-metric/event-subscriber.js.map +0 -1
  296. package/dist-server/service/kpi-metric/kpi-metric-history.d.ts +0 -25
  297. package/dist-server/service/kpi-metric/kpi-metric-history.js +0 -128
  298. package/dist-server/service/kpi-metric/kpi-metric-history.js.map +0 -1
  299. package/server/service/kpi-formula/event-subscriber.ts +0 -17
  300. package/server/service/kpi-formula/index.ts +0 -9
  301. package/server/service/kpi-formula/kpi-formula-history.ts +0 -116
  302. package/server/service/kpi-formula/kpi-formula-mutation.ts +0 -137
  303. package/server/service/kpi-formula/kpi-formula-query.ts +0 -48
  304. package/server/service/kpi-formula/kpi-formula-type.ts +0 -55
  305. package/server/service/kpi-formula/kpi-formula.ts +0 -95
  306. package/server/service/kpi-grade/event-subscriber.ts +0 -17
  307. package/server/service/kpi-grade/kpi-grade-history.ts +0 -116
  308. package/server/service/kpi-metric/event-subscriber.ts +0 -17
  309. package/server/service/kpi-metric/kpi-metric-history.ts +0 -116
@@ -0,0 +1,201 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/icon/icon.js';
3
+ import { html, LitElement, css } 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
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
9
+ let KpiValueManualEntryForm = class KpiValueManualEntryForm extends LitElement {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.valueDate = new Date().toISOString().slice(0, 10);
13
+ this.value = '';
14
+ this.groupId = '';
15
+ this.groupType = '';
16
+ this.meta = '';
17
+ this.loading = false;
18
+ }
19
+ static { this.styles = [
20
+ CommonHeaderStyles,
21
+ ScrollbarStyles,
22
+ css `
23
+ :host {
24
+ display: flex;
25
+ flex-direction: column;
26
+ background-color: var(--md-sys-color-surface, #f4f6fa);
27
+ }
28
+ .form-card {
29
+ flex: 1;
30
+ display: flex;
31
+ flex-direction: column;
32
+ padding: 32px 32px 0 32px;
33
+ background: #fff;
34
+ }
35
+ label {
36
+ font-weight: 500;
37
+ margin-bottom: 4px;
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: 2px;
41
+ }
42
+ input,
43
+ textarea {
44
+ font-size: 1em;
45
+ padding: 6px 8px;
46
+ border: 1px solid #ccc;
47
+ margin-top: 2px;
48
+ resize: none;
49
+ }
50
+
51
+ .desc {
52
+ font-size: 0.95em;
53
+ color: #888;
54
+ margin-top: 8px;
55
+ }
56
+
57
+ .footer span {
58
+ font-size: 0.8em;
59
+ color: var(--md-sys-color-on-surface);
60
+ line-height: 1.5;
61
+ padding: 10px;
62
+ }
63
+ `
64
+ ]; }
65
+ render() {
66
+ return html `
67
+ <form style="display:flex;flex-direction:column;height:100%;">
68
+ <div class="form-card">
69
+ <div style="font-size:1.1em;font-weight:bold;margin-bottom:16px;"><b>KPI:</b> ${this.kpi?.name}</div>
70
+ <label>
71
+ 실적일자
72
+ <input type="date" .value=${this.valueDate} @input=${e => (this.valueDate = e.target.value)} required />
73
+ </label>
74
+ <label>
75
+ 실적값
76
+ <input type="number" .value=${this.value} @input=${e => (this.value = e.target.value)} required />
77
+ </label>
78
+ <label>
79
+ 그룹ID (선택)
80
+ <input type="text" .value=${this.groupId} @input=${e => (this.groupId = e.target.value)} />
81
+ </label>
82
+ <label>
83
+ 그룹유형 (선택)
84
+ <input type="text" .value=${this.groupType} @input=${e => (this.groupType = e.target.value)} />
85
+ </label>
86
+ <label>
87
+ 메타정보 (선택, JSON)
88
+ <textarea .value=${this.meta} @input=${e => (this.meta = e.target.value)}></textarea>
89
+ </label>
90
+ <div class="desc">입력방식: MANUAL, Source: MANUAL (자동 지정)</div>
91
+ </div>
92
+ </form>
93
+ <div class="footer">
94
+ <div filler></div>
95
+ <button type="button" ?disabled=${this.loading} done @click=${this.save}><md-icon>save</md-icon>저장</button>
96
+ </div>
97
+ `;
98
+ }
99
+ async save() {
100
+ this.loading = true;
101
+ let parsedMeta = undefined;
102
+ if (this.meta) {
103
+ try {
104
+ parsedMeta = JSON.parse(this.meta);
105
+ }
106
+ catch (err) {
107
+ notify({ message: '메타정보는 올바른 JSON이어야 합니다.', level: 'error' });
108
+ this.loading = false;
109
+ return;
110
+ }
111
+ }
112
+ try {
113
+ await client.mutate({
114
+ mutation: gql `
115
+ mutation (
116
+ $kpiId: ID!
117
+ $valueDate: String!
118
+ $value: Float!
119
+ $groupId: String
120
+ $groupType: String
121
+ $meta: Object
122
+ ) {
123
+ createKpiValue(
124
+ kpiValue: {
125
+ kpiId: $kpiId
126
+ valueDate: $valueDate
127
+ value: $value
128
+ version: 1
129
+ groupId: $groupId
130
+ groupType: $groupType
131
+ inputType: MANUAL
132
+ source: "MANUAL"
133
+ meta: $meta
134
+ }
135
+ ) {
136
+ id
137
+ }
138
+ }
139
+ `,
140
+ variables: {
141
+ kpiId: this.kpi.id,
142
+ valueDate: this.valueDate,
143
+ value: parseFloat(this.value),
144
+ groupId: this.groupId || undefined,
145
+ groupType: this.groupType || undefined,
146
+ meta: parsedMeta
147
+ }
148
+ });
149
+ notify({ message: '실적값이 저장되었습니다.' });
150
+ this.dispatchEvent(new CustomEvent('saved', { bubbles: true, composed: true }));
151
+ // 팝업 닫기 로직
152
+ let el = this.parentElement;
153
+ while (el) {
154
+ if (typeof el.close === 'function') {
155
+ el.close();
156
+ break;
157
+ }
158
+ el = el.parentElement;
159
+ }
160
+ }
161
+ catch (err) {
162
+ notify({ message: '저장 실패: ' + (err?.message || err), level: 'error' });
163
+ }
164
+ finally {
165
+ this.loading = false;
166
+ }
167
+ }
168
+ };
169
+ __decorate([
170
+ property({ type: Object }),
171
+ __metadata("design:type", Object)
172
+ ], KpiValueManualEntryForm.prototype, "kpi", void 0);
173
+ __decorate([
174
+ state(),
175
+ __metadata("design:type", Object)
176
+ ], KpiValueManualEntryForm.prototype, "valueDate", void 0);
177
+ __decorate([
178
+ state(),
179
+ __metadata("design:type", Object)
180
+ ], KpiValueManualEntryForm.prototype, "value", void 0);
181
+ __decorate([
182
+ state(),
183
+ __metadata("design:type", Object)
184
+ ], KpiValueManualEntryForm.prototype, "groupId", void 0);
185
+ __decorate([
186
+ state(),
187
+ __metadata("design:type", Object)
188
+ ], KpiValueManualEntryForm.prototype, "groupType", void 0);
189
+ __decorate([
190
+ state(),
191
+ __metadata("design:type", Object)
192
+ ], KpiValueManualEntryForm.prototype, "meta", void 0);
193
+ __decorate([
194
+ state(),
195
+ __metadata("design:type", Object)
196
+ ], KpiValueManualEntryForm.prototype, "loading", void 0);
197
+ KpiValueManualEntryForm = __decorate([
198
+ customElement('kpi-value-manual-entry-form')
199
+ ], KpiValueManualEntryForm);
200
+ export { KpiValueManualEntryForm };
201
+ //# sourceMappingURL=kpi-value-manual-entry-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kpi-value-manual-entry-form.js","sourceRoot":"","sources":["../../../client/pages/kpi-value/kpi-value-manual-entry-form.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG9D,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAU;IAAhD;;QAiDI,cAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QACjD,UAAK,GAAG,EAAE,CAAA;QACV,YAAO,GAAG,EAAE,CAAA;QACZ,cAAS,GAAG,EAAE,CAAA;QACd,SAAI,GAAG,EAAE,CAAA;QACT,YAAO,GAAG,KAAK,CAAA;IAuG1B,CAAC;aA5JQ,WAAM,GAAG;QACd,kBAAkB;QAClB,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyCF;KACF,AA7CY,CA6CZ;IAUD,MAAM;QACJ,OAAO,IAAI,CAAA;;;0FAG2E,IAAI,CAAC,GAAG,EAAE,IAAI;;;wCAGhE,IAAI,CAAC,SAAS,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,KAA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tDb,uBAAuB;IADnC,aAAa,CAAC,6BAA6B,CAAC;GAChC,uBAAuB,CA6JnC","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { html, LitElement, css } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('kpi-value-manual-entry-form')\nexport class KpiValueManualEntryForm extends LitElement {\n static styles = [\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--md-sys-color-surface, #f4f6fa);\n }\n .form-card {\n flex: 1;\n display: flex;\n flex-direction: column;\n padding: 32px 32px 0 32px;\n background: #fff;\n }\n label {\n font-weight: 500;\n margin-bottom: 4px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n input,\n textarea {\n font-size: 1em;\n padding: 6px 8px;\n border: 1px solid #ccc;\n margin-top: 2px;\n resize: none;\n }\n\n .desc {\n font-size: 0.95em;\n color: #888;\n margin-top: 8px;\n }\n\n .footer span {\n font-size: 0.8em;\n color: var(--md-sys-color-on-surface);\n line-height: 1.5;\n padding: 10px;\n }\n `\n ]\n\n @property({ type: Object }) kpi: any\n @state() valueDate = new Date().toISOString().slice(0, 10)\n @state() value = ''\n @state() groupId = ''\n @state() groupType = ''\n @state() meta = ''\n @state() loading = false\n\n render() {\n return html`\n <form style=\"display:flex;flex-direction:column;height:100%;\">\n <div class=\"form-card\">\n <div style=\"font-size:1.1em;font-weight:bold;margin-bottom:16px;\"><b>KPI:</b> ${this.kpi?.name}</div>\n <label>\n 실적일자\n <input type=\"date\" .value=${this.valueDate} @input=${e => (this.valueDate = e.target.value)} required />\n </label>\n <label>\n 실적값\n <input type=\"number\" .value=${this.value} @input=${e => (this.value = e.target.value)} required />\n </label>\n <label>\n 그룹ID (선택)\n <input type=\"text\" .value=${this.groupId} @input=${e => (this.groupId = e.target.value)} />\n </label>\n <label>\n 그룹유형 (선택)\n <input type=\"text\" .value=${this.groupType} @input=${e => (this.groupType = e.target.value)} />\n </label>\n <label>\n 메타정보 (선택, JSON)\n <textarea .value=${this.meta} @input=${e => (this.meta = e.target.value)}></textarea>\n </label>\n <div class=\"desc\">입력방식: MANUAL, Source: MANUAL (자동 지정)</div>\n </div>\n </form>\n <div class=\"footer\">\n <div filler></div>\n <button type=\"button\" ?disabled=${this.loading} done @click=${this.save}><md-icon>save</md-icon>저장</button>\n </div>\n `\n }\n\n async save() {\n this.loading = true\n let parsedMeta = undefined\n if (this.meta) {\n try {\n parsedMeta = JSON.parse(this.meta)\n } catch (err) {\n notify({ message: '메타정보는 올바른 JSON이어야 합니다.', level: 'error' })\n this.loading = false\n return\n }\n }\n try {\n await client.mutate({\n mutation: gql`\n mutation (\n $kpiId: ID!\n $valueDate: String!\n $value: Float!\n $groupId: String\n $groupType: String\n $meta: Object\n ) {\n createKpiValue(\n kpiValue: {\n kpiId: $kpiId\n valueDate: $valueDate\n value: $value\n version: 1\n groupId: $groupId\n groupType: $groupType\n inputType: MANUAL\n source: \"MANUAL\"\n meta: $meta\n }\n ) {\n id\n }\n }\n `,\n variables: {\n kpiId: this.kpi.id,\n valueDate: this.valueDate,\n value: parseFloat(this.value),\n groupId: this.groupId || undefined,\n groupType: this.groupType || undefined,\n meta: parsedMeta\n }\n })\n notify({ message: '실적값이 저장되었습니다.' })\n this.dispatchEvent(new CustomEvent('saved', { bubbles: true, composed: true }))\n // 팝업 닫기 로직\n let el: any = this.parentElement\n while (el) {\n if (typeof el.close === 'function') {\n el.close()\n break\n }\n el = el.parentElement\n }\n } catch (err: any) {\n notify({ message: '저장 실패: ' + (err?.message || err), level: 'error' })\n } finally {\n this.loading = false\n }\n }\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import '@material/web/icon/icon.js';
2
+ import '@operato/data-grist';
3
+ import './kpi-value-manual-entry-form.js';
4
+ import { PageView } from '@operato/shell';
5
+ declare const KpiValueManualEntryPage_base: (new (...args: any[]) => {
6
+ _storeUnsubscribe: import("redux").Unsubscribe;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ stateChanged(_state: unknown): void;
10
+ readonly isConnected: boolean;
11
+ }) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
12
+ export declare class KpiValueManualEntryPage extends KpiValueManualEntryPage_base {
13
+ static styles: import("lit").CSSResult[];
14
+ get context(): {
15
+ title: string;
16
+ search: {
17
+ handler: (search: string) => void;
18
+ value: string;
19
+ };
20
+ filter: {
21
+ handler: () => void;
22
+ };
23
+ help: string;
24
+ };
25
+ private gristConfig;
26
+ private kpis;
27
+ private grist;
28
+ render(): import("lit-html").TemplateResult<1>;
29
+ pageInitialized(): Promise<void>;
30
+ fetchHandler({ page, limit, sortings, filters }: {
31
+ page?: number | undefined;
32
+ limit?: number | undefined;
33
+ sortings?: never[] | undefined;
34
+ filters?: never[] | undefined;
35
+ }): Promise<{
36
+ total: any;
37
+ records: any;
38
+ }>;
39
+ openManualEntryForm(kpi: any): void;
40
+ }
41
+ export {};
@@ -0,0 +1,180 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/icon/icon.js';
3
+ import '@operato/data-grist';
4
+ import './kpi-value-manual-entry-form.js';
5
+ import { css, html } from 'lit';
6
+ import { customElement, query, state } from 'lit/decorators.js';
7
+ import { connect } from 'pwa-helpers/connect-mixin';
8
+ import { DataGrist } from '@operato/data-grist';
9
+ import { client } from '@operato/graphql';
10
+ import { i18next, localize } from '@operato/i18n';
11
+ import { openPopup } from '@operato/layout';
12
+ import { PageView, store } from '@operato/shell';
13
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
14
+ import gql from 'graphql-tag';
15
+ let KpiValueManualEntryPage = class KpiValueManualEntryPage extends connect(store)(localize(i18next)(PageView)) {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.kpis = [];
19
+ }
20
+ static { this.styles = [
21
+ ScrollbarStyles,
22
+ CommonHeaderStyles,
23
+ css `
24
+ :host {
25
+ display: flex;
26
+ width: 100%;
27
+ }
28
+ ox-grist {
29
+ overflow-y: auto;
30
+ flex: 1;
31
+ }
32
+ `
33
+ ]; }
34
+ get context() {
35
+ return {
36
+ title: i18next.t('title.kpi value manual entry'),
37
+ search: {
38
+ handler: (search) => {
39
+ this.grist.searchText = search;
40
+ },
41
+ value: this.grist.searchText
42
+ },
43
+ filter: {
44
+ handler: () => {
45
+ this.grist.toggleHeadroom();
46
+ }
47
+ },
48
+ help: 'kpi/kpi-value'
49
+ };
50
+ }
51
+ render() {
52
+ return html `
53
+ <ox-grist mode="CARD" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>
54
+ `;
55
+ }
56
+ async pageInitialized() {
57
+ this.gristConfig = {
58
+ list: {
59
+ fields: ['name', 'description'],
60
+ details: ['category', 'active']
61
+ },
62
+ columns: [
63
+ {
64
+ type: 'gutter',
65
+ gutterName: 'button',
66
+ icon: 'note_alt',
67
+ iconOnly: false,
68
+ width: 96,
69
+ fixed: true,
70
+ title: () => i18next.t('button.enter-kpi-value'),
71
+ handlers: {
72
+ click: (columns, data, column, record, rowIndex) => {
73
+ this.openManualEntryForm(record);
74
+ }
75
+ }
76
+ },
77
+ {
78
+ type: 'string',
79
+ name: 'name',
80
+ header: i18next.t('field.name'),
81
+ record: { editable: false },
82
+ filter: 'search',
83
+ sortable: true,
84
+ width: 150
85
+ },
86
+ {
87
+ type: 'string',
88
+ name: 'description',
89
+ header: i18next.t('field.description'),
90
+ record: { editable: false },
91
+ width: 200
92
+ },
93
+ {
94
+ type: 'string',
95
+ name: 'category',
96
+ header: i18next.t('field.category'),
97
+ record: { editable: false, renderer: (v, c, r) => r.category?.name },
98
+ width: 120
99
+ },
100
+ {
101
+ type: 'checkbox',
102
+ name: 'active',
103
+ label: true,
104
+ header: 'Active',
105
+ record: { editable: false },
106
+ width: 60
107
+ }
108
+ ],
109
+ rows: {
110
+ appendable: false,
111
+ editable: false,
112
+ selectable: {
113
+ multiple: false
114
+ },
115
+ classifier: function (record, rowIndex) { }
116
+ },
117
+ sorters: [
118
+ {
119
+ name: 'name'
120
+ }
121
+ ]
122
+ };
123
+ }
124
+ async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
125
+ const response = await client.query({
126
+ query: gql `
127
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
128
+ responses: kpis(filters: $filters, pagination: $pagination, sortings: $sortings) {
129
+ items {
130
+ id
131
+ name
132
+ description
133
+ active
134
+ category {
135
+ id
136
+ name
137
+ }
138
+ }
139
+ total
140
+ }
141
+ }
142
+ `,
143
+ variables: {
144
+ filters,
145
+ pagination: { page, limit },
146
+ sortings
147
+ }
148
+ });
149
+ return {
150
+ total: response.data.responses.total || 0,
151
+ records: response.data.responses.items || []
152
+ };
153
+ }
154
+ openManualEntryForm(kpi) {
155
+ openPopup(html `
156
+ <kpi-value-manual-entry-form .kpi=${kpi} @saved=${() => this.grist.fetch()}></kpi-value-manual-entry-form>
157
+ `, {
158
+ backdrop: true,
159
+ size: 'medium',
160
+ title: `${kpi.name} - KPI 실적 수동 입력`
161
+ });
162
+ }
163
+ };
164
+ __decorate([
165
+ state(),
166
+ __metadata("design:type", Object)
167
+ ], KpiValueManualEntryPage.prototype, "gristConfig", void 0);
168
+ __decorate([
169
+ state(),
170
+ __metadata("design:type", Array)
171
+ ], KpiValueManualEntryPage.prototype, "kpis", void 0);
172
+ __decorate([
173
+ query('ox-grist'),
174
+ __metadata("design:type", DataGrist)
175
+ ], KpiValueManualEntryPage.prototype, "grist", void 0);
176
+ KpiValueManualEntryPage = __decorate([
177
+ customElement('kpi-value-manual-entry-page')
178
+ ], KpiValueManualEntryPage);
179
+ export { KpiValueManualEntryPage };
180
+ //# sourceMappingURL=kpi-value-manual-entry-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kpi-value-manual-entry-page.js","sourceRoot":"","sources":["../../../client/pages/kpi-value/kpi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AA;QACF,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;YACzC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;SAC7C,CAAA;IACH,CAAC;IAED,mBAAmB,CAAC,GAAG;QACrB,SAAS,CACP,IAAI,CAAA;4CACkC,GAAG,WAAW,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;OAC3E,EACD;YACE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG,GAAG,CAAC,IAAI,iBAAiB;SACpC,CACF,CAAA;IACH,CAAC;;AAzHgB;IAAhB,KAAK,EAAE;;4DAAyB;AAChB;IAAhB,KAAK,EAAE;;qDAAyB;AACN;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;sDAAA;AApCjC,uBAAuB;IADnC,aAAa,CAAC,6BAA6B,CAAC;GAChC,uBAAuB,CA4JnC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\nimport './kpi-value-manual-entry-form.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\nimport { DataGrist } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup, notify } from '@operato/layout'\nimport { PageView, store } from '@operato/shell'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport gql from 'graphql-tag'\n\n@customElement('kpi-value-manual-entry-page')\nexport class KpiValueManualEntryPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n width: 100%;\n }\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n get context() {\n return {\n title: i18next.t('title.kpi value manual entry'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist.searchText\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'kpi/kpi-value'\n }\n }\n\n @state() private gristConfig: any\n @state() private kpis: any[] = []\n @query('ox-grist') private grist!: DataGrist\n\n render() {\n return html`\n <ox-grist mode=\"CARD\" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>\n `\n }\n\n async pageInitialized() {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['category', 'active']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'note_alt',\n iconOnly: false,\n width: 96,\n fixed: true,\n title: () => i18next.t('button.enter-kpi-value'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n this.openManualEntryForm(record)\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: false },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: false },\n width: 200\n },\n {\n type: 'string',\n name: 'category',\n header: i18next.t('field.category'),\n record: { editable: false, renderer: (v, c, r) => r.category?.name },\n width: 120\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: 'Active',\n record: { editable: false },\n width: 60\n }\n ],\n rows: {\n appendable: false,\n editable: false,\n selectable: {\n multiple: false\n },\n classifier: function (record, rowIndex) {}\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: kpis(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n active\n category {\n id\n name\n }\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n openManualEntryForm(kpi) {\n openPopup(\n html`\n <kpi-value-manual-entry-form .kpi=${kpi} @saved=${() => this.grist.fetch()}></kpi-value-manual-entry-form>\n `,\n {\n backdrop: true,\n size: 'medium',\n title: `${kpi.name} - KPI 실적 수동 입력`\n }\n )\n }\n}\n"]}
@@ -1 +1 @@
1
- export default function route(page: string): void;
1
+ export default function route(page: string): "kpi-overview" | "kpi-dashboard" | "kpi-list" | "kpi-category-list" | "kpi-metric-list" | "kpi-value-list" | "kpi-value-manual-entry" | "kpi-grade-list" | "kpi-history-list" | undefined;
@@ -1,5 +1,32 @@
1
1
  export default function route(page) {
2
2
  switch (page) {
3
+ case 'kpi-overview':
4
+ import('./pages/kpi/kpi-overview');
5
+ return page;
6
+ case 'kpi-dashboard':
7
+ import('./pages/kpi-dashboard/kpi-dashboard');
8
+ return page;
9
+ case 'kpi-list':
10
+ import('./pages/kpi/kpi-list-page');
11
+ return page;
12
+ case 'kpi-category-list':
13
+ import('./pages/kpi-category/kpi-category-list-page');
14
+ return page;
15
+ case 'kpi-metric-list':
16
+ import('./pages/kpi-metric/kpi-metric-list-page');
17
+ return page;
18
+ case 'kpi-value-list':
19
+ import('./pages/kpi-value/kpi-value-list-page');
20
+ return page;
21
+ case 'kpi-value-manual-entry':
22
+ import('./pages/kpi-value/kpi-value-manual-entry-page');
23
+ return page;
24
+ case 'kpi-grade-list':
25
+ import('./pages/kpi-grade/kpi-grade-list-page');
26
+ return page;
27
+ case 'kpi-history-list':
28
+ import('./pages/kpi-history/kpi-history-list-page');
29
+ return page;
3
30
  }
4
31
  }
5
32
  //# sourceMappingURL=route.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n }\n}\n"]}
1
+ {"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,cAAc;YACjB,MAAM,CAAC,0BAA0B,CAAC,CAAA;YAClC,OAAO,IAAI,CAAA;QAEb,KAAK,eAAe;YAClB,MAAM,CAAC,qCAAqC,CAAC,CAAA;YAC7C,OAAO,IAAI,CAAA;QAEb,KAAK,UAAU;YACb,MAAM,CAAC,2BAA2B,CAAC,CAAA;YACnC,OAAO,IAAI,CAAA;QAEb,KAAK,mBAAmB;YACtB,MAAM,CAAC,6CAA6C,CAAC,CAAA;YACrD,OAAO,IAAI,CAAA;QAEb,KAAK,iBAAiB;YACpB,MAAM,CAAC,yCAAyC,CAAC,CAAA;YACjD,OAAO,IAAI,CAAA;QAEb,KAAK,gBAAgB;YACnB,MAAM,CAAC,uCAAuC,CAAC,CAAA;YAC/C,OAAO,IAAI,CAAA;QAEb,KAAK,wBAAwB;YAC3B,MAAM,CAAC,+CAA+C,CAAC,CAAA;YACvD,OAAO,IAAI,CAAA;QAEb,KAAK,gBAAgB;YACnB,MAAM,CAAC,uCAAuC,CAAC,CAAA;YAC/C,OAAO,IAAI,CAAA;QAEb,KAAK,kBAAkB;YACrB,MAAM,CAAC,2CAA2C,CAAC,CAAA;YACnD,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n case 'kpi-overview':\n import('./pages/kpi/kpi-overview')\n return page\n\n case 'kpi-dashboard':\n import('./pages/kpi-dashboard/kpi-dashboard')\n return page\n\n case 'kpi-list':\n import('./pages/kpi/kpi-list-page')\n return page\n\n case 'kpi-category-list':\n import('./pages/kpi-category/kpi-category-list-page')\n return page\n\n case 'kpi-metric-list':\n import('./pages/kpi-metric/kpi-metric-list-page')\n return page\n\n case 'kpi-value-list':\n import('./pages/kpi-value/kpi-value-list-page')\n return page\n\n case 'kpi-value-manual-entry':\n import('./pages/kpi-value/kpi-value-manual-entry-page')\n return page\n\n case 'kpi-grade-list':\n import('./pages/kpi-grade/kpi-grade-list-page')\n return page\n\n case 'kpi-history-list':\n import('./pages/kpi-history/kpi-history-list-page')\n return page\n }\n}\n"]}