@steedos/service-core-objects 3.0.0-beta.94 → 3.0.0-beta.96
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/objectTranslations/object_actions.en/object_actions.en.objectTranslation.yml +3 -0
- package/main/default/objectTranslations/object_actions.zh-CN/object_actions.zh-CN.objectTranslation.yml +3 -0
- package/main/default/objectTranslations/object_validation_rules.en/object_validation_rules.en.objectTranslation.yml +3 -3
- package/main/default/objectTranslations/object_webhooks.en/object_webhooks.en.objectTranslation.yml +4 -0
- package/main/default/objectTranslations/object_webhooks.zh-CN/object_webhooks.zh-CN.objectTranslation.yml +4 -0
- package/main/default/objectTranslations/objects.en/objects.en.objectTranslation.yml +16 -0
- package/main/default/objectTranslations/objects.zh-CN/objects.zh-CN.objectTranslation.yml +16 -0
- package/main/default/objects/apps/apps.object.yml +1 -1
- package/main/default/objects/object_actions/buttons/showDesign.button.js +5 -1
- package/main/default/pages/apps_form.page.amis.json +337 -0
- package/main/default/pages/apps_form.page.yml +12 -0
- package/main/default/pages/object_fields_form.page.amis.json +1 -1
- package/main/default/pages/object_form.page.amis.json +1 -1
- package/main/default/routes/amis_button_design.ejs +4 -1
- package/main/default/routes/amis_button_design.router.js +3 -2
- package/package.json +3 -3
|
@@ -17,17 +17,17 @@ fields:
|
|
|
17
17
|
(false).
|
|
18
18
|
description:
|
|
19
19
|
description:
|
|
20
|
-
label:
|
|
20
|
+
label: Description
|
|
21
21
|
help:
|
|
22
22
|
description:
|
|
23
23
|
error_condition_formula:
|
|
24
|
-
label:
|
|
24
|
+
label: Error Condition Formula
|
|
25
25
|
help: >-
|
|
26
26
|
The formula defined in the validation rule. If the formula returns a value
|
|
27
27
|
of true, an error message is displayed.
|
|
28
28
|
description:
|
|
29
29
|
error_message:
|
|
30
|
-
label:
|
|
30
|
+
label: Error Message
|
|
31
31
|
help: >-
|
|
32
32
|
The message that appears if the validation rule fails. The message must be
|
|
33
33
|
255 characters or less.
|
package/main/default/objectTranslations/object_webhooks.en/object_webhooks.en.objectTranslation.yml
CHANGED
|
@@ -23,6 +23,10 @@ fields:
|
|
|
23
23
|
- label: The record has been deleted.
|
|
24
24
|
value: delete
|
|
25
25
|
description:
|
|
26
|
+
condition:
|
|
27
|
+
label: Admission conditions
|
|
28
|
+
help: Specify access conditions to reduce the number of triggered executions. Minimizing the number of unnecessary executions will help save resources. If you create something that will be triggered when the record is updated, we recommend defining the admission conditions first. Then, for when to run for the updated record, select the option "Only when the updated record meets the condition requirements".
|
|
29
|
+
description:
|
|
26
30
|
fields:
|
|
27
31
|
label: Fields
|
|
28
32
|
help:
|
|
@@ -167,6 +167,22 @@ fields:
|
|
|
167
167
|
label: Highlight Fields
|
|
168
168
|
is_customize:
|
|
169
169
|
label: Customize
|
|
170
|
+
field_groups:
|
|
171
|
+
label: Field Grouping
|
|
172
|
+
help:
|
|
173
|
+
description:
|
|
174
|
+
field_groups.$.group_name:
|
|
175
|
+
label: Name
|
|
176
|
+
help:
|
|
177
|
+
description:
|
|
178
|
+
field_groups.$.collapsed:
|
|
179
|
+
label: Collapsed by default
|
|
180
|
+
help:
|
|
181
|
+
description:
|
|
182
|
+
field_groups.$.visible_on:
|
|
183
|
+
label: Visible On
|
|
184
|
+
help:
|
|
185
|
+
description:
|
|
170
186
|
groups:
|
|
171
187
|
feature: Features
|
|
172
188
|
advanced: Advanced
|
|
@@ -174,6 +174,22 @@ fields:
|
|
|
174
174
|
description: 高亮字段显示在记录详情页的顶部。
|
|
175
175
|
is_customize:
|
|
176
176
|
label: 自定义
|
|
177
|
+
field_groups:
|
|
178
|
+
label: 字段分组
|
|
179
|
+
help:
|
|
180
|
+
description:
|
|
181
|
+
field_groups.$.group_name:
|
|
182
|
+
label: 名称
|
|
183
|
+
help:
|
|
184
|
+
description:
|
|
185
|
+
field_groups.$.collapsed:
|
|
186
|
+
label: 默认折叠
|
|
187
|
+
help:
|
|
188
|
+
description:
|
|
189
|
+
field_groups.$.visible_on:
|
|
190
|
+
label: 显示条件
|
|
191
|
+
help:
|
|
192
|
+
description:
|
|
177
193
|
groups:
|
|
178
194
|
feature: 功能
|
|
179
195
|
advanced: 高级
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
showDesign:function (object_name, record_id) {
|
|
3
|
-
|
|
3
|
+
var locale = Builder.settings.context?.user?.language || window.navigator.language;
|
|
4
|
+
if(locale === 'en' || locale.startsWith('en-')){
|
|
5
|
+
locale = 'en-US'
|
|
6
|
+
}
|
|
7
|
+
document.location = Steedos.absoluteUrl(`/api/amisButtonDesign?id=${record_id}&object=${this.record.record.object}&assetUrls=${Builder.settings.assetUrls}&locale=${locale}`);
|
|
4
8
|
},
|
|
5
9
|
showDesignVisible:function (object_name, record_id, record_permissions, data) {
|
|
6
10
|
var perms;
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "page",
|
|
3
|
+
"title": "Welcome to Steedos",
|
|
4
|
+
"body": [
|
|
5
|
+
{
|
|
6
|
+
"type": "steedos-object-form",
|
|
7
|
+
"className": "sm:border sm:rounded sm:border-gray-300 bg-white p-4",
|
|
8
|
+
"label": "对象表单",
|
|
9
|
+
"objectApiName": "apps",
|
|
10
|
+
"recordId": "${recordId}",
|
|
11
|
+
"mode": "edit",
|
|
12
|
+
"fieldsExtend": {
|
|
13
|
+
"tab_items": {
|
|
14
|
+
"amis": {
|
|
15
|
+
"name": "tab_items",
|
|
16
|
+
"type": "steedos-input-table",
|
|
17
|
+
"label": "",
|
|
18
|
+
"showIndex": true,
|
|
19
|
+
"source": "${tab_items}",
|
|
20
|
+
"strictMode": true,
|
|
21
|
+
"affixHeader": false,
|
|
22
|
+
"editable": true,
|
|
23
|
+
"addable": false,
|
|
24
|
+
"removable": true,
|
|
25
|
+
"draggable": false,
|
|
26
|
+
"fields": [
|
|
27
|
+
{
|
|
28
|
+
"label": "${'apps.apps_form.tab' | t}",
|
|
29
|
+
"type": "lookup",
|
|
30
|
+
"multiple": false,
|
|
31
|
+
"is_wide": false,
|
|
32
|
+
"required": true,
|
|
33
|
+
"reference_to": "tabs",
|
|
34
|
+
"reference_to_field": "name",
|
|
35
|
+
"sort_no": 30,
|
|
36
|
+
"name": "tab_name",
|
|
37
|
+
"hidden": false,
|
|
38
|
+
"readonly": false,
|
|
39
|
+
"disabled": false,
|
|
40
|
+
"_prefix": "tab_items."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"label": "${'apps.apps_form.tab_grouping' | t}",
|
|
44
|
+
"name": "group",
|
|
45
|
+
"_prefix": "tab_items.",
|
|
46
|
+
"type": "text",
|
|
47
|
+
"amis": {
|
|
48
|
+
"type": "select",
|
|
49
|
+
"source": "${tab_groups|pick:group_name}",
|
|
50
|
+
"onEvent": {
|
|
51
|
+
"change": {
|
|
52
|
+
"actions": [
|
|
53
|
+
{
|
|
54
|
+
"actionType": "custom",
|
|
55
|
+
"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);"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"placeholder": "-"
|
|
61
|
+
},
|
|
62
|
+
"className": "m-0",
|
|
63
|
+
"checkAll": false,
|
|
64
|
+
"selectFirst": false,
|
|
65
|
+
"searchable": true,
|
|
66
|
+
"clearable": true,
|
|
67
|
+
"multiple": false,
|
|
68
|
+
"mode": "inline"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"columns": [
|
|
72
|
+
{
|
|
73
|
+
"name": "tab_name",
|
|
74
|
+
"inlineEditMode": false
|
|
75
|
+
},
|
|
76
|
+
"group"
|
|
77
|
+
],
|
|
78
|
+
"headerToolbar": [
|
|
79
|
+
{
|
|
80
|
+
"type": "service",
|
|
81
|
+
"id": "tabs-options-service",
|
|
82
|
+
"className": "mb-2",
|
|
83
|
+
"body": [
|
|
84
|
+
{
|
|
85
|
+
"type": "button",
|
|
86
|
+
"id": "u:a35a2276145d",
|
|
87
|
+
"label": "${'apps.apps_form.tab_generate' | t}",
|
|
88
|
+
"hidden": true,
|
|
89
|
+
"onEvent": {
|
|
90
|
+
"click": {
|
|
91
|
+
"actions": [
|
|
92
|
+
{
|
|
93
|
+
"script": "const appId = null; const page = Steedos.Page.getPage('app', appId, null, null, 'generate_object_tabs'); if (page && page.schema) { const pageSchema = JSON.parse(page.schema); let formSchema = pageSchema.body[0]; formSchema.canAccessSuperData = false; formSchema.wrapWithPanel = false; formSchema.className = 'steedos-amis-form'; const title = t('apps.apps_form.tab_generate_title'); doAction({ 'actionType': 'dialog', 'dialog': { 'type': 'dialog', 'title': title, 'body': formSchema, 'size': 'lg' } }); }",
|
|
94
|
+
"actionType": "custom"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"weight": 0
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"tpl": "内容"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"type": "button",
|
|
104
|
+
"label": "${'apps.apps_form.tab_set' | t}",
|
|
105
|
+
"id": "u:853b890ab524",
|
|
106
|
+
"actionType": "dialog",
|
|
107
|
+
"dialog": {
|
|
108
|
+
"type": "dialog",
|
|
109
|
+
"title": "${'apps.apps_form.tab_set' | t}",
|
|
110
|
+
"body": [
|
|
111
|
+
{
|
|
112
|
+
"type": "transfer",
|
|
113
|
+
"name": "picked_tabs",
|
|
114
|
+
"value": "${tab_items|pick:tab_name}",
|
|
115
|
+
"sortable": true,
|
|
116
|
+
"source": "${tabs_options}",
|
|
117
|
+
"searchable": true,
|
|
118
|
+
"itemHeight": 40,
|
|
119
|
+
"id": "u:f2d36873abd1"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"onEvent": {
|
|
123
|
+
"confirm": {
|
|
124
|
+
"actions": [
|
|
125
|
+
{
|
|
126
|
+
"actionType": "custom",
|
|
127
|
+
"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) }});"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"size": "lg",
|
|
133
|
+
"id": "u:9c93896a73cf",
|
|
134
|
+
"closeOnEsc": false,
|
|
135
|
+
"closeOnOutside": false,
|
|
136
|
+
"showCloseButton": true,
|
|
137
|
+
"showErrorMsg": true,
|
|
138
|
+
"showLoading": true,
|
|
139
|
+
"dataMapSwitch": false
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"type": "button",
|
|
144
|
+
"label": "${'apps.apps_form.tab_grouping_set' | t}",
|
|
145
|
+
"actionType": "dialog",
|
|
146
|
+
"dialog": {
|
|
147
|
+
"title": "${'apps.apps_form.tab_grouping_set' | t}",
|
|
148
|
+
"body": [
|
|
149
|
+
{
|
|
150
|
+
"type": "input-table",
|
|
151
|
+
"name": "setting_groups",
|
|
152
|
+
"value": "${tab_groups}",
|
|
153
|
+
"addable": true,
|
|
154
|
+
"draggable": true,
|
|
155
|
+
"editable": true,
|
|
156
|
+
"needConfirm": false,
|
|
157
|
+
"columns": [
|
|
158
|
+
{
|
|
159
|
+
"name": "group_name",
|
|
160
|
+
"label": "${'apps.apps_form.tab_grouping_name' | t}",
|
|
161
|
+
"id": "u:383c7744b499"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "default_open",
|
|
165
|
+
"label": "${'apps.apps_form.tab_grouping_open' | t}",
|
|
166
|
+
"id": "u:7a243c84ed66",
|
|
167
|
+
"type": "checkbox",
|
|
168
|
+
"value": true
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"removable": true,
|
|
172
|
+
"id": "setting_groups"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"onEvent": {
|
|
176
|
+
"confirm": {
|
|
177
|
+
"actions": [
|
|
178
|
+
{
|
|
179
|
+
"actionType": "custom",
|
|
180
|
+
"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);"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"type": "dialog",
|
|
186
|
+
"size": "lg",
|
|
187
|
+
"id": "setting_groups",
|
|
188
|
+
"closeOnEsc": false,
|
|
189
|
+
"closeOnOutside": false,
|
|
190
|
+
"showCloseButton": true,
|
|
191
|
+
"showErrorMsg": true,
|
|
192
|
+
"showLoading": true,
|
|
193
|
+
"dataMapSwitch": false
|
|
194
|
+
},
|
|
195
|
+
"id": "u:111b043b193c"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"messages": {
|
|
199
|
+
},
|
|
200
|
+
"api": {
|
|
201
|
+
"method": "post",
|
|
202
|
+
"url": "${context.rootUrl}/graphql",
|
|
203
|
+
"adaptor": "let data = payload.data;\ndata.tabs_options = [];\nif (data.options && data.options.length) {\n data.tabs_options = data.options.map(function (option) {\n option.label = option.label + '(' + option.value + ')';\n return option;\n });\n}\nif (!api.body.recordId) {\n const defaultValues = {\n is_creator: true,\n mobile: true,\n visible: true,\n sort: 9100\n };\n data = Object.assign({}, data, defaultValues);\n}\ndelete data.options;\npayload.data = data;\nreturn payload; ",
|
|
204
|
+
"data": {
|
|
205
|
+
"query": "{options:tabs{_id label:label value:name,type,object,desktop,mobile}}",
|
|
206
|
+
"recordId": "${recordId}"
|
|
207
|
+
},
|
|
208
|
+
"headers": {
|
|
209
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
210
|
+
},
|
|
211
|
+
"messages": {
|
|
212
|
+
},
|
|
213
|
+
"requestAdaptor": ""
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"enableDialog": false,
|
|
218
|
+
"id": "u:7949aecf0ca9"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"objects": {
|
|
222
|
+
"amis": {
|
|
223
|
+
"name": "objects",
|
|
224
|
+
"type": "select",
|
|
225
|
+
"className": "m-0",
|
|
226
|
+
"labelClassName": "text-left",
|
|
227
|
+
"id": "u:4e5047e44905",
|
|
228
|
+
"joinValues": false,
|
|
229
|
+
"extractValue": true,
|
|
230
|
+
"labelField": "label",
|
|
231
|
+
"valueField": "value",
|
|
232
|
+
"multiple": true,
|
|
233
|
+
"checkAll": false,
|
|
234
|
+
"searchable": true,
|
|
235
|
+
"menuTpl": "",
|
|
236
|
+
"source": {
|
|
237
|
+
"method": "get",
|
|
238
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
239
|
+
"headers": {
|
|
240
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"autoComplete": ""
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"mobile_objects": {
|
|
247
|
+
"amis": {
|
|
248
|
+
"name": "mobile_objects",
|
|
249
|
+
"type": "select",
|
|
250
|
+
"className": "m-0",
|
|
251
|
+
"labelClassName": "text-left",
|
|
252
|
+
"id": "u:cfaeb2f857a8",
|
|
253
|
+
"joinValues": false,
|
|
254
|
+
"extractValue": true,
|
|
255
|
+
"labelField": "label",
|
|
256
|
+
"valueField": "value",
|
|
257
|
+
"multiple": true,
|
|
258
|
+
"checkAll": false,
|
|
259
|
+
"searchable": true,
|
|
260
|
+
"menuTpl": "",
|
|
261
|
+
"source": {
|
|
262
|
+
"method": "get",
|
|
263
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
264
|
+
"messages": {
|
|
265
|
+
},
|
|
266
|
+
"headers": {
|
|
267
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"autoComplete": ""
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"visible_on": {
|
|
274
|
+
"amis": {
|
|
275
|
+
"type": "control",
|
|
276
|
+
"body": [
|
|
277
|
+
{
|
|
278
|
+
"type": "service",
|
|
279
|
+
"id": "u:edcd865de7d8",
|
|
280
|
+
"body": [
|
|
281
|
+
{
|
|
282
|
+
"type": "input-formula",
|
|
283
|
+
"name": "visible_on",
|
|
284
|
+
"evalMode": false,
|
|
285
|
+
"variableMode": "tabs",
|
|
286
|
+
"variables": "${visibleOnVariables}",
|
|
287
|
+
"visibleOn": "${visibleOnVariables}",
|
|
288
|
+
"id": "u:618105d5bfad",
|
|
289
|
+
"labelClassName": "none"
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"api": {
|
|
293
|
+
"method": "get",
|
|
294
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/apps/fields/options",
|
|
295
|
+
"cache": 30000,
|
|
296
|
+
"adaptor": "const visibleOnVariables = SteedosUI.getFormulaVariables(payload.data.options);\nconst defaultValueVariables = [visibleOnVariables[1]];\npayload = {\n data: {\n visibleOnVariables,\n defaultValueVariables\n }\n};\nreturn payload;",
|
|
297
|
+
"headers": {
|
|
298
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"dsType": "api"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
"id": "u:996ef29c6851"
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"enableTabs": true,
|
|
309
|
+
"debug": false,
|
|
310
|
+
"initApiRequestAdaptor": "",
|
|
311
|
+
"initApiAdaptor": "var data = payload.data;\nif (data.tab_items && !_.isArray(data.tab_items)) {\n // 数据库中存储的是对象格式而不是数组,转换为数组用于界面显示\n let arrTabItems = [];\n _.each(data.tab_items, function (n, k) {\n n.tab_name = k;\n delete n.index;\n arrTabItems.push(n);\n });\n data.tab_items = arrTabItems;\n}\nif (data._id && !data.tab_items) {\n const tabOptions = data.tabs_options || [];\n const tabItems = [];\n // 把应用中原来tabs属性值添加到新的tab_items属性的默认值中\n if (data.tabs && data.tabs.length) {\n data.tabs.forEach(function (item) {\n tabItems.push({ tab_name: item });\n });\n }\n const pushObjectsToTabItems = function (objects) {\n objects.forEach(function (item) {\n // 已经有绑定到指定对象的选项卡就不添加\n let existObjectItem = !!tabItems.find(function (tabItem) {\n return !!tabOptions.find(function (option) {\n return tabItem.tab_name === tabItem.value && option.object === item;\n });\n });\n if (existObjectItem) {\n return;\n }\n // 找到指向指定对象的选项卡\n let tempOption = tabOptions.find(function (option) {\n return option.type === \"object\" && option.object === item;\n });\n if (!tempOption) {\n return;\n }\n // 选项卡名称如果重复了就不添加\n let existTabItem = !!tabItems.find(function (tabItem) {\n return tabItem.tab_name === tempOption.value;\n });\n if (existTabItem) {\n return;\n }\n if (tempOption) {\n tabItems.push({ tab_name: tempOption.value });\n }\n });\n }\n // 把应用中原来objects属性值添加到新的tab_items属性的默认值中\n if (data.objects && data.objects.length) {\n pushObjectsToTabItems(data.objects);\n }\n // 把应用中原来mobile_objects属性值添加到新的tab_items属性的默认值中\n if (data.mobile_objects && data.mobile_objects.length) {\n pushObjectsToTabItems(data.mobile_objects);\n }\n data.tab_items = tabItems;\n}\n\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n ",
|
|
312
|
+
"apiRequestAdaptor": "delete formData.tabs_options;\nconst recordId = formData.recordId;\n\n// 新加字段tab_items,值同步回传到老字段tabs中兼容老UI界面\nformData.tabs = [];\nif (formData.tab_items && formData.tab_items.length) { \n formData.tabs = formData.tab_items.map(function (item) { return item.tab_name; });\n}\n\n/*\ntab_items存储为:\ntab_items: {\n test1:{\n group:\"xxx\"\n },\n test3:{\n group:\"yyy\"\n }\n}\n而不是:\ntab_items: [\n {\n \"index\":1,\n \"group\":\"xxx\"\n },\n {\n \"index\":2,\n \"group\":\"yyy\"\n }\n]\n*/\nif (formData.tab_items) { \n formData.tab_items = _.keyBy(formData.tab_items, \"tab_name\")\n let tempIndex = 0;\n _.each(formData.tab_items, function (n, k) {\n tempIndex++;\n n.index = tempIndex;\n delete n.tab_name;\n });\n}\n\nquery = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\nif(recordId){\n query = `mutation{record: ${objectName}__update(id: \"${recordId}\", doc: {__saveData}){_id}}`;\n};\n__saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = {query: query.replace('{__saveData}', __saveData)};\nreturn api;\n",
|
|
313
|
+
"apiAdaptor": "",
|
|
314
|
+
"form": {
|
|
315
|
+
"id": "object_form"
|
|
316
|
+
},
|
|
317
|
+
"id": "u:e1c1a841d373",
|
|
318
|
+
"tabsMode": "line"
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"regions": [
|
|
322
|
+
"body"
|
|
323
|
+
],
|
|
324
|
+
"data": {
|
|
325
|
+
"objectName": "apps",
|
|
326
|
+
"initialValues": {},
|
|
327
|
+
"appId": "builder",
|
|
328
|
+
"title": "",
|
|
329
|
+
"context": {
|
|
330
|
+
"rootUrl": "http://127.0.0.1:5800",
|
|
331
|
+
"tenantId": "64a4d6dd7fe9acaf8c330a37",
|
|
332
|
+
"userId": "683e09cd-8482-4034-bd29-5a30643e6c0f",
|
|
333
|
+
"authToken": "2906ff4353c25cfe291352f899ba3446aa5577f3de7ad60e1aa500c60dee7ca6fb446412f1c9693775b4cc"
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"id": "u:de840f3523f2"
|
|
337
|
+
}
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
id: "<%=id%>",
|
|
17
17
|
pageId: "<%=id%>",
|
|
18
18
|
messageOnly: true,
|
|
19
|
-
hiddenDeploy: true
|
|
19
|
+
hiddenDeploy: true,
|
|
20
|
+
title: "<%=locale%>" === 'zh-CN' ? '按钮设计器': 'Button Designer',
|
|
21
|
+
saveText: "<%=locale%>" === 'zh-CN' ? '保存': 'Save',
|
|
22
|
+
deployText: "<%=locale%>" === 'zh-CN' ? '发布': 'Deploy',
|
|
20
23
|
};
|
|
21
24
|
|
|
22
25
|
let comp = document.querySelector("builder-fiddle");
|
|
@@ -35,7 +35,7 @@ router.get('/api/amisButtonDesign', auth.requireAuthentication, async function (
|
|
|
35
35
|
// }
|
|
36
36
|
|
|
37
37
|
let locale = "zh-CN";
|
|
38
|
-
if (req.query.locale
|
|
38
|
+
if (req.query.locale?.startsWith('en')) {
|
|
39
39
|
locale = "en-US";
|
|
40
40
|
} else if (req.query.locale == "zh-cn") {
|
|
41
41
|
locale = "zh-CN";
|
|
@@ -56,7 +56,8 @@ router.get('/api/amisButtonDesign', auth.requireAuthentication, async function (
|
|
|
56
56
|
userId: userSession.userId,
|
|
57
57
|
authToken: userSession.authToken,
|
|
58
58
|
id: req.query.id,
|
|
59
|
-
userSession: userSession
|
|
59
|
+
userSession: userSession,
|
|
60
|
+
locale
|
|
60
61
|
}
|
|
61
62
|
const options = {}
|
|
62
63
|
ejs.renderFile(filename, data, options, function(err, str){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-core-objects",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.96",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"steedos"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@steedos/service-package-loader": "3.0.0-beta.
|
|
13
|
+
"@steedos/service-package-loader": "3.0.0-beta.96",
|
|
14
14
|
"json2xls": "^0.1.2",
|
|
15
15
|
"lodash": "^4.17.21"
|
|
16
16
|
},
|
|
17
17
|
"description": "steedos package",
|
|
18
18
|
"repository": {},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "96b68e266d217fce7ae35724edca75e53930db14"
|
|
21
21
|
}
|