@steedos/standard-object-database 2.7.0-beta.27 → 2.7.0-beta.28
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/objects/object_fields/fields/auto_fill_mapping.$.from.field.yml +1 -1
- package/main/default/objects/object_fields/fields/auto_fill_mapping.$.to.field.yml +1 -1
- package/main/default/objects/object_fields/fields/enable_enhanced_lookup.field.yml +1 -0
- package/main/default/objects/objects/fields/enable_enhanced_lookup.field.yml +2 -1
- package/main/default/pages/object_fields_form.page.amis.json +175 -188
- package/main/default/pages/object_form.page.amis.json +0 -1
- package/package.json +4 -4
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
name: enable_enhanced_lookup
|
|
2
2
|
defaultValue: true
|
|
3
3
|
group: advanced
|
|
4
|
-
hidden: false
|
|
4
|
+
hidden: false # 为兼容老版本魔方,不可以设置为true,只能用visible_on隐藏,否则前端拿不到该属性值,会造成老版本魔方升级后字段上未配置enable_enhanced_lookup的lookup字段默认不是弹出选择
|
|
5
5
|
inlineHelpText: >-
|
|
6
6
|
When enabled, the lookup field associated with this object displays its
|
|
7
7
|
options as a pop-up window.
|
|
8
8
|
label: Enable Enhanced Lookup
|
|
9
9
|
sort_no: 230
|
|
10
10
|
type: boolean
|
|
11
|
+
visible_on: '{{false}}'
|
|
@@ -1,199 +1,185 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "service",
|
|
3
|
-
"body": [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"value": {
|
|
20
|
-
"defaultValue": ""
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"expression": "${!!event.data.defaultValue_formula}"
|
|
3
|
+
"body": [{
|
|
4
|
+
"type": "steedos-object-form",
|
|
5
|
+
"label": "对象字段表单",
|
|
6
|
+
"objectApiName": "object_fields",
|
|
7
|
+
"recordId": "${recordId}",
|
|
8
|
+
"className": "",
|
|
9
|
+
"enableTabs": true,
|
|
10
|
+
"mode": "edit",
|
|
11
|
+
"layout": "horizontal",
|
|
12
|
+
"onEvent": {
|
|
13
|
+
"change": {
|
|
14
|
+
"actions": [{
|
|
15
|
+
"actionType": "setValue",
|
|
16
|
+
"args": {
|
|
17
|
+
"value": {
|
|
18
|
+
"defaultValue": ""
|
|
24
19
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
},
|
|
21
|
+
"expression": "${!!event.data.defaultValue_formula}"
|
|
22
|
+
}]
|
|
23
|
+
},
|
|
24
|
+
"inited": {
|
|
25
|
+
"actions": [{
|
|
26
|
+
"actionType": "ajax",
|
|
27
|
+
"api": {
|
|
28
|
+
"method": "get",
|
|
29
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object}/fields/options",
|
|
30
|
+
"cache": 30000,
|
|
31
|
+
"adaptor": "const visibleOnVariables = SteedosUI.getFormulaVariables(payload.data.options);\nconst defaultValueVariables = [visibleOnVariables[1]];\npayload = {\n data: {\n visibleOnVariables,\n defaultValueVariables\n }\n};\nreturn payload;",
|
|
32
|
+
"headers": {
|
|
33
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
34
|
+
}
|
|
38
35
|
}
|
|
39
|
-
}
|
|
40
36
|
},
|
|
41
37
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
"actionType": "setValue",
|
|
39
|
+
"args": {
|
|
40
|
+
"value": {
|
|
41
|
+
"visibleOnVariables": "${event.data.visibleOnVariables}",
|
|
42
|
+
"defaultValueVariables": "${event.data.defaultValueVariables}"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"componentId": "steedos_object_fields_service"
|
|
50
46
|
}
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"initApiAdaptor": "const defaultValue_field_value = payload.data.defaultValue;\nif (defaultValue_field_value && _.isString(defaultValue_field_value) && defaultValue_field_value.indexOf('{') > -1) {\n payload.data.defaultValue_formula = defaultValue_field_value;\n delete payload.data.defaultValue;\n}\n\nif (recordId) {\n var data = payload.data;\n if (data) {\n data.filters = window.amisConvert.filtersToConditions(data.filters || []);\n }\n payload.data = data;\n}\nreturn payload;",
|
|
51
|
+
"apiRequestAdaptor": "if (formData.defaultValue_formula) {\n formData.defaultValue = formData.defaultValue_formula\n}\nif ((formData.defaultValue_formula === \"\" || _.isNil(formData.defaultValue_formula)) && (formData.defaultValue === \"\" || _.isNil(formData.defaultValue))) { \n // 清空默认值公式编辑器中内容后,如果没有再给defaultValue设置值,则要把defaultValue值清空\n formData.defaultValue = null;\n}\ndelete formData.defaultValue_formula;\nif (formData.filters) {\n formData.filters = window.amisConvert.conditionsToFilters(formData.filters);\n}\n__saveData = JSON.stringify(JSON.stringify(formData));\napi.data = { query: query.replace('{__saveData}', __saveData) };\napi.data.query = api.data.query.replace('object_fields__update', 'object_fields__upsert');",
|
|
52
|
+
"submitSuccActions": [{
|
|
53
|
+
"actionType": "custom",
|
|
54
|
+
"script": "setTimeout(function(){doAction({'actionType': 'setValue','componentId': 'form_object_fields','args': {'value': {'sort_no': event.data.sort_no + 10}}})}, 300)"
|
|
53
55
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"actionType": "toast",
|
|
63
|
-
"args": {
|
|
64
|
-
"msgType": "success",
|
|
65
|
-
"msg": "操作成功, 请刷新浏览器后查看效果",
|
|
66
|
-
"position": "top-right"
|
|
67
|
-
}
|
|
56
|
+
{
|
|
57
|
+
"actionType": "toast",
|
|
58
|
+
"args": {
|
|
59
|
+
"msgType": "success",
|
|
60
|
+
"msg": "操作成功, 请刷新浏览器后查看效果",
|
|
61
|
+
"position": "top-right"
|
|
68
62
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"expression": "!!readonly"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"fieldsExtend": {
|
|
66
|
+
"readonly": {
|
|
67
|
+
"amis": {
|
|
68
|
+
"onEvent": {
|
|
69
|
+
"change": {
|
|
70
|
+
"actions": [{
|
|
71
|
+
"actionType": "setValue",
|
|
72
|
+
"componentId": "steedos_object_fields_form",
|
|
73
|
+
"args": {
|
|
74
|
+
"value": {
|
|
75
|
+
"static": false
|
|
85
76
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
"expression": "!!static"
|
|
77
|
+
},
|
|
78
|
+
"expression": "!!readonly"
|
|
79
|
+
}]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"id": "u:a32a4c461450"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"static": {
|
|
86
|
+
"amis": {
|
|
87
|
+
"onEvent": {
|
|
88
|
+
"change": {
|
|
89
|
+
"actions": [{
|
|
90
|
+
"actionType": "setValue",
|
|
91
|
+
"componentId": "steedos_object_fields_form",
|
|
92
|
+
"args": {
|
|
93
|
+
"value": {
|
|
94
|
+
"readonly": false
|
|
106
95
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
"componentId": "steedos_object_fields_form",
|
|
126
|
-
"expression": "${event.data.value}"
|
|
96
|
+
},
|
|
97
|
+
"expression": "!!static"
|
|
98
|
+
}]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"id": "u:7affdbb0ef6d"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": {
|
|
105
|
+
"amis": {
|
|
106
|
+
"onEvent": {
|
|
107
|
+
"change": {
|
|
108
|
+
"actions": [{
|
|
109
|
+
"actionType": "setValue",
|
|
110
|
+
"args": {
|
|
111
|
+
"value": {
|
|
112
|
+
"hidden": false
|
|
127
113
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"componentId": "steedos_object_fields_form",
|
|
147
|
-
"expression": "${event.data.value}"
|
|
114
|
+
},
|
|
115
|
+
"componentId": "steedos_object_fields_form",
|
|
116
|
+
"expression": "${event.data.value}"
|
|
117
|
+
}]
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"id": "u:adf4200a2170"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"hidden": {
|
|
124
|
+
"amis": {
|
|
125
|
+
"onEvent": {
|
|
126
|
+
"change": {
|
|
127
|
+
"actions": [{
|
|
128
|
+
"actionType": "setValue",
|
|
129
|
+
"args": {
|
|
130
|
+
"value": {
|
|
131
|
+
"required": false
|
|
148
132
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
"componentId": "steedos_object_fields_form"
|
|
133
|
+
},
|
|
134
|
+
"componentId": "steedos_object_fields_form",
|
|
135
|
+
"expression": "${event.data.value}"
|
|
136
|
+
}]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"id": "u:adf4200a2170"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"type": {
|
|
143
|
+
"amis": {
|
|
144
|
+
"onEvent": {
|
|
145
|
+
"change": {
|
|
146
|
+
"actions": [{
|
|
147
|
+
"actionType": "setValue",
|
|
148
|
+
"args": {
|
|
149
|
+
"value": {
|
|
150
|
+
"defaultValue": null
|
|
168
151
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
152
|
+
},
|
|
153
|
+
"componentId": "steedos_object_fields_form"
|
|
154
|
+
}]
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"disabledOn": "${is_system == true}",
|
|
158
|
+
"searchable": true,
|
|
159
|
+
"id": "u:5f21d4208685"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"filters": {
|
|
163
|
+
"amis": {
|
|
164
|
+
"type": "condition-builder",
|
|
165
|
+
"description": "",
|
|
166
|
+
"id": "u:a9f2232e30d7",
|
|
167
|
+
"source": {
|
|
168
|
+
"method": "get",
|
|
169
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-listviews/getFilterFields?objectName=${reference_to}",
|
|
170
|
+
"dataType": "json",
|
|
171
|
+
"headers": {
|
|
172
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"className": "col-span-2 m-0"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"filtersFunction": {
|
|
179
|
+
"hidden": true
|
|
180
|
+
},
|
|
181
|
+
"visible_on": {
|
|
182
|
+
"amis": {
|
|
197
183
|
"type": "input-formula",
|
|
198
184
|
"name": "formula",
|
|
199
185
|
"evalMode": false,
|
|
@@ -201,14 +187,15 @@
|
|
|
201
187
|
"variables": "${visibleOnVariables}",
|
|
202
188
|
"visibleOn": "${visibleOnVariables}",
|
|
203
189
|
"id": "u:618105d5bfad"
|
|
204
|
-
}
|
|
205
190
|
}
|
|
206
|
-
},
|
|
207
|
-
"form": {
|
|
208
|
-
"id": "steedos_object_fields_form"
|
|
209
191
|
}
|
|
210
|
-
}
|
|
211
|
-
|
|
192
|
+
},
|
|
193
|
+
"form": {
|
|
194
|
+
"id": "steedos_object_fields_form"
|
|
195
|
+
},
|
|
196
|
+
"id": "u:e17c57cce896",
|
|
197
|
+
"tabsMode": "line"
|
|
198
|
+
}],
|
|
212
199
|
"data": {
|
|
213
200
|
"context": {}
|
|
214
201
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-object-database",
|
|
3
|
-
"version": "2.7.0-beta.
|
|
3
|
+
"version": "2.7.0-beta.28",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"description": "steedos package",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@steedos-widgets/amis-lib": "^1.0.22",
|
|
15
|
-
"@steedos/metadata-core": "2.7.0-beta.
|
|
16
|
-
"@steedos/standard-objects": "2.7.0-beta.
|
|
15
|
+
"@steedos/metadata-core": "2.7.0-beta.28",
|
|
16
|
+
"@steedos/standard-objects": "2.7.0-beta.28"
|
|
17
17
|
},
|
|
18
18
|
"repository": {},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "55756b53104b59b3b678fd58b564dabd8fed1272"
|
|
21
21
|
}
|