@things-factory/meta-ui 7.0.1-alpha.61 → 7.0.1-alpha.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/personalize/{personal-column-selector.js → personal-column-selector.ts} +111 -114
- package/client/utils/meta-api.js +12 -4
- package/client/utils/meta-ui-util.js +162 -39
- package/client/utils/service-util.js +93 -21
- package/dist-client/pages/personalize/personal-column-selector.d.ts +18 -26
- package/dist-client/pages/personalize/personal-column-selector.js +127 -124
- package/dist-client/pages/personalize/personal-column-selector.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/meta-api.d.ts +3 -3
- package/dist-client/utils/meta-api.js +3 -3
- package/dist-client/utils/meta-api.js.map +1 -1
- package/dist-client/utils/meta-ui-util.js +112 -27
- package/dist-client/utils/meta-ui-util.js.map +1 -1
- package/dist-client/utils/service-util.d.ts +1 -1
- package/dist-client/utils/service-util.js +58 -15
- package/dist-client/utils/service-util.js.map +1 -1
- package/dist-server/service/button-role/button-role-query.js +1 -1
- package/dist-server/service/button-role/button-role-query.js.map +1 -1
- package/dist-server/service/grid-personalize/grid-personalize-mutation.js +25 -1
- package/dist-server/service/grid-personalize/grid-personalize-mutation.js.map +1 -1
- package/dist-server/service/grid-personalize/grid-personalize-query.js +13 -12
- package/dist-server/service/grid-personalize/grid-personalize-query.js.map +1 -1
- package/dist-server/service/grid-personalize/grid-personalize-type.js +4 -4
- package/dist-server/service/grid-personalize/grid-personalize-type.js.map +1 -1
- package/dist-server/service/grid-personalize/grid-personalize.js +3 -3
- package/dist-server/service/grid-personalize/grid-personalize.js.map +1 -1
- package/dist-server/service/menu-button-auth/menu-button-auth-query.js +3 -3
- package/dist-server/service/menu-button-auth/menu-button-auth-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/button-role/button-role-query.ts +9 -4
- package/server/service/grid-personalize/grid-personalize-mutation.ts +37 -8
- package/server/service/grid-personalize/grid-personalize-query.ts +11 -12
- package/server/service/grid-personalize/grid-personalize-type.ts +5 -7
- package/server/service/grid-personalize/grid-personalize.ts +10 -7
- package/server/service/menu-button-auth/menu-button-auth-query.ts +31 -29
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js'
|
|
2
2
|
import '@operato/data-grist/ox-record-creator.js'
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
5
|
import { css, html, render, nothing } from 'lit'
|
|
6
6
|
|
|
7
|
+
import { client } from '@operato/graphql'
|
|
7
8
|
import { getEditor, getRenderer } from '@operato/data-grist'
|
|
8
9
|
import { getValueGenerators } from '@operato/time-calculator'
|
|
9
|
-
import
|
|
10
|
+
import moment from '@operato/moment-timezone-es'
|
|
11
|
+
import {
|
|
12
|
+
ScrollbarStyles,
|
|
13
|
+
CommonGristStyles,
|
|
14
|
+
CommonButtonStyles,
|
|
15
|
+
ButtonContainerStyles,
|
|
16
|
+
CommonHeaderStyles
|
|
17
|
+
} from '@operato/styles'
|
|
10
18
|
|
|
11
19
|
import { MetaCrypto } from './meta-crypto'
|
|
12
20
|
import { TermsUtil } from './terms-util'
|
|
@@ -36,7 +44,9 @@ export class MetaUiUtil {
|
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
if (!menu.template) {
|
|
39
|
-
throw new Error(
|
|
47
|
+
throw new Error(
|
|
48
|
+
TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${TermsUtil.tLabel('model')}` })
|
|
49
|
+
)
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
this.menuId = menuId
|
|
@@ -63,6 +73,25 @@ export class MetaUiUtil {
|
|
|
63
73
|
// return undefined;
|
|
64
74
|
// }
|
|
65
75
|
|
|
76
|
+
const response = await client.query({
|
|
77
|
+
query: gql`
|
|
78
|
+
query ($routing: String) {
|
|
79
|
+
menus(routing: $routing) {
|
|
80
|
+
id
|
|
81
|
+
template
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
myGridPersonalize(menuId: $menuId) {
|
|
85
|
+
id
|
|
86
|
+
template
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
`,
|
|
90
|
+
variables: {
|
|
91
|
+
routing: menuRouting
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
66
95
|
let filters = [{ name: 'routing', operator: 'eq', value: menuRouting }]
|
|
67
96
|
let data = await ServiceUtil.searchByPagination('menus', filters, null, 0, 0, 'id,template')
|
|
68
97
|
return data
|
|
@@ -93,10 +122,12 @@ export class MetaUiUtil {
|
|
|
93
122
|
if (!menu) {
|
|
94
123
|
throw new Error(TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${menuRouting}` }))
|
|
95
124
|
} else if (!menu.template) {
|
|
96
|
-
throw new Error(
|
|
125
|
+
throw new Error(
|
|
126
|
+
TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${TermsUtil.tLabel('model')}` })
|
|
127
|
+
)
|
|
97
128
|
}
|
|
98
129
|
|
|
99
|
-
|
|
130
|
+
pageView.menuId = menu.id
|
|
100
131
|
return JSON.parse(MetaCrypto.dec(menu.template))
|
|
101
132
|
}
|
|
102
133
|
|
|
@@ -470,7 +501,8 @@ export class MetaUiUtil {
|
|
|
470
501
|
let defaultName = defaultSet[0]
|
|
471
502
|
|
|
472
503
|
if (defaultValueGenerators.includes(defaultName)) {
|
|
473
|
-
column.record.defaultValue =
|
|
504
|
+
column.record.defaultValue =
|
|
505
|
+
defaultSet.length == 1 ? { name: defaultName } : { name: defaultName, params: { calc: defaultSet[1] } }
|
|
474
506
|
} else {
|
|
475
507
|
column.record.defaultValue = type === 'number' ? Number(default_value) : default_value
|
|
476
508
|
}
|
|
@@ -492,7 +524,9 @@ export class MetaUiUtil {
|
|
|
492
524
|
} else {
|
|
493
525
|
if (select_opt.type === 'code') {
|
|
494
526
|
// 공통 코드
|
|
495
|
-
column.record.options = await ServiceUtil.getCodeSelectorData(
|
|
527
|
+
column.record.options = await ServiceUtil.getCodeSelectorData(
|
|
528
|
+
select_opt.values ? select_opt.values : select_opt.name
|
|
529
|
+
)
|
|
496
530
|
} else if (select_opt.type === 'scenario') {
|
|
497
531
|
// 시나리오
|
|
498
532
|
column.record.options = await ServiceUtil.getCodeByScenario(select_opt.name, select_opt.args)
|
|
@@ -583,7 +617,9 @@ export class MetaUiUtil {
|
|
|
583
617
|
* @returns {Object}
|
|
584
618
|
*/
|
|
585
619
|
static getGridListSet(pageView) {
|
|
586
|
-
let gridList = {
|
|
620
|
+
let gridList = {
|
|
621
|
+
fields: [ValueUtil.getParams(pageView.menuInfo, 'name'), ValueUtil.getParams(pageView.menuInfo, 'desc')]
|
|
622
|
+
}
|
|
587
623
|
|
|
588
624
|
// 기본 리스트 설정과 메타에서 가져온 설정 merge
|
|
589
625
|
if (pageView.gridConfig.list) {
|
|
@@ -601,7 +637,9 @@ export class MetaUiUtil {
|
|
|
601
637
|
*/
|
|
602
638
|
static getGridRowSet(pageView) {
|
|
603
639
|
// 기본 옵션, 메타와 상관없이 그리드 로우 멀티 셀렉트는 false, click 이벤트는 없다.
|
|
604
|
-
let { multiple_select = false, click = undefined } = ValueUtil.isEmpty(pageView.gridConfig.row)
|
|
640
|
+
let { multiple_select = false, click = undefined } = ValueUtil.isEmpty(pageView.gridConfig.row)
|
|
641
|
+
? {}
|
|
642
|
+
: pageView.gridConfig.row
|
|
605
643
|
|
|
606
644
|
let retObject = {
|
|
607
645
|
selectable: { multiple: multiple_select },
|
|
@@ -677,7 +715,10 @@ export class MetaUiUtil {
|
|
|
677
715
|
title: 'data_history_list',
|
|
678
716
|
type: 'popup',
|
|
679
717
|
tagname: logicTxt == 'history_copy' ? 'history-copy-list-popup' : 'history-json-list-popup',
|
|
680
|
-
location:
|
|
718
|
+
location:
|
|
719
|
+
logicTxt == 'history_copy'
|
|
720
|
+
? 'pages/hgistory/history-copy-list-popup.js'
|
|
721
|
+
: 'pages/hgistory/history-json-list-popup.js',
|
|
681
722
|
menu: pageView.currentRouting,
|
|
682
723
|
size: 'large',
|
|
683
724
|
popup_field: 'open_param',
|
|
@@ -729,7 +770,9 @@ export class MetaUiUtil {
|
|
|
729
770
|
|
|
730
771
|
// CARD, LIST인 경우 컬럼 정보를 표시하기 위한 컬럼들 추출
|
|
731
772
|
let mobileDisplayColumns =
|
|
732
|
-
UiUtil.isMobileEnv() && pageView.etcConfig && pageView.etcConfig.mobile_display_columns
|
|
773
|
+
UiUtil.isMobileEnv() && pageView.etcConfig && pageView.etcConfig.mobile_display_columns
|
|
774
|
+
? pageView.etcConfig.mobile_display_columns.split(',')
|
|
775
|
+
: []
|
|
733
776
|
|
|
734
777
|
let defaultValueGenerators = Object.keys(getValueGenerators())
|
|
735
778
|
let columns = []
|
|
@@ -775,7 +818,8 @@ export class MetaUiUtil {
|
|
|
775
818
|
let defaultName = defaultSet[0]
|
|
776
819
|
|
|
777
820
|
if (defaultValueGenerators.includes(defaultName)) {
|
|
778
|
-
column.record.defaultValue =
|
|
821
|
+
column.record.defaultValue =
|
|
822
|
+
defaultSet.length == 1 ? { name: defaultName } : { name: defaultName, params: { calc: defaultSet[1] } }
|
|
779
823
|
} else {
|
|
780
824
|
column.record.defaultValue = type === 'number' ? Number(default_value) : default_value
|
|
781
825
|
}
|
|
@@ -834,7 +878,9 @@ export class MetaUiUtil {
|
|
|
834
878
|
} else {
|
|
835
879
|
// 공통 코드
|
|
836
880
|
if (select_opt.type === 'code') {
|
|
837
|
-
column.record.options = await ServiceUtil.getCodeSelectorData(
|
|
881
|
+
column.record.options = await ServiceUtil.getCodeSelectorData(
|
|
882
|
+
select_opt.values ? select_opt.values : select_opt.name
|
|
883
|
+
)
|
|
838
884
|
// 시나리오
|
|
839
885
|
} else if (select_opt.type === 'scenario') {
|
|
840
886
|
column.record.options = await ServiceUtil.getCodeByScenario(select_opt.name, select_opt.args)
|
|
@@ -896,7 +942,7 @@ export class MetaUiUtil {
|
|
|
896
942
|
}
|
|
897
943
|
|
|
898
944
|
// 개인 그리드 컬럼 설정 가져오기
|
|
899
|
-
let personal = await MetaApi.
|
|
945
|
+
let personal = await MetaApi.getMyMenuGridPersnal(this.menuId)
|
|
900
946
|
let { template = {} } = personal
|
|
901
947
|
if (!template.master) {
|
|
902
948
|
// 설정이 없으면 그대로 리턴
|
|
@@ -1003,10 +1049,22 @@ export class MetaUiUtil {
|
|
|
1003
1049
|
let defValue = col.filter.value
|
|
1004
1050
|
let dateKeywords = ['today', 'year', 'month', 'date', 'hour', 'min', 'sec']
|
|
1005
1051
|
|
|
1006
|
-
if (
|
|
1052
|
+
if (
|
|
1053
|
+
defValue &&
|
|
1054
|
+
typeof defValue == 'string' &&
|
|
1055
|
+
dateKeywords.filter(x => defValue.startsWith(x)).length > 0
|
|
1056
|
+
) {
|
|
1007
1057
|
let defRes = []
|
|
1008
1058
|
let dateFormat = { date: 'YYYY-MM-DD', datetime: 'YYYY-MM-DD HH:mm:ss' }
|
|
1009
|
-
let durationType = {
|
|
1059
|
+
let durationType = {
|
|
1060
|
+
today: 'day',
|
|
1061
|
+
year: 'year',
|
|
1062
|
+
month: 'month',
|
|
1063
|
+
date: 'day',
|
|
1064
|
+
hour: 'hour',
|
|
1065
|
+
min: 'minute',
|
|
1066
|
+
sec: 'second'
|
|
1067
|
+
}
|
|
1010
1068
|
let defDates = defValue.split(',')
|
|
1011
1069
|
|
|
1012
1070
|
defDates.forEach(x => {
|
|
@@ -1018,12 +1076,19 @@ export class MetaUiUtil {
|
|
|
1018
1076
|
let wordSplits = x.split('-')
|
|
1019
1077
|
let key = wordSplits[0]
|
|
1020
1078
|
let value = wordSplits[1]
|
|
1021
|
-
defRes.push(
|
|
1079
|
+
defRes.push(
|
|
1080
|
+
todayMoment
|
|
1081
|
+
.subtract(value, durationType[key])
|
|
1082
|
+
.startOf(durationType[key])
|
|
1083
|
+
.format(dateFormat[col.type])
|
|
1084
|
+
)
|
|
1022
1085
|
} else if (x.includes('+')) {
|
|
1023
1086
|
let wordSplits = x.split('+')
|
|
1024
1087
|
let key = wordSplits[0]
|
|
1025
1088
|
let value = wordSplits[1]
|
|
1026
|
-
defRes.push(
|
|
1089
|
+
defRes.push(
|
|
1090
|
+
todayMoment.add(value, durationType[key]).startOf(durationType[key]).format(dateFormat[col.type])
|
|
1091
|
+
)
|
|
1027
1092
|
}
|
|
1028
1093
|
})
|
|
1029
1094
|
|
|
@@ -1085,7 +1150,14 @@ export class MetaUiUtil {
|
|
|
1085
1150
|
: buttonConfig
|
|
1086
1151
|
.filter(b => b.name != 'export' && b.name != 'import' && b.name != 'add')
|
|
1087
1152
|
.map(btn => {
|
|
1088
|
-
let {
|
|
1153
|
+
let {
|
|
1154
|
+
name = undefined,
|
|
1155
|
+
label = undefined,
|
|
1156
|
+
style = undefined,
|
|
1157
|
+
type = 'basic',
|
|
1158
|
+
action = undefined,
|
|
1159
|
+
logic = undefined
|
|
1160
|
+
} = btn
|
|
1089
1161
|
|
|
1090
1162
|
if (ValueUtil.isEmpty(name)) {
|
|
1091
1163
|
return { title: '-1' }
|
|
@@ -1129,7 +1201,14 @@ export class MetaUiUtil {
|
|
|
1129
1201
|
: buttonConfig
|
|
1130
1202
|
.filter(b => b.name != 'add')
|
|
1131
1203
|
.map(b => {
|
|
1132
|
-
let {
|
|
1204
|
+
let {
|
|
1205
|
+
name = undefined,
|
|
1206
|
+
label = undefined,
|
|
1207
|
+
style = undefined,
|
|
1208
|
+
type = 'basic',
|
|
1209
|
+
action = undefined,
|
|
1210
|
+
logic = undefined
|
|
1211
|
+
} = b
|
|
1133
1212
|
|
|
1134
1213
|
if (ValueUtil.isEmpty(label)) label = name
|
|
1135
1214
|
if (ValueUtil.isEmpty(style)) style = name
|
|
@@ -1233,7 +1312,8 @@ export class MetaUiUtil {
|
|
|
1233
1312
|
.map(x => {
|
|
1234
1313
|
if (Object.keys(action.param_field).includes(x)) {
|
|
1235
1314
|
let data = record[x]
|
|
1236
|
-
passParams[action.param_field[x]] =
|
|
1315
|
+
passParams[action.param_field[x]] =
|
|
1316
|
+
Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
|
|
1237
1317
|
}
|
|
1238
1318
|
})
|
|
1239
1319
|
}
|
|
@@ -1417,7 +1497,8 @@ export class MetaUiUtil {
|
|
|
1417
1497
|
.map(x => {
|
|
1418
1498
|
if (Object.keys(logic.param_field).includes(x)) {
|
|
1419
1499
|
let data = record[x]
|
|
1420
|
-
recordParams[logic.param_field[x]] =
|
|
1500
|
+
recordParams[logic.param_field[x]] =
|
|
1501
|
+
Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
|
|
1421
1502
|
}
|
|
1422
1503
|
})
|
|
1423
1504
|
return recordParams
|
|
@@ -1557,7 +1638,9 @@ export class MetaUiUtil {
|
|
|
1557
1638
|
|
|
1558
1639
|
// closeCallback
|
|
1559
1640
|
let closeCallback =
|
|
1560
|
-
action.after && typeof action.after === 'string' && action.after === 'fetch' && pageView && pageView.fetch
|
|
1641
|
+
action.after && typeof action.after === 'string' && action.after === 'fetch' && pageView && pageView.fetch
|
|
1642
|
+
? pageView.fetch.bind(pageView)
|
|
1643
|
+
: undefined
|
|
1561
1644
|
|
|
1562
1645
|
// 팝업 오픈
|
|
1563
1646
|
UiUtil.openDynamicPopup(title, action, record, closeCallback)
|
|
@@ -1651,7 +1734,8 @@ export class MetaUiUtil {
|
|
|
1651
1734
|
.map(x => {
|
|
1652
1735
|
if (Object.keys(after.param_field).includes(x)) {
|
|
1653
1736
|
let data = record[x]
|
|
1654
|
-
recordParams[after.param_field[x]] =
|
|
1737
|
+
recordParams[after.param_field[x]] =
|
|
1738
|
+
Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
|
|
1655
1739
|
}
|
|
1656
1740
|
})
|
|
1657
1741
|
return recordParams
|
|
@@ -2670,8 +2754,8 @@ export class MetaUiUtil {
|
|
|
2670
2754
|
fields += ['meta-object-selector', 'object', 'resource-object'].includes(c.type)
|
|
2671
2755
|
? `${c.name}\n{${MetaUiUtil.getObjctColumnSelectFields(c)}}`
|
|
2672
2756
|
: c.type == 'board'
|
|
2673
|
-
|
|
2674
|
-
|
|
2757
|
+
? `${c.name}\n{${'\nid\nname\nthumbnail'}}`
|
|
2758
|
+
: c.name
|
|
2675
2759
|
})
|
|
2676
2760
|
|
|
2677
2761
|
return fields
|
|
@@ -2686,7 +2770,11 @@ export class MetaUiUtil {
|
|
|
2686
2770
|
static getObjctColumnSelectFields(gridCol) {
|
|
2687
2771
|
let colStr = ''
|
|
2688
2772
|
|
|
2689
|
-
if (
|
|
2773
|
+
if (
|
|
2774
|
+
ValueUtil.isNotEmpty(gridCol.record) &&
|
|
2775
|
+
ValueUtil.isNotEmpty(gridCol.record.options) &&
|
|
2776
|
+
ValueUtil.isNotEmpty(gridCol.record.options.select)
|
|
2777
|
+
) {
|
|
2690
2778
|
// 설정에 정의가 되어 있으면
|
|
2691
2779
|
gridCol.record.options.select.forEach(x => {
|
|
2692
2780
|
if (x.name && x.name !== '') {
|
|
@@ -2721,7 +2809,13 @@ export class MetaUiUtil {
|
|
|
2721
2809
|
let gristElementId = pageView.gristId ? pageView.gristId : 'ox-grist'
|
|
2722
2810
|
let gridMode = pageView.gridMode
|
|
2723
2811
|
return html`
|
|
2724
|
-
<ox-grist
|
|
2812
|
+
<ox-grist
|
|
2813
|
+
id=${gristElementId}
|
|
2814
|
+
.config=${gristConfigSet}
|
|
2815
|
+
.mode=${gridMode}
|
|
2816
|
+
auto-fetch
|
|
2817
|
+
.fetchHandler=${pageView.fetchHandler.bind(pageView)}
|
|
2818
|
+
>
|
|
2725
2819
|
${MetaUiUtil.getGridDetailHtml(pageView)}
|
|
2726
2820
|
</ox-grist>
|
|
2727
2821
|
`
|
|
@@ -2846,7 +2940,13 @@ export class MetaUiUtil {
|
|
|
2846
2940
|
><span>${mandatory ? '*' : ''}${column.header_txt}</span>
|
|
2847
2941
|
${editable ? html`<md-icon>edit</md-icon>` : ''}
|
|
2848
2942
|
</label>
|
|
2849
|
-
<ox-grid-field
|
|
2943
|
+
<ox-grid-field
|
|
2944
|
+
.rowIndex=${rowIndex}
|
|
2945
|
+
.column=${column}
|
|
2946
|
+
.record=${record}
|
|
2947
|
+
.value=${record[column.name]}
|
|
2948
|
+
?dirty=${!!dirtyFields[column.name]}
|
|
2949
|
+
></ox-grid-field>
|
|
2850
2950
|
`
|
|
2851
2951
|
})}
|
|
2852
2952
|
</div>
|
|
@@ -2874,7 +2974,11 @@ export class MetaUiUtil {
|
|
|
2874
2974
|
let key = tab.name
|
|
2875
2975
|
|
|
2876
2976
|
return html`
|
|
2877
|
-
<div
|
|
2977
|
+
<div
|
|
2978
|
+
class="tab"
|
|
2979
|
+
?activate="${key === pageView.currentTabKey}"
|
|
2980
|
+
@click="${() => (pageView.currentTabKey = key)}"
|
|
2981
|
+
>
|
|
2878
2982
|
${tab.icon ? html`<md-icon>${tab.icon}</md-icon>` : html``}
|
|
2879
2983
|
<span>${label}</span>
|
|
2880
2984
|
</div>
|
|
@@ -2889,7 +2993,9 @@ export class MetaUiUtil {
|
|
|
2889
2993
|
displayStyle = 'display:flex'
|
|
2890
2994
|
}
|
|
2891
2995
|
|
|
2892
|
-
return html`
|
|
2996
|
+
return html`
|
|
2997
|
+
<div class="tab-contents" style="${displayStyle}">${MetaUiUtil.getBasicTabContent(pageView, tab)}</div>
|
|
2998
|
+
`
|
|
2893
2999
|
})}
|
|
2894
3000
|
</div>
|
|
2895
3001
|
`
|
|
@@ -2926,7 +3032,9 @@ export class MetaUiUtil {
|
|
|
2926
3032
|
</div>
|
|
2927
3033
|
`}
|
|
2928
3034
|
<div id="container" class="container" style="${layoutContainerStyle}">
|
|
2929
|
-
<div class="container_detail"
|
|
3035
|
+
<div class="container_detail">
|
|
3036
|
+
${MetaApi.getBasicGristHtml(pageView)} ${MetaUiUtil.getButtonContainer(pageView)}
|
|
3037
|
+
</div>
|
|
2930
3038
|
<div class="container_detail">
|
|
2931
3039
|
${pageView.is_activity === true
|
|
2932
3040
|
? html`${pageView.is_readonly === true
|
|
@@ -2948,8 +3056,17 @@ export class MetaUiUtil {
|
|
|
2948
3056
|
>
|
|
2949
3057
|
</meta-tab-element>`}`
|
|
2950
3058
|
: html`${pageView.is_readonly === true
|
|
2951
|
-
? html`<meta-tab-element
|
|
2952
|
-
|
|
3059
|
+
? html`<meta-tab-element
|
|
3060
|
+
id="detail"
|
|
3061
|
+
route_name="${currentRouting}"
|
|
3062
|
+
is_readonly="true"
|
|
3063
|
+
is_detail="true"
|
|
3064
|
+
></meta-tab-element>`
|
|
3065
|
+
: html`<meta-tab-element
|
|
3066
|
+
id="detail"
|
|
3067
|
+
route_name="${currentRouting}"
|
|
3068
|
+
is_detail="true"
|
|
3069
|
+
></meta-tab-element>`}`}
|
|
2953
3070
|
</div>
|
|
2954
3071
|
</div>
|
|
2955
3072
|
`
|
|
@@ -3075,8 +3192,8 @@ export class MetaUiUtil {
|
|
|
3075
3192
|
${detailInfo.tagname == '' || detailInfo.tagname == 'meta-tab-element'
|
|
3076
3193
|
? html``
|
|
3077
3194
|
: detailInfo.display
|
|
3078
|
-
|
|
3079
|
-
|
|
3195
|
+
? html`<h2 id="detail_title"><md-icon>list_alt</md-icon>${TermsUtil.tTitle(`${detailInfo.display}`)}</h2>`
|
|
3196
|
+
: html``}
|
|
3080
3197
|
${pageView.detailElement}
|
|
3081
3198
|
</div>
|
|
3082
3199
|
</div>
|
|
@@ -3264,13 +3381,19 @@ export class MetaUiUtil {
|
|
|
3264
3381
|
return html`
|
|
3265
3382
|
<div id="modes">
|
|
3266
3383
|
${pageView.gridViewOptions.includes('GRID')
|
|
3267
|
-
? html`<md-icon @click="${() => (pageView.gridMode = 'GRID')}" ?active="${pageView.gridMode == 'GRID'}"
|
|
3384
|
+
? html`<md-icon @click="${() => (pageView.gridMode = 'GRID')}" ?active="${pageView.gridMode == 'GRID'}"
|
|
3385
|
+
>grid_on</md-icon
|
|
3386
|
+
>`
|
|
3268
3387
|
: ``}
|
|
3269
3388
|
${pageView.gridViewOptions.includes('LIST')
|
|
3270
|
-
? html`<md-icon @click="${() => (pageView.gridMode = 'LIST')}" ?active="${pageView.gridMode == 'LIST'}"
|
|
3389
|
+
? html`<md-icon @click="${() => (pageView.gridMode = 'LIST')}" ?active="${pageView.gridMode == 'LIST'}"
|
|
3390
|
+
>format_list_bulleted</md-icon
|
|
3391
|
+
>`
|
|
3271
3392
|
: ``}
|
|
3272
3393
|
${pageView.gridViewOptions.includes('CARD')
|
|
3273
|
-
? html`<md-icon @click="${() => (pageView.gridMode = 'CARD')}" ?active="${pageView.gridMode == 'CARD'}"
|
|
3394
|
+
? html`<md-icon @click="${() => (pageView.gridMode = 'CARD')}" ?active="${pageView.gridMode == 'CARD'}"
|
|
3395
|
+
>apps</md-icon
|
|
3396
|
+
>`
|
|
3274
3397
|
: ``}
|
|
3275
3398
|
</div>
|
|
3276
3399
|
`
|
|
@@ -72,7 +72,13 @@ export class ServiceUtil {
|
|
|
72
72
|
*/
|
|
73
73
|
static async getCodeByScenario(scenarioName, variables) {
|
|
74
74
|
let response = await ServiceUtil.callScenario(null, scenarioName, variables, false)
|
|
75
|
-
if (
|
|
75
|
+
if (
|
|
76
|
+
response &&
|
|
77
|
+
response.data &&
|
|
78
|
+
response.data.runScenario &&
|
|
79
|
+
response.data.runScenario.result &&
|
|
80
|
+
response.data.runScenario.result.result
|
|
81
|
+
) {
|
|
76
82
|
let codes = response.data.runScenario.result.result
|
|
77
83
|
codes.unshift({ value: '', display: '' })
|
|
78
84
|
return codes.map(x => {
|
|
@@ -187,15 +193,25 @@ export class ServiceUtil {
|
|
|
187
193
|
**********************************************************
|
|
188
194
|
* @returns {Object} 그리드 개인화 오브젝트
|
|
189
195
|
*/
|
|
190
|
-
static async
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
196
|
+
static async getMyMenuGridPersnal(menuId) {
|
|
197
|
+
try {
|
|
198
|
+
const response = await client.query({
|
|
199
|
+
query: gql`
|
|
200
|
+
query myGridPersonalize($menuId: String!) {
|
|
201
|
+
myGridPersonalize(menuId: $menuId) {
|
|
202
|
+
id
|
|
203
|
+
template
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
`,
|
|
207
|
+
variables: {
|
|
208
|
+
menuId
|
|
209
|
+
}
|
|
210
|
+
})
|
|
194
211
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return { id: result.records[0].id, template: JSON.parse(result.records[0].template) }
|
|
212
|
+
return response.data.myGridPersonalize
|
|
213
|
+
} catch (e) {
|
|
214
|
+
ServiceUtil.showGraphqlException(e)
|
|
199
215
|
}
|
|
200
216
|
}
|
|
201
217
|
|
|
@@ -235,7 +251,14 @@ export class ServiceUtil {
|
|
|
235
251
|
let mainMenus = menuData
|
|
236
252
|
.map(item => {
|
|
237
253
|
if (item.menuType == 'GROUP' || item.menuType == 'MENU') {
|
|
238
|
-
let pMenu = {
|
|
254
|
+
let pMenu = {
|
|
255
|
+
id: item.id,
|
|
256
|
+
parent: true,
|
|
257
|
+
name: TermsUtil.tMenu(item.name),
|
|
258
|
+
icon: item.iconPath,
|
|
259
|
+
type: item.menuType == 'GROUP' ? 'group' : '',
|
|
260
|
+
menus: []
|
|
261
|
+
}
|
|
239
262
|
|
|
240
263
|
if (item.routing) {
|
|
241
264
|
pMenu.path = item.routing
|
|
@@ -433,7 +456,10 @@ export class ServiceUtil {
|
|
|
433
456
|
static async exportableData(isElement, exportTitle, grist) {
|
|
434
457
|
// 1. 헤더 설정
|
|
435
458
|
var headerSetting = grist._config.columns
|
|
436
|
-
.filter(
|
|
459
|
+
.filter(
|
|
460
|
+
column =>
|
|
461
|
+
column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined && column.hidden !== true
|
|
462
|
+
)
|
|
437
463
|
.map(column => {
|
|
438
464
|
return column.imex
|
|
439
465
|
})
|
|
@@ -443,9 +469,17 @@ export class ServiceUtil {
|
|
|
443
469
|
var data = records.map(item => {
|
|
444
470
|
return {
|
|
445
471
|
...grist._config.columns
|
|
446
|
-
.filter(
|
|
472
|
+
.filter(
|
|
473
|
+
column =>
|
|
474
|
+
column.type !== 'gutter' &&
|
|
475
|
+
column.record !== undefined &&
|
|
476
|
+
column.imex !== undefined &&
|
|
477
|
+
column.hidden !== true
|
|
478
|
+
)
|
|
447
479
|
.reduce((record, column) => {
|
|
448
|
-
record[column.imex.key] = column.imex.key
|
|
480
|
+
record[column.imex.key] = column.imex.key
|
|
481
|
+
.split('.')
|
|
482
|
+
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
449
483
|
return record
|
|
450
484
|
}, {})
|
|
451
485
|
}
|
|
@@ -804,16 +838,38 @@ export class ServiceUtil {
|
|
|
804
838
|
for (let key in mandatoryColumns) {
|
|
805
839
|
if (record[key] === undefined || record[key] == '') {
|
|
806
840
|
console.log(record)
|
|
807
|
-
UiUtil.showAlertPopup(
|
|
841
|
+
UiUtil.showAlertPopup(
|
|
842
|
+
'text.check-mandatory',
|
|
843
|
+
TermsUtil.tText('check-mandatory-field', { x: mandatoryColumns[key] }),
|
|
844
|
+
'info',
|
|
845
|
+
'confirm'
|
|
846
|
+
)
|
|
808
847
|
return
|
|
809
848
|
}
|
|
810
849
|
}
|
|
811
850
|
|
|
812
851
|
// 레코드 정보에서 저장 가능 유형으로 변환
|
|
813
852
|
for (let key in record) {
|
|
814
|
-
if (
|
|
853
|
+
if (
|
|
854
|
+
![
|
|
855
|
+
'creator',
|
|
856
|
+
'updater',
|
|
857
|
+
'createdAt',
|
|
858
|
+
'updatedAt',
|
|
859
|
+
'__dirty__',
|
|
860
|
+
'__dirtyfields__',
|
|
861
|
+
'__origin__',
|
|
862
|
+
'__seq__',
|
|
863
|
+
'__selected__'
|
|
864
|
+
].includes(key)
|
|
865
|
+
) {
|
|
815
866
|
// code-input 타입은 오브젝트 값을 가지지만 id 만 가져가지 않는다. 예외 처리
|
|
816
|
-
if (
|
|
867
|
+
if (
|
|
868
|
+
codeInputColumns.includes(key) == false &&
|
|
869
|
+
record[key] &&
|
|
870
|
+
typeof record[key] === 'object' &&
|
|
871
|
+
isObjectOrigin == false
|
|
872
|
+
) {
|
|
817
873
|
patchData[key] = { id: record[key].id }
|
|
818
874
|
} else {
|
|
819
875
|
patchData[key] = record[key]
|
|
@@ -1015,11 +1071,15 @@ export class ServiceUtil {
|
|
|
1015
1071
|
? ValueUtil.isNotEmpty(filterParam)
|
|
1016
1072
|
? filterParam[action.id_field]
|
|
1017
1073
|
: Array.isArray(dataParams)
|
|
1018
|
-
|
|
1019
|
-
|
|
1074
|
+
? dataParams[0][action.id_field]
|
|
1075
|
+
: dataParams[action.id_field]
|
|
1020
1076
|
: null
|
|
1021
1077
|
// 6. Mutation 호출
|
|
1022
|
-
let response = await ServiceUtil.callMutation(
|
|
1078
|
+
let response = await ServiceUtil.callMutation(
|
|
1079
|
+
action,
|
|
1080
|
+
idValue,
|
|
1081
|
+
ValueUtil.isEmpty(mutationParams) ? dataParams : mutationParams
|
|
1082
|
+
)
|
|
1023
1083
|
|
|
1024
1084
|
if (!response.errors) {
|
|
1025
1085
|
UiUtil.showToast('info', TermsUtil.tText('success to process'))
|
|
@@ -1210,7 +1270,13 @@ export class ServiceUtil {
|
|
|
1210
1270
|
let confirm = true
|
|
1211
1271
|
|
|
1212
1272
|
if (buttonName && useMessage === true) {
|
|
1213
|
-
const anwer = await UiUtil.showAlertPopup(
|
|
1273
|
+
const anwer = await UiUtil.showAlertPopup(
|
|
1274
|
+
'button.' + buttonName,
|
|
1275
|
+
'text.are_you_sure',
|
|
1276
|
+
'question',
|
|
1277
|
+
'confirm',
|
|
1278
|
+
'cancel'
|
|
1279
|
+
)
|
|
1214
1280
|
confirm = anwer.value
|
|
1215
1281
|
}
|
|
1216
1282
|
|
|
@@ -1253,7 +1319,13 @@ export class ServiceUtil {
|
|
|
1253
1319
|
* @returns {Boolean} 에러가 없으면 true 그렇지 않으면 false
|
|
1254
1320
|
*/
|
|
1255
1321
|
static checkClientError(response) {
|
|
1256
|
-
if (
|
|
1322
|
+
if (
|
|
1323
|
+
response &&
|
|
1324
|
+
response.data &&
|
|
1325
|
+
response.data.runScenario &&
|
|
1326
|
+
response.data.runScenario.result &&
|
|
1327
|
+
response.data.runScenario.result.error
|
|
1328
|
+
) {
|
|
1257
1329
|
let scenarioError = response.data.runScenario.result.error
|
|
1258
1330
|
UiUtil.showAlertPopup(scenarioError.title, scenarioError.message, 'error', 'confirm')
|
|
1259
1331
|
return false
|