@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
|
@@ -5,7 +5,7 @@ import '@operato/data-grist/ox-filters-form.js'
|
|
|
5
5
|
import '@operato/data-grist/ox-record-creator.js'
|
|
6
6
|
|
|
7
7
|
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
8
|
-
import { PageView
|
|
8
|
+
import { PageView } from '@operato/shell'
|
|
9
9
|
import { css, html } from 'lit'
|
|
10
10
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
11
11
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
@@ -17,94 +17,75 @@ import { OxPopup, OxPrompt } from '@operato/popup'
|
|
|
17
17
|
import { isMobileDevice } from '@operato/utils'
|
|
18
18
|
import { p13n } from '@operato/p13n'
|
|
19
19
|
|
|
20
|
-
import { connect } from 'pwa-helpers/connect-mixin'
|
|
21
20
|
import gql from 'graphql-tag'
|
|
22
21
|
|
|
23
22
|
import { KpiValueImporter } from './kpi-value-importer'
|
|
24
23
|
|
|
25
24
|
@customElement('kpi-value-list-page')
|
|
26
|
-
export class KpiValueListPage extends
|
|
27
|
-
static styles = [
|
|
25
|
+
export class KpiValueListPage extends p13n(localize(i18next)(ScopedElementsMixin(PageView))) { static styles = [
|
|
28
26
|
ScrollbarStyles,
|
|
29
27
|
CommonGristStyles,
|
|
30
28
|
CommonHeaderStyles,
|
|
31
29
|
css`
|
|
32
|
-
:host {
|
|
33
|
-
display: flex;
|
|
30
|
+
:host { display: flex;
|
|
34
31
|
|
|
35
32
|
width: 100%;
|
|
36
33
|
|
|
37
34
|
--grid-record-emphasized-background-color: #8b0000;
|
|
38
35
|
--grid-record-emphasized-color: #ff6b6b;
|
|
39
|
-
|
|
36
|
+
}
|
|
40
37
|
|
|
41
|
-
ox-grist {
|
|
42
|
-
overflow-y: auto;
|
|
38
|
+
ox-grist { overflow-y: auto;
|
|
43
39
|
flex: 1;
|
|
44
|
-
|
|
40
|
+
}
|
|
45
41
|
|
|
46
|
-
ox-filters-form {
|
|
47
|
-
|
|
48
|
-
}
|
|
42
|
+
ox-filters-form { flex: 1;
|
|
43
|
+
}
|
|
49
44
|
`
|
|
50
45
|
]
|
|
51
46
|
|
|
52
|
-
static get scopedElements() {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
}
|
|
47
|
+
static get scopedElements() { return { 'kpi-value-importer': KpiValueImporter
|
|
48
|
+
}
|
|
49
|
+
}
|
|
57
50
|
|
|
58
51
|
@property({ type: Object }) gristConfig: any
|
|
59
52
|
@property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
60
53
|
|
|
61
54
|
@query('ox-grist') private grist!: DataGrist
|
|
62
55
|
|
|
63
|
-
get context() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
search: {
|
|
67
|
-
handler: (search: string) => {
|
|
68
|
-
this.grist.searchText = search
|
|
69
|
-
},
|
|
56
|
+
get context() { return { title: i18next.t('title.kpi value list'),
|
|
57
|
+
search: { handler: (search: string) => { this.grist.searchText = search
|
|
58
|
+
},
|
|
70
59
|
value: this.grist.searchText
|
|
71
|
-
|
|
72
|
-
filter: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
},
|
|
60
|
+
},
|
|
61
|
+
filter: { handler: () => { this.grist.toggleHeadroom()
|
|
62
|
+
}
|
|
63
|
+
},
|
|
77
64
|
help: 'kpi/kpi-value',
|
|
78
65
|
actions: [
|
|
79
|
-
{
|
|
80
|
-
title: '일괄 편집',
|
|
66
|
+
{ title: '일괄 편집',
|
|
81
67
|
action: this._openEditor.bind(this),
|
|
82
68
|
icon: 'edit',
|
|
83
69
|
style: 'background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container);'
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
title: i18next.t('button.save'),
|
|
70
|
+
},
|
|
71
|
+
{ title: i18next.t('button.save'),
|
|
87
72
|
action: this._updateKpiValue.bind(this),
|
|
88
73
|
...CommonButtonStyles.save
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
title: i18next.t('button.delete'),
|
|
74
|
+
},
|
|
75
|
+
{ title: i18next.t('button.delete'),
|
|
92
76
|
action: this._deleteKpiValue.bind(this),
|
|
93
77
|
...CommonButtonStyles.delete
|
|
94
|
-
|
|
78
|
+
}
|
|
95
79
|
],
|
|
96
|
-
exportable: {
|
|
97
|
-
name: i18next.t('title.kpi value list'),
|
|
80
|
+
exportable: { name: i18next.t('title.kpi value list'),
|
|
98
81
|
data: this.exportHandler.bind(this)
|
|
99
|
-
|
|
100
|
-
importable: {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
82
|
+
},
|
|
83
|
+
importable: { handler: this.importHandler.bind(this)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
105
87
|
|
|
106
|
-
render() {
|
|
107
|
-
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
|
|
88
|
+
render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
|
|
108
89
|
|
|
109
90
|
return html`
|
|
110
91
|
<ox-grist
|
|
@@ -134,12 +115,9 @@ export class KpiValueListPage extends connect(store)(p13n(localize(i18next)(Scop
|
|
|
134
115
|
<ox-grist-personalizer slot="setting"></ox-grist-personalizer>
|
|
135
116
|
</ox-grist>
|
|
136
117
|
`
|
|
137
|
-
|
|
118
|
+
}
|
|
138
119
|
|
|
139
|
-
async pageInitialized(lifecycle: any) {
|
|
140
|
-
this.gristConfig = {
|
|
141
|
-
list: {
|
|
142
|
-
fields: [
|
|
120
|
+
async pageInitialized(lifecycle: any) { this.gristConfig = { list: { fields: [
|
|
143
121
|
'kpi',
|
|
144
122
|
'version',
|
|
145
123
|
'valueDate',
|
|
@@ -169,39 +147,33 @@ export class KpiValueListPage extends connect(store)(p13n(localize(i18next)(Scop
|
|
|
169
147
|
'creator',
|
|
170
148
|
'updater'
|
|
171
149
|
]
|
|
172
|
-
|
|
150
|
+
},
|
|
173
151
|
columns: [
|
|
174
152
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
175
153
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
176
154
|
// KPI Value 재계산 버튼 추가
|
|
177
|
-
{
|
|
178
|
-
type: 'gutter',
|
|
155
|
+
{ type: 'gutter',
|
|
179
156
|
gutterName: 'button',
|
|
180
157
|
icon: 'refresh',
|
|
181
158
|
title: '재계산',
|
|
182
|
-
handlers: {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
type: 'string',
|
|
159
|
+
handlers: { click: (columns, data, column, record, rowIndex) => { this._recalculateKpiValue(record)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{ type: 'string',
|
|
190
164
|
name: 'kpiOrgScope',
|
|
191
165
|
header: '조직',
|
|
192
166
|
record: { editable: false },
|
|
193
167
|
width: 120,
|
|
194
|
-
renderer: (value, column, record, rowIndex, field) => {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
{
|
|
199
|
-
type: 'string',
|
|
168
|
+
renderer: (value, column, record, rowIndex, field) => { return value?.entityName || value?.org || ''
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{ type: 'string',
|
|
200
172
|
name: 'kpi',
|
|
201
173
|
header: 'KPI',
|
|
202
174
|
record: { editable: false, renderer: (v, c, r) => r.kpi?.name },
|
|
203
175
|
width: 150
|
|
204
|
-
|
|
176
|
+
},
|
|
205
177
|
{ type: 'number', name: 'version', header: '버전', record: { editable: false }, width: 80 },
|
|
206
178
|
{ type: 'string', name: 'valueDate', header: '실적일', record: { editable: true }, width: 120 },
|
|
207
179
|
{ type: 'number', name: 'value', header: '실적값', record: { editable: true }, width: 120 },
|
|
@@ -211,48 +183,36 @@ export class KpiValueListPage extends connect(store)(p13n(localize(i18next)(Scop
|
|
|
211
183
|
{ type: 'object', name: 'meta', header: '메타', record: { editable: false }, width: 120 },
|
|
212
184
|
{ type: 'datetime', name: 'createdAt', header: '생성일', record: { editable: false }, width: 180 },
|
|
213
185
|
{ type: 'datetime', name: 'updatedAt', header: '수정일', record: { editable: false }, width: 180 },
|
|
214
|
-
{
|
|
215
|
-
type: 'resource-object',
|
|
186
|
+
{ type: 'resource-object',
|
|
216
187
|
name: 'creator',
|
|
217
188
|
header: '생성자',
|
|
218
189
|
record: { editable: false, renderer: (v, c, r) => r.creator?.name },
|
|
219
190
|
width: 120
|
|
220
|
-
|
|
221
|
-
{
|
|
222
|
-
type: 'resource-object',
|
|
191
|
+
},
|
|
192
|
+
{ type: 'resource-object',
|
|
223
193
|
name: 'updater',
|
|
224
194
|
header: '수정자',
|
|
225
195
|
record: { editable: false, renderer: (v, c, r) => r.updater?.name },
|
|
226
196
|
width: 120
|
|
227
|
-
|
|
197
|
+
}
|
|
228
198
|
],
|
|
229
|
-
rows: {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
},
|
|
199
|
+
rows: { appendable: false,
|
|
200
|
+
selectable: { multiple: true
|
|
201
|
+
}
|
|
202
|
+
},
|
|
235
203
|
sorters: [{ name: 'valueDate' }]
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
async pageUpdated(changes: any, lifecycle: any) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
const response = await client.query({
|
|
247
|
-
query: gql`
|
|
248
|
-
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
249
|
-
responses: kpiValues(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
250
|
-
items {
|
|
251
|
-
id
|
|
252
|
-
kpi {
|
|
253
|
-
id
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`
|
|
212
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: kpiValues(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id
|
|
213
|
+
kpi { id
|
|
254
214
|
name
|
|
255
|
-
|
|
215
|
+
}
|
|
256
216
|
version
|
|
257
217
|
valueDate
|
|
258
218
|
value
|
|
@@ -260,227 +220,173 @@ export class KpiValueListPage extends connect(store)(p13n(localize(i18next)(Scop
|
|
|
260
220
|
inputType
|
|
261
221
|
source
|
|
262
222
|
meta
|
|
263
|
-
kpiOrgScope {
|
|
264
|
-
id
|
|
223
|
+
kpiOrgScope { id
|
|
265
224
|
org
|
|
266
|
-
|
|
267
|
-
updater {
|
|
268
|
-
id
|
|
225
|
+
}
|
|
226
|
+
updater { id
|
|
269
227
|
name
|
|
270
|
-
|
|
228
|
+
}
|
|
271
229
|
updatedAt
|
|
272
|
-
creator {
|
|
273
|
-
id
|
|
230
|
+
creator { id
|
|
274
231
|
name
|
|
275
|
-
|
|
232
|
+
}
|
|
276
233
|
createdAt
|
|
277
|
-
|
|
234
|
+
}
|
|
278
235
|
total
|
|
279
|
-
|
|
280
|
-
|
|
236
|
+
}
|
|
237
|
+
}
|
|
281
238
|
`,
|
|
282
|
-
variables: {
|
|
283
|
-
filters,
|
|
239
|
+
variables: { filters,
|
|
284
240
|
pagination: { page, limit },
|
|
285
241
|
sortings
|
|
286
|
-
|
|
287
|
-
|
|
242
|
+
}
|
|
243
|
+
})
|
|
288
244
|
|
|
289
|
-
return {
|
|
290
|
-
total: response.data.responses.total || 0,
|
|
245
|
+
return { total: response.data.responses.total || 0,
|
|
291
246
|
records: response.data.responses.items || []
|
|
292
|
-
|
|
293
|
-
|
|
247
|
+
}
|
|
248
|
+
}
|
|
294
249
|
|
|
295
|
-
async _openEditor() {
|
|
296
|
-
const { KpiValueEditorPage } = await import('./kpi-value-editor-page.js')
|
|
250
|
+
async _openEditor() { const { KpiValueEditorPage } = await import('./kpi-value-editor-page.js')
|
|
297
251
|
await openPopup(html`
|
|
298
252
|
<${KpiValueEditorPage}></${KpiValueEditorPage}>
|
|
299
253
|
`)
|
|
300
|
-
|
|
254
|
+
}
|
|
301
255
|
|
|
302
|
-
async _deleteKpiValue() {
|
|
303
|
-
|
|
304
|
-
await OxPrompt.open({
|
|
305
|
-
title: i18next.t('text.are_you_sure'),
|
|
256
|
+
async _deleteKpiValue() { if (
|
|
257
|
+
await OxPrompt.open({ title: i18next.t('text.are_you_sure'),
|
|
306
258
|
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
307
259
|
confirmButton: { text: i18next.t('button.confirm') },
|
|
308
260
|
cancelButton: { text: i18next.t('button.cancel') }
|
|
309
|
-
|
|
310
|
-
) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
mutation: gql`
|
|
315
|
-
mutation ($ids: [String!]!) {
|
|
316
|
-
deleteKpiValues(ids: $ids)
|
|
317
|
-
}
|
|
261
|
+
})
|
|
262
|
+
) { const ids = this.grist.selected.map(record => record.id)
|
|
263
|
+
if (ids && ids.length > 0) { const response = await client.mutate({ mutation: gql`
|
|
264
|
+
mutation ($ids: [String!]!) { deleteKpiValues(ids: $ids)
|
|
265
|
+
}
|
|
318
266
|
`,
|
|
319
|
-
variables: {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
async _updateKpiValue() {
|
|
335
|
-
let patches = this.grist.dirtyRecords
|
|
336
|
-
if (patches && patches.length) {
|
|
337
|
-
patches = patches.map(patch => {
|
|
338
|
-
let patchField: any = patch.id ? { id: patch.id } : {}
|
|
267
|
+
variables: { ids
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
|
|
271
|
+
if (!response.errors) { this.grist.fetch()
|
|
272
|
+
notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
273
|
+
})
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
async _updateKpiValue() { let patches = this.grist.dirtyRecords
|
|
280
|
+
if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}
|
|
339
281
|
const dirtyFields = patch.__dirtyfields__
|
|
340
|
-
for (let key in dirtyFields) {
|
|
341
|
-
|
|
342
|
-
}
|
|
282
|
+
for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after
|
|
283
|
+
}
|
|
343
284
|
patchField.cuFlag = patch.__dirty__
|
|
344
285
|
|
|
345
286
|
return patchField
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
const response = await client.mutate({
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
updateMultipleKpiValue(patches: $patches) {
|
|
352
|
-
id
|
|
353
|
-
kpi {
|
|
354
|
-
id
|
|
287
|
+
})
|
|
288
|
+
|
|
289
|
+
const response = await client.mutate({ mutation: gql`
|
|
290
|
+
mutation ($patches: [KpiValuePatch!]!) { updateMultipleKpiValue(patches: $patches) { id
|
|
291
|
+
kpi { id
|
|
355
292
|
name
|
|
356
|
-
|
|
293
|
+
}
|
|
357
294
|
version
|
|
358
295
|
valueDate
|
|
359
296
|
value
|
|
360
297
|
score
|
|
361
|
-
|
|
362
|
-
|
|
298
|
+
}
|
|
299
|
+
}
|
|
363
300
|
`,
|
|
364
|
-
variables: {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
})
|
|
301
|
+
variables: { patches
|
|
302
|
+
}
|
|
303
|
+
})
|
|
368
304
|
|
|
369
|
-
if (!response.errors) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
try {
|
|
377
|
-
const response = await client.mutate({
|
|
378
|
-
mutation: gql`
|
|
379
|
-
mutation ($id: String!) {
|
|
380
|
-
recalculateKpiValue(id: $id) {
|
|
381
|
-
id
|
|
305
|
+
if (!response.errors) { this.grist.fetch()
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
async _recalculateKpiValue(kpiValue) { try { const response = await client.mutate({ mutation: gql`
|
|
311
|
+
mutation ($id: String!) { recalculateKpiValue(id: $id) { id
|
|
382
312
|
value
|
|
383
313
|
score
|
|
384
314
|
valueDate
|
|
385
|
-
kpiOrgScope {
|
|
386
|
-
id
|
|
315
|
+
kpiOrgScope { id
|
|
387
316
|
entityName
|
|
388
317
|
org
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
392
321
|
`,
|
|
393
|
-
variables: {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
})
|
|
397
|
-
if (!response.errors) {
|
|
398
|
-
notify({ message: 'KPI Value가 성공적으로 재계산되었습니다.' })
|
|
322
|
+
variables: { id: kpiValue.id
|
|
323
|
+
}
|
|
324
|
+
})
|
|
325
|
+
if (!response.errors) { notify({ message: 'KPI Value가 성공적으로 재계산되었습니다.' })
|
|
399
326
|
this.grist.fetch()
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
query: gql`
|
|
410
|
-
mutation ($kpiValue: NewKpiValue!) {
|
|
411
|
-
createKpiValue(kpiValue: $kpiValue) {
|
|
412
|
-
id
|
|
413
|
-
}
|
|
414
|
-
}
|
|
327
|
+
}
|
|
328
|
+
} catch (error) { notify({ message: 'KPI Value 재계산 중 오류가 발생했습니다.' })
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
async creationCallback(kpiValue) { try { const response = await client.query({ query: gql`
|
|
333
|
+
mutation ($kpiValue: NewKpiValue!) { createKpiValue(kpiValue: $kpiValue) { id
|
|
334
|
+
}
|
|
335
|
+
}
|
|
415
336
|
`,
|
|
416
|
-
variables: {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
if (!response.errors) {
|
|
425
|
-
this.grist.fetch()
|
|
337
|
+
variables: { kpiValue
|
|
338
|
+
},
|
|
339
|
+
context: { hasUpload: true
|
|
340
|
+
}
|
|
341
|
+
})
|
|
342
|
+
|
|
343
|
+
if (!response.errors) { this.grist.fetch()
|
|
426
344
|
document.dispatchEvent(
|
|
427
|
-
new CustomEvent('notify', {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
})
|
|
345
|
+
new CustomEvent('notify', { detail: { message: i18next.t('text.data_created_successfully')
|
|
346
|
+
}
|
|
347
|
+
})
|
|
432
348
|
)
|
|
433
|
-
|
|
349
|
+
}
|
|
434
350
|
|
|
435
351
|
return true
|
|
436
|
-
|
|
437
|
-
console.error(ex)
|
|
352
|
+
} catch (ex) { console.error(ex)
|
|
438
353
|
document.dispatchEvent(
|
|
439
|
-
new CustomEvent('notify', {
|
|
440
|
-
detail: {
|
|
441
|
-
type: 'error',
|
|
354
|
+
new CustomEvent('notify', { detail: { type: 'error',
|
|
442
355
|
message: i18next.t('text.error')
|
|
443
|
-
|
|
444
|
-
|
|
356
|
+
}
|
|
357
|
+
})
|
|
445
358
|
)
|
|
446
359
|
return false
|
|
447
|
-
|
|
448
|
-
|
|
360
|
+
}
|
|
361
|
+
}
|
|
449
362
|
|
|
450
|
-
async exportHandler() {
|
|
451
|
-
const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
|
|
363
|
+
async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records
|
|
452
364
|
const targetFieldSet = new Set(['id', 'name', 'description', 'active'])
|
|
453
365
|
|
|
454
|
-
return exportTargets.map(kpiValue => {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
tempObj[field] = kpiValue[field]
|
|
458
|
-
}
|
|
366
|
+
return exportTargets.map(kpiValue => { let tempObj = {}
|
|
367
|
+
for (const field of targetFieldSet) { tempObj[field] = kpiValue[field]
|
|
368
|
+
}
|
|
459
369
|
|
|
460
370
|
return tempObj
|
|
461
|
-
|
|
462
|
-
|
|
371
|
+
})
|
|
372
|
+
}
|
|
463
373
|
|
|
464
|
-
async importHandler(records) {
|
|
465
|
-
const popup = openPopup(
|
|
374
|
+
async importHandler(records) { const popup = openPopup(
|
|
466
375
|
html`
|
|
467
376
|
<kpi-value-importer
|
|
468
377
|
.kpiValues=${records}
|
|
469
|
-
@imported=${() => {
|
|
470
|
-
history.back()
|
|
378
|
+
@imported=${() => { history.back()
|
|
471
379
|
this.grist.fetch()
|
|
472
|
-
|
|
380
|
+
}}
|
|
473
381
|
></kpi-value-importer>
|
|
474
382
|
`,
|
|
475
|
-
{
|
|
476
|
-
backdrop: true,
|
|
383
|
+
{ backdrop: true,
|
|
477
384
|
size: 'large',
|
|
478
385
|
title: i18next.t('title.import kpi-value')
|
|
479
|
-
|
|
386
|
+
}
|
|
480
387
|
)
|
|
481
388
|
|
|
482
|
-
popup.onclosed = () => {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
389
|
+
popup.onclosed = () => { this.grist.fetch()
|
|
390
|
+
}
|
|
391
|
+
}
|
|
486
392
|
}
|
|
@@ -11,12 +11,6 @@ import { KpiImporter } from './kpi-importer';
|
|
|
11
11
|
import { KpiGradeEditor } from './kpi-grade-editor';
|
|
12
12
|
import { KpiVizEditor } from './kpi-viz-editor';
|
|
13
13
|
declare const KpiListPage_base: (new (...args: any[]) => {
|
|
14
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
15
|
-
connectedCallback(): void;
|
|
16
|
-
disconnectedCallback(): void;
|
|
17
|
-
stateChanged(_state: unknown): void;
|
|
18
|
-
readonly isConnected: boolean;
|
|
19
|
-
}) & (new (...args: any[]) => {
|
|
20
14
|
__preferenceProviders: {
|
|
21
15
|
[element: string]: import("@operato/p13n").PagePreferenceProvider;
|
|
22
16
|
};
|