@steedos/service-plugin-amis 2.6.2-beta.9 → 2.6.3
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/main/default/client/amis.render.client.js +6 -0
- package/main/default/pages/apps_form.page.amis.json +40 -53
- package/main/default/pages/listview_form.page.amis.json +115 -31
- package/main/default/pages/object_layouts_form.page.amis.json +485 -32
- package/main/default/pages/space_user_info_record.page.amis.json +1 -1
- package/main/default/services/metadata/listviews.service.js +1 -0
- package/main/default/services/utils/fields/index.js +4 -1
- package/package.json +2 -2
- package/public/tailwind/tailwind-steedos.css +10 -11
- package/public/translations/amis/zh-CN.json +1 -1
|
@@ -59,6 +59,12 @@
|
|
|
59
59
|
// window.React = window.__React;
|
|
60
60
|
// window.ReactDOM = window.__ReactDOM;
|
|
61
61
|
const AmisRenderers = [];
|
|
62
|
+
let amis = (window.amisRequire && window.amisRequire('amis')) || window.Amis;
|
|
63
|
+
let amisVersion = amis && amis.version;
|
|
64
|
+
if(amisVersion){
|
|
65
|
+
const amisVersionClassName = "amis-" + amisVersion.split(".")[0] + "-" + amisVersion.split(".")[1];
|
|
66
|
+
document.getElementsByTagName('body')[0].className += " " + amisVersionClassName;
|
|
67
|
+
}
|
|
62
68
|
let amisLib = amisRequire('amis');
|
|
63
69
|
amisLib.registerFilter('t', function (key,param) {
|
|
64
70
|
return typeof key === 'string' ? window.t(key,param) : key;
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"tab_items": {
|
|
14
14
|
"amis": {
|
|
15
15
|
"name": "tab_items",
|
|
16
|
-
"type": "
|
|
16
|
+
"type": "steedos-input-table",
|
|
17
|
+
"label": "",
|
|
18
|
+
"showIndex": true,
|
|
17
19
|
"source": "${tab_items}",
|
|
18
20
|
"strictMode": true,
|
|
19
21
|
"affixHeader": false,
|
|
@@ -22,68 +24,49 @@
|
|
|
22
24
|
"removable": true,
|
|
23
25
|
"draggable": false,
|
|
24
26
|
"headerToolbarClassName": "px-1 pb-3",
|
|
25
|
-
"
|
|
27
|
+
"fields": [
|
|
26
28
|
{
|
|
27
|
-
"name": "index",
|
|
28
|
-
"label": "${'apps.apps_form.tab_number'| t}",
|
|
29
|
-
"type": "tpl",
|
|
30
|
-
"tpl": "${index+1}",
|
|
31
|
-
"className": "w-10",
|
|
32
|
-
"id": "u:c59784421c37"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "tab_name_label",
|
|
36
29
|
"label": "${'apps.apps_form.tab' | t}",
|
|
37
|
-
"type": "
|
|
38
|
-
"
|
|
39
|
-
"
|
|
30
|
+
"type": "lookup",
|
|
31
|
+
"multiple": false,
|
|
32
|
+
"is_wide": false,
|
|
33
|
+
"required": true,
|
|
34
|
+
"reference_to": "tabs",
|
|
35
|
+
"reference_to_field": "name",
|
|
36
|
+
"sort_no": 30,
|
|
37
|
+
"name": "tab_name",
|
|
38
|
+
"hidden": false,
|
|
39
|
+
"readonly": false,
|
|
40
|
+
"disabled": false,
|
|
41
|
+
"_prefix": "tab_items."
|
|
40
42
|
},
|
|
41
43
|
{
|
|
42
|
-
"name": "group",
|
|
43
44
|
"label": "${'apps.apps_form.tab_grouping' | t}",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
45
|
+
"name": "group",
|
|
46
|
+
"_prefix": "tab_items.",
|
|
47
|
+
"type": "text",
|
|
48
|
+
"amis": {
|
|
46
49
|
"type": "select",
|
|
47
|
-
"
|
|
48
|
-
"className": "m-0",
|
|
50
|
+
"source": "${tab_groups|pick:group_name}",
|
|
49
51
|
"onEvent": {
|
|
50
52
|
"change": {
|
|
51
53
|
"actions": [
|
|
52
54
|
{
|
|
53
55
|
"actionType": "custom",
|
|
54
|
-
"script": "const tabGroupKey = \"group\";const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const quickEidtSaveForTab = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super
|
|
56
|
+
"script": "const tabGroupKey = \"group\";const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const quickEidtSaveForTab = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super; const tab_name = rowValue.tab_name; rowValue[prop_name] = currentPropValue; delete rowValue.index; let newTabs = formValue.tab_items.map(function (item) { if (item.tab_name == tab_name) { return Object.assign({}, item, rowValue); } else { return item; } }); const tabGroups = input.__super.__super.tab_groups; const groupNames = _.compact(_.map(tabGroups, \"group_name\")); if (groupNames && groupNames.length) { newTabs.sort(getTabsSortFun(groupNames)); } return { tab_items: newTabs }};const eventData = event.data;const newTabTtemsProp = quickEidtSaveForTab(eventData, \"group\");setTimeout(function () { doAction({ actionType: 'setValue', componentId: \"object_form\", args: { value: newTabTtemsProp } });},300);"
|
|
55
57
|
}
|
|
56
58
|
]
|
|
57
59
|
}
|
|
58
60
|
},
|
|
59
|
-
"
|
|
60
|
-
"checkAll": false,
|
|
61
|
-
"selectFirst": false,
|
|
62
|
-
"searchable": true,
|
|
63
|
-
"clearable": true,
|
|
64
|
-
"id": "u:8b3d6979e884",
|
|
65
|
-
"multiple": false,
|
|
66
|
-
"mode": "inline"
|
|
61
|
+
"placeholder": "-"
|
|
67
62
|
},
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"tpl": "${tabs_options|filter:value:equals:tab_name|first|pick:desktop|isTrue:'✔':'✘'}",
|
|
76
|
-
"placeholder": "-",
|
|
77
|
-
"remark": "${'apps.apps_form.tab_desktop_remark' | t}"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"name": "tab_name_mobile",
|
|
81
|
-
"label": "${'apps.apps_form.tab_mobile' | t}",
|
|
82
|
-
"type": "tpl",
|
|
83
|
-
"id": "u:b95c69a1cd84",
|
|
84
|
-
"tpl": "${tabs_options|filter:value:equals:tab_name|first|pick:mobile|isTrue:'✔':'✘'}",
|
|
85
|
-
"placeholder": "-",
|
|
86
|
-
"remark": "${'apps.apps_form.tab_mobile_remark' | t}"
|
|
63
|
+
"className": "m-0",
|
|
64
|
+
"checkAll": false,
|
|
65
|
+
"selectFirst": false,
|
|
66
|
+
"searchable": true,
|
|
67
|
+
"clearable": true,
|
|
68
|
+
"multiple": false,
|
|
69
|
+
"mode": "inline"
|
|
87
70
|
}
|
|
88
71
|
],
|
|
89
72
|
"headerToolbar": [
|
|
@@ -132,7 +115,7 @@
|
|
|
132
115
|
"actions": [
|
|
133
116
|
{
|
|
134
117
|
"actionType": "custom",
|
|
135
|
-
"script": "const tabGroupKey = 'group';const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const clearTabs = function (input) { return { tab_items: [] }};const convertDataForTabs = function (input) { let pickedTabs = input.picked_tabs || [];
|
|
118
|
+
"script": "const tabGroupKey = 'group';const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const clearTabs = function (input) { return { tab_items: [] }};const convertDataForTabs = function (input) { let pickedTabs = input.picked_tabs || []; const superTabs = _.keyBy(input.__super.tab_items, 'tab_name'); if (typeof pickedTabs === 'string') { pickedTabs = pickedTabs.split(','); } const tabOptions = _.keyBy(input.__super.tabs_options, 'value'); const convertedTabs = pickedTabs.map(function (tab_name) { const superTab = superTabs[tab_name]; if (superTab) { return superTab; } else { const tabOption = tabOptions[tab_name]; return { tab_name: tab_name, group: tabOption.group } } }); const tabGroups = input.__super.tab_groups; const groupNames = _.compact(_.map(tabGroups, 'group_name')); if (groupNames && groupNames.length) { convertedTabs.sort(getTabsSortFun(groupNames)); } return { tab_items: convertedTabs }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: 'object_form', args: { value: convertDataForTabs(eventData) }});doAction({ actionType: 'setValue', componentId: 'tabs-options-service', args: { value: convertDataForTabs(eventData) }});"
|
|
136
119
|
}
|
|
137
120
|
]
|
|
138
121
|
}
|
|
@@ -185,7 +168,7 @@
|
|
|
185
168
|
"actions": [
|
|
186
169
|
{
|
|
187
170
|
"actionType": "custom",
|
|
188
|
-
"script": "const tabGroupKey = 'group'
|
|
171
|
+
"script": "const tabGroupKey = 'group';\nconst getTabsSortFun = function (groupNames) {\n return function (m, n) {\n var tempM = !!m[tabGroupKey] ? 1 : 0;\n var tempN = !!n[tabGroupKey] ? 1 : 0;\n if (!m[tabGroupKey] || !n[tabGroupKey]) {\n return tempM - tempN;\n }\n return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]);\n };\n};\nconst clearTabs = function (input) { return { tab_items: [] } };\nconst convertDataForGroups = function (input) {\n \n const settingGroups = input.setting_groups || [];\n const convertedGroups = _.uniqBy(settingGroups.map(function (item) {\n return { group_name: item.group_name, default_open: item.default_open }\n }), 'group_name');\n const groupNames = _.compact(_.map(convertedGroups, 'group_name'));\n const tab_items = input.tab_items;\n tab_items?.sort(getTabsSortFun(groupNames));\n \n return { tab_groups: convertedGroups, tab_items: tab_items }\n};\nconst eventData = event.data;\ndoAction(\n {\n actionType: 'setValue',\n componentId: 'object_form',\n args: { value: convertDataForGroups(eventData) }\n }\n);"
|
|
189
172
|
}
|
|
190
173
|
]
|
|
191
174
|
}
|
|
@@ -203,7 +186,8 @@
|
|
|
203
186
|
"id": "u:111b043b193c"
|
|
204
187
|
}
|
|
205
188
|
],
|
|
206
|
-
"messages": {
|
|
189
|
+
"messages": {
|
|
190
|
+
},
|
|
207
191
|
"api": {
|
|
208
192
|
"method": "post",
|
|
209
193
|
"url": "${context.rootUrl}/graphql",
|
|
@@ -215,11 +199,13 @@
|
|
|
215
199
|
"headers": {
|
|
216
200
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
217
201
|
},
|
|
218
|
-
"messages": {
|
|
202
|
+
"messages": {
|
|
203
|
+
},
|
|
219
204
|
"requestAdaptor": ""
|
|
220
205
|
}
|
|
221
206
|
}
|
|
222
|
-
]
|
|
207
|
+
],
|
|
208
|
+
"id": "u:7949aecf0ca9"
|
|
223
209
|
}
|
|
224
210
|
},
|
|
225
211
|
"objects": {
|
|
@@ -265,7 +251,8 @@
|
|
|
265
251
|
"source": {
|
|
266
252
|
"method": "get",
|
|
267
253
|
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
268
|
-
"messages": {
|
|
254
|
+
"messages": {
|
|
255
|
+
},
|
|
269
256
|
"headers": {
|
|
270
257
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
271
258
|
}
|
|
@@ -7,11 +7,69 @@
|
|
|
7
7
|
"objectApiName": "object_listviews",
|
|
8
8
|
"recordId": "${recordId}",
|
|
9
9
|
"className": "sm:rounded sm:border-gray-300 bg-white",
|
|
10
|
-
"
|
|
10
|
+
"form": {
|
|
11
|
+
"id": "form_object_listviews"
|
|
12
|
+
},
|
|
11
13
|
"mode": "edit",
|
|
12
14
|
"enableTabs": true,
|
|
13
15
|
"tabsMode": "line",
|
|
14
16
|
"fieldsExtend": {
|
|
17
|
+
"columns": {
|
|
18
|
+
"amis": {
|
|
19
|
+
"footerToolbar": [
|
|
20
|
+
{
|
|
21
|
+
"type": "button",
|
|
22
|
+
"label": "设置字段",
|
|
23
|
+
"actionType": "dialog",
|
|
24
|
+
"dialog": {
|
|
25
|
+
"type": "dialog",
|
|
26
|
+
"title": "显示的列",
|
|
27
|
+
"size": "md",
|
|
28
|
+
"body": [
|
|
29
|
+
{
|
|
30
|
+
"type": "transfer",
|
|
31
|
+
"options": [
|
|
32
|
+
],
|
|
33
|
+
"multiple": true,
|
|
34
|
+
"id": "u:92c0b3cccca0",
|
|
35
|
+
"required": true,
|
|
36
|
+
"placeholder": "-",
|
|
37
|
+
"className": "col-span-2 m-0",
|
|
38
|
+
"checkAll": false,
|
|
39
|
+
"searchable": true,
|
|
40
|
+
"sortable": true,
|
|
41
|
+
"source": {
|
|
42
|
+
"method": "get",
|
|
43
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/options",
|
|
44
|
+
"headers": {
|
|
45
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
46
|
+
},
|
|
47
|
+
"requestAdaptor": "",
|
|
48
|
+
"adaptor": ""
|
|
49
|
+
},
|
|
50
|
+
"joinValues": false,
|
|
51
|
+
"extractValue": true,
|
|
52
|
+
"name": "columns_quick_select",
|
|
53
|
+
"value": "${columns|pick:field|split}"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"onEvent": {
|
|
57
|
+
"confirm": {
|
|
58
|
+
"actions": [
|
|
59
|
+
{
|
|
60
|
+
"actionType": "custom",
|
|
61
|
+
"script": "const columns = [];\nconst columns_quick_select = _.cloneDeep(event.data.columns_quick_select);\n_.forEach(columns_quick_select, function (field) {\n const column_field = _.find(event.data.columns, { field });\n if (column_field) {\n columns.push(column_field)\n } else {\n columns.push({\n field\n })\n }\n});\ndoAction({\n \"componentId\": \"form_object_listviews\",\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n columns\n }\n }\n});"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"addable": false,
|
|
70
|
+
"draggable": false
|
|
71
|
+
}
|
|
72
|
+
},
|
|
15
73
|
"sort": {
|
|
16
74
|
"label": "",
|
|
17
75
|
"amis": {
|
|
@@ -109,37 +167,62 @@
|
|
|
109
167
|
},
|
|
110
168
|
"mobile_columns": {
|
|
111
169
|
"amis": {
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
170
|
+
"footerToolbar": [
|
|
171
|
+
{
|
|
172
|
+
"type": "button",
|
|
173
|
+
"label": "设置字段",
|
|
174
|
+
"actionType": "dialog",
|
|
175
|
+
"dialog": {
|
|
176
|
+
"type": "dialog",
|
|
177
|
+
"title": "显示的列",
|
|
178
|
+
"size": "md",
|
|
179
|
+
"body": [
|
|
180
|
+
{
|
|
181
|
+
"type": "transfer",
|
|
182
|
+
"options": [
|
|
183
|
+
],
|
|
184
|
+
"multiple": true,
|
|
185
|
+
"id": "u:92c0b3cccca0",
|
|
186
|
+
"required": true,
|
|
187
|
+
"placeholder": "-",
|
|
188
|
+
"className": "col-span-2 m-0",
|
|
189
|
+
"checkAll": false,
|
|
190
|
+
"searchable": true,
|
|
191
|
+
"sortable": true,
|
|
192
|
+
"source": {
|
|
193
|
+
"method": "get",
|
|
194
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/options",
|
|
195
|
+
"headers": {
|
|
196
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
197
|
+
},
|
|
198
|
+
"requestAdaptor": "",
|
|
199
|
+
"adaptor": ""
|
|
200
|
+
},
|
|
201
|
+
"joinValues": false,
|
|
202
|
+
"extractValue": true,
|
|
203
|
+
"name": "columns_quick_select",
|
|
204
|
+
"value": "${mobile_columns|pick:field|split}"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"onEvent": {
|
|
208
|
+
"confirm": {
|
|
209
|
+
"actions": [
|
|
210
|
+
{
|
|
211
|
+
"actionType": "custom",
|
|
212
|
+
"script": "const mobile_columns = [];\nconst columns_quick_select = _.cloneDeep(event.data.columns_quick_select);\n_.forEach(columns_quick_select, function (field) {\n const column_field = _.find(event.data.mobile_columns, { field });\n if (column_field) {\n mobile_columns.push(column_field)\n } else {\n mobile_columns.push({\n field\n })\n }\n});\ndoAction({\n \"componentId\": \"form_object_listviews\",\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n mobile_columns\n }\n }\n});"
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"addable": false,
|
|
221
|
+
"draggable": false
|
|
139
222
|
}
|
|
140
223
|
},
|
|
141
224
|
"searchable_fields": {
|
|
142
|
-
"label":"",
|
|
225
|
+
"label": "",
|
|
143
226
|
"amis": {
|
|
144
227
|
"type": "transfer",
|
|
145
228
|
"options": [
|
|
@@ -170,8 +253,9 @@
|
|
|
170
253
|
}
|
|
171
254
|
}
|
|
172
255
|
},
|
|
173
|
-
"initApiAdaptor": "\nvar data;\nif (recordId) {\n data = payload.data || { _filters_type_controller: 'conditions' };\n //数据格式转换\n if (data) {\n data.sort = lodash.map(data.sort, (item) => {\n return item.field_name + \":\" + item.order;\n });\n data.
|
|
174
|
-
"apiRequestAdaptor": "delete formData.created;\ndelete formData.created_by;\ndelete formData.modified;\ndelete formData.modified_by;\ndelete formData._display;\n\n//数据格式转换\nformData.sort = lodash.map(formData.sort, (item) => {\n const arr = item.split(':');\n return { field_name: arr[0], order: arr[1] };\n});\n\nformData.
|
|
256
|
+
"initApiAdaptor": "\nvar data;\nif (recordId) {\n data = payload.data || { _filters_type_controller: 'conditions' };\n //数据格式转换\n if (data) {\n data.sort = lodash.map(data.sort, (item) => {\n return item.field_name + \":\" + item.order;\n });\n data.searchable_fields = lodash.map(data.searchable_fields, 'field');\n\n if (data.filters && lodash.isString(data.filters)) {\n try {\n data.filters = JSON.parse(data.filters);\n } catch (e) { }\n }\n\n if (data.filters && lodash.isString(data.filters)) {\n data._filters_type_controller = 'function';\n } else {\n data._filters_type_controller = 'conditions'\n }\n\n if (data._filters_type_controller === 'conditions') {\n data._filters_conditions = window.amisConvert.filtersToConditions(data.filters || []);\n } else {\n data._filters_function = data.filters;\n }\n }\n} else {\n const uiSchema = api.body.uiSchema;\n const defaultData = api.body.defaultData;\n let defaultValues = {};\n _.each(uiSchema && uiSchema.fields, function (field) {\n var value = SteedosUI.getFieldDefaultValue(field, api.body.global);\n if (!_.isNil(value)) {\n defaultValues[field.name] = value;\n }\n });\n if (defaultData && _.isObject(defaultData) && !_.isArray(defaultData)) {\n data = Object.assign({}, defaultValues, defaultData)\n }\n}\nfor (key in data) {\n if (data[key] === null) {\n delete data[key];\n }\n}\npayload.data = data;\ndelete payload.extensions; if (data.is_enable != false) { data.is_enable = true; };\nreturn payload;",
|
|
257
|
+
"apiRequestAdaptor": "delete formData.created;\ndelete formData.created_by;\ndelete formData.modified;\ndelete formData.modified_by;\ndelete formData._display;\n\n//数据格式转换\nformData.sort = lodash.map(formData.sort, (item) => {\n const arr = item.split(':');\n return { field_name: arr[0], order: arr[1] };\n});\n\nformData.searchable_fields = lodash.map(formData.searchable_fields, (item) => {\n return { field: item };\n});\n\nif (!formData._filters_type_controller) {\n formData._filters_type_controller = 'conditions';\n}\n\nif (formData._filters_type_controller === 'conditions' && formData._filters_conditions) {\n formData.filters = window.amisConvert.conditionsToFilters(formData._filters_conditions);\n // formData.filters = JSON.stringify(window.amisConvert.conditionsToFilters(formData._filters_conditions), null, 4);\n} else {\n formData.filters = formData._filters_function || null;\n}\n\ndelete formData._filters_type_controller;\ndelete formData._filters_conditions;\ndelete formData._filters_function;\n\nquery = `mutation{record: object_listviews__insert(doc: {__saveData}){_id}}`;\nif (formData.recordId) {\n query = `mutation{record: object_listviews__update(id: \"` + formData._id + `\", doc: {__saveData}){_id}}`;\n};\n__saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = { query: query.replace('{__saveData}', __saveData) };\nreturn api;",
|
|
258
|
+
"id": "u:ce9e3fcc411a"
|
|
175
259
|
}
|
|
176
260
|
],
|
|
177
261
|
"regions": [
|
|
@@ -10,44 +10,497 @@
|
|
|
10
10
|
"initFetch": true,
|
|
11
11
|
"className": "bg-white",
|
|
12
12
|
"id": "u:bb8612f5bbef",
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
"label": "对象表单",
|
|
14
|
+
"objectApiName": "object_layouts",
|
|
15
|
+
"recordId": "${recordId}",
|
|
16
|
+
"enableTabs": true,
|
|
17
|
+
"debug": false,
|
|
18
|
+
"fieldsExtend": {
|
|
19
|
+
"profiles": {
|
|
20
|
+
"amis": {
|
|
21
|
+
"type": "select",
|
|
22
|
+
"name": "profiles",
|
|
23
|
+
"required": true,
|
|
24
|
+
"joinValues": false,
|
|
25
|
+
"extractValue": true,
|
|
26
|
+
"labelField": "label",
|
|
27
|
+
"multiple": true,
|
|
28
|
+
"labelClassName": "text-left",
|
|
29
|
+
"checkAll": true,
|
|
30
|
+
"source": {
|
|
31
|
+
"method": "post",
|
|
32
|
+
"url": "${context.rootUrl}/graphql",
|
|
33
|
+
"data": {
|
|
34
|
+
"query": "{options:permission_set(filters: [\"type\", \"=\", \"profile\"]){name,label}}"
|
|
35
|
+
},
|
|
36
|
+
"requestAdaptor": "",
|
|
37
|
+
"adaptor": "",
|
|
38
|
+
"headers": {
|
|
39
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
40
|
+
}
|
|
23
41
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
"valueField": "name",
|
|
43
|
+
"searchable": true,
|
|
44
|
+
"id": "u:3c65447a8a6e",
|
|
45
|
+
"defaultCheckAll": false,
|
|
46
|
+
"checkAllLabel": "全选",
|
|
47
|
+
"autoComplete": "",
|
|
48
|
+
"menuTpl": ""
|
|
49
|
+
}
|
|
29
50
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
"buttons": {
|
|
52
|
+
"label": "",
|
|
53
|
+
"amis": {
|
|
54
|
+
"headerToolbar": [
|
|
55
|
+
{
|
|
56
|
+
"type": "button",
|
|
57
|
+
"actionType": "dialog",
|
|
58
|
+
"dialog": {
|
|
59
|
+
"title": "${'object_layouts.object_layouts_form.button_set' | t}",
|
|
60
|
+
"body": [
|
|
61
|
+
{
|
|
62
|
+
"type": "transfer",
|
|
63
|
+
"name": "picked_buttons",
|
|
64
|
+
"sortable": true,
|
|
65
|
+
"source": {
|
|
66
|
+
"method": "get",
|
|
67
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/actions/options",
|
|
68
|
+
"sendOn": "!!this.object_name",
|
|
69
|
+
"headers": {
|
|
70
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
71
|
+
},
|
|
72
|
+
"cache": 120000
|
|
73
|
+
},
|
|
74
|
+
"value": "${buttons|pick:button_name|split}",
|
|
75
|
+
"searchable": true,
|
|
76
|
+
"id": "u:d6e067c40e83",
|
|
77
|
+
"joinValues": false,
|
|
78
|
+
"extractValue": true
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"onEvent": {
|
|
82
|
+
"confirm": {
|
|
83
|
+
"actions": [
|
|
84
|
+
{
|
|
85
|
+
"actionType": "custom",
|
|
86
|
+
"script": "const buttons = [];\nconst picked_buttons = _.cloneDeep(event.data.picked_buttons);\n_.forEach(picked_buttons, function (button) {\n const table_button = _.find(event.data.buttons, { button_name: button });\n if (table_button) {\n buttons.push(table_button)\n } else {\n buttons.push({\n button_name: button\n })\n }\n})\ndoAction({\n \"componentId\": \"object-layout-form\",\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n buttons\n }\n }\n});"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"type": "dialog",
|
|
92
|
+
"id": "u:a0027ac6f8c1",
|
|
93
|
+
"closeOnEsc": false,
|
|
94
|
+
"closeOnOutside": false,
|
|
95
|
+
"showCloseButton": true,
|
|
96
|
+
"size": "md"
|
|
97
|
+
},
|
|
98
|
+
"label": "${'object_layouts.object_layouts_form.button_set' | t}",
|
|
99
|
+
"className": "mb-2",
|
|
100
|
+
"id": "u:1ac8afc8a9bb"
|
|
40
101
|
}
|
|
102
|
+
],
|
|
103
|
+
"addable": false,
|
|
104
|
+
"draggable": false,
|
|
105
|
+
"id": "u:1120663b07c6",
|
|
106
|
+
"dialog": {
|
|
107
|
+
"title": "按钮明细"
|
|
41
108
|
}
|
|
42
|
-
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"fields": {
|
|
112
|
+
"amis": {
|
|
113
|
+
"type": "service",
|
|
114
|
+
"body": [
|
|
115
|
+
{
|
|
116
|
+
"name": "fields",
|
|
117
|
+
"required": true,
|
|
118
|
+
"type": "steedos-input-table",
|
|
119
|
+
"fields": [
|
|
120
|
+
{
|
|
121
|
+
"name": "field_name",
|
|
122
|
+
"label": "${'object_layouts.object_layouts_form.fields' | t}",
|
|
123
|
+
"type": "select",
|
|
124
|
+
"amis": {
|
|
125
|
+
"source": "${fields_options}",
|
|
126
|
+
"menuTpl": "",
|
|
127
|
+
"id": "u:beecbd5b6b69"
|
|
128
|
+
},
|
|
129
|
+
"id": "u:b95c69a1cd84"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "is_readonly",
|
|
133
|
+
"label": "${'object_layouts.object_layouts_form.readonly' | t}",
|
|
134
|
+
"id": "u:5081e6e1af55",
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"placeholder": "-"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "is_required",
|
|
140
|
+
"label": "${'object_layouts.object_layouts_form.required' | t}",
|
|
141
|
+
"id": "u:e54afb5cc05c",
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"placeholder": "-"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "group",
|
|
147
|
+
"label": "${'object_layouts.object_layouts_form.grouping' | t}",
|
|
148
|
+
"type": "select",
|
|
149
|
+
"amis": {
|
|
150
|
+
"className": "m-0",
|
|
151
|
+
"source": "${field_groups|pick:group_name}",
|
|
152
|
+
"checkAll": false,
|
|
153
|
+
"selectFirst": false,
|
|
154
|
+
"searchable": true,
|
|
155
|
+
"clearable": true,
|
|
156
|
+
"id": "u:f75ddc45d296",
|
|
157
|
+
"multiple": false,
|
|
158
|
+
"mode": "popOver"
|
|
159
|
+
},
|
|
160
|
+
"id": "u:e532b1949676",
|
|
161
|
+
"placeholder": "-"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "visible_on",
|
|
165
|
+
"label": "${'object_layouts.object_layouts_form.visibile_on' | t}",
|
|
166
|
+
"breakpoint": "*",
|
|
167
|
+
"id": "u:e3618b8b4c52",
|
|
168
|
+
"type": "textarea",
|
|
169
|
+
"placeholder": "-"
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"headerToolbar": [
|
|
173
|
+
{
|
|
174
|
+
"type": "button",
|
|
175
|
+
"actionType": "dialog",
|
|
176
|
+
"dialog": {
|
|
177
|
+
"title": "${'object_layouts.object_layouts_form.field_set' | t}",
|
|
178
|
+
"body": [
|
|
179
|
+
{
|
|
180
|
+
"type": "transfer",
|
|
181
|
+
"name": "picked_fields",
|
|
182
|
+
"sortable": true,
|
|
183
|
+
"source": "${fields_options}",
|
|
184
|
+
"value": "${fields|pick:field_name|split}",
|
|
185
|
+
"joinValues": false,
|
|
186
|
+
"extractValue": true,
|
|
187
|
+
"searchable": true,
|
|
188
|
+
"id": "u:502c4ecd81b6"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"onEvent": {
|
|
192
|
+
"confirm": {
|
|
193
|
+
"actions": [
|
|
194
|
+
{
|
|
195
|
+
"actionType": "custom",
|
|
196
|
+
"script": "var fields = [];\nvar picked_fields = _.cloneDeep(event.data.picked_fields);\n\n_.forEach(picked_fields, function (field) {\n var table_field = _.find(event.data.fields, { field_name: field });\n if (table_field) {\n fields.push(table_field);\n } else {\n fields.push({\n field_name: field\n });\n }\n});\n\n// 将 fields 分为 group 为空和非空的两部分\nvar groupsPartition = _.partition(fields, function(item) {\n return !item.group;\n});\nvar emptyGroups = groupsPartition[0];\nvar nonEmptyGroups = groupsPartition[1];\n\n// 创建排序映射\nvar sortOrderMap = _.fromPairs(_.map(event.data.field_groups, function(item, index) {\n return [item.group_name, index];\n}));\n\n// 对非空 group 的部分进行排序\nvar sortedNonEmptyGroups = _.sortBy(nonEmptyGroups, function(item) {\n return sortOrderMap[item.group];\n});\n\n// 合并两个数组,空 group 的部分在前\nfields = emptyGroups.concat(sortedNonEmptyGroups);\n\ndoAction({\n \"componentId\": \"object-layout-form\",\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n fields: fields\n }\n }\n});\n"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"type": "dialog",
|
|
202
|
+
"size": "md",
|
|
203
|
+
"id": "u:c405734543e0",
|
|
204
|
+
"closeOnEsc": false,
|
|
205
|
+
"closeOnOutside": false,
|
|
206
|
+
"showCloseButton": true
|
|
207
|
+
},
|
|
208
|
+
"label": "${'object_layouts.object_layouts_form.field_set' | t}",
|
|
209
|
+
"id": "u:853b890ab524",
|
|
210
|
+
"className": "mb-2"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"type": "button",
|
|
214
|
+
"actionType": "dialog",
|
|
215
|
+
"dialog": {
|
|
216
|
+
"title": "${'object_layouts.object_layouts_form.grouping_set' | t}",
|
|
217
|
+
"size": "lg",
|
|
218
|
+
"body": [
|
|
219
|
+
{
|
|
220
|
+
"type": "form",
|
|
221
|
+
"mode": "normal",
|
|
222
|
+
"body": [
|
|
223
|
+
{
|
|
224
|
+
"type": "steedos-input-table",
|
|
225
|
+
"name": "field_groups",
|
|
226
|
+
"addable": true,
|
|
227
|
+
"draggable": true,
|
|
228
|
+
"editable": true,
|
|
229
|
+
"fields": [
|
|
230
|
+
{
|
|
231
|
+
"name": "group_name",
|
|
232
|
+
"type": "text",
|
|
233
|
+
"label": "${'object_layouts.object_layouts_form.group_name' | t}",
|
|
234
|
+
"id": "u:ee2fb813a3e7"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"type": "text",
|
|
238
|
+
"name": "visible_on",
|
|
239
|
+
"label": "${'object_layouts.object_layouts_form.visible_on' | t}"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"id": "u:e9f43ef94d08"
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
"onEvent": {
|
|
248
|
+
"confirm": {
|
|
249
|
+
"actions": [
|
|
250
|
+
{
|
|
251
|
+
"actionType": "custom",
|
|
252
|
+
"args": {},
|
|
253
|
+
"componentId": "",
|
|
254
|
+
"script": "var field_groups = _.cloneDeep(event.data.field_groups);\nvar fields = _.cloneDeep(event.data.fields);\n\n// 将数组分为 group 为空和非空的两部分\nvar groupsPartition = _.partition(fields, function(item) {\n return !item.group;\n});\nvar emptyGroups = groupsPartition[0];\nvar nonEmptyGroups = groupsPartition[1];\n\n// 创建排序映射\nvar sortOrderMap = _.fromPairs(_.map(field_groups, function(item, index) {\n return [item.group_name, index];\n}));\n\n// 对非空 group 的部分进行排序\nvar sortedNonEmptyGroups = _.sortBy(nonEmptyGroups, function(item) {\n return sortOrderMap[item.group];\n});\n\n// 合并两个数组,空 group 的部分在前\nfields = emptyGroups.concat(sortedNonEmptyGroups);\n\ndoAction({\n \"componentId\": \"object-layout-form\",\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n field_groups: field_groups,\n fields: fields\n }\n }\n});\n"
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"type": "dialog",
|
|
260
|
+
"id": "u:e02c8f59216e",
|
|
261
|
+
"closeOnEsc": false,
|
|
262
|
+
"closeOnOutside": false,
|
|
263
|
+
"showCloseButton": true
|
|
264
|
+
},
|
|
265
|
+
"label": "${'object_layouts.object_layouts_form.grouping_set' | t}",
|
|
266
|
+
"id": "u:ec9931ea883c",
|
|
267
|
+
"className": "mb-2"
|
|
268
|
+
}
|
|
269
|
+
],
|
|
270
|
+
"editable": true,
|
|
271
|
+
"removable": true,
|
|
272
|
+
"showIndex": true,
|
|
273
|
+
"id": "u:22121edc42b1",
|
|
274
|
+
"amis": {
|
|
275
|
+
"columnsTogglable": false
|
|
276
|
+
},
|
|
277
|
+
"dialog": {
|
|
278
|
+
"title": "字段明细",
|
|
279
|
+
"onEvent": {
|
|
280
|
+
"confirm": {
|
|
281
|
+
"actions": [
|
|
282
|
+
{
|
|
283
|
+
"actionType": "custom",
|
|
284
|
+
"script": "var eventForm = event.context.scoped.getComponentById('object-layout-form');\nsetTimeout(function() {\n var form = eventForm;\n var data = form && _.clone(form.getData());\n var fields = data.fields;\n var field_groups = data.field_groups;\n\n // 将fields分为 group 为空和非空的两部分\n var groupsPartition = _.partition(fields, function(item) {\n return !item.group;\n });\n var emptyGroups = groupsPartition[0];\n var nonEmptyGroups = groupsPartition[1];\n\n // 创建排序映射\n var sortOrderMap = _.fromPairs(_.map(field_groups, function(item, index) {\n return [item.group_name, index];\n }));\n\n // 对非空 group 的部分进行排序\n var sortedNonEmptyGroups = _.sortBy(nonEmptyGroups, function(item) {\n return sortOrderMap[item.group];\n });\n\n // 合并两个数组,空 group 的部分在前\n fields = emptyGroups.concat(sortedNonEmptyGroups);\n form.setValues({ fields: fields });\n}, 500);"
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
"cancel": {
|
|
289
|
+
"actions": [
|
|
290
|
+
{
|
|
291
|
+
"actionType": "custom",
|
|
292
|
+
"script": "var form = event.context.scoped.getComponentById('object-layout-form');\nvar data = form && _.clone(form.getData());\nvar fields = data.fields;\nvar field_groups = data.field_groups;\n\n// 将 fields 分为 group 为空和非空的两部分\nvar groupsPartition = _.partition(fields, function(item) {\n return !item.group;\n});\nvar emptyGroups = groupsPartition[0];\nvar nonEmptyGroups = groupsPartition[1];\n\n// 创建排序映射\nvar sortOrderMap = _.fromPairs(_.map(field_groups, function(item, index) {\n return [item.group_name, index];\n}));\n\n// 对非空 group 的部分进行排序\nvar sortedNonEmptyGroups = _.sortBy(nonEmptyGroups, function(item) {\n return sortOrderMap[item.group];\n});\n\n// 合并两个数组,空 group 的部分在前\nfields = emptyGroups.concat(sortedNonEmptyGroups);\nform.setValues({fields: fields});"
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"id": "u:ac5b7818b88f",
|
|
301
|
+
"affixFooter": false,
|
|
302
|
+
"api": {
|
|
303
|
+
"method": "get",
|
|
304
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/fields/layout_options",
|
|
305
|
+
"adaptor": "let data = payload.data;data.fields_options = data.options;data.field_groups_options = lodash.uniq(lodash.compact(lodash.map(data.options, \"group\"))) || [];delete data.options;payload.data = data; return payload;",
|
|
306
|
+
"sendOn": "!!this.object_name",
|
|
307
|
+
"data": null,
|
|
308
|
+
"headers": {
|
|
309
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"className": "col-span-2 m-0",
|
|
313
|
+
"placeholder": "-",
|
|
314
|
+
"onEvent": {
|
|
315
|
+
"fetchInited": {
|
|
316
|
+
"actions": [
|
|
317
|
+
{
|
|
318
|
+
"actionType": "custom",
|
|
319
|
+
"script": "const mixingGroupsFromFields = function (input, formData) { const groupsOptions = input.field_groups_options; const groups = formData.field_groups || []; const object_field_groups = formData.object_field_groups || []; const groupsForMixing = groupsOptions.map(function (item) { return { group_name: item } }); const mixedGroups = lodash.unionBy(groups, groupsForMixing, object_field_groups, \"group_name\"); return { field_groups: mixedGroups }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \"object-layout-form\", args: { value: mixingGroupsFromFields(eventData, context.props.data) }});"
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"messages": {}
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"related_lists": {
|
|
328
|
+
"amis": {
|
|
329
|
+
"type": "service",
|
|
330
|
+
"id": "u:dbadaff47153",
|
|
331
|
+
"api": {
|
|
332
|
+
"method": "get",
|
|
333
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object_name}/relatedLists/options",
|
|
334
|
+
"sendOn": "!!this.object_name",
|
|
335
|
+
"adaptor": "let data = payload.data;data.related_lists_options = data.options;delete data.options;payload.data = data;return payload;",
|
|
336
|
+
"headers": {
|
|
337
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"className": "col-span-2 m-0",
|
|
341
|
+
"affixFooter": false,
|
|
342
|
+
"body": [
|
|
343
|
+
{
|
|
344
|
+
"name": "related_lists",
|
|
345
|
+
"type": "steedos-input-table",
|
|
346
|
+
"editable": true,
|
|
347
|
+
"removable": true,
|
|
348
|
+
"draggable": false,
|
|
349
|
+
"showIndex": true,
|
|
350
|
+
"columns": [
|
|
351
|
+
"related_field_fullname",
|
|
352
|
+
"label",
|
|
353
|
+
"field_names",
|
|
354
|
+
"visible_on"
|
|
355
|
+
],
|
|
356
|
+
"fields": [
|
|
357
|
+
{
|
|
358
|
+
"name": "related_field_fullname",
|
|
359
|
+
"label": "${'object_layouts.object_layouts_form.related_list_name' | t}",
|
|
360
|
+
"type": "select",
|
|
361
|
+
"amis": {
|
|
362
|
+
"source": "${related_lists_options}",
|
|
363
|
+
"menuTpl": "",
|
|
364
|
+
"id": "u:beecbd5b6b69"
|
|
365
|
+
},
|
|
366
|
+
"id": "u:5204fc0fbe1c"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"name": "label",
|
|
370
|
+
"label": "${'object_layouts.object_layouts_form.related_list_label' | t}",
|
|
371
|
+
"type": "text",
|
|
372
|
+
"id": "u:1267e4351d66",
|
|
373
|
+
"placeholder": "-"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "field_names",
|
|
377
|
+
"label": "${'object_layouts.object_layouts_form.field_names' | t}",
|
|
378
|
+
"type": "select",
|
|
379
|
+
"amis": {
|
|
380
|
+
"source": {
|
|
381
|
+
"method": "get",
|
|
382
|
+
"url": "/service/api/amis-metadata-objects/objects/${related_field_fullname|split:.|first}/fields/options",
|
|
383
|
+
"cache": 60000,
|
|
384
|
+
"headers": {
|
|
385
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"id": "u:e2ece172d739"
|
|
389
|
+
},
|
|
390
|
+
"id": "u:ce65d4020107",
|
|
391
|
+
"placeholder": "-"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "sort_field_name",
|
|
395
|
+
"label": "${'object_layouts.object_layouts_form.sort_field_name' | t}",
|
|
396
|
+
"type": "select",
|
|
397
|
+
"amis": {
|
|
398
|
+
"source": {
|
|
399
|
+
"method": "get",
|
|
400
|
+
"url": "/service/api/amis-metadata-objects/objects/${related_field_fullname|split:.|first}/fields/options",
|
|
401
|
+
"cache": 60000,
|
|
402
|
+
"headers": {
|
|
403
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
"id": "u:3dbee6a855c4",
|
|
408
|
+
"multiple": true
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"name": "sort_order",
|
|
412
|
+
"label": "${'object_layouts.object_layouts_form.sort_order' | t}",
|
|
413
|
+
"type": "select",
|
|
414
|
+
"amis": {
|
|
415
|
+
"source": "${sort_order_options}"
|
|
416
|
+
},
|
|
417
|
+
"id": "u:13cb3d304615"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"name": "filters",
|
|
421
|
+
"label": "${'object_layouts.object_layouts_form.filters_rule' | t}",
|
|
422
|
+
"type": "code",
|
|
423
|
+
"amis": {
|
|
424
|
+
"language": "javascript",
|
|
425
|
+
"description": "${'object_layouts.object_layouts_form.filters_rule_description' | t}",
|
|
426
|
+
"minRows": 3,
|
|
427
|
+
"maxRows": 20
|
|
428
|
+
},
|
|
429
|
+
"breakpoint": "*",
|
|
430
|
+
"id": "u:e4c367804b67"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"name": "visible_on",
|
|
434
|
+
"label": "${'object_layouts.object_layouts_form.visibile_on' | t}",
|
|
435
|
+
"type": "text",
|
|
436
|
+
"breakpoint": "*",
|
|
437
|
+
"id": "u:1e1dc52d7c33"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"name": "page_size",
|
|
441
|
+
"label": "${'object_layouts.object_layouts_form.page_size' | t}",
|
|
442
|
+
"type": "number",
|
|
443
|
+
"breakpoint": "*",
|
|
444
|
+
"id": "u:f9bbd9567bbd"
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
"headerToolbar": [
|
|
448
|
+
{
|
|
449
|
+
"type": "button",
|
|
450
|
+
"actionType": "dialog",
|
|
451
|
+
"dialog": {
|
|
452
|
+
"title": "${'object_layouts.object_layouts_form.set_related_list' | t}",
|
|
453
|
+
"body": [
|
|
454
|
+
{
|
|
455
|
+
"type": "transfer",
|
|
456
|
+
"name": "picked_related_lists",
|
|
457
|
+
"sortable": true,
|
|
458
|
+
"source": "${related_lists_options}",
|
|
459
|
+
"value": "${related_lists|pick:related_field_fullname | split}",
|
|
460
|
+
"searchable": true,
|
|
461
|
+
"id": "u:ab6a6c9c8677",
|
|
462
|
+
"joinValues": false,
|
|
463
|
+
"extractValue": true
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"onEvent": {
|
|
467
|
+
"confirm": {
|
|
468
|
+
"actions": [
|
|
469
|
+
{
|
|
470
|
+
"actionType": "custom",
|
|
471
|
+
"script": "const related_lists = [];\nconst picked_related_lists = _.cloneDeep(event.data.picked_related_lists);\n_.forEach(picked_related_lists, function (related_list) {\n const table_related_list = _.find(event.data.related_lists, { related_field_fullname: related_list });\n if (table_related_list) {\n related_lists.push(table_related_list)\n } else {\n related_lists.push({\n related_field_fullname: related_list,sort_order: \"asc\"\n })\n }\n})\ndoAction({\n \"componentId\": \"object-layout-form\",\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n related_lists\n }\n }\n});"
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
"type": "dialog",
|
|
477
|
+
"size": "md",
|
|
478
|
+
"id": "u:3663990f226a",
|
|
479
|
+
"closeOnEsc": false,
|
|
480
|
+
"closeOnOutside": false,
|
|
481
|
+
"showCloseButton": true
|
|
482
|
+
},
|
|
483
|
+
"label": "${'object_layouts.object_layouts_form.set_related_list' | t}",
|
|
484
|
+
"id": "u:b9a5d3b611d7",
|
|
485
|
+
"className": "mb-2"
|
|
486
|
+
}
|
|
487
|
+
],
|
|
488
|
+
"id": "u:95aea10231d3",
|
|
489
|
+
"amis": {
|
|
490
|
+
"columnsTogglable": false
|
|
491
|
+
},
|
|
492
|
+
"dialog": {
|
|
493
|
+
"title": "子表明细"
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
],
|
|
497
|
+
"messages": {}
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
"field_groups": {
|
|
501
|
+
"hidden": true
|
|
43
502
|
}
|
|
44
503
|
},
|
|
45
|
-
"label": "对象表单",
|
|
46
|
-
"objectApiName": "object_layouts",
|
|
47
|
-
"recordId": "${recordId}",
|
|
48
|
-
"enableTabs": true,
|
|
49
|
-
"debug": false,
|
|
50
|
-
"fieldsExtend": "{\n \"profiles\":{\n \"amis\":{\n \"type\": \"select\",\n \"name\": \"profiles\",\n \"required\": true,\n \"joinValues\": false,\n \"extractValue\": true,\n \"labelField\": \"label\",\n \"multiple\": true,\n \"labelClassName\": \"text-left\",\n \"checkAll\": true,\n \"source\": {\n \"method\": \"post\",\n \"url\": \"\\${context.rootUrl}/graphql\",\n \"data\": {\n \"query\": \"{options:permission_set(filters: [\\\"type\\\", \\\"=\\\", \\\"profile\\\"]){name,label}}\"\n },\n \"requestAdaptor\": \"\",\n \"adaptor\": \"\",\n \"headers\": {\n \"Authorization\": \"Bearer \\${context.tenantId},\\${context.authToken}\"\n }\n },\n \"valueField\": \"name\",\n \"searchable\": true,\n \"id\": \"u:3c65447a8a6e\",\n \"defaultCheckAll\": false,\n \"checkAllLabel\": \"全选\",\n \"autoComplete\":\"\",\n \"menuTpl\":\"\"\n }\n },\n \"buttons\": {\n \"amis\": {\n \"type\":\"service\",\n \"body\":[\n {\n \"type\": \"crud\",\n \"name\": \"buttons\",\n \"label\": \"按钮\",\n \"strictMode\": true,\n \"affixHeader\": false,\n \"editable\": true,\n \"addable\": false,\n \"removable\": true,\n \"draggable\": false,\n \"columns\": [\n {\n \"name\": \"button_name_label\",\n \"label\": \"\\${'object_layouts.object_layouts_form.button_name_label' | t}\",\n \"type\": \"tpl\",\n \"tpl\": \"\\${buttons_options|filter:value:equals:button_name|pick:label}\",\n \"id\": \"u:302f8fadccd3\"\n },\n {\n \"name\": \"visible_on\",\n \"label\": \"\\${'object_layouts.object_layouts_form.visibile_on' | t}\",\n \"className\": \"w-6/12\",\n \"quickEdit\": {\n \"type\": \"input-text\",\n \"className\": \"m-0\",\n \"labelClassName\": \"text-left\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForButton = function (input, prop_name) { let currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super.__super; const button_name = rowValue.button_name; if (currentPropValue.startsWith(\\\"\\\\$\\\\{\\\")) { currentPropValue = \\\"\\\\\\\\\\\" + currentPropValue }; rowValue[prop_name] = currentPropValue; let newButtons = formValue.buttons.map(function (item) { if (item.button_name == button_name) { return Object.assign({}, item, rowValue); } else { return item; } }); return { buttons: newButtons }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForButton(eventData, \\\"visible_on\\\") }});\"\n }\n ]\n }\n },\n \"tpl\": \"<b><%=data.visible_on%></b>\",\n \"name\": \"visible_on\",\n \"id\": \"u:daa771bd34b9\",\n \"mode\": \"popOver\"\n },\n \"id\": \"u:3c35211aa1a0\",\n \"placeholder\": \"-\"\n }\n ],\n \"className\": \"col-span-2 m-0\",\n \"labelClassName\": \"text-left\",\n \"footable\": false,\n \"headerToolbar\": [\n {\n \"type\": \"button\",\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"title\": \"\\${'object_layouts.object_layouts_form.button_set' | t}\",\n \"body\": [\n {\n \"type\": \"transfer\",\n \"name\": \"picked_buttons\",\n \"sortable\": true,\n \"source\": \"\\${buttons_options}\",\n \"value\": \"\\${buttons|pick:button_name}\",\n \"searchable\": true,\n \"id\": \"u:d6e067c40e83\"\n }\n ],\n \"onEvent\": {\n \"confirm\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const clearButtons = function (input) { return { buttons: [] }};const convertDataForButtons = function (input) { let pickedButtons = input.picked_buttons || []; const superButtons = _.keyBy(input.__super.buttons, 'button_name'); if (typeof pickedButtons === \\\"string\\\") { pickedButtons = pickedButtons.split(\\\",\\\"); }; const convertedButtons = pickedButtons.map(function (key) { return superButtons[key] || { button_name: key } }); return { buttons: convertedButtons }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: clearButtons() }});setTimeout(function () { doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: convertDataForButtons(eventData) } });}, 300);\"\n }\n ]\n }\n },\n \"type\": \"dialog\",\n \"id\": \"u:a0027ac6f8c1\",\n \"closeOnEsc\": false,\n \"closeOnOutside\": false,\n \"showCloseButton\": true,\n \"size\": \"md\"\n },\n \"label\": \"\\${'object_layouts.object_layouts_form.button_set' | t}\",\n \"id\": \"u:1ac8afc8a9bb\"\n }\n ],\n \"headerToolbarClassName\": \"px-1 pb-3\",\n \"source\": \"\\${buttons}\",\n \"id\": \"u:a5d43b752494\",\n \"perPageAvailable\": [\n 10\n ],\n \"messages\": {},\n \"onEvent\": {\n \"rowClick\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForButton = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super.__super; const button_name = rowValue.button_name;};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForButton(eventData, \\\"visible_on\\\") }});\"\n }\n ]\n }\n }\n }\n ],\n \"api\": {\n \"method\": \"get\",\n \"url\": \"\\${context.rootUrl}/service/api/amis-metadata-objects/objects/\\${object_name}/actions/options\",\n \"adaptor\": \"let data = payload.data;data.buttons_options = data.options;delete data.options;payload.data = data;return payload;\",\n \"sendOn\": \"!!this.object_name\",\n \"headers\": {\n \"Authorization\": \"Bearer ${context.tenantId},${context.authToken}\"\n }\n }\n \n }\n },\n \"fields\":{\n \"amis\":{\n \"type\": \"service\",\n \"body\": [\n {\n \"name\": \"fields\",\n \"required\": true,\n \"type\": \"crud\",\n \"strictMode\": true,\n \"affixHeader\": false,\n \"editable\": true,\n \"addable\": false,\n \"removable\": true,\n \"draggable\": false,\n \"columns\": [\n {\n \"name\": \"field_name_label\",\n \"label\": \"\\${'object_layouts.object_layouts_form.fields' | t}\",\n \"type\": \"tpl\",\n \"tpl\": \"\\${fields_options|filter:value:equals:field_name|pick:label}\",\n \"id\": \"u:b95c69a1cd84\"\n },\n {\n \"name\": \"is_readonly\",\n \"label\": \"\\${'object_layouts.object_layouts_form.readonly' | t}\",\n \"quickEdit\": {\n \"type\": \"checkbox\",\n \"tpl\": null,\n \"className\": \"m-0\",\n \"labelClassName\": \"text-left\",\n \"mode\": \"inline\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const fieldGroupKey = \\\"group\\\";const getFieldsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[fieldGroupKey] ? 1 : 0; var tempN = !!n[fieldGroupKey] ? 1 : 0; if (!m[fieldGroupKey] || !n[fieldGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[fieldGroupKey]) - groupNames.indexOf(n[fieldGroupKey]); };};const quickEidtSaveForField = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super.__super; const field_name = rowValue.field_name; rowValue[prop_name] = currentPropValue; let newFields = formValue.fields.map(function (item) { if (item.field_name == field_name) { return Object.assign({}, item, rowValue); } else { return item; } }); const fieldGroups = input.__super.__super.field_groups; const groupNames = lodash.compact(lodash.map(fieldGroups, \\\"group_name\\\")); newFields.sort(getFieldsSortFun(groupNames)); return { fields: newFields }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForField(eventData, \\\"is_readonly\\\") }});\"\n }\n ]\n }\n },\n \"id\": \"u:8cb44f3db16c\",\n \"name\": \"is_readonly\"\n },\n \"id\": \"u:5081e6e1af55\",\n \"placeholder\": \"-\"\n },\n {\n \"name\": \"is_required\",\n \"label\": \"\\${'object_layouts.object_layouts_form.required' | t}\",\n \"quickEdit\": {\n \"mode\": \"inline\",\n \"type\": \"checkbox\",\n \"className\": \"m-0\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const fieldGroupKey = \\\"group\\\";const getFieldsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[fieldGroupKey] ? 1 : 0; var tempN = !!n[fieldGroupKey] ? 1 : 0; if (!m[fieldGroupKey] || !n[fieldGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[fieldGroupKey]) - groupNames.indexOf(n[fieldGroupKey]); };};const quickEidtSaveForField = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super.__super; const field_name = rowValue.field_name; rowValue[prop_name] = currentPropValue; let newFields = formValue.fields.map(function (item) { if (item.field_name == field_name) { return Object.assign({}, item, rowValue); } else { return item; } }); const fieldGroups = input.__super.__super.field_groups; const groupNames = lodash.compact(lodash.map(fieldGroups, \\\"group_name\\\")); newFields.sort(getFieldsSortFun(groupNames)); return { fields: newFields }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForField(eventData, \\\"is_required\\\") }});\"\n }\n ]\n }\n },\n \"tpl\": null,\n \"labelClassName\": \"text-left\",\n \"id\": \"u:bbd1c15b6504\",\n \"name\": \"is_required\"\n },\n \"id\": \"u:e54afb5cc05c\",\n \"placeholder\": \"-\"\n },\n {\n \"name\": \"group\",\n \"label\": \"\\${'object_layouts.object_layouts_form.grouping' | t}\",\n \"quickEdit\": {\n \"type\": \"select\",\n \"className\": \"m-0\",\n \"source\": \"\\${field_groups|pick:group_name}\",\n \"checkAll\": false,\n \"selectFirst\": false,\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const fieldGroupKey = \\\"group\\\"; const getFieldsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[fieldGroupKey] ? 1 : 0; var tempN = !!n[fieldGroupKey] ? 1 : 0; if (!m[fieldGroupKey] || !n[fieldGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[fieldGroupKey]) - groupNames.indexOf(n[fieldGroupKey]); }; }; const quickEidtSaveForField = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super.__super; const field_name = rowValue.field_name; rowValue[prop_name] = currentPropValue; let newFields = formValue.fields.map(function (item) { if (item.field_name == field_name) { return Object.assign({}, item, rowValue); } else { return item; } }); const fieldGroups = input.__super.__super.field_groups; const groupNames = lodash.compact(lodash.map(fieldGroups, \\\"group_name\\\")); newFields.sort(getFieldsSortFun(groupNames)); return { fields: newFields } }; const eventData = event.data; const clearFields = function (input) { return { fields: [] } };doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: clearFields() }});setTimeout(function () { doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForField(eventData, \\\"group\\\") } });}, 300);\"\n }\n ]\n }\n },\n \"searchable\": true,\n \"clearable\": true,\n \"name\": \"group\",\n \"id\": \"u:f75ddc45d296\",\n \"multiple\": false,\n \"mode\": \"popOver\"\n },\n \"id\": \"u:e532b1949676\",\n \"placeholder\": \"-\"\n },\n {\n \"name\": \"visible_on\",\n \"label\": \"\\${'object_layouts.object_layouts_form.visibile_on' | t}\",\n \"quickEdit\": {\n \"type\": \"input-text\",\n \"tpl\": \"<b><%=data.visible_on%></b>\",\n \"className\": \"m-0\",\n \"labelClassName\": \"text-left\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const fieldGroupKey = \\\"group\\\";const getFieldsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[fieldGroupKey] ? 1 : 0; var tempN = !!n[fieldGroupKey] ? 1 : 0; if (!m[fieldGroupKey] || !n[fieldGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[fieldGroupKey]) - groupNames.indexOf(n[fieldGroupKey]); };};const quickEidtSaveForField = function (input, prop_name) { let currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super.__super; const field_name = rowValue.field_name; if (currentPropValue.startsWith(\\\"\\\\$\\\\{\\\")) { currentPropValue = \\\"\\\\\\\\\\\" + currentPropValue }; rowValue[prop_name] = currentPropValue; let newFields = formValue.fields.map(function (item) { if (item.field_name == field_name) { return Object.assign({}, item, rowValue); } else { return item; } }); const fieldGroups = input.__super.__super.field_groups; const groupNames = lodash.compact(lodash.map(fieldGroups, \\\"group_name\\\")); newFields.sort(getFieldsSortFun(groupNames)); return { fields: newFields }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForField(eventData, \\\"visible_on\\\") }});\"\n }\n ]\n }\n },\n \"name\": \"visible_on\",\n \"id\": \"u:624913811ecc\",\n \"minRows\": 3,\n \"maxRows\": 20,\n \"mode\": \"popOver\"\n },\n \"breakpoint\": \"*\",\n \"id\": \"u:e3618b8b4c52\",\n \"placeholder\": \"-\"\n }\n ],\n \"className\": \"col-span-2 m-0\",\n \"labelClassName\": \"text-left\",\n \"source\": \"\\${fields}\",\n \"footable\": false,\n \"headerToolbar\": [\n {\n \"type\": \"button\",\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"title\": \"\\${'object_layouts.object_layouts_form.field_set' | t}\",\n \"body\": [\n {\n \"type\": \"transfer\",\n \"name\": \"picked_fields\",\n \"sortable\": true,\n \"source\": \"\\${fields_options}\",\n \"value\": \"\\${fields|pick:field_name}\",\n \"searchable\": true,\n \"id\": \"u:502c4ecd81b6\"\n }\n ],\n \"onEvent\": {\n \"confirm\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const fieldGroupKey = \\\"group\\\";const getFieldsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[fieldGroupKey] ? 1 : 0; var tempN = !!n[fieldGroupKey] ? 1 : 0; if (!m[fieldGroupKey] || !n[fieldGroupKey]) { return tempM - tempN; }; return groupNames.indexOf(m[fieldGroupKey]) - groupNames.indexOf(n[fieldGroupKey]); };};const clearFields = function (input) { return { fields: [] }};const convertDataForFields = function (input) { let pickedFields = input.picked_fields || []; const superFields = _.keyBy(input.__super.fields, 'field_name'); if (typeof pickedFields === \\\"string\\\") { pickedFields = pickedFields.split(\\\",\\\"); }; const fieldOptions = lodash.keyBy(input.__super.__super.__super.__super.__super.fields_options, \\\"value\\\"); const convertedFields = pickedFields.map(function (field_name) { const superField = superFields[field_name]; if (superField) { return superField; } else { const fieldOption = fieldOptions[field_name]; return { field_name: field_name, is_readonly: fieldOption.readonly, is_required: fieldOption.required, group: fieldOption.group } } }); const fieldGroups = input.__super.__super.__super.__super.__super.field_groups; const groupNames = lodash.compact(lodash.map(fieldGroups, \\\"group_name\\\")); convertedFields.sort(getFieldsSortFun(groupNames)); return { fields: convertedFields }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: clearFields() }});setTimeout(function () { doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: convertDataForFields(eventData) } });}, 300);\"\n }\n ]\n }\n },\n \"type\": \"dialog\",\n \"size\": \"md\",\n \"id\": \"u:c405734543e0\",\n \"closeOnEsc\": false,\n \"closeOnOutside\": false,\n \"showCloseButton\": true\n },\n \"label\": \"\\${'object_layouts.object_layouts_form.field_set' | t}\",\n \"id\": \"u:853b890ab524\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"title\": \"\\${'object_layouts.object_layouts_form.grouping_set' | t}\",\n \"size\": \"lg\",\n \"body\": [\n {\n \"type\": \"input-table\",\n \"name\": \"setting_groups\",\n \"addable\": true,\n \"draggable\": true,\n \"editable\": true,\n \"columns\": [\n {\n \"name\": \"group_name\",\n \"label\": \"\\${'object_layouts.object_layouts_form.group_name' | t}\",\n \"id\": \"u:ee2fb813a3e7\"\n },\n {\n \"name\": \"visible_on\",\n \"label\": \"\\${'object_layouts.object_layouts_form.visible_on' | t}\"\n }\n ],\n \"value\": \"\\${field_groups}\",\n \"removable\": true,\n \"id\": \"u:e9f43ef94d08\"\n }\n ],\n \"onEvent\": {\n \"confirm\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"args\": {},\n \"componentId\": \"\",\n \"script\": \"const fieldGroupKey = \\\"group\\\";const getFieldsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[fieldGroupKey] ? 1 : 0; var tempN = !!n[fieldGroupKey] ? 1 : 0; if (!m[fieldGroupKey] || !n[fieldGroupKey]) { return tempM - tempN; }; return groupNames.indexOf(m[fieldGroupKey]) - groupNames.indexOf(n[fieldGroupKey]); };};const clearFields = function (input) { return { fields: [] }};const convertDataForGroups = function (input) { const settingGroups = input.setting_groups || []; const convertedGroups = lodash.uniqBy(settingGroups.map(function (item) { return { group_name: item.group_name, visible_on: item.visible_on } }), \\\"group_name\\\"); const groupNames = lodash.compact(lodash.map(convertedGroups, \\\"group_name\\\")); const fields = input.__super.__super.items; fields.sort(getFieldsSortFun(groupNames)); return { field_groups: convertedGroups, fields: fields }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: clearFields() }});doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: convertDataForGroups(eventData) }});\"\n }\n ]\n }\n },\n \"type\": \"dialog\",\n \"id\": \"u:e02c8f59216e\",\n \"closeOnEsc\": false,\n \"closeOnOutside\": false,\n \"showCloseButton\": true\n },\n \"label\": \"\\${'object_layouts.object_layouts_form.grouping_set' | t}\",\n \"id\": \"u:ec9931ea883c\"\n }\n ],\n \"headerToolbarClassName\": \"px-1 pb-3\",\n \"id\": \"u:22121edc42b1\"\n }\n ],\n \"id\": \"u:ac5b7818b88f\",\n \"affixFooter\": false,\n \"api\": {\n \"method\": \"get\",\n \"url\": \"\\${context.rootUrl}/service/api/amis-metadata-objects/objects/\\${object_name}/fields/layout_options\",\n \"adaptor\": \"let data = payload.data;data.fields_options = data.options;data.field_groups_options = lodash.uniq(lodash.compact(lodash.map(data.options, \\\"group\\\"))) || [];delete data.options;payload.data = data; return payload;\",\n \"sendOn\": \"!!this.object_name\",\n \"data\": null,\n \"headers\": {\n \"Authorization\": \"Bearer ${context.tenantId},${context.authToken}\"\n }\n },\n \"className\": \"col-span-2 m-0\",\n \"placeholder\": \"-\",\n \"onEvent\": {\n \"fetchInited\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const mixingGroupsFromFields = function (input, formData) { const groupsOptions = input.field_groups_options; const groups = formData.field_groups || []; const object_field_groups = formData.object_field_groups || []; const groupsForMixing = groupsOptions.map(function (item) { return { group_name: item } }); const mixedGroups = lodash.unionBy(groups, groupsForMixing, object_field_groups, \\\"group_name\\\"); return { field_groups: mixedGroups }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: mixingGroupsFromFields(eventData, context.props.data) }});\"\n }\n ]\n }\n },\n \"messages\": {}\n }\n },\n \"related_lists\":{\n \"amis\":{\n \"type\": \"service\",\n \"id\": \"u:dbadaff47153\",\n \"api\": {\n \"method\": \"get\",\n \"url\": \"\\${context.rootUrl}/service/api/amis-metadata-objects/objects/\\${object_name}/relatedLists/options\",\n \"sendOn\": \"!!this.object_name\",\n \"adaptor\": \"let data = payload.data;data.related_lists_options = data.options;delete data.options;payload.data = data;return payload;\",\n \"headers\": {\n \"Authorization\": \"Bearer \\${context.tenantId},\\${context.authToken}\"\n }\n },\n \"className\": \"col-span-2 m-0\",\n \"affixFooter\": false,\n \"body\": [\n {\n \"name\": \"related_lists\",\n \"type\": \"crud\",\n \"strictMode\": true,\n \"affixHeader\": false,\n \"editable\": true,\n \"addable\": true,\n \"removable\": true,\n \"draggable\": false,\n \"columns\": [\n {\n \"name\": \"related_field_fullname_label\",\n \"label\": \"\\${'object_layouts.object_layouts_form.related_list_name' | t}\",\n \"type\": \"tpl\",\n \"tpl\": \"\\${related_lists_options|filter:value:equals:related_field_fullname|pick:label}\",\n \"id\": \"u:5204fc0fbe1c\"\n },\n {\n \"name\": \"label\",\n \"label\": \"\\${'object_layouts.object_layouts_form.related_list_label' | t}\",\n \"quickEdit\": {\n \"type\": \"input-text\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForRelatedList = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input; delete rowValue.event; const formValue = rowValue.__super.__super; const related_field_fullname = rowValue.related_field_fullname; rowValue[prop_name] = currentPropValue; let newRelatedLists = formValue.related_lists.map(function (item) { if (item.related_field_fullname == related_field_fullname) { if (prop_name === \\\"related_field_fullname\\\") { return { related_field_fullname: currentPropValue, sort_order: \\\"asc\\\" } } else { return Object.assign({}, item, rowValue); } } else { return item; } }); const newFormDoc = { related_lists: newRelatedLists }; if (prop_name === \\\"field_names\\\" || prop_name === \\\"sort_field_name\\\") { const currentOptions = {}; currentOptions[related_field_fullname] = input.options; newFormDoc.related_object_fields_options = Object.assign({}, formValue.related_object_fields_options, currentOptions); }; return newFormDoc;};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForRelatedList(eventData, \\\"label\\\") }});\"\n }\n ]\n }\n },\n \"labelRemark\": \"\\${'object_layouts.object_layouts_form.related_list_label_remark' | t}\",\n \"className\": \"m-0\",\n \"labelClassName\": \"text-left\",\n \"id\": \"u:5b30f2a71830\",\n \"name\": \"label\",\n \"mode\":\"popOver\"\n },\n \"id\": \"u:1267e4351d66\",\n \"placeholder\": \"-\"\n },\n {\n \"name\": \"field_names\",\n \"label\": \"\\${'object_layouts.object_layouts_form.field_names' | t}\",\n \"quickEdit\": {\n \"type\": \"transfer-picker\",\n \"source\": {\n \"method\": \"get\",\n \"url\": \"/service/api/amis-metadata-objects/objects/\\${related_field_fullname|split:.|first}/fields/options\",\n \"cache\": 60000,\n \"headers\": {\n \"Authorization\": \"Bearer \\${context.tenantId},\\${context.authToken}\"\n }\n },\n \"searchable\": true,\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForRelatedList = function (input, rowValue, prop_name) { const currentPropValue = input.value; delete rowValue.event; const formValue = rowValue.__super.__super; const related_field_fullname = rowValue.related_field_fullname; rowValue[prop_name] = currentPropValue; let newRelatedLists = formValue.related_lists.map(function (item) { if (item.related_field_fullname == related_field_fullname) { if (prop_name === \\\"related_field_fullname\\\") { return { related_field_fullname: currentPropValue, sort_order: \\\"asc\\\" } } else { return Object.assign({}, item, rowValue); } } else { return item; } }); const newFormDoc = { related_lists: newRelatedLists }; if (prop_name === \\\"field_names\\\" || prop_name === \\\"sort_field_name\\\") { const currentOptions = {}; currentOptions[related_field_fullname] = input.options; newFormDoc.related_object_fields_options = Object.assign({}, formValue.related_object_fields_options, currentOptions); } return newFormDoc;};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForRelatedList(eventData, context.props.data, \\\"field_names\\\") }});\"\n }\n ]\n }\n },\n \"joinValues\": false,\n \"extractValue\": true,\n \"mode\": \"inline\",\n \"id\": \"u:a85f62af394f\",\n \"name\": \"field_names\"\n },\n \"type\": \"tpl\",\n \"tpl\": \"<%= data.related_object_fields_options && data.related_object_fields_options[data.related_field_fullname] ? data.related_object_fields_options[data.related_field_fullname].filter(function(item){ return data.field_names && data.field_names.indexOf(item.value) > -1;}).map(function(item){return item.label}) : data.field_names%>\",\n \"id\": \"u:ce65d4020107\",\n \"placeholder\": \"-\"\n },\n {\n \"name\": \"sort_field_name\",\n \"label\": \"\\${'object_layouts.object_layouts_form.sort_field_name' | t}\",\n \"quickEdit\": {\n \"type\": \"transfer-picker\",\n \"joinValues\": false,\n \"extractValue\": true,\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForRelatedList = function (input, rowValue, prop_name) { const currentPropValue = input.value; delete rowValue.event; const formValue = rowValue.__super.__super; const related_field_fullname = rowValue.related_field_fullname; rowValue[prop_name] = currentPropValue; let newRelatedLists = formValue.related_lists.map(function (item) { if (item.related_field_fullname == related_field_fullname) { if (prop_name === \\\"related_field_fullname\\\") { return { related_field_fullname: currentPropValue, sort_order: \\\"asc\\\" } } else { return Object.assign({}, item, rowValue); } } else { return item; } }); const newFormDoc = { related_lists: newRelatedLists }; if (prop_name === \\\"field_names\\\" || prop_name === \\\"sort_field_name\\\") { const currentOptions = {}; currentOptions[related_field_fullname] = input.options; newFormDoc.related_object_fields_options = Object.assign({}, formValue.related_object_fields_options, currentOptions); } return newFormDoc;};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForRelatedList(eventData, context.props.data, \\\"sort_field_name\\\") }});\"\n }\n ]\n }\n },\n \"source\": {\n \"method\": \"get\",\n \"url\": \"/service/api/amis-metadata-objects/objects/\\${related_field_fullname|split:.|first}/fields/options\",\n \"cache\": 60000,\n \"headers\": {\n \"Authorization\": \"Bearer \\${context.tenantId},\\${context.authToken}\"\n }\n },\n \"searchable\": true,\n \"name\": \"sort_field_name\",\n \"id\": \"u:c1e3daddf92c\",\n \"mode\": \"inline\"\n },\n \"tpl\": \"<%= data.related_object_fields_options && data.related_object_fields_options[data.related_field_fullname] ? data.related_object_fields_options[data.related_field_fullname].filter(function(item){ return data.sort_field_name && data.sort_field_name.indexOf(item.value) > -1;}).map(function(item){return item.label}) : data.sort_field_name%>\",\n \"id\": \"u:3dbee6a855c4\"\n },\n {\n \"name\": \"sort_order\",\n \"label\": \"\\${'object_layouts.object_layouts_form.sort_order' | t}\",\n \"quickEdit\": {\n \"className\": \"m-0\",\n \"labelClassName\": \"text-left\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForRelatedList = function (input, rowValue, prop_name) { const currentPropValue = input.value; delete rowValue.event; const formValue = rowValue.__super.__super; const related_field_fullname = rowValue.related_field_fullname; rowValue[prop_name] = currentPropValue; let newRelatedLists = formValue.related_lists.map(function (item) { if (item.related_field_fullname == related_field_fullname) { if (prop_name === \\\"related_field_fullname\\\") { return { related_field_fullname: currentPropValue, sort_order: \\\"asc\\\" } } else { return Object.assign({}, item, rowValue); } } else { return item; } }); const newFormDoc = { related_lists: newRelatedLists }; if (prop_name === \\\"field_names\\\" || prop_name === \\\"sort_field_name\\\") { const currentOptions = {}; currentOptions[related_field_fullname] = input.options; newFormDoc.related_object_fields_options = Object.assign({}, formValue.related_object_fields_options, currentOptions); } return newFormDoc;};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForRelatedList(eventData, context.props.data, \\\"sort_order\\\") }});\"\n }\n ]\n }\n },\n \"joinValues\": false,\n \"extractValue\": true,\n \"clearable\": true,\n \"labelField\": \"label\",\n \"valueField\": \"value\",\n \"mode\": \"popOver\",\n \"source\": \"\\${sort_order_options}\",\n \"type\": \"select\",\n \"name\": \"sort_order\",\n \"id\": \"u:951e05ace916\",\n \"multiple\": false\n },\n \"breakpoint\": \"*\",\n \"type\": \"tpl\",\n \"tpl\": \"\\${sort_order_options|filter:value:equals:sort_order|pick:label}\",\n \"id\": \"u:13cb3d304615\"\n },\n {\n \"name\": \"filters\",\n \"label\": \"\\${'object_layouts.object_layouts_form.filters_rule' | t}\",\n \"quickEdit\": {\n \"type\": \"editor\",\n \"language\": \"javascript\",\n \"description\": \"\\${'object_layouts.object_layouts_form.filters_rule_description' | t}\",\n \"tpl\": \"<b><%=data.filters%></b>\",\n \"className\": \"col-span-2 m-0\",\n \"labelClassName\": \"text-left\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForRelatedList = function (input, rowValue, prop_name) { const currentPropValue = input.value; delete rowValue.event; const formValue = rowValue.__super.__super; const related_field_fullname = rowValue.related_field_fullname; rowValue[prop_name] = currentPropValue; let newRelatedLists = formValue.related_lists.map(function (item) { if (item.related_field_fullname == related_field_fullname) { if (prop_name === \\\"related_field_fullname\\\") { return { related_field_fullname: currentPropValue, sort_order: \\\"asc\\\" } } else { return Object.assign({}, item, rowValue); } } else { return item; } }); const newFormDoc = { related_lists: newRelatedLists }; if (prop_name === \\\"field_names\\\" || prop_name === \\\"sort_field_name\\\") { const currentOptions = {}; currentOptions[related_field_fullname] = input.options; newFormDoc.related_object_fields_options = Object.assign({}, formValue.related_object_fields_options, currentOptions); } return newFormDoc;};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForRelatedList(eventData, context.props.data, \\\"filters\\\") }});\"\n }\n ]\n }\n },\n \"name\": \"filters\",\n \"id\": \"u:0436e626f06a\",\n \"minRows\": 3,\n \"maxRows\": 20\n },\n \"breakpoint\": \"*\",\n \"id\": \"u:e4c367804b67\"\n },\n {\n \"name\": \"visible_on\",\n \"label\": \"\\${'object_layouts.object_layouts_form.visibile_on' | t}\",\n \"quickEdit\": {\n \"type\": \"input-text\",\n \"className\": \"m-0\",\n \"labelClassName\": \"text-left\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForRelatedList = function (input, rowValue, prop_name) { let currentPropValue = input.value; delete rowValue.event; const formValue = rowValue.__super.__super; const related_field_fullname = rowValue.related_field_fullname; if (currentPropValue.startsWith(\\\"\\\\$\\\\{\\\")) { currentPropValue = \\\"\\\\\\\\\\\" + currentPropValue }; rowValue[prop_name] = currentPropValue; let newRelatedLists = formValue.related_lists.map(function (item) { if (item.related_field_fullname == related_field_fullname) { if (prop_name === \\\"related_field_fullname\\\") { return { related_field_fullname: currentPropValue, sort_order: \\\"asc\\\" } } else { return Object.assign({}, item, rowValue); } } else { return item; } }); const newFormDoc = { related_lists: newRelatedLists }; if (prop_name === \\\"field_names\\\" || prop_name === \\\"sort_field_name\\\") { const currentOptions = {}; currentOptions[related_field_fullname] = input.options; newFormDoc.related_object_fields_options = Object.assign({}, formValue.related_object_fields_options, currentOptions); } return newFormDoc;};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForRelatedList(eventData, context.props.data, \\\"visible_on\\\") }});\"\n }\n ]\n }\n },\n \"tpl\": \"<b><%=data.visible_on%></b>\",\n \"name\": \"visible_on\",\n \"id\": \"u:3106cc0f9cc7\",\n \"minRows\": 3,\n \"maxRows\": 20,\n \"mode\": \"popOver\"\n },\n \"breakpoint\": \"*\",\n \"id\": \"u:1e1dc52d7c33\"\n },\n {\n \"name\": \"page_size\",\n \"label\": \"\\${'object_layouts.object_layouts_form.page_size' | t}\",\n \"quickEdit\": {\n \"type\": \"input-number\",\n \"precision\": 0,\n \"className\": \"m-0\",\n \"labelClassName\": \"text-number\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const quickEidtSaveForRelatedList = function (input, rowValue, prop_name) { const currentPropValue = input.value; delete rowValue.event; const formValue = rowValue.__super.__super; const related_field_fullname = rowValue.related_field_fullname; rowValue[prop_name] = currentPropValue; let newRelatedLists = formValue.related_lists.map(function (item) { if (item.related_field_fullname == related_field_fullname) { if (prop_name === \\\"related_field_fullname\\\") { return { related_field_fullname: currentPropValue, sort_order: \\\"asc\\\" } } else { return Object.assign({}, item, rowValue); } } else { return item; } }); const newFormDoc = { related_lists: newRelatedLists }; if (prop_name === \\\"field_names\\\" || prop_name === \\\"sort_field_name\\\") { const currentOptions = {}; currentOptions[related_field_fullname] = input.options; newFormDoc.related_object_fields_options = Object.assign({}, formValue.related_object_fields_options, currentOptions); } return newFormDoc;};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: quickEidtSaveForRelatedList(eventData, context.props.data, \\\"page_size\\\") }});\"\n }\n ]\n }\n },\n \"name\": \"page_size\",\n \"mode\": \"popOver\",\n \"id\": \"u:0e261f265511\"\n },\n \"breakpoint\": \"*\",\n \"id\": \"u:f9bbd9567bbd\"\n }\n ],\n \"className\": \"col-span-2 m-0\",\n \"labelClassName\": \"text-left\",\n \"headerToolbar\": [\n {\n \"type\": \"button\",\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"title\": \"\\${'object_layouts.object_layouts_form.set_related_list' | t}\",\n \"body\": [\n {\n \"type\": \"transfer\",\n \"name\": \"picked_related_lists\",\n \"sortable\": true,\n \"source\": \"\\${related_lists_options}\",\n \"value\": \"\\${related_lists|pick:related_field_fullname}\",\n \"searchable\": true,\n \"id\": \"u:ab6a6c9c8677\"\n }\n ],\n \"onEvent\": {\n \"confirm\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const clearRelatedLists = function (input) { return { related_lists: [] }};const convertDataForRelatedLists = function (input) { let pickedRelateds = input.picked_related_lists || []; const superRelateds = _.keyBy(input.__super.related_lists, 'related_field_fullname'); if (typeof pickedRelateds === \\\"string\\\") { pickedRelateds = pickedRelateds.split(\\\",\\\"); } const convertedRelateds = pickedRelateds.map(function (key) { return superRelateds[key] || { related_field_fullname: key, sort_order: \\\"asc\\\" } }); return { related_lists: convertedRelateds }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: clearRelatedLists() }});setTimeout(function () { doAction({ actionType: 'setValue', componentId: \\\"object-layout-form\\\", args: { value: convertDataForRelatedLists(eventData) } });}, 300);\"\n }\n ]\n }\n },\n \"type\": \"dialog\",\n \"size\": \"md\",\n \"id\": \"u:3663990f226a\",\n \"closeOnEsc\": false,\n \"closeOnOutside\": false,\n \"showCloseButton\": true\n },\n \"label\": \"\\${'object_layouts.object_layouts_form.set_related_list' | t}\",\n \"id\": \"u:b9a5d3b611d7\"\n }\n ],\n \"headerToolbarClassName\": \"px-1 pb-3\",\n \"source\": \"\\${related_lists}\",\n \"footable\": false,\n \"columnsTogglable\": false,\n \"messages\": {},\n \"tableClassName\": \"min-w-max\",\n \"id\": \"u:95aea10231d3\"\n }\n ],\n \"messages\": {}\n }\n },\n \"field_groups\":{\n \"hidden\": true\n }\n}",
|
|
51
504
|
"form": {
|
|
52
505
|
"id": "object-layout-form",
|
|
53
506
|
"data": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"body": {
|
|
39
39
|
"type": "tpl",
|
|
40
40
|
"className": "block",
|
|
41
|
-
"tpl": "<img class='slds-icon slds-icon_container slds-icon-standard-user' src='${context.rootUrl}/unpkg.com/@salesforce-ux/design-system/assets/icons/standard/user.svg'>",
|
|
41
|
+
"tpl": "<img class='slds-icon slds-icon_container slds-icon-standard-user' src='${context.rootUrl}/unpkg.com/@salesforce-ux/design-system@2.22.2/assets/icons/standard/user.svg'>",
|
|
42
42
|
"id": "u:9207cb731ca4"
|
|
43
43
|
},
|
|
44
44
|
"md": "auto",
|
|
@@ -6,6 +6,7 @@ const AmisFormInputs = [
|
|
|
6
6
|
'text',
|
|
7
7
|
'date',
|
|
8
8
|
'file',
|
|
9
|
+
'color',
|
|
9
10
|
'avatar',
|
|
10
11
|
'image',
|
|
11
12
|
'datetime',
|
|
@@ -50,7 +51,7 @@ function getAmisStaticFieldType(type, readonly){
|
|
|
50
51
|
}
|
|
51
52
|
return type;
|
|
52
53
|
}
|
|
53
|
-
if(_.include(['text'], type)){
|
|
54
|
+
if(_.include(['text','color'], type)){
|
|
54
55
|
return `static-${type}`;
|
|
55
56
|
}else{
|
|
56
57
|
return 'static';
|
|
@@ -67,6 +68,8 @@ function getAmisFieldType(sField){
|
|
|
67
68
|
return 'html';
|
|
68
69
|
case 'select':
|
|
69
70
|
return 'select';
|
|
71
|
+
case 'color':
|
|
72
|
+
return 'color';
|
|
70
73
|
case 'boolean':
|
|
71
74
|
return 'checkbox';
|
|
72
75
|
case 'date':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "2b56101256aa6fa0069d86bd373e4e368bd7d073",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tailwindcss": "3.2.4"
|
|
19
19
|
}
|
|
@@ -124,10 +124,18 @@
|
|
|
124
124
|
margin-top: -0.75rem
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
.mb-2 {
|
|
128
|
+
margin-bottom: 0.5rem
|
|
129
|
+
}
|
|
130
|
+
|
|
127
131
|
.mt-3 {
|
|
128
132
|
margin-top: 0.75rem
|
|
129
133
|
}
|
|
130
134
|
|
|
135
|
+
.mr-7 {
|
|
136
|
+
margin-right: 1.75rem
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
.mb-0 {
|
|
132
140
|
margin-bottom: 0px
|
|
133
141
|
}
|
|
@@ -188,18 +196,14 @@
|
|
|
188
196
|
width: 2.25rem
|
|
189
197
|
}
|
|
190
198
|
|
|
191
|
-
.w-
|
|
192
|
-
width:
|
|
199
|
+
.w-full {
|
|
200
|
+
width: 100%
|
|
193
201
|
}
|
|
194
202
|
|
|
195
203
|
.w-6\/12 {
|
|
196
204
|
width: 50%
|
|
197
205
|
}
|
|
198
206
|
|
|
199
|
-
.w-full {
|
|
200
|
-
width: 100%
|
|
201
|
-
}
|
|
202
|
-
|
|
203
207
|
.w-4\/5 {
|
|
204
208
|
width: 80%
|
|
205
209
|
}
|
|
@@ -208,11 +212,6 @@
|
|
|
208
212
|
width: 24rem
|
|
209
213
|
}
|
|
210
214
|
|
|
211
|
-
.min-w-max {
|
|
212
|
-
min-width: -moz-max-content;
|
|
213
|
-
min-width: max-content
|
|
214
|
-
}
|
|
215
|
-
|
|
216
215
|
.min-w-\[240px\] {
|
|
217
216
|
min-width: 240px
|
|
218
217
|
}
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"PaginationWrapper.placeholder": "请配置内容",
|
|
47
47
|
"Pagination.select": "{{count}} 条/页",
|
|
48
48
|
"Pagination.goto": "跳转至",
|
|
49
|
-
"Pagination.go": "
|
|
49
|
+
"Pagination.go": "跳转",
|
|
50
50
|
"Pagination.totalPage": "共 {{lastPage}} 页",
|
|
51
51
|
"Pagination.totalCount": "共 {{total}} 条",
|
|
52
52
|
"Date.titleYear": "选择年",
|