@things-factory/meta-ui 8.0.0-beta.8 → 8.0.0
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/bootstrap.ts +170 -0
- package/client/component/filter/filter-form-meta-code-select.ts +102 -0
- package/client/component/filter/filter-form-meta-object-select.ts +107 -0
- package/client/component/filter/filter-grist-meta-code-select.ts +97 -0
- package/client/component/filter/filter-grist-meta-object-select.ts +102 -0
- package/client/component/grist/editor/grist-editor-code-input.js +96 -0
- package/client/component/grist/editor/grist-editor-meta-code-selector.js +157 -0
- package/client/component/grist/editor/grist-editor-meta-object-selector.js +122 -0
- package/client/component/grist/renderer/grist-renderer-code-input.js +20 -0
- package/client/component/grist/renderer/grist-renderer-meta-code-selector.js +28 -0
- package/client/component/grist/renderer/grist-renderer-meta-object-selector.js +25 -0
- package/client/component/popup/code-input-editor-popup.js +111 -0
- package/client/component/popup/file-upload-popup.js +129 -0
- package/client/component/popup/meta-object-selector-popup.ts +356 -0
- package/client/component/popup/record-based-code-editor-popup.ts +141 -0
- package/client/dynamic-menus.ts +38 -0
- package/client/index.ts +18 -0
- package/client/load-components.ts +17 -0
- package/client/mixin/meta-base-mixin.js +323 -0
- package/client/mixin/meta-basic-grist-mixin.js +283 -0
- package/client/mixin/meta-button-mixin.js +116 -0
- package/client/mixin/meta-form-mixin.js +435 -0
- package/client/mixin/meta-grist-tab-mixin.js +335 -0
- package/client/mixin/meta-main-tab-mixin.js +267 -0
- package/client/mixin/meta-master-detail-mixin.js +395 -0
- package/client/mixin/meta-service-mixin.js +306 -0
- package/client/mixin/meta-tab-detail-mixin.js +283 -0
- package/client/mixin/meta-tab-mixin.js +190 -0
- package/client/pages/activity/meta-activity-define-page.js +422 -0
- package/client/pages/activity/meta-activity-list-page.js +262 -0
- package/client/pages/activity/meta-activity-viewer-element.js +35 -0
- package/client/pages/activity/meta-activity-writer-element.js +48 -0
- package/client/pages/activity/meta-activiy-mixin.js +79 -0
- package/client/pages/button-role/button-role-detail.js +50 -0
- package/client/pages/button-role/button-role-page.js +25 -0
- package/client/pages/doc-number/doc-number-page.js +24 -0
- package/client/pages/doc-number/next-doc-number-popup.js +25 -0
- package/client/pages/entity/config-entity.js +955 -0
- package/client/pages/entity/main-menu-selector.js +245 -0
- package/client/pages/history/history-copy-list-popup.js +145 -0
- package/client/pages/history/history-json-list-popup.js +159 -0
- package/client/pages/menu/dynamic-menu-template.js +92 -0
- package/client/pages/menu/dynamic-menu.ts +744 -0
- package/client/pages/menu/export-menu-popup.js +468 -0
- package/client/pages/meta-form-element.js +9 -0
- package/client/pages/meta-grist-element.js +12 -0
- package/client/pages/meta-grist-page.js +16 -0
- package/client/pages/meta-grist-tab-element.js +16 -0
- package/client/pages/meta-grist-tab-page.js +16 -0
- package/client/pages/meta-main-tab-element.js +12 -0
- package/client/pages/meta-main-tab-page.js +16 -0
- package/client/pages/meta-master-detail-element.js +12 -0
- package/client/pages/meta-master-detail-page.js +16 -0
- package/client/pages/meta-tab-detail-element.js +12 -0
- package/client/pages/meta-tab-detail-page.js +16 -0
- package/client/pages/meta-tab-element.js +15 -0
- package/client/pages/printer-device/printer-device-page.js +24 -0
- package/client/pages/template/doc-template-page.js +24 -0
- package/client/pages/template/template-file-page.js +24 -0
- package/client/pages/terms/config-terminology.js +214 -0
- package/client/pages/work-code/work-code-detail-popup.js +16 -0
- package/client/pages/work-code/work-code-page.js +23 -0
- package/client/route.ts +36 -0
- package/client/tsconfig.json +13 -0
- package/client/utils/grist-default-value.js +36 -0
- package/client/utils/meta-api.js +811 -0
- package/client/utils/meta-crypto.js +52 -0
- package/client/utils/meta-ui-util.js +3304 -0
- package/client/utils/rest-service-util.js +328 -0
- package/client/utils/service-util.js +1327 -0
- package/client/utils/terms-util.ts +119 -0
- package/client/utils/ui-util.js +338 -0
- package/client/utils/value-util.js +234 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/service-util.d.ts +2 -2
- package/dist-client/utils/service-util.js +4 -4
- package/dist-client/utils/service-util.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -24
- package/server/activity/CommonActivity.ts +68 -0
- package/server/index.ts +3 -0
- package/server/routes.ts +61 -0
- package/server/service/button-role/button-role-mutation.ts +105 -0
- package/server/service/button-role/button-role-query.ts +53 -0
- package/server/service/button-role/button-role-type.ts +39 -0
- package/server/service/button-role/button-role.ts +61 -0
- package/server/service/button-role/index.ts +7 -0
- package/server/service/dynamic-menu/dynamic-menu-query.ts +270 -0
- package/server/service/dynamic-menu/dynamic-menu-type.ts +74 -0
- package/server/service/dynamic-menu/index.ts +3 -0
- package/server/service/entity-event-subscriber/entity-event-subscriber.ts +80 -0
- package/server/service/entity-event-subscriber/index.ts +3 -0
- package/server/service/index.ts +41 -0
- package/server/service/menu-button-auth/index.ts +7 -0
- package/server/service/menu-button-auth/menu-button-auth-mutation.ts +133 -0
- package/server/service/menu-button-auth/menu-button-auth-query.ts +138 -0
- package/server/service/menu-button-auth/menu-button-auth-type.ts +63 -0
- package/server/service/menu-button-auth/menu-button-auth.ts +92 -0
- package/server/service/meta-activity/index.ts +5 -0
- package/server/service/meta-activity/meta-activity-mutation.ts +191 -0
- package/server/service/meta-activity/meta-activity-query.ts +43 -0
- package/server/service/meta-activity/meta-activity-type.ts +56 -0
- package/server/service/set-translations/index.ts +3 -0
- package/server/service/set-translations/set-translation-resolver.ts +63 -0
- package/server/service/work-code/index.ts +6 -0
- package/server/service/work-code/work-code-mutation.ts +147 -0
- package/server/service/work-code/work-code-query.ts +67 -0
- package/server/service/work-code/work-code-type.ts +60 -0
- package/server/service/work-code/work-code.ts +83 -0
- package/server/service/work-code-detail/index.ts +6 -0
- package/server/service/work-code-detail/work-code-detail-mutation.ts +149 -0
- package/server/service/work-code-detail/work-code-detail-query.ts +59 -0
- package/server/service/work-code-detail/work-code-detail-type.ts +50 -0
- package/server/service/work-code-detail/work-code-detail.ts +82 -0
- package/server/tsconfig.json +9 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
3
|
+
import { css, html, LitElement } from 'lit'
|
|
4
|
+
|
|
5
|
+
import { i18next, localize } from '@operato/i18n'
|
|
6
|
+
import { ScrollbarStyles, CommonGristStyles, CommonHeaderStyles } from '@operato/styles'
|
|
7
|
+
|
|
8
|
+
import { TermsUtil } from './../../utils/terms-util'
|
|
9
|
+
import { MetaUiUtil } from './../../utils/meta-ui-util'
|
|
10
|
+
import { MetaApi } from '../../utils/meta-api'
|
|
11
|
+
import { MetaCrypto } from '../../utils/meta-crypto'
|
|
12
|
+
|
|
13
|
+
import snakeCase from 'lodash-es/snakeCase'
|
|
14
|
+
import upperFirst from 'lodash-es/upperFirst'
|
|
15
|
+
import { singular } from 'pluralize'
|
|
16
|
+
|
|
17
|
+
const i18nextEn = i18next.getFixedT('en', null, null)
|
|
18
|
+
const i18nextKo = i18next.getFixedT('ko', null, null)
|
|
19
|
+
const colTypes = {
|
|
20
|
+
'character varying': 'VARCHAR',
|
|
21
|
+
numeric: 'NUMERIC',
|
|
22
|
+
boolean: 'BOOLEAN',
|
|
23
|
+
uuid: 'VARCHAR',
|
|
24
|
+
timestamp: 'TIMESTAMP',
|
|
25
|
+
date: 'DATE',
|
|
26
|
+
datetime: 'DATETIME',
|
|
27
|
+
integer: 'INT'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @license
|
|
32
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
33
|
+
* @author Yang
|
|
34
|
+
* @description
|
|
35
|
+
*/
|
|
36
|
+
export class ExportMenuPopup extends localize(i18next)(LitElement) {
|
|
37
|
+
/**
|
|
38
|
+
* @description 스타일 정의
|
|
39
|
+
***********************************
|
|
40
|
+
* @returns {Object} 화면의 스타일 정의
|
|
41
|
+
*/
|
|
42
|
+
static get styles() {
|
|
43
|
+
return [
|
|
44
|
+
ScrollbarStyles,
|
|
45
|
+
CommonGristStyles,
|
|
46
|
+
CommonHeaderStyles,
|
|
47
|
+
css`
|
|
48
|
+
:host {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
overflow-x: overlay;
|
|
52
|
+
background-color: var(--md-sys-color-background);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ox-grist {
|
|
56
|
+
overflow-y: auto;
|
|
57
|
+
flex: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
ox-filters-form {
|
|
61
|
+
flex: 1;
|
|
62
|
+
}
|
|
63
|
+
`
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @description 라이트 사이클
|
|
69
|
+
***************************
|
|
70
|
+
*/
|
|
71
|
+
async connectedCallback() {
|
|
72
|
+
this.gridConfig = {
|
|
73
|
+
rows: MetaApi.getGristSelectableConfig(false),
|
|
74
|
+
pagination: { infinite: true },
|
|
75
|
+
columns: [
|
|
76
|
+
MetaApi.getGristColumnConfig2('integer', 'seq', 'seq', 'center', false, false, 80),
|
|
77
|
+
MetaApi.getGristColumnConfig2('string', 'column_ko', 'column_display_ko', 'left', false, false, 150),
|
|
78
|
+
MetaApi.getGristColumnConfig2('string', 'column_en', 'column_display_en', 'left', false, false, 150),
|
|
79
|
+
MetaApi.getGristColumnConfig2('string', 'group_cd', 'screen_group_cd', 'left', false, false, 100),
|
|
80
|
+
MetaApi.getGristColumnConfig2('string', 'group_nm_en', 'screen_group_display_en', 'left', false, false, 150),
|
|
81
|
+
MetaApi.getGristColumnConfig2('string', 'group_nm_ko', 'screen_group_display_ko', 'left', false, false, 150),
|
|
82
|
+
MetaApi.getGristColumnConfig2('string', 'group_type', 'screen_group_type', 'left', false, false, 100),
|
|
83
|
+
MetaApi.getGristColumnConfig2('string', 'column_id', 'column_id', 'left', false, false, 150),
|
|
84
|
+
MetaApi.getGristColumnConfig2('string', 'search_field', 'is_search_field', 'center', false, false, 80),
|
|
85
|
+
MetaApi.getGristColumnConfig2(
|
|
86
|
+
'string',
|
|
87
|
+
'entity_ref',
|
|
88
|
+
'entity_object_reference_field',
|
|
89
|
+
'left',
|
|
90
|
+
false,
|
|
91
|
+
false,
|
|
92
|
+
100
|
|
93
|
+
),
|
|
94
|
+
MetaApi.getGristColumnConfig2(
|
|
95
|
+
'string',
|
|
96
|
+
'entity_code_ref',
|
|
97
|
+
'entity_code_reference_field',
|
|
98
|
+
'left',
|
|
99
|
+
false,
|
|
100
|
+
false,
|
|
101
|
+
100
|
|
102
|
+
),
|
|
103
|
+
MetaApi.getGristColumnConfig2('string', 'code_ref', 'code_reference_field', 'left', false, false, 100),
|
|
104
|
+
MetaApi.getGristColumnConfig2('string', 'main_column', 'is_main_list_field', 'center', false, false, 80),
|
|
105
|
+
MetaApi.getGristColumnConfig2('string', 'editable', 'is_editable', 'center', false, false, 80),
|
|
106
|
+
MetaApi.getGristColumnConfig2('string', 'hidden', 'hidden', 'center', false, false, 80),
|
|
107
|
+
MetaApi.getGristColumnConfig2('string', 'grid_align', 'grid_align', 'center', false, false, 100),
|
|
108
|
+
MetaApi.getGristColumnConfig2('string', 'export_field', 'is_export_field', 'center', false, false, 100),
|
|
109
|
+
MetaApi.getGristColumnConfig2('string', 'grid_width', 'field_width', 'center', false, false, 80),
|
|
110
|
+
MetaApi.getGristColumnConfig2('string', 'column_type', 'column_type', 'center', false, false, 100),
|
|
111
|
+
MetaApi.getGristColumnConfig2('string', 'column_length', 'column_size', 'center', false, false, 80),
|
|
112
|
+
MetaApi.getGristColumnConfig2('string', 'column_not_null', 'is_not_null', 'center', false, false, 80),
|
|
113
|
+
MetaApi.getGristColumnConfig2('string', 'default_value', 'default_value', 'left', false, false, 80),
|
|
114
|
+
MetaApi.getGristColumnConfig2('string', 'index', 'table_index', 'left', false, false, 100),
|
|
115
|
+
MetaApi.getGristColumnConfig2('string', 'unique', 'is_unique', 'center', false, false, 100)
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (super.connectedCallback) {
|
|
120
|
+
await super.connectedCallback()
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @description 라이프 사이클
|
|
126
|
+
***************************
|
|
127
|
+
*/
|
|
128
|
+
render() {
|
|
129
|
+
return html`
|
|
130
|
+
<ox-grist
|
|
131
|
+
id="ox-grist"
|
|
132
|
+
.config=${this.gridConfig}
|
|
133
|
+
.mode=${'GRID'}
|
|
134
|
+
auto-fetch
|
|
135
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
136
|
+
>
|
|
137
|
+
</ox-grist>
|
|
138
|
+
<div class="footer">
|
|
139
|
+
<div filler></div>
|
|
140
|
+
<button @click=${this.export.bind(this)} done>
|
|
141
|
+
<md-icon>export_notes</md-icon>${TermsUtil.tButton('export')}
|
|
142
|
+
</button>
|
|
143
|
+
</div>
|
|
144
|
+
`
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @description 그리드 리턴
|
|
149
|
+
**************************
|
|
150
|
+
* @returns {Object} 그리드
|
|
151
|
+
*/
|
|
152
|
+
get grist() {
|
|
153
|
+
return this.shadowRoot.querySelector('#ox-grist')
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
async export() {
|
|
157
|
+
let exportTitle = TermsUtil.tTitle(this.recordName)
|
|
158
|
+
return await MetaApi.exportableData(true, exportTitle, this.grist)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @description 이력 조회
|
|
163
|
+
***************************
|
|
164
|
+
* @returns
|
|
165
|
+
*/
|
|
166
|
+
async fetchHandler({ page = 0, limit = 0, sortings = [], filters = [] }) {
|
|
167
|
+
let selectFields = `
|
|
168
|
+
id
|
|
169
|
+
menu{
|
|
170
|
+
id
|
|
171
|
+
name
|
|
172
|
+
routing
|
|
173
|
+
template
|
|
174
|
+
}
|
|
175
|
+
entity {
|
|
176
|
+
id
|
|
177
|
+
bundle
|
|
178
|
+
name
|
|
179
|
+
tableName
|
|
180
|
+
dataProp
|
|
181
|
+
delStrategy
|
|
182
|
+
description
|
|
183
|
+
}
|
|
184
|
+
entityColumns{
|
|
185
|
+
id
|
|
186
|
+
name
|
|
187
|
+
rank
|
|
188
|
+
description
|
|
189
|
+
term
|
|
190
|
+
colType
|
|
191
|
+
colSize
|
|
192
|
+
nullable
|
|
193
|
+
uniqRank
|
|
194
|
+
searchRank
|
|
195
|
+
searchOper
|
|
196
|
+
gridRank
|
|
197
|
+
gridWidth
|
|
198
|
+
gridEditor
|
|
199
|
+
refType
|
|
200
|
+
refName
|
|
201
|
+
refUrl
|
|
202
|
+
defVal
|
|
203
|
+
},
|
|
204
|
+
indices{
|
|
205
|
+
name
|
|
206
|
+
isUnique
|
|
207
|
+
columns
|
|
208
|
+
}
|
|
209
|
+
columns{
|
|
210
|
+
name
|
|
211
|
+
isNullable
|
|
212
|
+
length
|
|
213
|
+
type
|
|
214
|
+
default
|
|
215
|
+
}
|
|
216
|
+
parentMenu{
|
|
217
|
+
id
|
|
218
|
+
name
|
|
219
|
+
}
|
|
220
|
+
`
|
|
221
|
+
|
|
222
|
+
let res = await MetaApi.findOne('exportMenuInfo', this.recordId, selectFields)
|
|
223
|
+
|
|
224
|
+
// table 컬럼 정보
|
|
225
|
+
let records = res.columns
|
|
226
|
+
.filter(column => ['id', 'data_revision_no', 'deleted_at'].includes(column.name) === false)
|
|
227
|
+
.map(column => {
|
|
228
|
+
let record = {
|
|
229
|
+
column_id: column.name,
|
|
230
|
+
column_type: column.type,
|
|
231
|
+
column_length: column.length,
|
|
232
|
+
column_not_null: column.isNullable === true ? '' : 'O',
|
|
233
|
+
default_value: column.default
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
let entityIdx = res.entityColumns.findIndex(col => col.name == column.name)
|
|
237
|
+
if (entityIdx > -1) {
|
|
238
|
+
record.rank = res.entityColumns[entityIdx].rank
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return record
|
|
242
|
+
})
|
|
243
|
+
let total = records.length
|
|
244
|
+
|
|
245
|
+
// entity Column 기반 정렬
|
|
246
|
+
records = records.sort((a, b) => a.rank - b.rank)
|
|
247
|
+
|
|
248
|
+
// index
|
|
249
|
+
for (let idx = 0; idx < res.indices.length; idx++) {
|
|
250
|
+
records[idx].unique = res.indices[idx].isUnique === true ? 'O' : ''
|
|
251
|
+
records[idx].index = res.indices[idx].columns.filter(x => x != 'deleted_at').join(',')
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
let mainMenu = JSON.parse(MetaCrypto.dec(res.menu.template))
|
|
255
|
+
|
|
256
|
+
// 메인 메뉴 컬럼 정보
|
|
257
|
+
mainMenu.grid_column.forEach(x => {
|
|
258
|
+
let mainColName = snakeCase(x.name)
|
|
259
|
+
|
|
260
|
+
if (['object', 'meta-object-selector', 'resource-object'].includes(x.type)) {
|
|
261
|
+
mainColName = mainColName + '_id'
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
let recIdx = records.findIndex(rec => rec.column_id == mainColName)
|
|
265
|
+
|
|
266
|
+
if (recIdx > -1) {
|
|
267
|
+
records[recIdx].main_column = 'O'
|
|
268
|
+
records[recIdx].editable = x.editable === true ? 'O' : ''
|
|
269
|
+
records[recIdx].hidden = x.hidden === true ? 'O' : ''
|
|
270
|
+
records[recIdx].grid_align = x.align
|
|
271
|
+
records[recIdx].export_field = x.exportable === true ? 'O' : ''
|
|
272
|
+
records[recIdx].grid_width = x.width
|
|
273
|
+
records[recIdx].entity_ref = ''
|
|
274
|
+
records[recIdx].entity_code_ref = ''
|
|
275
|
+
records[recIdx].code_ref = ''
|
|
276
|
+
|
|
277
|
+
if (x.select_opt) {
|
|
278
|
+
let opt = x.select_opt
|
|
279
|
+
|
|
280
|
+
if (opt.type == 'code') {
|
|
281
|
+
records[recIdx].code_ref = opt.name
|
|
282
|
+
} else if (opt.type == 'entity') {
|
|
283
|
+
records[recIdx].entity_code_ref = `${opt.name},${opt.args.codeField},${opt.args.dispField}`
|
|
284
|
+
}
|
|
285
|
+
} else if (x.object_opt) {
|
|
286
|
+
let opt = x.object_opt
|
|
287
|
+
|
|
288
|
+
if (opt.menu) {
|
|
289
|
+
records[recIdx].entity_ref = `menu,${opt.menu}`
|
|
290
|
+
} else {
|
|
291
|
+
records[recIdx].entity_ref = `${upperFirst(singular(opt.queryName))},${opt.nameField}`
|
|
292
|
+
|
|
293
|
+
if (opt.descriptionField && opt.descriptionField.length > 0) {
|
|
294
|
+
records[recIdx].entity_ref += `,${opt.descriptionField}`
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
})
|
|
300
|
+
|
|
301
|
+
// 메인메뉴 검색 정보
|
|
302
|
+
let searchFields = [...mainMenu.gql.query.filters, ...mainMenu.search]
|
|
303
|
+
searchFields.forEach(x => {
|
|
304
|
+
let searchName = snakeCase(x.name)
|
|
305
|
+
|
|
306
|
+
let recIdx = records.findIndex(rec => rec.column_id == searchName)
|
|
307
|
+
|
|
308
|
+
if (recIdx > -1) {
|
|
309
|
+
records[recIdx].search_field = 'O'
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
// tab etc
|
|
314
|
+
let tabs = [...mainMenu.tab]
|
|
315
|
+
if (mainMenu.etc.master_detail_element) {
|
|
316
|
+
tabs.push(JSON.parse(mainMenu.etc.master_detail_element))
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// tab 설정 검색 ....
|
|
320
|
+
for (let tabIdx = 0; tabIdx < tabs.length; tabIdx++) {
|
|
321
|
+
// name, tagname, menu(routing), display,
|
|
322
|
+
|
|
323
|
+
let tab = tabs[tabIdx]
|
|
324
|
+
let tabNmEn = await this.getTerms('en-US', ['label', 'field'], tab.display)
|
|
325
|
+
let tabNmKo = await this.getTerms('ko-KR', ['label', 'field'], tab.display)
|
|
326
|
+
|
|
327
|
+
let data = await MetaUiUtil.getMenuMetaData(tab.menu ? tab.menu : tab.routing)
|
|
328
|
+
|
|
329
|
+
if (!data || !data.records || data.records.length == 0) {
|
|
330
|
+
continue
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
let tabMenuConfig = JSON.parse(MetaCrypto.dec(data.records[0].template))
|
|
334
|
+
|
|
335
|
+
for (let idx in tabMenuConfig.grid_column) {
|
|
336
|
+
let x = tabMenuConfig.grid_column[idx]
|
|
337
|
+
|
|
338
|
+
let colName = snakeCase(x.name)
|
|
339
|
+
|
|
340
|
+
if (['object', 'meta-object-selector', 'resource-object'].includes(x.type)) {
|
|
341
|
+
colName = colName + '_id'
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
let recIdx = records.findIndex(rec => rec.column_id == colName)
|
|
345
|
+
|
|
346
|
+
if (recIdx > -1) {
|
|
347
|
+
console.log(tab.tagName)
|
|
348
|
+
records[recIdx].group_cd = tab.name
|
|
349
|
+
records[recIdx].group_nm_en = tabNmEn
|
|
350
|
+
records[recIdx].group_nm_ko = tabNmKo
|
|
351
|
+
records[recIdx].group_type = tab.tagname == 'meta-form-element' ? 'Form' : 'Grist'
|
|
352
|
+
|
|
353
|
+
records[recIdx].editable = x.editable === true ? 'O' : ''
|
|
354
|
+
records[recIdx].hidden = x.hidden === true ? 'O' : ''
|
|
355
|
+
records[recIdx].grid_align = x.align
|
|
356
|
+
records[recIdx].export_field = x.exportable === true ? 'O' : ''
|
|
357
|
+
records[recIdx].grid_width = x.width
|
|
358
|
+
records[recIdx].entity_ref = ''
|
|
359
|
+
records[recIdx].entity_code_ref = ''
|
|
360
|
+
records[recIdx].code_ref = ''
|
|
361
|
+
|
|
362
|
+
if (x.select_opt) {
|
|
363
|
+
let opt = x.select_opt
|
|
364
|
+
|
|
365
|
+
if (opt.type == 'code') {
|
|
366
|
+
records[recIdx].code_ref = opt.name
|
|
367
|
+
} else if (opt.type == 'entity') {
|
|
368
|
+
records[recIdx].entity_code_ref = `${opt.name},${opt.args.codeField},${opt.args.dispField}`
|
|
369
|
+
}
|
|
370
|
+
} else if (x.object_opt) {
|
|
371
|
+
let opt = x.object_opt
|
|
372
|
+
if (opt.menu) {
|
|
373
|
+
records[recIdx].entity_ref = `menu,${opt.menu}`
|
|
374
|
+
} else {
|
|
375
|
+
records[recIdx].entity_ref = `${upperFirst(singular(opt.queryName))},${opt.nameField}`
|
|
376
|
+
|
|
377
|
+
if (opt.descriptionField && opt.descriptionField.length > 0) {
|
|
378
|
+
records[recIdx].entity_ref += `,${opt.descriptionField}`
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// 최종 ~~
|
|
387
|
+
for (let recIdx in records) {
|
|
388
|
+
let x = records[recIdx]
|
|
389
|
+
x.seq = Number(recIdx) + 1
|
|
390
|
+
|
|
391
|
+
// 컬럼 명칭 termionologies 에 없으면 i18next 에서 찾는다 .
|
|
392
|
+
x.column_ko = await this.getTerms(
|
|
393
|
+
'ko-KR',
|
|
394
|
+
['label', 'field'],
|
|
395
|
+
x.column_id.endsWith('_id') ? x.column_id.substring(0, x.column_id.length - 3) : x.column_id
|
|
396
|
+
)
|
|
397
|
+
x.column_en = await this.getTerms(
|
|
398
|
+
'en-US',
|
|
399
|
+
['label', 'field'],
|
|
400
|
+
x.column_id.endsWith('_id') ? x.column_id.substring(0, x.column_id.length - 3) : x.column_id
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
x.column_id = x.column_id.toUpperCase()
|
|
404
|
+
x.column_type = colTypes[x.column_type]
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return {
|
|
408
|
+
records,
|
|
409
|
+
total
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
async getTerms(locale, category, name) {
|
|
414
|
+
let filters = [
|
|
415
|
+
{ name: 'name', operator: 'eq', value: name },
|
|
416
|
+
{ name: 'locale', operator: 'eq', value: locale }
|
|
417
|
+
]
|
|
418
|
+
|
|
419
|
+
if (Array.isArray(category)) {
|
|
420
|
+
filters.push({ name: 'category', operator: 'in', value: category })
|
|
421
|
+
} else {
|
|
422
|
+
filters.push({ name: 'category', operator: 'eq', value: category })
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
let res = await MetaApi.searchByPagination('terminologies', filters, [], 0, 0, 'display')
|
|
426
|
+
|
|
427
|
+
if (res.records.length > 0) {
|
|
428
|
+
return res.records[0].display
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (Array.isArray(category)) {
|
|
432
|
+
for (let catIdx in category) {
|
|
433
|
+
let disp = this.getI18t(locale, category[catIdx], name)
|
|
434
|
+
|
|
435
|
+
if (disp) {
|
|
436
|
+
return disp
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
} else {
|
|
440
|
+
let disp = this.getI18t(locale, category, name)
|
|
441
|
+
|
|
442
|
+
if (disp) {
|
|
443
|
+
return disp
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return ''
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
getI18t(locale, category, name) {
|
|
451
|
+
let tName = `${category}.${name}`
|
|
452
|
+
let disp = ''
|
|
453
|
+
|
|
454
|
+
if (locale == 'en-US') {
|
|
455
|
+
disp = i18nextEn(tName)
|
|
456
|
+
} else {
|
|
457
|
+
disp = i18nextKo(tName)
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (disp == tName) {
|
|
461
|
+
return undefined
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
return disp
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
customElements.define('export-menu-popup', ExportMenuPopup)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
|
|
3
|
+
import { i18next, localize } from '@operato/i18n'
|
|
4
|
+
import { p13n } from '@operato/p13n'
|
|
5
|
+
import { MetaFormMixin } from './../mixin/meta-form-mixin.js'
|
|
6
|
+
|
|
7
|
+
export class MetaFormElement extends MetaFormMixin(p13n(localize(i18next)(LitElement))) {}
|
|
8
|
+
|
|
9
|
+
customElements.define('meta-form-element', MetaFormElement)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
import { i18next, localize } from '@operato/i18n'
|
|
3
|
+
import { p13n } from '@operato/p13n'
|
|
4
|
+
|
|
5
|
+
import { MetaBasicGristMixin } from './../mixin/meta-basic-grist-mixin.js'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description Meta API로 엘리먼트 생성 테스트 용
|
|
9
|
+
*/
|
|
10
|
+
export class MetaGristElement extends MetaBasicGristMixin(p13n(localize(i18next)(LitElement))) {}
|
|
11
|
+
|
|
12
|
+
customElements.define('meta-grist-element', MetaGristElement)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { i18next, localize } from '@operato/i18n'
|
|
2
|
+
import { p13n } from '@operato/p13n'
|
|
3
|
+
import { PageView } from '@operato/shell'
|
|
4
|
+
|
|
5
|
+
import { MetaBasicGristMixin } from './../mixin/meta-basic-grist-mixin.js'
|
|
6
|
+
|
|
7
|
+
import './meta-grist-element'
|
|
8
|
+
import './meta-form-element'
|
|
9
|
+
import './meta-tab-element'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description Meta API로 페이지 생성 테스트 용
|
|
13
|
+
*/
|
|
14
|
+
export class MetaGristPage extends MetaBasicGristMixin(p13n(localize(i18next)(PageView))) {}
|
|
15
|
+
|
|
16
|
+
customElements.define('meta-grist-page', MetaGristPage)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
import { i18next, localize } from '@operato/i18n'
|
|
3
|
+
import { p13n } from '@operato/p13n'
|
|
4
|
+
|
|
5
|
+
import { MetaGristTabMixin } from './../mixin/meta-grist-tab-mixin'
|
|
6
|
+
|
|
7
|
+
import './meta-grist-element'
|
|
8
|
+
import './meta-form-element'
|
|
9
|
+
import './meta-tab-element'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description Meta API로 엘리먼트 생성 테스트 용
|
|
13
|
+
*/
|
|
14
|
+
export class MetaGristTabElement extends MetaGristTabMixin(p13n(localize(i18next)(LitElement))) {}
|
|
15
|
+
|
|
16
|
+
customElements.define('meta-grist-tab-element', MetaGristTabElement)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { i18next, localize } from '@operato/i18n'
|
|
2
|
+
import { p13n } from '@operato/p13n'
|
|
3
|
+
import { PageView } from '@operato/shell'
|
|
4
|
+
|
|
5
|
+
import { MetaGristTabMixin } from './../mixin/meta-grist-tab-mixin'
|
|
6
|
+
|
|
7
|
+
import './meta-grist-element'
|
|
8
|
+
import './meta-form-element'
|
|
9
|
+
import './meta-tab-element'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description Meta API로 페이지 생성 테스트 용
|
|
13
|
+
*/
|
|
14
|
+
export class MetaGristTabPage extends MetaGristTabMixin(p13n(localize(i18next)(PageView))) {}
|
|
15
|
+
|
|
16
|
+
customElements.define('meta-grist-tab-page', MetaGristTabPage)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
import { i18next, localize } from '@operato/i18n'
|
|
3
|
+
import { p13n } from '@operato/p13n'
|
|
4
|
+
|
|
5
|
+
import { MetaMainTabMixin } from './../mixin/meta-main-tab-mixin'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description Meta API로 엘리먼트 생성 테스트 용
|
|
9
|
+
*/
|
|
10
|
+
export class MetaMainTabElement extends MetaMainTabMixin(p13n(localize(i18next)(LitElement))) {}
|
|
11
|
+
|
|
12
|
+
customElements.define('meta-main-tab-element', MetaMainTabElement)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { i18next, localize } from '@operato/i18n'
|
|
2
|
+
import { p13n } from '@operato/p13n'
|
|
3
|
+
import { PageView } from '@operato/shell'
|
|
4
|
+
|
|
5
|
+
import { MetaMainTabMixin } from './../mixin/meta-main-tab-mixin'
|
|
6
|
+
|
|
7
|
+
import './meta-grist-element'
|
|
8
|
+
import './meta-form-element'
|
|
9
|
+
import './meta-tab-element'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description Meta API로 페이지 생성 테스트 용
|
|
13
|
+
*/
|
|
14
|
+
export class MetaMainTabPage extends MetaMainTabMixin(p13n(localize(i18next)(PageView))) {}
|
|
15
|
+
|
|
16
|
+
customElements.define('meta-main-tab-page', MetaMainTabPage)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
import { i18next, localize } from '@operato/i18n'
|
|
3
|
+
import { p13n } from '@operato/p13n'
|
|
4
|
+
|
|
5
|
+
import { MetaMasterDetailMixin } from './../mixin/meta-master-detail-mixin'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description Meta API로 엘리먼트 생성 테스트 용
|
|
9
|
+
*/
|
|
10
|
+
export class MetaMasterDetailElement extends MetaMasterDetailMixin(p13n(localize(i18next)(LitElement))) {}
|
|
11
|
+
|
|
12
|
+
customElements.define('meta-master-detail-element', MetaMasterDetailElement)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { i18next, localize } from '@operato/i18n'
|
|
2
|
+
import { p13n } from '@operato/p13n'
|
|
3
|
+
import { PageView } from '@operato/shell'
|
|
4
|
+
|
|
5
|
+
import { MetaMasterDetailMixin } from './../mixin/meta-master-detail-mixin'
|
|
6
|
+
|
|
7
|
+
import './meta-grist-element'
|
|
8
|
+
import './meta-form-element'
|
|
9
|
+
import './meta-tab-element'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description Meta API로 페이지 생성 테스트 용
|
|
13
|
+
*/
|
|
14
|
+
export class MetaMasterDetailPage extends MetaMasterDetailMixin(p13n(localize(i18next)(PageView))) {}
|
|
15
|
+
|
|
16
|
+
customElements.define('meta-master-detail-page', MetaMasterDetailPage)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit'
|
|
2
|
+
import { i18next, localize } from '@operato/i18n'
|
|
3
|
+
import { p13n } from '@operato/p13n'
|
|
4
|
+
|
|
5
|
+
import { MetaTabDetailMixin } from './../mixin/meta-tab-detail-mixin'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description Meta API로 엘리먼트 생성 테스트 용
|
|
9
|
+
*/
|
|
10
|
+
export class MetaTabDetailElement extends MetaTabDetailMixin(p13n(localize(i18next)(LitElement))) {}
|
|
11
|
+
|
|
12
|
+
customElements.define('meta-tab-detail-element', MetaTabDetailElement)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { i18next, localize } from '@operato/i18n'
|
|
2
|
+
import { p13n } from '@operato/p13n'
|
|
3
|
+
import { PageView } from '@operato/shell'
|
|
4
|
+
|
|
5
|
+
import { MetaTabDetailMixin } from './../mixin/meta-tab-detail-mixin'
|
|
6
|
+
|
|
7
|
+
import './meta-grist-element'
|
|
8
|
+
import './meta-form-element'
|
|
9
|
+
import './meta-tab-element'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description Meta API로 페이지 생성 테스트 용
|
|
13
|
+
*/
|
|
14
|
+
export class MetaTabDetailPage extends MetaTabDetailMixin(p13n(localize(i18next)(PageView))) {}
|
|
15
|
+
|
|
16
|
+
customElements.define('meta-tab-detail-page', MetaTabDetailPage)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { i18next, localize } from '@operato/i18n'
|
|
2
|
+
import { p13n } from '@operato/p13n'
|
|
3
|
+
import { LitElement } from 'lit'
|
|
4
|
+
|
|
5
|
+
import { MetaTabMixin } from './../mixin/meta-tab-mixin'
|
|
6
|
+
|
|
7
|
+
import './meta-grist-element'
|
|
8
|
+
import './meta-form-element'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @description Meta API로 페이지 생성 테스트 용
|
|
12
|
+
*/
|
|
13
|
+
export class MetaTabElement extends MetaTabMixin(p13n(localize(i18next)(LitElement))) {}
|
|
14
|
+
|
|
15
|
+
customElements.define('meta-tab-element', MetaTabElement)
|