@things-factory/kpi 9.1.19 → 10.0.0-beta.2
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/client/pages/kpi/kpi-list-page.ts +339 -525
- package/client/pages/kpi/kpi-tree-page.ts +135 -207
- package/client/pages/kpi-metric/kpi-metric-list-page.ts +146 -226
- package/client/pages/kpi-metric-value/kpi-metric-value-editor-page.ts +187 -295
- package/client/pages/kpi-metric-value/kpi-metric-value-list-page.ts +123 -194
- package/client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.ts +57 -91
- package/client/pages/kpi-statistic/kpi-statistic-editor-page.ts +180 -278
- package/client/pages/kpi-statistic/kpi-statistic-list-page.ts +186 -286
- package/client/pages/kpi-value/kpi-value-editor-page.ts +189 -292
- package/client/pages/kpi-value/kpi-value-list-page.ts +170 -264
- package/dist-client/pages/kpi/kpi-list-page.d.ts +0 -6
- package/dist-client/pages/kpi/kpi-list-page.js +150 -282
- package/dist-client/pages/kpi/kpi-list-page.js.map +1 -1
- package/dist-client/pages/kpi/kpi-tree-page.d.ts +1 -7
- package/dist-client/pages/kpi/kpi-tree-page.js +76 -127
- package/dist-client/pages/kpi/kpi-tree-page.js.map +1 -1
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.d.ts +0 -6
- package/dist-client/pages/kpi-metric/kpi-metric-list-page.js +62 -116
- 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 -7
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-editor-page.js +82 -140
- 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-list-page.d.ts +0 -6
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-list-page.js +54 -98
- 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-page.d.ts +1 -7
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js +30 -57
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.js.map +1 -1
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.d.ts +1 -7
- package/dist-client/pages/kpi-statistic/kpi-statistic-editor-page.js +91 -153
- 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 +0 -6
- package/dist-client/pages/kpi-statistic/kpi-statistic-list-page.js +81 -155
- 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 +1 -7
- package/dist-client/pages/kpi-value/kpi-value-editor-page.js +80 -136
- 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 +0 -6
- package/dist-client/pages/kpi-value/kpi-value-list-page.js +73 -134
- package/dist-client/pages/kpi-value/kpi-value-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/client/tsconfig.json +0 -11
- package/dist-server/tsconfig.json +0 -10
- package/server/@types/index.d.ts +0 -11
- package/server/calculator/evaluator.ts +0 -45
- package/server/calculator/functions.ts +0 -67
- package/server/calculator/index.ts +0 -4
- package/server/calculator/parser.ts +0 -137
- package/server/calculator/provider.ts +0 -10
- package/server/controllers/index.ts +0 -2
- package/server/controllers/kpi-metric-value-provider.ts +0 -79
- package/server/controllers/kpi-value-provider.ts +0 -51
- package/server/index.ts +0 -6
- package/server/migrations/1752190849680-seed-kpi-metrics.ts +0 -124
- package/server/migrations/1752190849681-seed-kpi.ts +0 -356
- package/server/migrations/1752192090123-add-grades-to-kpi.ts +0 -67
- package/server/migrations/1752192090124-add-kpi-statistics.ts +0 -719
- package/server/migrations/1752192090128-seed-kpi-org-scope.ts +0 -132
- package/server/migrations/1752192090129-seed-kpi-values.ts +0 -207
- package/server/migrations/grade-data/x11-performance-table.json +0 -962
- package/server/migrations/grade-data/x12-performance-table.json +0 -611
- package/server/migrations/grade-data/x14-performance-table.json +0 -42
- package/server/migrations/grade-data/x21-performance-table.json +0 -889
- package/server/migrations/grade-data/x22-performance-table.json +0 -1064
- package/server/migrations/grade-data/x23-performance-table.json +0 -42
- package/server/migrations/grade-data/x31-performance-table.json +0 -644
- package/server/migrations/grade-data/x32-performance-table.json +0 -993
- package/server/migrations/grade-data/x33-performance-table.json +0 -195
- package/server/migrations/grade-data/x34-performance-table.json +0 -12
- package/server/migrations/grade-data/x35-performance-table.json +0 -42
- package/server/migrations/grade-data/x41-performance-table.json +0 -825
- package/server/migrations/grade-data/x42-performance-table.json +0 -786
- package/server/migrations/grade-data/x43-performance-table.json +0 -12
- package/server/migrations/grade-data/x44-performance-table.json +0 -42
- package/server/migrations/grade-data/x51-performance-table.json +0 -924
- package/server/migrations/grade-data/x52-performance-table.json +0 -42
- package/server/migrations/grade-data/x61-performance-table.json +0 -261
- package/server/migrations/grade-data/x62-performance-table.json +0 -42
- package/server/migrations/index.ts +0 -9
- package/server/migrations/seed-data/kpi-metrics-seed.json +0 -454
- package/server/migrations/seed-data/kpi-org-scope-seed.json +0 -1676
- package/server/migrations/seed-data/kpi-scopes-seed.json +0 -121
- package/server/migrations/seed-data/kpi-values-seed.json +0 -402
- package/server/migrations/seed-data/kpis-seed.json +0 -488
- package/server/migrations/seed-data/scope-definitions-seed.json +0 -90
- package/server/routes.ts +0 -81
- package/server/service/index.ts +0 -51
- package/server/service/kpi/aggregate-kpi.ts +0 -103
- package/server/service/kpi/event-subscriber.ts +0 -29
- package/server/service/kpi/index.ts +0 -9
- package/server/service/kpi/kpi-formula.service.ts +0 -164
- package/server/service/kpi/kpi-grade.types.ts +0 -28
- package/server/service/kpi/kpi-history.ts +0 -126
- package/server/service/kpi/kpi-mutation.ts +0 -553
- package/server/service/kpi/kpi-query.ts +0 -224
- package/server/service/kpi/kpi-type.ts +0 -151
- package/server/service/kpi/kpi.ts +0 -254
- package/server/service/kpi-alert/index.ts +0 -3
- package/server/service/kpi-alert/kpi-alert-query.ts +0 -59
- package/server/service/kpi-alert/kpi-alert-type.ts +0 -20
- package/server/service/kpi-metric/aggregate-kpi-metric.ts +0 -132
- package/server/service/kpi-metric/index.ts +0 -7
- package/server/service/kpi-metric/kpi-metric-mutation.ts +0 -309
- package/server/service/kpi-metric/kpi-metric-query.ts +0 -70
- package/server/service/kpi-metric/kpi-metric-type.ts +0 -111
- package/server/service/kpi-metric/kpi-metric.ts +0 -134
- package/server/service/kpi-metric-value/index.ts +0 -7
- package/server/service/kpi-metric-value/kpi-metric-value-mutation.ts +0 -270
- package/server/service/kpi-metric-value/kpi-metric-value-query.ts +0 -62
- package/server/service/kpi-metric-value/kpi-metric-value-type.ts +0 -82
- package/server/service/kpi-metric-value/kpi-metric-value.ts +0 -93
- package/server/service/kpi-org-scope/index.ts +0 -6
- package/server/service/kpi-org-scope/kpi-org-scope-mutation.ts +0 -173
- package/server/service/kpi-org-scope/kpi-org-scope-query.ts +0 -127
- package/server/service/kpi-org-scope/kpi-org-scope-type.ts +0 -68
- package/server/service/kpi-org-scope/kpi-org-scope.ts +0 -123
- package/server/service/kpi-scope/index.ts +0 -11
- package/server/service/kpi-scope/kpi-scope-mutation.ts +0 -129
- package/server/service/kpi-scope/kpi-scope-query.ts +0 -63
- package/server/service/kpi-scope/kpi-scope-type.ts +0 -96
- package/server/service/kpi-scope/kpi-scope.ts +0 -143
- package/server/service/kpi-statistic/index.ts +0 -7
- package/server/service/kpi-statistic/kpi-statistic-batch.service.ts +0 -231
- package/server/service/kpi-statistic/kpi-statistic-calculation.service.ts +0 -410
- package/server/service/kpi-statistic/kpi-statistic-mutation.ts +0 -291
- package/server/service/kpi-statistic/kpi-statistic-query.ts +0 -146
- package/server/service/kpi-statistic/kpi-statistic-type.ts +0 -152
- package/server/service/kpi-statistic/kpi-statistic.ts +0 -199
- package/server/service/kpi-value/index.ts +0 -7
- package/server/service/kpi-value/kpi-value-mutation.ts +0 -432
- package/server/service/kpi-value/kpi-value-query.ts +0 -61
- package/server/service/kpi-value/kpi-value-score.service.ts +0 -106
- package/server/service/kpi-value/kpi-value-type.ts +0 -122
- package/server/service/kpi-value/kpi-value.ts +0 -160
- package/server/service/utils/value-date-util.ts +0 -119
- package/server/tsconfig.json +0 -10
- package/server/types/global.d.ts +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-metric-value-manual-entry-page.js","sourceRoot":"","sources":["../../../client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAC5B,OAAO,yCAAyC,CAAA;AAEhD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"kpi-metric-value-manual-entry-page.js","sourceRoot":"","sources":["../../../client/pages/kpi-metric-value/kpi-metric-value-manual-entry-page.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAC5B,OAAO,yCAAyC,CAAA;AAEhD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,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EAAE,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;SAChD,CAAA;IACD,CAAC;IAEA,mBAAmB,CAAC,MAAM;QAAQ,SAAS,CACvC,IAAI,CAAA;;oBAEU,MAAM;mBACP,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;;OAEpC,EACD,EAAU,QAAQ,EAAE,IAAI;YACtB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG,MAAM,CAAC,IAAI,mBAAmB;SAC9C,CACG,CAAA;IACJ,CAAC;;AA7GiB;IAAhB,KAAK,EAAE;;kEAAyB;AAChB;IAAhB,KAAK,EAAE;;8DAA4B;AACT;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;4DAAA;AA3BjC,6BAA6B;IADzC,aAAa,CAAC,oCAAoC,CAAC;GACvC,6BAA6B,CAuIzC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\nimport './kpi-metric-value-manual-entry-form.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\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 } from '@operato/shell'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport gql from 'graphql-tag'\n\n@customElement('kpi-metric-value-manual-entry-page')\nexport class KpiMetricValueManualEntryPage extends localize(i18next)(PageView) { static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host { display: flex;\n width: 100%;\n }\n ox-grist { overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n get context() { return { title: i18next.t('title.kpi metric value manual entry'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist.searchText\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'kpi/kpi-metric-value'\n }\n }\n\n @state() private gristConfig: any\n @state() private metrics: any[] = []\n @query('ox-grist') private grist!: DataGrist\n\n render() { return html`\n <ox-grist mode=\"CARD\" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>\n `\n }\n\n async pageInitialized() { this.gristConfig = { list: { fields: ['name', 'description'],\n details: ['periodType', 'active']\n },\n columns: [\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-metric-value'),\n handlers: { click: (columns, data, column, record, rowIndex) => { this.openManualEntryForm(record)\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 { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: false },\n width: 200\n },\n { type: 'select',\n name: 'periodType',\n header: '주기',\n record: { editable: true,\n options: [\n { value: '', display: '' },\n { value: 'DAY', display: '일' },\n { value: 'WEEK', display: '주' },\n { value: 'MONTH', display: '월' },\n { value: 'QUARTER', display: '분기' },\n { value: 'YEAR', display: '년' },\n { value: 'RANGE', display: '범위' },\n { value: 'ALLTIME', display: '전체' }\n ]\n },\n width: 80\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: 'Active',\n record: { editable: false },\n width: 60\n }\n ],\n rows: { appendable: false,\n editable: false,\n selectable: { multiple: false\n },\n classifier: function (record, rowIndex) {}\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: kpiMetrics(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n periodType\n active\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n openManualEntryForm(metric) { openPopup(\n html`\n <kpi-metric-value-manual-entry-form\n .metric=${metric}\n @saved=${() => this.grist.fetch()}\n ></kpi-metric-value-manual-entry-form>\n `,\n { backdrop: true,\n size: 'medium',\n title: `${metric.name} - Metric 값 수동 입력`\n }\n )\n }\n}\n"]}
|
|
@@ -2,13 +2,7 @@ import '@material/web/icon/icon.js';
|
|
|
2
2
|
import '@material/web/button/elevated-button.js';
|
|
3
3
|
import '@material/web/textfield/outlined-text-field.js';
|
|
4
4
|
import { PageView } from '@operato/shell';
|
|
5
|
-
declare const KpiStatisticEditorPage_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 & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
5
|
+
declare const KpiStatisticEditorPage_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
|
12
6
|
export declare class KpiStatisticEditorPage extends KpiStatisticEditorPage_base {
|
|
13
7
|
static styles: import("lit").CSSResult[];
|
|
14
8
|
periodType: string;
|
|
@@ -3,16 +3,15 @@ import '@material/web/icon/icon.js';
|
|
|
3
3
|
import '@material/web/button/elevated-button.js';
|
|
4
4
|
import '@material/web/textfield/outlined-text-field.js';
|
|
5
5
|
import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
|
|
6
|
-
import { PageView
|
|
6
|
+
import { PageView } from '@operato/shell';
|
|
7
7
|
import { css, html } from 'lit';
|
|
8
8
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
9
9
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
10
10
|
import { client } from '@operato/graphql';
|
|
11
11
|
import { i18next, localize } from '@operato/i18n';
|
|
12
12
|
import { notify } from '@operato/layout';
|
|
13
|
-
import { connect } from 'pwa-helpers/connect-mixin';
|
|
14
13
|
import gql from 'graphql-tag';
|
|
15
|
-
let KpiStatisticEditorPage = class KpiStatisticEditorPage extends
|
|
14
|
+
let KpiStatisticEditorPage = class KpiStatisticEditorPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
|
|
16
15
|
constructor() {
|
|
17
16
|
super(...arguments);
|
|
18
17
|
this.periodType = 'MONTH';
|
|
@@ -45,45 +44,39 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
45
44
|
CommonHeaderStyles,
|
|
46
45
|
ScrollbarStyles,
|
|
47
46
|
css `
|
|
48
|
-
:host {
|
|
49
|
-
display: flex;
|
|
47
|
+
:host { display: flex;
|
|
50
48
|
flex-direction: column;
|
|
51
49
|
padding: 20px;
|
|
52
50
|
overflow-x: auto;
|
|
53
|
-
|
|
51
|
+
}
|
|
54
52
|
|
|
55
|
-
.header {
|
|
56
|
-
display: flex;
|
|
53
|
+
.header { display: flex;
|
|
57
54
|
gap: 16px;
|
|
58
55
|
align-items: center;
|
|
59
56
|
margin-bottom: 20px;
|
|
60
57
|
padding: 16px;
|
|
61
58
|
background: var(--md-sys-color-surface-container);
|
|
62
59
|
border-radius: 8px;
|
|
63
|
-
|
|
60
|
+
}
|
|
64
61
|
|
|
65
|
-
.controls {
|
|
66
|
-
display: flex;
|
|
62
|
+
.controls { display: flex;
|
|
67
63
|
gap: 12px;
|
|
68
64
|
align-items: center;
|
|
69
65
|
flex-wrap: wrap;
|
|
70
|
-
|
|
66
|
+
}
|
|
71
67
|
|
|
72
|
-
.table-container {
|
|
73
|
-
flex: 1;
|
|
68
|
+
.table-container { flex: 1;
|
|
74
69
|
overflow: auto;
|
|
75
70
|
border: 1px solid var(--md-sys-color-outline);
|
|
76
71
|
border-radius: 8px;
|
|
77
|
-
|
|
72
|
+
}
|
|
78
73
|
|
|
79
|
-
table {
|
|
80
|
-
width: 100%;
|
|
74
|
+
table { width: 100%;
|
|
81
75
|
border-collapse: collapse;
|
|
82
76
|
min-width: max-content;
|
|
83
|
-
|
|
77
|
+
}
|
|
84
78
|
|
|
85
|
-
th {
|
|
86
|
-
background: var(--md-sys-color-surface-container-low);
|
|
79
|
+
th { background: var(--md-sys-color-surface-container-low);
|
|
87
80
|
font-weight: 500;
|
|
88
81
|
padding: 8px 12px;
|
|
89
82
|
border: 1px solid var(--md-sys-color-outline-variant);
|
|
@@ -91,161 +84,137 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
91
84
|
height: 60px;
|
|
92
85
|
vertical-align: middle;
|
|
93
86
|
text-align: center;
|
|
94
|
-
|
|
87
|
+
}
|
|
95
88
|
|
|
96
|
-
td {
|
|
97
|
-
padding: 8px 12px;
|
|
89
|
+
td { padding: 8px 12px;
|
|
98
90
|
border: 1px solid var(--md-sys-color-outline-variant);
|
|
99
91
|
min-width: 120px;
|
|
100
92
|
height: 60px;
|
|
101
93
|
text-align: center;
|
|
102
94
|
vertical-align: middle;
|
|
103
|
-
|
|
95
|
+
}
|
|
104
96
|
|
|
105
|
-
.kpi-header {
|
|
106
|
-
position: sticky;
|
|
97
|
+
.kpi-header { position: sticky;
|
|
107
98
|
left: 0;
|
|
108
99
|
top: 0;
|
|
109
100
|
z-index: 3;
|
|
110
101
|
min-width: 200px;
|
|
111
102
|
text-align: left;
|
|
112
|
-
|
|
103
|
+
}
|
|
113
104
|
|
|
114
|
-
.field-header {
|
|
115
|
-
position: sticky;
|
|
105
|
+
.field-header { position: sticky;
|
|
116
106
|
left: 0;
|
|
117
107
|
top: 0;
|
|
118
108
|
z-index: 2;
|
|
119
109
|
min-width: 200px;
|
|
120
110
|
text-align: center;
|
|
121
|
-
|
|
111
|
+
}
|
|
122
112
|
|
|
123
|
-
.kpi-name {
|
|
124
|
-
position: sticky;
|
|
113
|
+
.kpi-name { position: sticky;
|
|
125
114
|
left: 0;
|
|
126
115
|
background: var(--md-sys-color-surface);
|
|
127
116
|
font-weight: 500;
|
|
128
117
|
min-width: 200px;
|
|
129
118
|
text-align: left;
|
|
130
119
|
z-index: 2;
|
|
131
|
-
|
|
120
|
+
}
|
|
132
121
|
|
|
133
|
-
tr:hover {
|
|
134
|
-
|
|
135
|
-
}
|
|
122
|
+
tr:hover { background: var(--md-sys-color-surface-container-high);
|
|
123
|
+
}
|
|
136
124
|
|
|
137
|
-
td.editable-cell {
|
|
138
|
-
cursor: pointer;
|
|
125
|
+
td.editable-cell { cursor: pointer;
|
|
139
126
|
background: var(--md-sys-color-primary-container);
|
|
140
127
|
color: var(--md-sys-color-on-primary-container);
|
|
141
|
-
|
|
128
|
+
}
|
|
142
129
|
|
|
143
|
-
td.editable-cell:hover {
|
|
144
|
-
|
|
145
|
-
}
|
|
130
|
+
td.editable-cell:hover { background: var(--md-sys-color-primary-container-high);
|
|
131
|
+
}
|
|
146
132
|
|
|
147
|
-
td.highlighted-cell {
|
|
148
|
-
background: var(--md-sys-color-secondary-container);
|
|
133
|
+
td.highlighted-cell { background: var(--md-sys-color-secondary-container);
|
|
149
134
|
color: var(--md-sys-color-on-secondary-container);
|
|
150
135
|
font-weight: 500;
|
|
151
|
-
|
|
136
|
+
}
|
|
152
137
|
|
|
153
|
-
td.highlighted-cell:hover {
|
|
154
|
-
|
|
155
|
-
}
|
|
138
|
+
td.highlighted-cell:hover { background: var(--md-sys-color-secondary-container-high);
|
|
139
|
+
}
|
|
156
140
|
|
|
157
|
-
td.disabled-cell {
|
|
158
|
-
background: var(--md-sys-color-surface-container);
|
|
141
|
+
td.disabled-cell { background: var(--md-sys-color-surface-container);
|
|
159
142
|
color: var(--md-sys-color-on-surface-variant);
|
|
160
143
|
cursor: not-allowed;
|
|
161
|
-
|
|
144
|
+
}
|
|
162
145
|
|
|
163
|
-
.value-input {
|
|
164
|
-
width: 100%;
|
|
146
|
+
.value-input { width: 100%;
|
|
165
147
|
text-align: center;
|
|
166
148
|
border: none;
|
|
167
149
|
background: transparent;
|
|
168
150
|
color: inherit;
|
|
169
151
|
font-size: 12px;
|
|
170
152
|
padding: 2px;
|
|
171
|
-
|
|
153
|
+
}
|
|
172
154
|
|
|
173
|
-
.value-input:focus {
|
|
174
|
-
outline: 2px solid var(--md-sys-color-primary);
|
|
155
|
+
.value-input:focus { outline: 2px solid var(--md-sys-color-primary);
|
|
175
156
|
border-radius: 4px;
|
|
176
|
-
|
|
157
|
+
}
|
|
177
158
|
|
|
178
|
-
.period-badge {
|
|
179
|
-
font-size: 10px;
|
|
159
|
+
.period-badge { font-size: 10px;
|
|
180
160
|
padding: 2px 6px;
|
|
181
161
|
border-radius: 4px;
|
|
182
162
|
background: var(--md-sys-color-tertiary-container);
|
|
183
163
|
color: var(--md-sys-color-on-tertiary-container);
|
|
184
164
|
margin-left: 8px;
|
|
185
|
-
|
|
165
|
+
}
|
|
186
166
|
|
|
187
|
-
.loading {
|
|
188
|
-
display: flex;
|
|
167
|
+
.loading { display: flex;
|
|
189
168
|
justify-content: center;
|
|
190
169
|
align-items: center;
|
|
191
170
|
height: 200px;
|
|
192
171
|
color: var(--md-sys-color-on-surface-variant);
|
|
193
|
-
|
|
172
|
+
}
|
|
194
173
|
|
|
195
|
-
.error {
|
|
196
|
-
color: var(--md-sys-color-error);
|
|
174
|
+
.error { color: var(--md-sys-color-error);
|
|
197
175
|
padding: 16px;
|
|
198
176
|
text-align: center;
|
|
199
|
-
|
|
177
|
+
}
|
|
200
178
|
|
|
201
|
-
.legend {
|
|
202
|
-
display: flex;
|
|
179
|
+
.legend { display: flex;
|
|
203
180
|
gap: 16px;
|
|
204
181
|
margin-top: 16px;
|
|
205
182
|
font-size: 12px;
|
|
206
|
-
|
|
183
|
+
}
|
|
207
184
|
|
|
208
|
-
.legend-item {
|
|
209
|
-
display: flex;
|
|
185
|
+
.legend-item { display: flex;
|
|
210
186
|
align-items: center;
|
|
211
187
|
gap: 4px;
|
|
212
|
-
|
|
188
|
+
}
|
|
213
189
|
|
|
214
|
-
.legend-color {
|
|
215
|
-
width: 16px;
|
|
190
|
+
.legend-color { width: 16px;
|
|
216
191
|
height: 16px;
|
|
217
192
|
border-radius: 2px;
|
|
218
|
-
|
|
193
|
+
}
|
|
219
194
|
|
|
220
|
-
.field-group {
|
|
221
|
-
display: flex;
|
|
195
|
+
.field-group { display: flex;
|
|
222
196
|
flex-direction: column;
|
|
223
197
|
gap: 4px;
|
|
224
|
-
|
|
198
|
+
}
|
|
225
199
|
|
|
226
|
-
.field-name {
|
|
227
|
-
font-size: 10px;
|
|
200
|
+
.field-name { font-size: 10px;
|
|
228
201
|
color: var(--md-sys-color-on-surface-variant);
|
|
229
202
|
font-weight: 500;
|
|
230
|
-
|
|
203
|
+
}
|
|
231
204
|
|
|
232
|
-
.field-value {
|
|
233
|
-
font-size: 12px;
|
|
205
|
+
.field-value { font-size: 12px;
|
|
234
206
|
font-weight: 500;
|
|
235
|
-
|
|
207
|
+
}
|
|
236
208
|
`
|
|
237
209
|
]; }
|
|
238
210
|
get context() {
|
|
239
|
-
return {
|
|
240
|
-
title: i18next.t('title.kpi statistic editor'),
|
|
211
|
+
return { title: i18next.t('title.kpi statistic editor'),
|
|
241
212
|
actions: [
|
|
242
|
-
{
|
|
243
|
-
title: i18next.t('button.save'),
|
|
213
|
+
{ title: i18next.t('button.save'),
|
|
244
214
|
action: this._saveStatistics.bind(this),
|
|
245
215
|
...CommonButtonStyles.save
|
|
246
216
|
},
|
|
247
|
-
{
|
|
248
|
-
title: i18next.t('button.cancel'),
|
|
217
|
+
{ title: i18next.t('button.cancel'),
|
|
249
218
|
action: this._cancel.bind(this),
|
|
250
219
|
...CommonButtonStyles.cancel
|
|
251
220
|
}
|
|
@@ -366,11 +335,9 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
366
335
|
return 'editable-cell';
|
|
367
336
|
}
|
|
368
337
|
_isFieldEditable(fieldName) {
|
|
369
|
-
// 모든 필드를 편집 가능하게 설정 (필요에 따라 제한 가능)
|
|
370
338
|
return true;
|
|
371
339
|
}
|
|
372
340
|
_isFieldHighlighted(fieldName) {
|
|
373
|
-
// 중요 필드들을 하이라이트
|
|
374
341
|
const importantFields = ['count', 'mean', 'median', 'minimum', 'maximum', 'standardDeviation'];
|
|
375
342
|
return importantFields.includes(fieldName);
|
|
376
343
|
}
|
|
@@ -416,41 +383,29 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
416
383
|
}
|
|
417
384
|
this.loading = true;
|
|
418
385
|
this.error = '';
|
|
419
|
-
try {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
query: gql `
|
|
423
|
-
query ($filters: [Filter!]) {
|
|
424
|
-
kpis(filters: $filters) {
|
|
425
|
-
items {
|
|
426
|
-
id
|
|
386
|
+
try { // KPI 목록 조회
|
|
387
|
+
const kpisResponse = await client.query({ query: gql `
|
|
388
|
+
query ($filters: [Filter!]) { kpis(filters: $filters) { items { id
|
|
427
389
|
name
|
|
428
390
|
periodType
|
|
429
391
|
active
|
|
430
|
-
category: parent {
|
|
431
|
-
id
|
|
392
|
+
category: parent { id
|
|
432
393
|
name
|
|
433
|
-
|
|
434
|
-
|
|
394
|
+
}
|
|
395
|
+
}
|
|
435
396
|
total
|
|
436
|
-
|
|
437
|
-
|
|
397
|
+
}
|
|
398
|
+
}
|
|
438
399
|
`,
|
|
439
|
-
variables: {
|
|
440
|
-
filters: [{ name: 'active', operator: 'eq', value: true }]
|
|
400
|
+
variables: { filters: [{ name: 'active', operator: 'eq', value: true }]
|
|
441
401
|
}
|
|
442
402
|
});
|
|
443
403
|
// 기존 KPI Statistic 데이터 조회
|
|
444
|
-
const statisticsResponse = await client.query({
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
kpiStatistics(filters: $filters) {
|
|
448
|
-
items {
|
|
449
|
-
id
|
|
450
|
-
kpi {
|
|
451
|
-
id
|
|
404
|
+
const statisticsResponse = await client.query({ query: gql `
|
|
405
|
+
query ($filters: [Filter!]) { kpiStatistics(filters: $filters) { items { id
|
|
406
|
+
kpi { id
|
|
452
407
|
name
|
|
453
|
-
|
|
408
|
+
}
|
|
454
409
|
valueDate
|
|
455
410
|
periodType
|
|
456
411
|
count
|
|
@@ -469,13 +424,12 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
469
424
|
upperFence
|
|
470
425
|
additionalStatistics
|
|
471
426
|
metadata
|
|
472
|
-
|
|
427
|
+
}
|
|
473
428
|
total
|
|
474
|
-
|
|
475
|
-
|
|
429
|
+
}
|
|
430
|
+
}
|
|
476
431
|
`,
|
|
477
|
-
variables: {
|
|
478
|
-
filters: [
|
|
432
|
+
variables: { filters: [
|
|
479
433
|
{ name: 'valueDate', operator: 'eq', value: this.valueDate },
|
|
480
434
|
{ name: 'periodType', operator: 'eq', value: this.periodType }
|
|
481
435
|
]
|
|
@@ -486,12 +440,10 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
486
440
|
const filteredKpis = kpisResponse.data.kpis.items;
|
|
487
441
|
console.log('모든 KPI 포함:', filteredKpis);
|
|
488
442
|
console.log('필터링된 KPI:', filteredKpis);
|
|
489
|
-
this.kpis = filteredKpis.map((kpi) => ({
|
|
490
|
-
kpi: kpi,
|
|
443
|
+
this.kpis = filteredKpis.map((kpi) => ({ kpi: kpi,
|
|
491
444
|
valueDate: this.valueDate,
|
|
492
445
|
periodType: this.periodType,
|
|
493
|
-
statistics: {
|
|
494
|
-
count: null,
|
|
446
|
+
statistics: { count: null,
|
|
495
447
|
sum: null,
|
|
496
448
|
range: null,
|
|
497
449
|
mean: null,
|
|
@@ -516,8 +468,7 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
516
468
|
const kpi = this.kpis.find(k => k.kpi.id === statistic.kpi.id); // KPI ID로 매칭
|
|
517
469
|
console.log(`통계 데이터 매핑: statistic.kpi.id=${statistic.kpi.id}, 찾은 KPI:`, kpi?.kpi.name || '없음');
|
|
518
470
|
if (kpi) {
|
|
519
|
-
kpi.statistics = {
|
|
520
|
-
count: statistic.count,
|
|
471
|
+
kpi.statistics = { count: statistic.count,
|
|
521
472
|
sum: statistic.sum,
|
|
522
473
|
range: statistic.range,
|
|
523
474
|
mean: statistic.mean,
|
|
@@ -554,31 +505,24 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
554
505
|
try {
|
|
555
506
|
const patches = [];
|
|
556
507
|
this.kpis.forEach(kpi => {
|
|
557
|
-
// dirty 상태인 데이터만 처리
|
|
558
508
|
if (kpi.statistics.isDirty) {
|
|
559
509
|
const existingStatistic = this._findExistingStatistic(kpi.kpi.id);
|
|
560
|
-
if (existingStatistic) {
|
|
561
|
-
// 기존 데이터 업데이트
|
|
510
|
+
if (existingStatistic) { // 기존 데이터 업데이트
|
|
562
511
|
const { isDirty, ...statisticsWithoutDirty } = kpi.statistics;
|
|
563
|
-
patches.push({
|
|
564
|
-
id: existingStatistic.id,
|
|
512
|
+
patches.push({ id: existingStatistic.id,
|
|
565
513
|
...statisticsWithoutDirty,
|
|
566
514
|
cuFlag: 'M'
|
|
567
515
|
});
|
|
568
516
|
}
|
|
569
|
-
else {
|
|
570
|
-
// 새로운 데이터 생성
|
|
517
|
+
else { // 새로운 데이터 생성
|
|
571
518
|
const { isDirty, ...statisticsWithoutDirty } = kpi.statistics;
|
|
572
|
-
patches.push({
|
|
573
|
-
kpi: {
|
|
574
|
-
id: kpi.kpi.id
|
|
519
|
+
patches.push({ kpi: { id: kpi.kpi.id
|
|
575
520
|
},
|
|
576
521
|
valueDate: kpi.valueDate,
|
|
577
522
|
periodType: kpi.periodType,
|
|
578
523
|
...statisticsWithoutDirty,
|
|
579
524
|
additionalStatistics: {},
|
|
580
|
-
metadata: {
|
|
581
|
-
calculationMethod: 'manual',
|
|
525
|
+
metadata: { calculationMethod: 'manual',
|
|
582
526
|
lastCalculated: new Date(),
|
|
583
527
|
dataCount: kpi.statistics.count || 0
|
|
584
528
|
},
|
|
@@ -591,24 +535,19 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
591
535
|
notify({ message: '저장할 데이터가 없습니다.' });
|
|
592
536
|
return;
|
|
593
537
|
}
|
|
594
|
-
const response = await client.mutate({
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
updateMultipleKpiStatistic(patches: $patches) {
|
|
598
|
-
id
|
|
599
|
-
kpi {
|
|
600
|
-
id
|
|
538
|
+
const response = await client.mutate({ mutation: gql `
|
|
539
|
+
mutation ($patches: [KpiStatisticPatch!]!) { updateMultipleKpiStatistic(patches: $patches) { id
|
|
540
|
+
kpi { id
|
|
601
541
|
name
|
|
602
|
-
|
|
542
|
+
}
|
|
603
543
|
valueDate
|
|
604
544
|
periodType
|
|
605
|
-
|
|
606
|
-
|
|
545
|
+
}
|
|
546
|
+
}
|
|
607
547
|
`,
|
|
608
548
|
variables: { patches }
|
|
609
549
|
});
|
|
610
|
-
if (!response.errors) {
|
|
611
|
-
// 저장 후 dirty 상태 해제
|
|
550
|
+
if (!response.errors) { // 저장 후 dirty 상태 해제
|
|
612
551
|
this.kpis.forEach(kpi => {
|
|
613
552
|
kpi.statistics.isDirty = false;
|
|
614
553
|
});
|
|
@@ -669,7 +608,6 @@ let KpiStatisticEditorPage = class KpiStatisticEditorPage extends connect(store)
|
|
|
669
608
|
this._loadData(); // 원본 데이터로 복원
|
|
670
609
|
}
|
|
671
610
|
async pageInitialized(lifecycle) {
|
|
672
|
-
// 기본값 설정 - 현재 날짜를 기준으로
|
|
673
611
|
if (!this.targetDate) {
|
|
674
612
|
this.targetDate = new Date().toLocaleDateString('sv-SE');
|
|
675
613
|
}
|