@things-factory/meta-ui 7.0.1-alpha.62 → 7.0.1-alpha.64
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 +0 -1
- package/client/component/popup/meta-object-selector-popup.ts +33 -6
- package/client/mixin/meta-basic-grist-mixin.js +233 -232
- package/client/mixin/meta-tab-detail-mixin.js +4 -0
- package/client/pages/activity/meta-activity-define-page.js +21 -7
- package/client/pages/activity/meta-activity-list-page.js +27 -6
- package/client/pages/entity/config-entity.js +176 -30
- package/client/pages/menu/dynamic-menu.js +45 -11
- package/client/pages/terms/config-terminology.js +17 -4
- package/client/utils/meta-ui-util.js +101 -95
- package/client/utils/service-util.js +21 -21
- package/dist-client/bootstrap.d.ts +0 -1
- package/dist-client/bootstrap.js +0 -1
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/component/popup/meta-object-selector-popup.js +15 -3
- package/dist-client/component/popup/meta-object-selector-popup.js.map +1 -1
- package/dist-client/mixin/meta-basic-grist-mixin.d.ts +9 -19
- package/dist-client/mixin/meta-basic-grist-mixin.js +6 -7
- package/dist-client/mixin/meta-basic-grist-mixin.js.map +1 -1
- package/dist-client/mixin/meta-tab-detail-mixin.d.ts +6 -1
- package/dist-client/mixin/meta-tab-detail-mixin.js +2 -0
- package/dist-client/mixin/meta-tab-detail-mixin.js.map +1 -1
- package/dist-client/pages/activity/meta-activity-define-page.js +10 -1
- package/dist-client/pages/activity/meta-activity-define-page.js.map +1 -1
- package/dist-client/pages/activity/meta-activity-list-page.js +16 -5
- package/dist-client/pages/activity/meta-activity-list-page.js.map +1 -1
- package/dist-client/pages/button-role/button-role-detail.d.ts +2 -1
- package/dist-client/pages/entity/config-entity.js +69 -18
- package/dist-client/pages/entity/config-entity.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu.js +19 -8
- package/dist-client/pages/menu/dynamic-menu.js.map +1 -1
- package/dist-client/pages/meta-grist-element.d.ts +2 -1
- package/dist-client/pages/meta-grist-page.d.ts +2 -1
- package/dist-client/pages/meta-tab-detail-element.d.ts +1 -0
- package/dist-client/pages/meta-tab-detail-page.d.ts +1 -0
- package/dist-client/pages/terms/config-terminology.js +15 -4
- package/dist-client/pages/terms/config-terminology.js.map +1 -1
- package/dist-client/pages/work-code/work-code-detail-popup.d.ts +2 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/meta-ui-util.d.ts +0 -2
- package/dist-client/utils/meta-ui-util.js +96 -95
- package/dist-client/utils/meta-ui-util.js.map +1 -1
- package/dist-client/utils/service-util.d.ts +0 -1
- package/dist-client/utils/service-util.js +20 -21
- package/dist-client/utils/service-util.js.map +1 -1
- package/dist-server/service/dynamic-menu/dynamic-menu-query.js +20 -4
- package/dist-server/service/dynamic-menu/dynamic-menu-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/server/service/dynamic-menu/dynamic-menu-query.ts +40 -8
package/client/bootstrap.ts
CHANGED
|
@@ -37,7 +37,6 @@ import { FilterGristMetaObjectSelect } from './component/filter/filter-grist-met
|
|
|
37
37
|
import { FilterFormMetaCodeSelect } from './component/filter/filter-form-meta-code-select'
|
|
38
38
|
import { FilterFormMetaObjectSelect } from './component/filter/filter-form-meta-object-select'
|
|
39
39
|
|
|
40
|
-
import './pages/personalize/personal-column-selector'
|
|
41
40
|
import './pages/history/history-copy-list-popup'
|
|
42
41
|
import './pages/history/history-json-list-popup'
|
|
43
42
|
|
|
@@ -65,7 +65,16 @@ export class MetaObjectSelectorPopup extends LitElement {
|
|
|
65
65
|
private record: any
|
|
66
66
|
|
|
67
67
|
async connectedCallback() {
|
|
68
|
-
const {
|
|
68
|
+
const {
|
|
69
|
+
select,
|
|
70
|
+
sorters,
|
|
71
|
+
filters,
|
|
72
|
+
codeField,
|
|
73
|
+
nameField,
|
|
74
|
+
dispField,
|
|
75
|
+
filterFields: optionFilterFields,
|
|
76
|
+
menu_template
|
|
77
|
+
} = this.options || {}
|
|
69
78
|
|
|
70
79
|
// 숨김 검색 조건
|
|
71
80
|
this.foundationFilters = filters ? filters : this.basicArgs && this.basicArgs.filters ? this.basicArgs.filters : []
|
|
@@ -88,7 +97,11 @@ export class MetaObjectSelectorPopup extends LitElement {
|
|
|
88
97
|
let sortFields = sorters ? sorters : this.basicArgs && this.basicArgs.sorters ? this.basicArgs.sorters : []
|
|
89
98
|
|
|
90
99
|
// 기본 검색 조건
|
|
91
|
-
let filterFields = optionFilterFields
|
|
100
|
+
let filterFields = optionFilterFields
|
|
101
|
+
? optionFilterFields
|
|
102
|
+
: menu_template?.search && menu_template?.search.length > 0
|
|
103
|
+
? menu_template.search
|
|
104
|
+
: []
|
|
92
105
|
|
|
93
106
|
// 그리드 컬럼
|
|
94
107
|
let gridColumns = select
|
|
@@ -165,7 +178,9 @@ export class MetaObjectSelectorPopup extends LitElement {
|
|
|
165
178
|
} else {
|
|
166
179
|
if (options.type === 'code') {
|
|
167
180
|
// 공통 코드
|
|
168
|
-
columnConfig.record.options = await ServiceUtil.getCodeSelectorData(
|
|
181
|
+
columnConfig.record.options = await ServiceUtil.getCodeSelectorData(
|
|
182
|
+
options.values ? options.values : options.name
|
|
183
|
+
)
|
|
169
184
|
} else if (options.type === 'scenario') {
|
|
170
185
|
// 시나리오
|
|
171
186
|
columnConfig.record.options = await ServiceUtil.getCodeByScenario(options.name, options.args)
|
|
@@ -233,7 +248,13 @@ export class MetaObjectSelectorPopup extends LitElement {
|
|
|
233
248
|
|
|
234
249
|
render() {
|
|
235
250
|
return html`
|
|
236
|
-
<ox-grist
|
|
251
|
+
<ox-grist
|
|
252
|
+
id="ox-grist"
|
|
253
|
+
.config=${this.gridConfig}
|
|
254
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
255
|
+
auto-fetch
|
|
256
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
257
|
+
>
|
|
237
258
|
<div slot="headroom" class="header">
|
|
238
259
|
<div class="filters">
|
|
239
260
|
<ox-filters-form></ox-filters-form>
|
|
@@ -242,7 +263,9 @@ export class MetaObjectSelectorPopup extends LitElement {
|
|
|
242
263
|
</ox-grist>
|
|
243
264
|
|
|
244
265
|
<div class="button-container" style="margin-left:unset;">
|
|
245
|
-
<button @click=${this.clickEmpty.bind(this)}
|
|
266
|
+
<button @click=${this.clickEmpty.bind(this)}>
|
|
267
|
+
<md-icon>check_box_outline_blank</md-icon>${TermsUtil.tButton('empty')}
|
|
268
|
+
</button>
|
|
246
269
|
<div filler></div>
|
|
247
270
|
<button @click=${this.clickCancel.bind(this)}><md-icon>cancel</md-icon>${TermsUtil.tButton('cancel')}</button>
|
|
248
271
|
<button @click=${this.clickSelect.bind(this)}><md-icon>done</md-icon>${TermsUtil.tButton('select')}</button>
|
|
@@ -271,7 +294,11 @@ export class MetaObjectSelectorPopup extends LitElement {
|
|
|
271
294
|
|
|
272
295
|
let resFilter = adjustFilters([...this.foundationFilters], filters)
|
|
273
296
|
|
|
274
|
-
let queryAfterSetFields = ValueUtil.getParams(
|
|
297
|
+
let queryAfterSetFields = ValueUtil.getParams(
|
|
298
|
+
menu_template ? menu_template.gql || {} : {},
|
|
299
|
+
'query',
|
|
300
|
+
'after_set_fields'
|
|
301
|
+
)
|
|
275
302
|
let selectSkipFields = Object.keys(queryAfterSetFields || {})
|
|
276
303
|
|
|
277
304
|
// 조회 컬럼 추출 후 조회
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { html } from 'lit'
|
|
2
2
|
|
|
3
|
+
import { PagePreferenceProviderImpl } from '@things-factory/personalization/dist-client/page-preference-provider-impl.js'
|
|
4
|
+
|
|
3
5
|
import { MetaApi } from '../utils/meta-api'
|
|
4
6
|
import { MetaUiUtil } from '../utils/meta-ui-util'
|
|
5
7
|
import { ValueUtil } from '../utils/value-util'
|
|
@@ -10,275 +12,274 @@ import { MetaButtonMixin } from './meta-button-mixin'
|
|
|
10
12
|
/**
|
|
11
13
|
* @description 메뉴 메타 정보를 이용해 그리드를 렌더링
|
|
12
14
|
******************************************************
|
|
13
|
-
* @param {Object} MetaButtonMixin
|
|
14
|
-
* @returns
|
|
15
|
+
* @param {Object} MetaButtonMixin
|
|
16
|
+
* @returns
|
|
15
17
|
*/
|
|
16
|
-
export const MetaBasicGristMixin =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
export const MetaBasicGristMixin = baseElement =>
|
|
19
|
+
class extends MetaButtonMixin(baseElement) {
|
|
20
|
+
/**
|
|
21
|
+
* @description 스타일 정의
|
|
22
|
+
**************************
|
|
23
|
+
* @returns {Array} 스타일
|
|
24
|
+
*/
|
|
25
|
+
static get styles() {
|
|
26
|
+
return MetaApi.getBasicGristStyles()
|
|
27
|
+
}
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
29
|
+
/**
|
|
30
|
+
* @description 프로퍼티 정의
|
|
31
|
+
***************************************
|
|
32
|
+
* @returns {Object} 프로퍼티
|
|
33
|
+
*/
|
|
34
|
+
static get properties() {
|
|
35
|
+
return {
|
|
36
|
+
/**
|
|
37
|
+
* @description 그리드 구성 정보
|
|
38
|
+
*****************************
|
|
39
|
+
* @type {Object}
|
|
40
|
+
*/
|
|
41
|
+
gridConfig: Object,
|
|
42
|
+
/**
|
|
43
|
+
* @description 그리드 컬럼 구성 정보
|
|
44
|
+
*********************************
|
|
45
|
+
* @type {Array}
|
|
46
|
+
*/
|
|
47
|
+
gridColumnConfig: Array,
|
|
48
|
+
/**
|
|
49
|
+
* @description 검색 폼 구성 정보
|
|
50
|
+
*******************************
|
|
51
|
+
* @type {Array}
|
|
52
|
+
*/
|
|
53
|
+
searchConfig: Array,
|
|
54
|
+
/**
|
|
55
|
+
* @description 화면에서 사용되는 서치 폼 : grist, filter, not
|
|
56
|
+
*********************************************************
|
|
57
|
+
* @type {String}
|
|
58
|
+
*/
|
|
59
|
+
searchFormElement: String,
|
|
60
|
+
/**
|
|
61
|
+
* @description 메뉴 메타 정보로 부터 추출한 후 그리스트를 위해 설정 정보 구성
|
|
62
|
+
*****************************************************************
|
|
63
|
+
* @type {Object}
|
|
64
|
+
*/
|
|
65
|
+
gristConfigSet: Object,
|
|
66
|
+
/**
|
|
67
|
+
* @description 필터 폼 사용 여부
|
|
68
|
+
*****************************
|
|
69
|
+
* @type {Boolean}
|
|
70
|
+
*/
|
|
71
|
+
useFilterForm: Boolean,
|
|
72
|
+
/**
|
|
73
|
+
* @description 모바일 기기에서 그리드 모드 : GRID, LIST, CARD
|
|
74
|
+
*********************************************************
|
|
75
|
+
* @type {String}
|
|
76
|
+
*/
|
|
77
|
+
gridMobileMode: String,
|
|
78
|
+
/**
|
|
79
|
+
* @description 데스크탑에서 그리드 모드 : GRID, LIST, CARD
|
|
80
|
+
******************************************************
|
|
81
|
+
* @type {String}
|
|
82
|
+
*/
|
|
83
|
+
gridDeskMode: String,
|
|
84
|
+
/**
|
|
85
|
+
* @description 그리드 뷰 모드 : GRID, LIST, CARD
|
|
86
|
+
**********************************************
|
|
87
|
+
* @type {Array}
|
|
88
|
+
*/
|
|
89
|
+
gridViewOptions: Array,
|
|
90
|
+
/**
|
|
91
|
+
* @description 현재 그리드 뷰 모드 : GRID, LIST, CARD
|
|
92
|
+
***************************************************
|
|
93
|
+
* @type {String}
|
|
94
|
+
*/
|
|
95
|
+
gridMode: String,
|
|
96
|
+
/**
|
|
97
|
+
* @description Infinity Page 사용 여부
|
|
98
|
+
**************************************
|
|
99
|
+
* @type {Boolean}
|
|
100
|
+
*/
|
|
101
|
+
infinityPage: Boolean,
|
|
102
|
+
/**
|
|
103
|
+
* @description 그리스트 엘리먼트 ID
|
|
104
|
+
***************************
|
|
105
|
+
* @type {String}
|
|
106
|
+
*/
|
|
107
|
+
gristId: String,
|
|
108
|
+
/**
|
|
109
|
+
* @description 필터 폼 엘리먼트 ID
|
|
110
|
+
***************************
|
|
111
|
+
* @type {String}
|
|
112
|
+
*/
|
|
113
|
+
filterFormId: String
|
|
114
|
+
}
|
|
112
115
|
}
|
|
113
|
-
}
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
/**
|
|
118
|
+
* @description 그리스트
|
|
119
|
+
***********************
|
|
120
|
+
* @returns {HTMLElement}
|
|
121
|
+
*/
|
|
122
|
+
get grist() {
|
|
123
|
+
return this.renderRoot?.querySelector(this.gristId)
|
|
124
|
+
}
|
|
123
125
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
/**
|
|
127
|
+
* @description 필터 폼
|
|
128
|
+
***********************
|
|
129
|
+
* @returns {HTMLElement}
|
|
130
|
+
*/
|
|
131
|
+
get filterForm() {
|
|
132
|
+
return this.shadowRoot?.querySelector(this.filterFormId)
|
|
133
|
+
}
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
/**
|
|
136
|
+
* @description 컨텍스트
|
|
137
|
+
***********************
|
|
138
|
+
* @returns {HTMLElement}
|
|
139
|
+
*/
|
|
140
|
+
get context() {
|
|
141
|
+
return MetaUiUtil.getContextObject(this)
|
|
142
|
+
}
|
|
141
143
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
/******************************************************
|
|
145
|
+
* LifeCycle
|
|
146
|
+
******************************************************/
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
async connectedCallback() {
|
|
149
|
+
// 그리스트, 필터 폼 ID 설정
|
|
150
|
+
this.gristId = 'ox-grist'
|
|
151
|
+
this.filterFormId = 'ox-filters-form'
|
|
150
152
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
// 메뉴 메타 정보 조회 및 기본 파싱
|
|
154
|
+
await this.getAndParseMenuMeta()
|
|
153
155
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
if (this.isElement) {
|
|
157
|
+
await this.parseGristConfigs()
|
|
158
|
+
}
|
|
157
159
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
if (this.activityDataSet) {
|
|
161
|
+
this.dataSet = this.activityDataSet
|
|
162
|
+
}
|
|
161
163
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
if (super.connectedCallback) {
|
|
165
|
+
await super.connectedCallback()
|
|
166
|
+
}
|
|
164
167
|
}
|
|
165
|
-
}
|
|
166
168
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
async firstUpdated() {
|
|
170
|
+
if (super.firstUpdated) {
|
|
171
|
+
await super.firstUpdated()
|
|
172
|
+
}
|
|
170
173
|
}
|
|
171
|
-
}
|
|
172
174
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
async pageInitialized(lifecycle) {
|
|
176
|
+
if (this.isPage) {
|
|
177
|
+
await this.parseGristConfigs()
|
|
178
|
+
}
|
|
177
179
|
|
|
178
|
-
|
|
179
|
-
await super.pageInitialized()
|
|
180
|
-
}
|
|
181
|
-
}
|
|
180
|
+
this.personalConfigProvider = new PagePreferenceProviderImpl(lifecycle.page, 'meta::basic::ox-grist')
|
|
182
181
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
/* this page is activated */
|
|
186
|
-
if(this.gridConfig.grid_refresh_when_page_activated) {
|
|
187
|
-
this.fetch();
|
|
182
|
+
if (super.pageInitialized) {
|
|
183
|
+
await super.pageInitialized()
|
|
188
184
|
}
|
|
189
|
-
} else {
|
|
190
|
-
/* this page is deactivated */
|
|
191
185
|
}
|
|
192
|
-
}
|
|
193
186
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
187
|
+
async pageUpdated(changes, lifecycle, before) {
|
|
188
|
+
if (this.active) {
|
|
189
|
+
/* this page is activated */
|
|
190
|
+
if (this.gridConfig.grid_refresh_when_page_activated) {
|
|
191
|
+
this.fetch()
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
/* this page is deactivated */
|
|
195
|
+
}
|
|
196
|
+
}
|
|
200
197
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
* @param {Object} menuMeta 메뉴 메타 정보
|
|
205
|
-
*/
|
|
206
|
-
parseBasicGridConfigs(menuMeta) {
|
|
207
|
-
this.gridConfig = menuMeta.grid
|
|
208
|
-
this.gridColumnConfig = menuMeta.grid_column
|
|
209
|
-
this.searchConfig = menuMeta.search
|
|
210
|
-
this.gridEmphasized = menuMeta.gridEmphasized
|
|
211
|
-
}
|
|
198
|
+
render() {
|
|
199
|
+
return html` ${MetaApi.getBasicGristHtml(this)} ${this.isPage ? html`` : MetaUiUtil.getButtonContainer(this)} `
|
|
200
|
+
}
|
|
212
201
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
202
|
+
/**
|
|
203
|
+
* @descrtiption 메뉴 메타에서 기본 그리드 정보 파싱 처리
|
|
204
|
+
************************************************
|
|
205
|
+
* @param {Object} menuMeta 메뉴 메타 정보
|
|
206
|
+
*/
|
|
207
|
+
parseBasicGridConfigs(menuMeta) {
|
|
208
|
+
this.gridConfig = menuMeta.grid
|
|
209
|
+
this.gridColumnConfig = menuMeta.grid_column
|
|
210
|
+
this.searchConfig = menuMeta.search
|
|
211
|
+
this.gridEmphasized = menuMeta.gridEmphasized
|
|
212
|
+
}
|
|
220
213
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
214
|
+
/**
|
|
215
|
+
* @descrtiption 그리스트 구성 정보 파싱 처리
|
|
216
|
+
***************************************
|
|
217
|
+
*/
|
|
218
|
+
async parseGristConfigs() {
|
|
219
|
+
this.gristConfigSet = await MetaApi.parseGridConfigSet(this)
|
|
220
|
+
}
|
|
224
221
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
/********************************************************************
|
|
223
|
+
* C R U D Functions
|
|
224
|
+
********************************************************************/
|
|
228
225
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
async fetch() {
|
|
227
|
+
await this.grist.fetch()
|
|
228
|
+
}
|
|
232
229
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
let result = ValueUtil.isNotEmpty(patches) ? await this.updateMultiple(patches) : false
|
|
236
|
-
if (result) {
|
|
237
|
-
this.fetch()
|
|
230
|
+
back() {
|
|
231
|
+
history.back()
|
|
238
232
|
}
|
|
239
|
-
}
|
|
240
233
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
234
|
+
async save() {
|
|
235
|
+
let patches = MetaApi.patchesForUpdateMultiple(this.grist)
|
|
236
|
+
let result = ValueUtil.isNotEmpty(patches) ? await this.updateMultiple(patches) : false
|
|
237
|
+
if (result) {
|
|
238
|
+
this.fetch()
|
|
239
|
+
}
|
|
240
|
+
}
|
|
245
241
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if (result) {
|
|
250
|
-
this.fetch()
|
|
242
|
+
async find() {
|
|
243
|
+
let ids = MetaApi.getSelectedIdList(this.grist, true)
|
|
244
|
+
return ValueUtil.isNotEmpty(ids) ? await this.findOne(ids[0]) : {}
|
|
251
245
|
}
|
|
252
|
-
}
|
|
253
246
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
247
|
+
async delete() {
|
|
248
|
+
let ids = MetaApi.getSelectedIdList(this.grist, true)
|
|
249
|
+
let result = ValueUtil.isNotEmpty(ids) ? await this.deleteByIds(ids) : false
|
|
250
|
+
if (result) {
|
|
251
|
+
this.fetch()
|
|
252
|
+
}
|
|
253
|
+
}
|
|
258
254
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
255
|
+
async export() {
|
|
256
|
+
let exportTitle = TermsUtil.tTitle(ValueUtil.getParams(this.menuInfo, 'title'))
|
|
257
|
+
return await MetaApi.exportableData(this.isElement, exportTitle, this.grist)
|
|
258
|
+
}
|
|
262
259
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
this.grist.data = { page: 0, total: 0, limit: 0, records:[] };
|
|
260
|
+
async import() {
|
|
261
|
+
// TODO
|
|
266
262
|
}
|
|
267
|
-
}
|
|
268
263
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
264
|
+
async clear() {
|
|
265
|
+
if (this.grist) {
|
|
266
|
+
this.grist.data = { page: 0, total: 0, limit: 0, records: [] }
|
|
267
|
+
}
|
|
268
|
+
}
|
|
272
269
|
|
|
273
|
-
|
|
274
|
-
let
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
270
|
+
getData() {
|
|
271
|
+
let records = this.grist.___data.records
|
|
272
|
+
records = JSON.parse(JSON.stringify(records))
|
|
273
|
+
|
|
274
|
+
records.forEach(record => {
|
|
275
|
+
let keys = Object.keys(record)
|
|
276
|
+
keys.forEach(x => {
|
|
277
|
+
if (x.startsWith('__')) {
|
|
278
|
+
delete record[x]
|
|
279
|
+
}
|
|
280
|
+
})
|
|
279
281
|
})
|
|
280
|
-
})
|
|
281
282
|
|
|
282
|
-
|
|
283
|
+
return records
|
|
284
|
+
}
|
|
283
285
|
}
|
|
284
|
-
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PagePreferenceProviderImpl } from '@things-factory/personalization/dist-client/page-preference-provider-impl.js'
|
|
2
|
+
|
|
1
3
|
import { MetaApi } from '../utils/meta-api'
|
|
2
4
|
import { MetaUiUtil } from '../utils/meta-ui-util'
|
|
3
5
|
|
|
@@ -184,6 +186,8 @@ export const MetaTabDetailMixin = baseElement =>
|
|
|
184
186
|
await this.parseGristConfigs()
|
|
185
187
|
}
|
|
186
188
|
|
|
189
|
+
this.personalConfigProvider = new PagePreferenceProviderImpl(lifecycle.page, 'meta::tab-detail::ox-grist')
|
|
190
|
+
|
|
187
191
|
if (super.pageInitialized) {
|
|
188
192
|
await super.pageInitialized()
|
|
189
193
|
}
|