@things-factory/meta-ui 8.0.0-beta.9 → 8.0.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/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,245 @@
|
|
|
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, ButtonContainerStyles } from '@operato/styles'
|
|
7
|
+
|
|
8
|
+
import { TermsUtil } from './../../utils/terms-util'
|
|
9
|
+
import { UiUtil } from '../../utils/ui-util'
|
|
10
|
+
import { MetaApi } from '../../utils/meta-api'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
15
|
+
* @author Shortstop <shortstop@hatiolab.com>
|
|
16
|
+
* @description 메인 메뉴 선택 화면
|
|
17
|
+
*/
|
|
18
|
+
export class MainMenuSelector extends localize(i18next)(LitElement) {
|
|
19
|
+
/**
|
|
20
|
+
* @description 스타일 정의
|
|
21
|
+
***********************************
|
|
22
|
+
* @returns {Object} 화면의 스타일 정의
|
|
23
|
+
*/
|
|
24
|
+
static get styles() {
|
|
25
|
+
let styles = [
|
|
26
|
+
ScrollbarStyles,
|
|
27
|
+
CommonGristStyles,
|
|
28
|
+
ButtonContainerStyles,
|
|
29
|
+
css`
|
|
30
|
+
:host {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
overflow-x: auto;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.container {
|
|
37
|
+
flex: 1;
|
|
38
|
+
display: grid;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.container_detail {
|
|
43
|
+
background-color: var(--md-sys-color-background);
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
flex: 1;
|
|
47
|
+
overflow-y: auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
h2 {
|
|
51
|
+
padding: var(--subtitle-padding);
|
|
52
|
+
font: var(--subtitle-font);
|
|
53
|
+
color: var(--subtitle-text-color);
|
|
54
|
+
border-bottom: var(--subtitle-border-bottom);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.container_detail h2 {
|
|
58
|
+
margin: var(--grist-title-margin);
|
|
59
|
+
border: var(--grist-title-border);
|
|
60
|
+
font: var(--grist-title-font);
|
|
61
|
+
color: var(--md-sys-color-secondary);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.container_detail h2 md-icon {
|
|
65
|
+
--md-icon-size: var(--grist-title-icon-size);
|
|
66
|
+
vertical-align: middle;
|
|
67
|
+
margin: var(--grist-title-icon-margin);
|
|
68
|
+
color: var(--grist-title-icon-color);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
h2 {
|
|
72
|
+
padding-bottom: var(--grist-title-with-grid-padding);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
ox-grist {
|
|
76
|
+
overflow-y: auto;
|
|
77
|
+
flex: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
ox-filters-form {
|
|
81
|
+
flex: 1;
|
|
82
|
+
}
|
|
83
|
+
`
|
|
84
|
+
]
|
|
85
|
+
return styles
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @description 프로퍼티 정의
|
|
90
|
+
***********************************
|
|
91
|
+
* @returns {Object} 화면의 프로퍼티 정의
|
|
92
|
+
*/
|
|
93
|
+
static get properties() {
|
|
94
|
+
return {
|
|
95
|
+
/**
|
|
96
|
+
* @description 메인 메뉴 리스트
|
|
97
|
+
****************************
|
|
98
|
+
* @type {Array}
|
|
99
|
+
*/
|
|
100
|
+
items: {
|
|
101
|
+
type: Array
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @description 총 메인 메뉴 건수
|
|
106
|
+
******************************
|
|
107
|
+
* @type {Number}
|
|
108
|
+
*/
|
|
109
|
+
total: {
|
|
110
|
+
type: Number
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @description 메인 메뉴 선택 이후 콜백 함수
|
|
115
|
+
***************************************
|
|
116
|
+
* @type {Function}
|
|
117
|
+
*/
|
|
118
|
+
selectCallback: {
|
|
119
|
+
type: Function
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @description 라이트 사이클
|
|
126
|
+
***************************
|
|
127
|
+
*/
|
|
128
|
+
async connectedCallback() {
|
|
129
|
+
// 메뉴 그룹 그리드 설정
|
|
130
|
+
this.gridConfig = {
|
|
131
|
+
rows: MetaApi.getGristSelectableConfig(false),
|
|
132
|
+
pagination: { pages: [1000] },
|
|
133
|
+
appendable: true,
|
|
134
|
+
columns: [
|
|
135
|
+
...MetaApi.getGristGuttersConfig(true, false),
|
|
136
|
+
{
|
|
137
|
+
name: 'rank',
|
|
138
|
+
header: TermsUtil.tLabel('rank'),
|
|
139
|
+
width: 80,
|
|
140
|
+
record: {
|
|
141
|
+
editable: false,
|
|
142
|
+
format: '#,###',
|
|
143
|
+
align: 'left'
|
|
144
|
+
},
|
|
145
|
+
sortable: true
|
|
146
|
+
},
|
|
147
|
+
MetaApi.getGristColumnConfig('string', 'name', 'left', true, false, 300),
|
|
148
|
+
{
|
|
149
|
+
type: 'string',
|
|
150
|
+
name: 'title',
|
|
151
|
+
header: TermsUtil.tLabel('title'),
|
|
152
|
+
record: {
|
|
153
|
+
editable: false,
|
|
154
|
+
align: 'left',
|
|
155
|
+
renderer: (value, column, record, rowIndex, field) => {
|
|
156
|
+
return record.name ? TermsUtil.tMenu(record.name) : ''
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
sortable: false,
|
|
160
|
+
width: 350
|
|
161
|
+
},
|
|
162
|
+
await MetaApi.getGristCodeSelectorColumnConfig('menuType', 'menu_type', 'left', false, 100, true, 'MENU_TYPE')
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (super.connectedCallback) {
|
|
167
|
+
await super.connectedCallback()
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @description 라이프 사이클
|
|
173
|
+
***************************
|
|
174
|
+
*/
|
|
175
|
+
render() {
|
|
176
|
+
return html` <div id="container" class="container">
|
|
177
|
+
<div class="container_detail">
|
|
178
|
+
<ox-grist
|
|
179
|
+
id="ox-grist"
|
|
180
|
+
.config=${this.gridConfig}
|
|
181
|
+
.mode=${'GRID'}
|
|
182
|
+
auto-fetch
|
|
183
|
+
.fetchHandler=${this.fetchMainMenus.bind(this)}
|
|
184
|
+
>
|
|
185
|
+
</ox-grist>
|
|
186
|
+
<div class="button-container">
|
|
187
|
+
<button hidden id="receive" @click=${this.selectMainMenu.bind(this)}>
|
|
188
|
+
<md-icon>menu_open</md-icon>${TermsUtil.tButton('create-menu')}
|
|
189
|
+
</button>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
</div>`
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @description 그리드 리턴
|
|
197
|
+
**************************
|
|
198
|
+
* @returns {Object} 그리드
|
|
199
|
+
*/
|
|
200
|
+
get grist() {
|
|
201
|
+
return this.shadowRoot.querySelector('#ox-grist')
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @description 메인 메뉴 조회
|
|
206
|
+
***************************
|
|
207
|
+
* @returns
|
|
208
|
+
*/
|
|
209
|
+
async fetchMainMenus() {
|
|
210
|
+
let filters = [{ name: 'parentId', operator: 'is_null', value: '' }]
|
|
211
|
+
let sorters = [{ name: 'rank' }]
|
|
212
|
+
let selectFields = `
|
|
213
|
+
id
|
|
214
|
+
name
|
|
215
|
+
rank
|
|
216
|
+
description
|
|
217
|
+
menuType
|
|
218
|
+
category
|
|
219
|
+
`
|
|
220
|
+
let result = await MetaApi.searchByPagination('menus', filters, sorters, 0, 0, selectFields)
|
|
221
|
+
this.items = result.records
|
|
222
|
+
this.total = result.total
|
|
223
|
+
return { total: this.total, records: this.items }
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @description 메인 메뉴 선택 시 액션 - 콜백 함수 호출
|
|
228
|
+
************************************************
|
|
229
|
+
*/
|
|
230
|
+
async selectMainMenu(e) {
|
|
231
|
+
const records = this.grist.selected
|
|
232
|
+
if (!records || records.length == 0) {
|
|
233
|
+
UiUtil.showCustomAlert('title.info', 'text.NOTHING_SELECTED', 'info', 'button.confirm')
|
|
234
|
+
} else {
|
|
235
|
+
if (this.selectCallback) {
|
|
236
|
+
let res = await this.selectCallback(records[0].id)
|
|
237
|
+
if (res.success) {
|
|
238
|
+
history.back()
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
customElements.define('main-menu-selector', MainMenuSelector)
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit'
|
|
2
|
+
|
|
3
|
+
import { i18next, localize } from '@operato/i18n'
|
|
4
|
+
import { ScrollbarStyles, CommonGristStyles } from '@operato/styles'
|
|
5
|
+
|
|
6
|
+
import { MetaApi } from '../../utils/meta-api'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
11
|
+
* @author Yang
|
|
12
|
+
* @description 변경 이력 (COPY) 타입 조회 팝업
|
|
13
|
+
*/
|
|
14
|
+
export class HistoryCopyListPopup extends localize(i18next)(LitElement) {
|
|
15
|
+
/**
|
|
16
|
+
* @description 스타일 정의
|
|
17
|
+
***********************************
|
|
18
|
+
* @returns {Object} 화면의 스타일 정의
|
|
19
|
+
*/
|
|
20
|
+
static get styles() {
|
|
21
|
+
let styles = [
|
|
22
|
+
ScrollbarStyles,
|
|
23
|
+
CommonGristStyles,
|
|
24
|
+
css`
|
|
25
|
+
:host {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
overflow-x: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ox-grist {
|
|
32
|
+
overflow-y: auto;
|
|
33
|
+
flex: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ox-filters-form {
|
|
37
|
+
flex: 1;
|
|
38
|
+
}
|
|
39
|
+
`
|
|
40
|
+
]
|
|
41
|
+
return styles
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @description 프로퍼티 정의
|
|
46
|
+
***********************************
|
|
47
|
+
* @returns {Object} 화면의 프로퍼티 정의
|
|
48
|
+
*/
|
|
49
|
+
static get properties() {
|
|
50
|
+
return {
|
|
51
|
+
parent_id: String
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @description 라이트 사이클
|
|
57
|
+
***************************
|
|
58
|
+
*/
|
|
59
|
+
async connectedCallback() {
|
|
60
|
+
// 메뉴 그룹 그리드 설정
|
|
61
|
+
let parentGristConfig = this.open_param.gristConfig
|
|
62
|
+
this.gqlFunc = this.open_param.gqlFunc
|
|
63
|
+
|
|
64
|
+
delete parentGristConfig.list
|
|
65
|
+
delete parentGristConfig.rows
|
|
66
|
+
|
|
67
|
+
parentGristConfig.rows = {
|
|
68
|
+
appendable: false,
|
|
69
|
+
selectable: false
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
parentGristConfig.sorters = [{ name: 'dataRevisionNo', desc: true }]
|
|
73
|
+
|
|
74
|
+
let gristColumns = parentGristConfig.columns.filter(x => x.type != 'gutter' && x.unusable !== true)
|
|
75
|
+
gristColumns.forEach(x => {
|
|
76
|
+
if (x.filter) delete x.filter
|
|
77
|
+
if (!x.record) x.record = {}
|
|
78
|
+
|
|
79
|
+
x.sortable = false
|
|
80
|
+
x.record.editable = false
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
parentGristConfig.columns = [
|
|
84
|
+
{ type: 'gutter', gutterName: 'dirty' },
|
|
85
|
+
MetaApi.getGristColumnConfig2('integer', 'dataRevisionNo', 'data_revision_no', 'center', false, true, 90),
|
|
86
|
+
MetaApi.getGristColumnConfig2('string', 'dataRevisionAction', 'data_revision_action', 'center', false, false, 90),
|
|
87
|
+
...gristColumns
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
this.gridConfig = parentGristConfig
|
|
91
|
+
|
|
92
|
+
if (super.connectedCallback) {
|
|
93
|
+
await super.connectedCallback()
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @description 라이프 사이클
|
|
99
|
+
***************************
|
|
100
|
+
*/
|
|
101
|
+
render() {
|
|
102
|
+
return html`
|
|
103
|
+
<ox-grist
|
|
104
|
+
id="ox-grist"
|
|
105
|
+
.config=${this.gridConfig}
|
|
106
|
+
.mode=${'GRID'}
|
|
107
|
+
auto-fetch
|
|
108
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
109
|
+
>
|
|
110
|
+
</ox-grist>
|
|
111
|
+
`
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @description 그리드 리턴
|
|
116
|
+
**************************
|
|
117
|
+
* @returns {Object} 그리드
|
|
118
|
+
*/
|
|
119
|
+
get grist() {
|
|
120
|
+
return this.shadowRoot.querySelector('#ox-grist')
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @description 이력 조회
|
|
125
|
+
***************************
|
|
126
|
+
* @returns
|
|
127
|
+
*/
|
|
128
|
+
async fetchHandler({ page = 0, limit = 0, sortings = [], filters = [] }) {
|
|
129
|
+
let filter = [{ name: 'originalId', operator: 'eq', value: this.parent_id }, ...filters]
|
|
130
|
+
|
|
131
|
+
let selectFields = MetaApi.getSelectColumns(this.gridConfig.columns)
|
|
132
|
+
|
|
133
|
+
let result = await MetaApi.searchByPagination(
|
|
134
|
+
`${this.gqlFunc}Histories`,
|
|
135
|
+
filter,
|
|
136
|
+
sortings,
|
|
137
|
+
page,
|
|
138
|
+
limit,
|
|
139
|
+
selectFields
|
|
140
|
+
)
|
|
141
|
+
return result
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
customElements.define('history-copy-list-popup', HistoryCopyListPopup)
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit'
|
|
2
|
+
|
|
3
|
+
import { i18next, localize } from '@operato/i18n'
|
|
4
|
+
import { ScrollbarStyles, CommonGristStyles } from '@operato/styles'
|
|
5
|
+
|
|
6
|
+
import { TermsUtil } from './../../utils/terms-util'
|
|
7
|
+
import { UiUtil } from '../../utils/ui-util'
|
|
8
|
+
import { MetaApi } from '../../utils/meta-api'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
13
|
+
* @author Yang
|
|
14
|
+
* @description 변경 이력 (JSON) 타입 조회 팝업
|
|
15
|
+
*/
|
|
16
|
+
export class HistoryJsonListPopup extends localize(i18next)(LitElement) {
|
|
17
|
+
/**
|
|
18
|
+
* @description 스타일 정의
|
|
19
|
+
***********************************
|
|
20
|
+
* @returns {Object} 화면의 스타일 정의
|
|
21
|
+
*/
|
|
22
|
+
static get styles() {
|
|
23
|
+
let styles = [
|
|
24
|
+
ScrollbarStyles,
|
|
25
|
+
CommonGristStyles,
|
|
26
|
+
css`
|
|
27
|
+
:host {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
overflow-x: auto;
|
|
31
|
+
}
|
|
32
|
+
ox-grist {
|
|
33
|
+
overflow-y: auto;
|
|
34
|
+
flex: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
ox-filters-form {
|
|
38
|
+
flex: 1;
|
|
39
|
+
}
|
|
40
|
+
`
|
|
41
|
+
]
|
|
42
|
+
return styles
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @description 프로퍼티 정의
|
|
47
|
+
***********************************
|
|
48
|
+
* @returns {Object} 화면의 프로퍼티 정의
|
|
49
|
+
*/
|
|
50
|
+
static get properties() {
|
|
51
|
+
return {
|
|
52
|
+
parent_id: String
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @description 라이트 사이클
|
|
58
|
+
***************************
|
|
59
|
+
*/
|
|
60
|
+
async connectedCallback() {
|
|
61
|
+
// 메뉴 그룹 그리드 설정
|
|
62
|
+
let parentGristConfig = this.open_param.gristConfig
|
|
63
|
+
this.gqlFunc = this.open_param.gqlFunc
|
|
64
|
+
|
|
65
|
+
delete parentGristConfig.list
|
|
66
|
+
delete parentGristConfig.rows
|
|
67
|
+
|
|
68
|
+
parentGristConfig.rows = {
|
|
69
|
+
appendable: false,
|
|
70
|
+
selectable: false
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
parentGristConfig.sorters = [{ name: 'dataRevisionNo', desc: true }]
|
|
74
|
+
|
|
75
|
+
let gristColumns = parentGristConfig.columns.filter(x => x.type != 'gutter' && x.unusable !== true)
|
|
76
|
+
gristColumns.forEach(x => {
|
|
77
|
+
if (x.filter) delete x.filter
|
|
78
|
+
if (!x.record) x.record = {}
|
|
79
|
+
|
|
80
|
+
x.sortable = false
|
|
81
|
+
x.record.editable = false
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
parentGristConfig.columns = [
|
|
85
|
+
{ type: 'gutter', gutterName: 'dirty' },
|
|
86
|
+
MetaApi.getGristColumnConfig2('integer', 'dataRevisionNo', 'data_revision_no', 'center', false, true, 90),
|
|
87
|
+
MetaApi.getGristColumnConfig2('string', 'dataRevisionAction', 'data_revision_action', 'center', false, false, 90),
|
|
88
|
+
...gristColumns
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
this.gridConfig = parentGristConfig
|
|
92
|
+
|
|
93
|
+
if (super.connectedCallback) {
|
|
94
|
+
await super.connectedCallback()
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @description 라이프 사이클
|
|
100
|
+
***************************
|
|
101
|
+
*/
|
|
102
|
+
render() {
|
|
103
|
+
return html`
|
|
104
|
+
<ox-grist
|
|
105
|
+
id="ox-grist"
|
|
106
|
+
.config=${this.gridConfig}
|
|
107
|
+
.mode=${'GRID'}
|
|
108
|
+
auto-fetch
|
|
109
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
110
|
+
>
|
|
111
|
+
</ox-grist>
|
|
112
|
+
`
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @description 그리드 리턴
|
|
117
|
+
**************************
|
|
118
|
+
* @returns {Object} 그리드
|
|
119
|
+
*/
|
|
120
|
+
get grist() {
|
|
121
|
+
return this.shadowRoot.querySelector('#ox-grist')
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @description 이력 조회
|
|
126
|
+
***************************
|
|
127
|
+
* @returns
|
|
128
|
+
*/
|
|
129
|
+
async fetchHandler({ page = 0, limit = 0, sortings = [], filters = [] }) {
|
|
130
|
+
let filter = [{ name: 'originalId', operator: 'eq', value: this.parent_id }, ...filters]
|
|
131
|
+
|
|
132
|
+
let selectFields = `
|
|
133
|
+
id
|
|
134
|
+
originalId
|
|
135
|
+
dataRevisionNo
|
|
136
|
+
dataRevisionAction
|
|
137
|
+
historyJson
|
|
138
|
+
`
|
|
139
|
+
|
|
140
|
+
let result = await MetaApi.searchByPagination(
|
|
141
|
+
`${this.gqlFunc}Histories`,
|
|
142
|
+
filter,
|
|
143
|
+
sortings,
|
|
144
|
+
page,
|
|
145
|
+
limit,
|
|
146
|
+
selectFields
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
result.records = result.records.map(x => {
|
|
150
|
+
return {
|
|
151
|
+
...JSON.parse(x.historyJson),
|
|
152
|
+
...x
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
return result
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
customElements.define('history-json-list-popup', HistoryJsonListPopup)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit'
|
|
2
|
+
import { i18next, localize } from '@operato/i18n'
|
|
3
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
4
|
+
|
|
5
|
+
import '@operato/input/ox-input-code.js'
|
|
6
|
+
|
|
7
|
+
import { MetaApi } from '../../utils/meta-api'
|
|
8
|
+
|
|
9
|
+
class DynamicMenuTemplate extends localize(i18next)(LitElement) {
|
|
10
|
+
static get properties() {
|
|
11
|
+
return {
|
|
12
|
+
title: String,
|
|
13
|
+
recordId: String
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static get styles() {
|
|
18
|
+
let styles = [
|
|
19
|
+
ScrollbarStyles,
|
|
20
|
+
css`
|
|
21
|
+
:host {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
overflow-x: overlay;
|
|
25
|
+
background-color: var(--md-sys-color-background);
|
|
26
|
+
}
|
|
27
|
+
legend {
|
|
28
|
+
margin: 10px;
|
|
29
|
+
text-transform: capitalize;
|
|
30
|
+
padding: var(--legend-padding);
|
|
31
|
+
font: var(--legend-font);
|
|
32
|
+
color: var(--legend-text-color);
|
|
33
|
+
border-bottom: var(--legend-border-bottom);
|
|
34
|
+
}
|
|
35
|
+
ox-input-code {
|
|
36
|
+
margin: 10px;
|
|
37
|
+
overflow-y: auto;
|
|
38
|
+
flex: 1;
|
|
39
|
+
}
|
|
40
|
+
.button-container {
|
|
41
|
+
padding: var(--button-container-padding);
|
|
42
|
+
margin: var(--button-container-margin);
|
|
43
|
+
text-align: var(--button-container-align);
|
|
44
|
+
background-color: var(--button-container-background);
|
|
45
|
+
height: var(--button-container-height);
|
|
46
|
+
text-align: right;
|
|
47
|
+
padding-right: 12px;
|
|
48
|
+
}
|
|
49
|
+
`
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
return styles
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async firstUpdated() {
|
|
56
|
+
if (super.firstUpdated) {
|
|
57
|
+
await super.firstUpdated()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let menu = await MetaApi.findOne('menu', this.recordId, 'template')
|
|
61
|
+
let codeData = menu ? menu.template || '' : ''
|
|
62
|
+
this.codeEditor.value = codeData
|
|
63
|
+
this.codeEditor.orgValue = this.codeEditor.value
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
render() {
|
|
67
|
+
return html` <legend>${this.title}</legend>
|
|
68
|
+
<ox-input-code mode="javascript" value=${this.codeValueNew}></ox-input-code>
|
|
69
|
+
<div class="button-container"></div>`
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get codeEditor() {
|
|
73
|
+
return this.shadowRoot.querySelector('ox-input-code')
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async save() {
|
|
77
|
+
if (this.codeEditor.orgValue == this.codeEditor.value) {
|
|
78
|
+
MetaApi.showAlertPopup('text.nothing_changed', 'text.there_is_nothing_to_save', 'info', 'confirm')
|
|
79
|
+
return
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let template = this.codeEditor.value
|
|
83
|
+
|
|
84
|
+
let patches = [{ id: this.recordId, template: template, cuFlag: 'M' }]
|
|
85
|
+
let result = await MetaApi.updateMultiple('updateMultipleMenu', patches)
|
|
86
|
+
if (result) {
|
|
87
|
+
history.back()
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
customElements.define('dynamic-menu-template', DynamicMenuTemplate)
|