@things-factory/meta-ui 7.0.1-alpha.1 → 7.0.1-alpha.11
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/actions/main.js +14 -20
- package/client/bootstrap.ts +13 -6
- package/client/component/grist/renderer/grist-renderer-meta-object-selector.js +18 -13
- package/client/pages/entity/config-entity.js +180 -112
- package/client/pages/entity/main-menu-selector.js +85 -84
- package/client/pages/history/history-copy-list-popup.js +33 -45
- package/client/pages/history/history-json-list-popup.js +38 -50
- package/client/pages/menu/dynamic-menu-template.js +1 -1
- package/client/pages/menu/dynamic-menu.js +137 -121
- package/client/pages/menu/export-menu-popup.js +210 -218
- package/client/pages/personalize/personal-column-selector.js +112 -122
- package/client/utils/meta-ui-util.js +0 -4
- package/client/utils/service-util.js +4 -4
- package/client/utils/terms-util.js +41 -42
- package/client/utils/ui-util.js +2 -5
- package/client/viewparts/dynamic-menu-part.js +7 -28
- package/dist-client/actions/main.js +6 -5
- package/dist-client/actions/main.js.map +1 -1
- package/dist-client/bootstrap.d.ts +4 -1
- package/dist-client/bootstrap.js +12 -6
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-code-input.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-code-selector.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js +9 -3
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js.map +1 -1
- package/dist-client/component/popup/code-input-editor-popup.d.ts +1 -1
- package/dist-client/component/popup/meta-object-selector-popup.d.ts +1 -1
- package/dist-client/component/popup/record-based-code-editor-popup.d.ts +1 -1
- package/dist-client/mixin/meta-basic-grist-mixin.d.ts +1 -1
- package/dist-client/pages/activity/meta-activity-viewer-element.d.ts +1 -1
- package/dist-client/pages/activity/meta-activity-writer-element.d.ts +1 -1
- package/dist-client/pages/button-role/button-role-detail.d.ts +1 -1
- package/dist-client/pages/entity/config-entity.js +131 -62
- package/dist-client/pages/entity/config-entity.js.map +1 -1
- package/dist-client/pages/entity/main-menu-selector.d.ts +1 -1
- package/dist-client/pages/entity/main-menu-selector.js +74 -73
- package/dist-client/pages/entity/main-menu-selector.js.map +1 -1
- package/dist-client/pages/history/history-copy-list-popup.d.ts +1 -1
- package/dist-client/pages/history/history-copy-list-popup.js +14 -26
- package/dist-client/pages/history/history-copy-list-popup.js.map +1 -1
- package/dist-client/pages/history/history-json-list-popup.d.ts +5 -5
- package/dist-client/pages/history/history-json-list-popup.js +19 -31
- package/dist-client/pages/history/history-json-list-popup.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu-setting-let.d.ts +1 -1
- package/dist-client/pages/menu/dynamic-menu-template.js +1 -1
- package/dist-client/pages/menu/dynamic-menu-template.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu.js +68 -48
- package/dist-client/pages/menu/dynamic-menu.js.map +1 -1
- package/dist-client/pages/menu/export-menu-popup.d.ts +5 -5
- package/dist-client/pages/menu/export-menu-popup.js +50 -54
- package/dist-client/pages/menu/export-menu-popup.js.map +1 -1
- package/dist-client/pages/meta-grist-element.d.ts +1 -1
- package/dist-client/pages/meta-grist-page.d.ts +1 -1
- package/dist-client/pages/personalize/personal-column-selector.d.ts +1 -1
- package/dist-client/pages/personalize/personal-column-selector.js +76 -84
- package/dist-client/pages/personalize/personal-column-selector.js.map +1 -1
- package/dist-client/pages/work-code/work-code-detail-popup.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/meta-ui-util.js +0 -3
- package/dist-client/utils/meta-ui-util.js.map +1 -1
- package/dist-client/utils/service-util.js +4 -4
- package/dist-client/utils/service-util.js.map +1 -1
- package/dist-client/utils/terms-util.d.ts +13 -13
- package/dist-client/utils/terms-util.js +10 -12
- package/dist-client/utils/terms-util.js.map +1 -1
- package/dist-client/utils/ui-util.js +1 -4
- package/dist-client/utils/ui-util.js.map +1 -1
- package/dist-client/viewparts/dynamic-menu-part.d.ts +1 -1
- package/dist-client/viewparts/dynamic-menu-part.js +7 -26
- package/dist-client/viewparts/dynamic-menu-part.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/client/viewparts/dynamic-menu-landscape-styles.js +0 -149
- package/client/viewparts/dynamic-menu-landscape.js +0 -106
- package/client/viewparts/dynamic-menu-portrait-styles.js +0 -130
- package/client/viewparts/dynamic-menu-portrait.js +0 -90
- package/client/viewparts/dynamic-top-menu-bar.js +0 -148
- package/dist-client/viewparts/dynamic-menu-landscape-styles.d.ts +0 -1
- package/dist-client/viewparts/dynamic-menu-landscape-styles.js +0 -149
- package/dist-client/viewparts/dynamic-menu-landscape-styles.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-landscape.d.ts +0 -21
- package/dist-client/viewparts/dynamic-menu-landscape.js +0 -87
- package/dist-client/viewparts/dynamic-menu-landscape.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait-styles.d.ts +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait-styles.js +0 -130
- package/dist-client/viewparts/dynamic-menu-portrait-styles.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait.d.ts +0 -13
- package/dist-client/viewparts/dynamic-menu-portrait.js +0 -74
- package/dist-client/viewparts/dynamic-menu-portrait.js.map +0 -1
- package/dist-client/viewparts/dynamic-top-menu-bar.d.ts +0 -27
- package/dist-client/viewparts/dynamic-top-menu-bar.js +0 -133
- package/dist-client/viewparts/dynamic-top-menu-bar.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, html, LitElement } from 'lit
|
|
1
|
+
import { css, html, LitElement } from 'lit'
|
|
2
2
|
|
|
3
3
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
4
4
|
import { ScrollbarStyles, CommonGristStyles } from '@operato/styles'
|
|
@@ -10,60 +10,59 @@ import { MetaCrypto } from '../../utils/meta-crypto'
|
|
|
10
10
|
|
|
11
11
|
import snakeCase from 'lodash-es/snakeCase'
|
|
12
12
|
import upperFirst from 'lodash-es/upperFirst'
|
|
13
|
-
import {singular} from 'pluralize'
|
|
13
|
+
import { singular } from 'pluralize'
|
|
14
14
|
|
|
15
|
-
const i18nextEn = i18next.getFixedT('en', null, null)
|
|
16
|
-
const i18nextKo = i18next.getFixedT('ko', null, null)
|
|
15
|
+
const i18nextEn = i18next.getFixedT('en', null, null)
|
|
16
|
+
const i18nextKo = i18next.getFixedT('ko', null, null)
|
|
17
17
|
const colTypes = {
|
|
18
|
-
'character varying'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
'character varying': 'VARCHAR',
|
|
19
|
+
numeric: 'NUMERIC',
|
|
20
|
+
boolean: 'BOOLEAN',
|
|
21
|
+
uuid: 'VARCHAR',
|
|
22
|
+
timestamp: 'TIMESTAMP',
|
|
23
|
+
date: 'DATE',
|
|
24
|
+
datetime: 'DATETIME',
|
|
25
|
+
integer: 'INT'
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright © HatioLab Inc. All rights reserved.
|
|
31
31
|
* @author Yang
|
|
32
|
-
* @description
|
|
32
|
+
* @description
|
|
33
33
|
*/
|
|
34
34
|
export class ExportMenuPopup extends localize(i18next)(LitElement) {
|
|
35
|
-
|
|
36
|
-
/**
|
|
35
|
+
/**
|
|
37
36
|
* @description 스타일 정의
|
|
38
37
|
***********************************
|
|
39
38
|
* @returns {Object} 화면의 스타일 정의
|
|
40
39
|
*/
|
|
41
|
-
|
|
40
|
+
static get styles() {
|
|
42
41
|
return [
|
|
43
42
|
ScrollbarStyles,
|
|
44
43
|
CommonGristStyles,
|
|
45
44
|
css`
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
:host {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
overflow-x: overlay;
|
|
49
|
+
background-color: var(--main-section-background-color);
|
|
50
|
+
}
|
|
51
|
+
ox-grist {
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
flex: 1;
|
|
54
|
+
}
|
|
55
|
+
.button-container {
|
|
56
|
+
padding: var(--button-container-padding);
|
|
57
|
+
margin: var(--button-container-margin);
|
|
58
|
+
text-align: var(--button-container-align);
|
|
59
|
+
background-color: var(--button-container-background);
|
|
60
|
+
height: var(--button-container-height);
|
|
61
|
+
text-align: right;
|
|
62
|
+
padding-right: 12px;
|
|
63
|
+
}
|
|
65
64
|
`
|
|
66
|
-
]
|
|
65
|
+
]
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
/**
|
|
@@ -73,33 +72,33 @@ export class ExportMenuPopup extends localize(i18next)(LitElement) {
|
|
|
73
72
|
async connectedCallback() {
|
|
74
73
|
this.gridConfig = {
|
|
75
74
|
rows: MetaApi.getGristSelectableConfig(false),
|
|
76
|
-
pagination: {infinite:true},
|
|
75
|
+
pagination: { infinite: true },
|
|
77
76
|
columns: [
|
|
78
|
-
MetaApi.getGristColumnConfig2('integer', 'seq','seq', 'center', false, false, 80),
|
|
79
|
-
MetaApi.getGristColumnConfig2('string', 'column_ko','column_display_ko', 'left', false, false, 150),
|
|
80
|
-
MetaApi.getGristColumnConfig2('string', 'column_en','column_display_en', 'left', false, false, 150),
|
|
81
|
-
MetaApi.getGristColumnConfig2('string', 'group_cd','screen_group_cd', 'left', false, false, 100),
|
|
82
|
-
MetaApi.getGristColumnConfig2('string', 'group_nm_en','screen_group_display_en', 'left', false, false, 150),
|
|
83
|
-
MetaApi.getGristColumnConfig2('string', 'group_nm_ko','screen_group_display_ko', 'left', false, false, 150),
|
|
84
|
-
MetaApi.getGristColumnConfig2('string', 'group_type','screen_group_type', 'left', false, false, 100),
|
|
85
|
-
MetaApi.getGristColumnConfig2('string', 'column_id','column_id', 'left', false, false, 150),
|
|
86
|
-
MetaApi.getGristColumnConfig2('string', 'search_field','is_search_field', 'center', false, false, 80),
|
|
87
|
-
MetaApi.getGristColumnConfig2('string', 'entity_ref','entity_object_reference_field', 'left', false, false, 100),
|
|
88
|
-
MetaApi.getGristColumnConfig2('string', 'entity_code_ref','entity_code_reference_field', 'left', false, false, 100),
|
|
89
|
-
MetaApi.getGristColumnConfig2('string', 'code_ref','code_reference_field', 'left', false, false, 100),
|
|
90
|
-
MetaApi.getGristColumnConfig2('string', 'main_column','is_main_list_field', 'center', false, false, 80),
|
|
91
|
-
MetaApi.getGristColumnConfig2('string', 'editable','is_editable', 'center', false, false, 80),
|
|
92
|
-
MetaApi.getGristColumnConfig2('string', 'hidden','hidden', 'center', false, false, 80),
|
|
93
|
-
MetaApi.getGristColumnConfig2('string', 'grid_align','grid_align', 'center', false, false, 100),
|
|
94
|
-
MetaApi.getGristColumnConfig2('string', 'export_field','is_export_field', 'center', false, false, 100),
|
|
95
|
-
MetaApi.getGristColumnConfig2('string', 'grid_width','field_width', 'center', false, false, 80),
|
|
96
|
-
MetaApi.getGristColumnConfig2('string', 'column_type','column_type', 'center', false, false, 100),
|
|
97
|
-
MetaApi.getGristColumnConfig2('string', 'column_length','column_size', 'center', false, false, 80),
|
|
98
|
-
MetaApi.getGristColumnConfig2('string', 'column_not_null','is_not_null', 'center', false, false, 80),
|
|
99
|
-
MetaApi.getGristColumnConfig2('string', 'default_value','default_value', 'left', false, false, 80),
|
|
100
|
-
MetaApi.getGristColumnConfig2('string', 'index','table_index', 'left', false, false, 100),
|
|
101
|
-
MetaApi.getGristColumnConfig2('string', 'unique','is_unique', 'center', false, false, 100)
|
|
102
|
-
]
|
|
77
|
+
MetaApi.getGristColumnConfig2('integer', 'seq', 'seq', 'center', false, false, 80),
|
|
78
|
+
MetaApi.getGristColumnConfig2('string', 'column_ko', 'column_display_ko', 'left', false, false, 150),
|
|
79
|
+
MetaApi.getGristColumnConfig2('string', 'column_en', 'column_display_en', 'left', false, false, 150),
|
|
80
|
+
MetaApi.getGristColumnConfig2('string', 'group_cd', 'screen_group_cd', 'left', false, false, 100),
|
|
81
|
+
MetaApi.getGristColumnConfig2('string', 'group_nm_en', 'screen_group_display_en', 'left', false, false, 150),
|
|
82
|
+
MetaApi.getGristColumnConfig2('string', 'group_nm_ko', 'screen_group_display_ko', 'left', false, false, 150),
|
|
83
|
+
MetaApi.getGristColumnConfig2('string', 'group_type', 'screen_group_type', 'left', false, false, 100),
|
|
84
|
+
MetaApi.getGristColumnConfig2('string', 'column_id', 'column_id', 'left', false, false, 150),
|
|
85
|
+
MetaApi.getGristColumnConfig2('string', 'search_field', 'is_search_field', 'center', false, false, 80),
|
|
86
|
+
MetaApi.getGristColumnConfig2('string', 'entity_ref', 'entity_object_reference_field', 'left', false, false, 100),
|
|
87
|
+
MetaApi.getGristColumnConfig2('string', 'entity_code_ref', 'entity_code_reference_field', 'left', false, false, 100),
|
|
88
|
+
MetaApi.getGristColumnConfig2('string', 'code_ref', 'code_reference_field', 'left', false, false, 100),
|
|
89
|
+
MetaApi.getGristColumnConfig2('string', 'main_column', 'is_main_list_field', 'center', false, false, 80),
|
|
90
|
+
MetaApi.getGristColumnConfig2('string', 'editable', 'is_editable', 'center', false, false, 80),
|
|
91
|
+
MetaApi.getGristColumnConfig2('string', 'hidden', 'hidden', 'center', false, false, 80),
|
|
92
|
+
MetaApi.getGristColumnConfig2('string', 'grid_align', 'grid_align', 'center', false, false, 100),
|
|
93
|
+
MetaApi.getGristColumnConfig2('string', 'export_field', 'is_export_field', 'center', false, false, 100),
|
|
94
|
+
MetaApi.getGristColumnConfig2('string', 'grid_width', 'field_width', 'center', false, false, 80),
|
|
95
|
+
MetaApi.getGristColumnConfig2('string', 'column_type', 'column_type', 'center', false, false, 100),
|
|
96
|
+
MetaApi.getGristColumnConfig2('string', 'column_length', 'column_size', 'center', false, false, 80),
|
|
97
|
+
MetaApi.getGristColumnConfig2('string', 'column_not_null', 'is_not_null', 'center', false, false, 80),
|
|
98
|
+
MetaApi.getGristColumnConfig2('string', 'default_value', 'default_value', 'left', false, false, 80),
|
|
99
|
+
MetaApi.getGristColumnConfig2('string', 'index', 'table_index', 'left', false, false, 100),
|
|
100
|
+
MetaApi.getGristColumnConfig2('string', 'unique', 'is_unique', 'center', false, false, 100)
|
|
101
|
+
]
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
if (super.connectedCallback) {
|
|
@@ -113,17 +112,11 @@ export class ExportMenuPopup extends localize(i18next)(LitElement) {
|
|
|
113
112
|
*/
|
|
114
113
|
render() {
|
|
115
114
|
return html`
|
|
116
|
-
<ox-grist
|
|
117
|
-
id="ox-grist"
|
|
118
|
-
.config=${this.gridConfig}
|
|
119
|
-
.mode=${'GRID'}
|
|
120
|
-
auto-fetch
|
|
121
|
-
.fetchHandler=${this.fetchHandler.bind(this)}>
|
|
122
|
-
</ox-grist>
|
|
115
|
+
<ox-grist id="ox-grist" .config=${this.gridConfig} .mode=${'GRID'} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>
|
|
123
116
|
<div id="button-container" class="button-container">
|
|
124
117
|
<mwc-button raised label="${TermsUtil.tButton('export')}" @click=${this.export.bind(this)}></mwc-button>
|
|
125
118
|
</div>
|
|
126
|
-
|
|
119
|
+
`
|
|
127
120
|
}
|
|
128
121
|
|
|
129
122
|
/**
|
|
@@ -135,18 +128,17 @@ export class ExportMenuPopup extends localize(i18next)(LitElement) {
|
|
|
135
128
|
return this.shadowRoot.querySelector('#ox-grist')
|
|
136
129
|
}
|
|
137
130
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return await MetaApi.exportableData(true, exportTitle, this.grist);
|
|
131
|
+
async export() {
|
|
132
|
+
let exportTitle = TermsUtil.tTitle(this.recordName)
|
|
133
|
+
return await MetaApi.exportableData(true, exportTitle, this.grist)
|
|
142
134
|
}
|
|
143
135
|
|
|
144
136
|
/**
|
|
145
137
|
* @description 이력 조회
|
|
146
138
|
***************************
|
|
147
|
-
* @returns
|
|
139
|
+
* @returns
|
|
148
140
|
*/
|
|
149
|
-
async fetchHandler({ page = 0, limit = 0, sortings = [], filters = [] }){
|
|
141
|
+
async fetchHandler({ page = 0, limit = 0, sortings = [], filters = [] }) {
|
|
150
142
|
let selectFields = `
|
|
151
143
|
id
|
|
152
144
|
menu{
|
|
@@ -202,77 +194,78 @@ export class ExportMenuPopup extends localize(i18next)(LitElement) {
|
|
|
202
194
|
}
|
|
203
195
|
`
|
|
204
196
|
|
|
205
|
-
let res = await MetaApi.findOne('exportMenuInfo',this.recordId, selectFields)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
197
|
+
let res = await MetaApi.findOne('exportMenuInfo', this.recordId, selectFields)
|
|
198
|
+
|
|
199
|
+
// table 컬럼 정보
|
|
200
|
+
let records = res.columns
|
|
201
|
+
.filter(column => ['id', 'data_revision_no', 'deleted_at'].includes(column.name) === false)
|
|
202
|
+
.map(column => {
|
|
203
|
+
let record = {
|
|
204
|
+
column_id: column.name,
|
|
205
|
+
column_type: column.type,
|
|
206
|
+
column_length: column.length,
|
|
207
|
+
column_not_null: column.isNullable === true ? '' : 'O',
|
|
208
|
+
default_value: column.default
|
|
209
|
+
}
|
|
217
210
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
211
|
+
let entityIdx = res.entityColumns.findIndex(col => col.name == column.name)
|
|
212
|
+
if (entityIdx > -1) {
|
|
213
|
+
record.rank = res.entityColumns[entityIdx].rank
|
|
214
|
+
}
|
|
222
215
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
let total = records.length
|
|
216
|
+
return record
|
|
217
|
+
})
|
|
218
|
+
let total = records.length
|
|
226
219
|
|
|
227
|
-
// entity Column 기반 정렬
|
|
228
|
-
records = records.sort((a, b) => a.rank - b.rank)
|
|
220
|
+
// entity Column 기반 정렬
|
|
221
|
+
records = records.sort((a, b) => a.rank - b.rank)
|
|
229
222
|
|
|
230
|
-
// index
|
|
231
|
-
for(let idx = 0
|
|
232
|
-
records[idx].unique = res.indices[idx].isUnique === true ? 'O' : ''
|
|
233
|
-
records[idx].index = res.indices[idx].columns.filter(x=> x!= 'deleted_at').join(
|
|
223
|
+
// index
|
|
224
|
+
for (let idx = 0; idx < res.indices.length; idx++) {
|
|
225
|
+
records[idx].unique = res.indices[idx].isUnique === true ? 'O' : ''
|
|
226
|
+
records[idx].index = res.indices[idx].columns.filter(x => x != 'deleted_at').join(',')
|
|
234
227
|
}
|
|
235
228
|
|
|
236
|
-
let mainMenu = JSON.parse(MetaCrypto.dec(res.menu.template))
|
|
229
|
+
let mainMenu = JSON.parse(MetaCrypto.dec(res.menu.template))
|
|
237
230
|
|
|
238
|
-
// 메인 메뉴 컬럼 정보
|
|
239
|
-
mainMenu.grid_column.forEach(x=>{
|
|
240
|
-
let mainColName = snakeCase(x.name)
|
|
231
|
+
// 메인 메뉴 컬럼 정보
|
|
232
|
+
mainMenu.grid_column.forEach(x => {
|
|
233
|
+
let mainColName = snakeCase(x.name)
|
|
241
234
|
|
|
242
|
-
if(['object','meta-object-selector','resource-object'].includes(x.type)){
|
|
243
|
-
mainColName = mainColName + '_id'
|
|
235
|
+
if (['object', 'meta-object-selector', 'resource-object'].includes(x.type)) {
|
|
236
|
+
mainColName = mainColName + '_id'
|
|
244
237
|
}
|
|
245
238
|
|
|
246
|
-
let recIdx = records.findIndex(rec => rec.column_id == mainColName)
|
|
247
|
-
|
|
248
|
-
if(recIdx > -1){
|
|
249
|
-
records[recIdx].main_column = 'O'
|
|
250
|
-
records[recIdx].editable = x.editable === true ? 'O' : ''
|
|
251
|
-
records[recIdx].hidden = x.hidden === true ? 'O' : ''
|
|
252
|
-
records[recIdx].grid_align = x.align
|
|
253
|
-
records[recIdx].export_field = x.exportable === true ? 'O' : ''
|
|
254
|
-
records[recIdx].grid_width = x.width
|
|
255
|
-
records[recIdx].entity_ref = ''
|
|
256
|
-
records[recIdx].entity_code_ref = ''
|
|
239
|
+
let recIdx = records.findIndex(rec => rec.column_id == mainColName)
|
|
240
|
+
|
|
241
|
+
if (recIdx > -1) {
|
|
242
|
+
records[recIdx].main_column = 'O'
|
|
243
|
+
records[recIdx].editable = x.editable === true ? 'O' : ''
|
|
244
|
+
records[recIdx].hidden = x.hidden === true ? 'O' : ''
|
|
245
|
+
records[recIdx].grid_align = x.align
|
|
246
|
+
records[recIdx].export_field = x.exportable === true ? 'O' : ''
|
|
247
|
+
records[recIdx].grid_width = x.width
|
|
248
|
+
records[recIdx].entity_ref = ''
|
|
249
|
+
records[recIdx].entity_code_ref = ''
|
|
257
250
|
records[recIdx].code_ref = ''
|
|
258
251
|
|
|
259
|
-
if(x.select_opt){
|
|
260
|
-
let opt = x.select_opt
|
|
252
|
+
if (x.select_opt) {
|
|
253
|
+
let opt = x.select_opt
|
|
261
254
|
|
|
262
|
-
if(opt.type == 'code'){
|
|
263
|
-
records[recIdx].code_ref = opt.name
|
|
264
|
-
} else if (opt.type == 'entity'){
|
|
265
|
-
records[recIdx].entity_code_ref = `${opt.name},${opt.args.codeField},${opt.args.dispField}
|
|
255
|
+
if (opt.type == 'code') {
|
|
256
|
+
records[recIdx].code_ref = opt.name
|
|
257
|
+
} else if (opt.type == 'entity') {
|
|
258
|
+
records[recIdx].entity_code_ref = `${opt.name},${opt.args.codeField},${opt.args.dispField}`
|
|
266
259
|
}
|
|
267
|
-
} else if (x.object_opt){
|
|
268
|
-
let opt = x.object_opt
|
|
260
|
+
} else if (x.object_opt) {
|
|
261
|
+
let opt = x.object_opt
|
|
269
262
|
|
|
270
|
-
if(opt.menu){
|
|
271
|
-
records[recIdx].entity_ref = `menu,${opt.menu}
|
|
263
|
+
if (opt.menu) {
|
|
264
|
+
records[recIdx].entity_ref = `menu,${opt.menu}`
|
|
272
265
|
} else {
|
|
273
|
-
records[recIdx].entity_ref = `${upperFirst(singular(opt.queryName))},${opt.nameField}
|
|
266
|
+
records[recIdx].entity_ref = `${upperFirst(singular(opt.queryName))},${opt.nameField}`
|
|
274
267
|
|
|
275
|
-
if(opt.descriptionField && opt.descriptionField.length > 0){
|
|
268
|
+
if (opt.descriptionField && opt.descriptionField.length > 0) {
|
|
276
269
|
records[recIdx].entity_ref += `,${opt.descriptionField}`
|
|
277
270
|
}
|
|
278
271
|
}
|
|
@@ -280,103 +273,102 @@ export class ExportMenuPopup extends localize(i18next)(LitElement) {
|
|
|
280
273
|
}
|
|
281
274
|
})
|
|
282
275
|
|
|
283
|
-
// 메인메뉴 검색 정보
|
|
276
|
+
// 메인메뉴 검색 정보
|
|
284
277
|
let searchFields = [...mainMenu.gql.query.filters, ...mainMenu.search]
|
|
285
|
-
searchFields.forEach(x=>{
|
|
286
|
-
let searchName = snakeCase(x.name)
|
|
278
|
+
searchFields.forEach(x => {
|
|
279
|
+
let searchName = snakeCase(x.name)
|
|
287
280
|
|
|
288
|
-
let recIdx = records.findIndex(rec => rec.column_id == searchName)
|
|
281
|
+
let recIdx = records.findIndex(rec => rec.column_id == searchName)
|
|
289
282
|
|
|
290
|
-
if(recIdx > -1){
|
|
291
|
-
records[recIdx].search_field = 'O'
|
|
283
|
+
if (recIdx > -1) {
|
|
284
|
+
records[recIdx].search_field = 'O'
|
|
292
285
|
}
|
|
293
286
|
})
|
|
294
287
|
|
|
295
288
|
// tab etc
|
|
296
|
-
let tabs = [...mainMenu.tab]
|
|
297
|
-
if(mainMenu.etc.master_detail_element){
|
|
289
|
+
let tabs = [...mainMenu.tab]
|
|
290
|
+
if (mainMenu.etc.master_detail_element) {
|
|
298
291
|
tabs.push(JSON.parse(mainMenu.etc.master_detail_element))
|
|
299
292
|
}
|
|
300
293
|
|
|
301
|
-
// tab 설정 검색 ....
|
|
302
|
-
for(let tabIdx = 0
|
|
303
|
-
// name, tagname, menu(routing), display,
|
|
294
|
+
// tab 설정 검색 ....
|
|
295
|
+
for (let tabIdx = 0; tabIdx < tabs.length; tabIdx++) {
|
|
296
|
+
// name, tagname, menu(routing), display,
|
|
304
297
|
|
|
305
|
-
let tab = tabs[tabIdx]
|
|
306
|
-
let tabNmEn = await this.getTerms(
|
|
307
|
-
let tabNmKo = await this.getTerms(
|
|
298
|
+
let tab = tabs[tabIdx]
|
|
299
|
+
let tabNmEn = await this.getTerms('en-US', ['label', 'field'], tab.display)
|
|
300
|
+
let tabNmKo = await this.getTerms('ko-KR', ['label', 'field'], tab.display)
|
|
308
301
|
|
|
309
|
-
let data = await MetaUiUtil.getMenuMetaData(tab.menu ? tab.menu : tab.routing)
|
|
302
|
+
let data = await MetaUiUtil.getMenuMetaData(tab.menu ? tab.menu : tab.routing)
|
|
310
303
|
|
|
311
|
-
if(!data || !data.records || data.records.length == 0){
|
|
312
|
-
continue
|
|
304
|
+
if (!data || !data.records || data.records.length == 0) {
|
|
305
|
+
continue
|
|
313
306
|
}
|
|
314
307
|
|
|
315
|
-
let tabMenuConfig = JSON.parse(MetaCrypto.dec(data.records[0].template))
|
|
308
|
+
let tabMenuConfig = JSON.parse(MetaCrypto.dec(data.records[0].template))
|
|
316
309
|
|
|
317
|
-
for(let idx in tabMenuConfig.grid_column){
|
|
318
|
-
let x = tabMenuConfig.grid_column[idx]
|
|
310
|
+
for (let idx in tabMenuConfig.grid_column) {
|
|
311
|
+
let x = tabMenuConfig.grid_column[idx]
|
|
319
312
|
|
|
320
|
-
let colName = snakeCase(x.name)
|
|
313
|
+
let colName = snakeCase(x.name)
|
|
321
314
|
|
|
322
|
-
if(['object','meta-object-selector','resource-object'].includes(x.type)){
|
|
323
|
-
colName = colName + '_id'
|
|
315
|
+
if (['object', 'meta-object-selector', 'resource-object'].includes(x.type)) {
|
|
316
|
+
colName = colName + '_id'
|
|
324
317
|
}
|
|
325
|
-
|
|
326
|
-
let recIdx = records.findIndex(rec => rec.column_id == colName)
|
|
327
|
-
|
|
328
|
-
if(recIdx > -1){
|
|
318
|
+
|
|
319
|
+
let recIdx = records.findIndex(rec => rec.column_id == colName)
|
|
320
|
+
|
|
321
|
+
if (recIdx > -1) {
|
|
329
322
|
console.log(tab.tagName)
|
|
330
|
-
records[recIdx].group_cd = tab.name
|
|
331
|
-
records[recIdx].group_nm_en = tabNmEn
|
|
332
|
-
records[recIdx].group_nm_ko = tabNmKo
|
|
333
|
-
records[recIdx].group_type =
|
|
334
|
-
|
|
335
|
-
records[recIdx].editable = x.editable === true ? 'O' : ''
|
|
336
|
-
records[recIdx].hidden = x.hidden === true ? 'O' : ''
|
|
337
|
-
records[recIdx].grid_align = x.align
|
|
338
|
-
records[recIdx].export_field = x.exportable === true ? 'O' : ''
|
|
339
|
-
records[recIdx].grid_width = x.width
|
|
340
|
-
records[recIdx].entity_ref = ''
|
|
341
|
-
records[recIdx].entity_code_ref = ''
|
|
342
|
-
records[recIdx].code_ref = ''
|
|
343
|
-
|
|
344
|
-
if(x.select_opt){
|
|
345
|
-
let opt = x.select_opt
|
|
346
|
-
|
|
347
|
-
if(opt.type == 'code'){
|
|
348
|
-
records[recIdx].code_ref = opt.name
|
|
349
|
-
} else if (opt.type == 'entity'){
|
|
350
|
-
records[recIdx].entity_code_ref = `${opt.name},${opt.args.codeField},${opt.args.dispField}
|
|
323
|
+
records[recIdx].group_cd = tab.name
|
|
324
|
+
records[recIdx].group_nm_en = tabNmEn
|
|
325
|
+
records[recIdx].group_nm_ko = tabNmKo
|
|
326
|
+
records[recIdx].group_type = tab.tagname == 'meta-form-element' ? 'Form' : 'Grist'
|
|
327
|
+
|
|
328
|
+
records[recIdx].editable = x.editable === true ? 'O' : ''
|
|
329
|
+
records[recIdx].hidden = x.hidden === true ? 'O' : ''
|
|
330
|
+
records[recIdx].grid_align = x.align
|
|
331
|
+
records[recIdx].export_field = x.exportable === true ? 'O' : ''
|
|
332
|
+
records[recIdx].grid_width = x.width
|
|
333
|
+
records[recIdx].entity_ref = ''
|
|
334
|
+
records[recIdx].entity_code_ref = ''
|
|
335
|
+
records[recIdx].code_ref = ''
|
|
336
|
+
|
|
337
|
+
if (x.select_opt) {
|
|
338
|
+
let opt = x.select_opt
|
|
339
|
+
|
|
340
|
+
if (opt.type == 'code') {
|
|
341
|
+
records[recIdx].code_ref = opt.name
|
|
342
|
+
} else if (opt.type == 'entity') {
|
|
343
|
+
records[recIdx].entity_code_ref = `${opt.name},${opt.args.codeField},${opt.args.dispField}`
|
|
351
344
|
}
|
|
352
|
-
} else if (x.object_opt){
|
|
353
|
-
let opt = x.object_opt
|
|
354
|
-
if(opt.menu){
|
|
355
|
-
records[recIdx].entity_ref = `menu,${opt.menu}
|
|
345
|
+
} else if (x.object_opt) {
|
|
346
|
+
let opt = x.object_opt
|
|
347
|
+
if (opt.menu) {
|
|
348
|
+
records[recIdx].entity_ref = `menu,${opt.menu}`
|
|
356
349
|
} else {
|
|
357
|
-
records[recIdx].entity_ref = `${upperFirst(singular(opt.queryName))},${opt.nameField}
|
|
350
|
+
records[recIdx].entity_ref = `${upperFirst(singular(opt.queryName))},${opt.nameField}`
|
|
358
351
|
|
|
359
|
-
if(opt.descriptionField && opt.descriptionField.length > 0){
|
|
352
|
+
if (opt.descriptionField && opt.descriptionField.length > 0) {
|
|
360
353
|
records[recIdx].entity_ref += `,${opt.descriptionField}`
|
|
361
354
|
}
|
|
362
355
|
}
|
|
363
356
|
}
|
|
364
357
|
}
|
|
365
358
|
}
|
|
366
|
-
|
|
367
|
-
|
|
359
|
+
}
|
|
368
360
|
|
|
369
361
|
// 최종 ~~
|
|
370
|
-
for(
|
|
371
|
-
let x = records[recIdx]
|
|
372
|
-
x.seq = Number(recIdx) +1
|
|
362
|
+
for (let recIdx in records) {
|
|
363
|
+
let x = records[recIdx]
|
|
364
|
+
x.seq = Number(recIdx) + 1
|
|
373
365
|
|
|
374
366
|
// 컬럼 명칭 termionologies 에 없으면 i18next 에서 찾는다 .
|
|
375
|
-
x.column_ko = await this.getTerms(
|
|
376
|
-
x.column_en = await this.getTerms(
|
|
367
|
+
x.column_ko = await this.getTerms('ko-KR', ['label', 'field'], x.column_id.endsWith('_id') ? x.column_id.substring(0, x.column_id.length - 3) : x.column_id)
|
|
368
|
+
x.column_en = await this.getTerms('en-US', ['label', 'field'], x.column_id.endsWith('_id') ? x.column_id.substring(0, x.column_id.length - 3) : x.column_id)
|
|
377
369
|
|
|
378
|
-
x.column_id = x.column_id.toUpperCase()
|
|
379
|
-
x.column_type = colTypes[x.column_type]
|
|
370
|
+
x.column_id = x.column_id.toUpperCase()
|
|
371
|
+
x.column_type = colTypes[x.column_type]
|
|
380
372
|
}
|
|
381
373
|
|
|
382
374
|
return {
|
|
@@ -385,59 +377,59 @@ export class ExportMenuPopup extends localize(i18next)(LitElement) {
|
|
|
385
377
|
}
|
|
386
378
|
}
|
|
387
379
|
|
|
388
|
-
async getTerms(locale, category, name){
|
|
380
|
+
async getTerms(locale, category, name) {
|
|
389
381
|
let filters = [
|
|
390
|
-
{name:'name', operator:'eq', value:name},
|
|
391
|
-
{name:'locale', operator:'eq', value:locale}
|
|
382
|
+
{ name: 'name', operator: 'eq', value: name },
|
|
383
|
+
{ name: 'locale', operator: 'eq', value: locale }
|
|
392
384
|
]
|
|
393
385
|
|
|
394
|
-
if(Array.isArray(category)){
|
|
395
|
-
filters.push({name:'category', operator:'in', value:category})
|
|
386
|
+
if (Array.isArray(category)) {
|
|
387
|
+
filters.push({ name: 'category', operator: 'in', value: category })
|
|
396
388
|
} else {
|
|
397
|
-
filters.push({name:'category', operator:'eq', value:category})
|
|
389
|
+
filters.push({ name: 'category', operator: 'eq', value: category })
|
|
398
390
|
}
|
|
399
391
|
|
|
400
|
-
let res = await MetaApi.searchByPagination('terminologies',filters, [], 0, 0, 'display')
|
|
392
|
+
let res = await MetaApi.searchByPagination('terminologies', filters, [], 0, 0, 'display')
|
|
401
393
|
|
|
402
|
-
if(res.records.length > 0){
|
|
403
|
-
return res.records[0].display
|
|
394
|
+
if (res.records.length > 0) {
|
|
395
|
+
return res.records[0].display
|
|
404
396
|
}
|
|
405
397
|
|
|
406
|
-
if(Array.isArray(category)){
|
|
407
|
-
for(let catIdx in category){
|
|
398
|
+
if (Array.isArray(category)) {
|
|
399
|
+
for (let catIdx in category) {
|
|
408
400
|
let disp = this.getI18t(locale, category[catIdx], name)
|
|
409
401
|
|
|
410
|
-
if(disp){
|
|
411
|
-
return disp
|
|
402
|
+
if (disp) {
|
|
403
|
+
return disp
|
|
412
404
|
}
|
|
413
405
|
}
|
|
414
406
|
} else {
|
|
415
407
|
let disp = this.getI18t(locale, category, name)
|
|
416
408
|
|
|
417
|
-
if(disp){
|
|
418
|
-
return disp
|
|
409
|
+
if (disp) {
|
|
410
|
+
return disp
|
|
419
411
|
}
|
|
420
412
|
}
|
|
421
413
|
|
|
422
|
-
return ''
|
|
414
|
+
return ''
|
|
423
415
|
}
|
|
424
416
|
|
|
425
|
-
getI18t(locale, category, name){
|
|
426
|
-
let tName = `${category}.${name}
|
|
427
|
-
let disp = ''
|
|
417
|
+
getI18t(locale, category, name) {
|
|
418
|
+
let tName = `${category}.${name}`
|
|
419
|
+
let disp = ''
|
|
428
420
|
|
|
429
|
-
if(locale == 'en-US') {
|
|
421
|
+
if (locale == 'en-US') {
|
|
430
422
|
disp = i18nextEn(tName)
|
|
431
423
|
} else {
|
|
432
424
|
disp = i18nextKo(tName)
|
|
433
425
|
}
|
|
434
426
|
|
|
435
|
-
if(disp == tName){
|
|
436
|
-
return undefined
|
|
427
|
+
if (disp == tName) {
|
|
428
|
+
return undefined
|
|
437
429
|
}
|
|
438
|
-
|
|
439
|
-
return disp
|
|
430
|
+
|
|
431
|
+
return disp
|
|
440
432
|
}
|
|
441
433
|
}
|
|
442
434
|
|
|
443
|
-
customElements.define('export-menu-popup', ExportMenuPopup)
|
|
435
|
+
customElements.define('export-menu-popup', ExportMenuPopup)
|