@steedos/standard-object-database 2.7.0-beta.27 → 2.7.0-beta.29

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.
@@ -22,5 +22,5 @@ label: 'From:Fields in object that reference to'
22
22
  reference_to: object_fields
23
23
  reference_to_field: name
24
24
  required: true
25
- sort_no: 530
25
+ sort_no: 520
26
26
  type: lookup
@@ -58,5 +58,5 @@ label: 'To:Fields in the current form'
58
58
  reference_to: object_fields
59
59
  reference_to_field: name
60
60
  required: true
61
- sort_no: 520
61
+ sort_no: 530
62
62
  type: lookup
@@ -1,4 +1,5 @@
1
1
  name: enable_enhanced_lookup
2
+ defaultValue: true
2
3
  group: ui
3
4
  hidden: false
4
5
  label: Enable Enhanced Lookup
@@ -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
- "type": "steedos-object-form",
6
- "label": "对象字段表单",
7
- "objectApiName": "object_fields",
8
- "recordId": "${recordId}",
9
- "className": "",
10
- "enableTabs": true,
11
- "mode": "edit",
12
- "layout": "horizontal",
13
- "onEvent": {
14
- "change": {
15
- "actions": [
16
- {
17
- "actionType": "setValue",
18
- "args": {
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
- "inited": {
28
- "actions": [
29
- {
30
- "actionType": "ajax",
31
- "api": {
32
- "method": "get",
33
- "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${object}/fields/options",
34
- "cache": 30000,
35
- "adaptor": "const visibleOnVariables = SteedosUI.getFormulaVariables(payload.data.options);\nconst defaultValueVariables = [visibleOnVariables[1]];\npayload = {\n data: {\n visibleOnVariables,\n defaultValueVariables\n }\n};\nreturn payload;",
36
- "headers": {
37
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
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
- "actionType": "setValue",
43
- "args": {
44
- "value": {
45
- "visibleOnVariables": "${event.data.visibleOnVariables}",
46
- "defaultValueVariables": "${event.data.defaultValueVariables}"
47
- }
48
- },
49
- "componentId": "steedos_object_fields_service"
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
- "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;",
55
- "apiRequestAdaptor": "if (formData.defaultValue_formula) {\n formData.defaultValue = formData.defaultValue_formula\n}\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');",
56
- "submitSuccActions": [
57
- {
58
- "actionType": "custom",
59
- "script": "setTimeout(function(){doAction({'actionType': 'setValue','componentId': 'form_object_fields','args': {'value': {'sort_no': event.data.sort_no + 10}}})}, 300)"
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
- "fieldsExtend": {
71
- "readonly": {
72
- "amis": {
73
- "onEvent": {
74
- "change": {
75
- "actions": [
76
- {
77
- "actionType": "setValue",
78
- "componentId": "steedos_object_fields_form",
79
- "args": {
80
- "value": {
81
- "static": false
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
- "id": "u:a32a4c461450"
90
- }
91
- },
92
- "static": {
93
- "amis": {
94
- "onEvent": {
95
- "change": {
96
- "actions": [
97
- {
98
- "actionType": "setValue",
99
- "componentId": "steedos_object_fields_form",
100
- "args": {
101
- "value": {
102
- "readonly": false
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
- "id": "u:7affdbb0ef6d"
111
- }
112
- },
113
- "required": {
114
- "amis": {
115
- "onEvent": {
116
- "change": {
117
- "actions": [
118
- {
119
- "actionType": "setValue",
120
- "args": {
121
- "value": {
122
- "hidden": false
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
- "id": "u:adf4200a2170"
132
- }
133
- },
134
- "hidden": {
135
- "amis": {
136
- "onEvent": {
137
- "change": {
138
- "actions": [
139
- {
140
- "actionType": "setValue",
141
- "args": {
142
- "value": {
143
- "required": false
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
- "id": "u:adf4200a2170"
153
- }
154
- },
155
- "type": {
156
- "amis": {
157
- "onEvent": {
158
- "change": {
159
- "actions": [
160
- {
161
- "actionType": "setValue",
162
- "args": {
163
- "value": {
164
- "defaultValue": null
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
- "disabledOn": "${is_system == true}",
173
- "searchable": true
174
- }
175
- },
176
- "filters": {
177
- "amis": {
178
- "type": "condition-builder",
179
- "description": "",
180
- "id": "u:a9f2232e30d7",
181
- "source": {
182
- "method": "get",
183
- "url": "${context.rootUrl}/service/api/amis-metadata-listviews/getFilterFields?objectName=${reference_to}",
184
- "dataType": "json",
185
- "headers": {
186
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
187
- }
188
- },
189
- "className": "col-span-2 m-0"
190
- }
191
- },
192
- "filtersFunction": {
193
- "hidden": true
194
- },
195
- "visible_on": {
196
- "amis": {
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
  },
@@ -3,7 +3,6 @@
3
3
  "body": [
4
4
  {
5
5
  "type": "steedos-object-form",
6
- "debug": false,
7
6
  "label": "对象表单",
8
7
  "objectApiName": "objects",
9
8
  "recordId": "${recordId}",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-object-database",
3
- "version": "2.7.0-beta.27",
3
+ "version": "2.7.0-beta.29",
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.27",
16
- "@steedos/standard-objects": "2.7.0-beta.27"
15
+ "@steedos/metadata-core": "2.7.0-beta.29",
16
+ "@steedos/standard-objects": "2.7.0-beta.29"
17
17
  },
18
18
  "repository": {},
19
19
  "license": "MIT",
20
- "gitHead": "3ff30ac23eea83fafd51df11bf5d818e73c005ed"
20
+ "gitHead": "bed06b59dd588350bf7226309164003ac1414a5b"
21
21
  }