@steedos/standard-object-database 2.6.8-beta.11 → 2.6.8-beta.13
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/buttons/standard_new.button.js +3 -0
- package/main/default/objects/object_fields.object.yml +1 -1
- package/main/default/pages/design_field_layout.page.amis.json +1 -1
- package/main/default/pages/object_fields_form.page.amis.json +19 -0
- package/main/default/routes/amis_button_design.ejs +2 -1
- package/main/default/routes/amis_button_design.router.js +1 -0
- package/package.json +4 -4
- package/package.service.js +8 -4
|
@@ -203,7 +203,7 @@ fields:
|
|
|
203
203
|
blackbox: true
|
|
204
204
|
label: Default Value
|
|
205
205
|
sort_no: 160
|
|
206
|
-
visible_on: "{{['autonumber','formula','summary','image','file'].indexOf(formData.type)
|
|
206
|
+
visible_on: "{{formData.type && ['autonumber','formula','summary','image','file'].indexOf(formData.type) < 0}}"
|
|
207
207
|
amis:
|
|
208
208
|
type: service
|
|
209
209
|
className:
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
},
|
|
392
392
|
"messages": {},
|
|
393
393
|
"requestAdaptor": "",
|
|
394
|
-
"adaptor": "const field_groups = payload.data.objects[0] && _.map(payload.data.objects[0].field_groups, function (obj) {\n return {\n \"id\": obj.group_name,\n \"group_name\": obj.group_name,\n \"visible_on\": obj.visible_on,\n \"
|
|
394
|
+
"adaptor": "const field_groups = payload.data.objects[0] && _.map(payload.data.objects[0].field_groups, function (obj) {\n return {\n \"id\": obj.group_name,\n \"group_name\": obj.group_name,\n \"visible_on\": obj.visible_on,\n \"collapsed\": obj.collapsed\n }\n});\nfield_groups.unshift({\n id: \"隐藏\",\n group_name: \"隐藏\",\n visible_on: \"\",\n is_hidden: true\n});\nfield_groups.unshift({\n id: \"未分组\",\n group_name: \"未分组\",\n visible_on: \"\",\n is_default: true\n});\n\n\n\nconst designObjectId = payload.data.objects[0] && payload.data.objects[0]._id;\nreturn payload = {\n data: {\n field_groups,\n designObjectId,\n designObjectLabel: payload.data.objects[0] && payload.data.objects[0].label,\n _master: {\n recordId: designObjectId\n }\n }\n}"
|
|
395
395
|
},
|
|
396
396
|
"messages": {},
|
|
397
397
|
"onEvent": {
|
|
@@ -125,6 +125,25 @@
|
|
|
125
125
|
},
|
|
126
126
|
"id": "u:adf4200a2170"
|
|
127
127
|
}
|
|
128
|
+
},
|
|
129
|
+
"type": {
|
|
130
|
+
"amis": {
|
|
131
|
+
"onEvent": {
|
|
132
|
+
"change": {
|
|
133
|
+
"actions": [
|
|
134
|
+
{
|
|
135
|
+
"actionType": "setValue",
|
|
136
|
+
"args": {
|
|
137
|
+
"value": {
|
|
138
|
+
"defaultValue": null
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"componentId": "steedos_object_fields_form"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
128
147
|
}
|
|
129
148
|
},
|
|
130
149
|
"form": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2022-06-02 17:45:15
|
|
4
4
|
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2024-02-29 13:28:53
|
|
6
6
|
* @Description:
|
|
7
7
|
-->
|
|
8
8
|
<html>
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
schema.data.context.tenantId = tenantId;
|
|
102
102
|
schema.data.context.userId = userId;
|
|
103
103
|
schema.data.context.authToken = authToken;
|
|
104
|
+
schema.data.context.user = <%- JSON.stringify(userSession) %>;
|
|
104
105
|
|
|
105
106
|
return schema || initialContent
|
|
106
107
|
}
|
|
@@ -56,6 +56,7 @@ router.get('/api/amisButtonDesign', core.requireAuthentication, async function (
|
|
|
56
56
|
userId: userSession.userId,
|
|
57
57
|
authToken: userSession.authToken,
|
|
58
58
|
id: req.query.id,
|
|
59
|
+
userSession: userSession
|
|
59
60
|
}
|
|
60
61
|
const options = {}
|
|
61
62
|
ejs.renderFile(filename, data, options, function(err, str){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-object-database",
|
|
3
|
-
"version": "2.6.8-beta.
|
|
3
|
+
"version": "2.6.8-beta.13",
|
|
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.6.8-beta.
|
|
16
|
-
"@steedos/standard-objects": "2.6.8-beta.
|
|
15
|
+
"@steedos/metadata-core": "2.6.8-beta.13",
|
|
16
|
+
"@steedos/standard-objects": "2.6.8-beta.13"
|
|
17
17
|
},
|
|
18
18
|
"repository": {},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "bab85130c5ca3bb1f6c520cb2a321694c211f3b3"
|
|
21
21
|
}
|
package/package.service.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: sunhaolin@hotoa.com
|
|
3
3
|
* @Date: 1985-10-26 16:15:00
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2024-02-29 10:24:41
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
"use strict";
|
|
@@ -167,6 +167,9 @@ module.exports = {
|
|
|
167
167
|
const dbRecord = await object.directFind({filters: ['_id','=',id]});
|
|
168
168
|
if(dbRecord.length === 0){
|
|
169
169
|
// const newId = await object._makeNewID();
|
|
170
|
+
const objectConfig = await object.toConfig();
|
|
171
|
+
let field_groups = objectConfig.field_groups || null;
|
|
172
|
+
|
|
170
173
|
const now = new Date();
|
|
171
174
|
await object.directInsert(Object.assign({}, data, {
|
|
172
175
|
// _id: newId,
|
|
@@ -182,13 +185,14 @@ module.exports = {
|
|
|
182
185
|
company_ids: userSession.company_ids,
|
|
183
186
|
extend: name,
|
|
184
187
|
custom: false,
|
|
185
|
-
is_system: true
|
|
188
|
+
is_system: true,
|
|
189
|
+
field_groups: field_groups
|
|
186
190
|
}));
|
|
187
191
|
// id = newId;
|
|
188
192
|
}
|
|
189
193
|
|
|
190
194
|
if(data.is_system){
|
|
191
|
-
data = _.pick(data, ['label', 'icon', 'enable_files', 'enable_tasks', 'enable_notes', 'enable_events', 'enable_workflow', 'enable_instances', 'enable_inline_edit', 'enable_tree', 'enable_enhanced_lookup', 'description', 'is_deleted'])
|
|
195
|
+
data = _.pick(data, ['label', 'icon', 'enable_files', 'enable_tasks', 'enable_notes', 'enable_events', 'enable_workflow', 'enable_instances', 'enable_inline_edit', 'enable_tree', 'enable_enhanced_lookup', 'description', 'is_deleted', 'field_groups'])
|
|
192
196
|
}
|
|
193
197
|
|
|
194
198
|
return object.update(id, data, userSession)
|