@steedos/service-core-objects 3.0.0-beta.99 → 3.0.0
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/README.md +3 -3
- package/main/default/applications/.gitkeep +0 -0
- package/main/default/applications/admin.app.yml +179 -0
- package/main/default/client/socket.client.js +1 -1
- package/main/default/objectTranslations/announcements.en/announcements.en.objectTranslation.yml +37 -0
- package/main/default/objectTranslations/announcements.zh-CN/announcements.zh-CN.objectTranslation.yml +37 -0
- package/main/default/objectTranslations/audit_records.en/audit_records.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/company.en/company.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/logs.en/logs.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/object_fields.en/object_fields.en.objectTranslation.yml +3 -3
- package/main/default/objectTranslations/object_fields.zh-CN/object_fields.zh-CN.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/object_functions.en/object_functions.en.objectTranslation.yml +1 -5
- package/main/default/objectTranslations/object_functions.zh-CN/object_functions.zh-CN.objectTranslation.yml +1 -5
- package/main/default/objectTranslations/objects.en/objects.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/operation_logs.en/operation_logs.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/organizations.en/organizations.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/process_delegation_rules.en/process_delegation_rules.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/reports.en/reports.en.objectTranslation.yml +7 -1
- package/main/default/objectTranslations/reports.zh-CN/reports.zh-CN.objectTranslation.yml +7 -1
- package/main/default/objectTranslations/sessions.en/sessions.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/settings.en/settings.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/space_users.en/space_users.en.objectTranslation.yml +1 -1
- package/main/default/objects/_base/base.client.js +113 -114
- package/main/default/objects/_base/base.object.js +225 -217
- package/main/default/objects/_base/base.recordFieldAudit.trigger.js +3 -0
- package/main/default/objects/_base/base.trigger.js +7 -144
- package/main/default/objects/audit_records.object.yml +1 -1
- package/main/default/objects/cms_files/cms_files.object.yml +1 -1
- package/main/default/objects/company/company.object.yml +1 -1
- package/main/default/objects/license.object.yml +13 -33
- package/main/default/objects/logs/logs.object.yml +1 -1
- package/main/default/objects/notifications/fields/related_to.field.yml +12 -4
- package/main/default/objects/object_fields/fields/description.field.yml +11 -2
- package/main/default/objects/object_fields/fields/required.field.yml +1 -1
- package/main/default/objects/object_fields/listviews/all.listview.yml +1 -1
- package/main/default/objects/object_functions/buttons/open_api.button.yml +1 -3
- package/main/default/objects/object_functions/fields/script.field.yml +3 -2
- package/main/default/objects/object_functions/listviews/all.listview.yml +0 -1
- package/main/default/objects/object_functions/listviews/customize.listview.yml +0 -1
- package/main/default/objects/object_functions/object_functions.object.yml +1 -1
- package/main/default/objects/object_listviews/fields/extra_columns.field.yml +1 -1
- package/main/default/objects/object_triggers/fields/handler.field.yml +3 -2
- package/main/default/objects/object_webhooks/object_webhooks.object.yml +1 -1
- package/main/default/objects/objects/buttons/show_object.button.js +1 -1
- package/main/default/objects/permission_set/buttons/copy.button.yml +114 -0
- package/main/default/objects/permission_set/buttons/set_permission_tabs.button.yml +166 -0
- package/main/default/objects/{permission_set.object.yml → permission_set/permission_set.object.yml} +1 -1
- package/main/default/objects/reports.object.yml +125 -258
- package/main/default/objects/roles.object.yml +1 -0
- package/main/default/objects/sessions.object.yml +1 -1
- package/main/default/objects/space_users/buttons/clear_login_tokens.button.yml +1 -1
- package/main/default/objects/space_users/buttons/setPassword.button.js +12 -12
- package/main/default/objects/space_users/fields/password_expired.field.yml +1 -1
- package/main/default/pages/about.page.amis.json +21 -4
- package/main/default/pages/apps_form.page.amis.json +2 -1
- package/main/default/pages/cfs_files_record_preview.page.amis.json +8 -8
- package/main/default/pages/cms_files_preview.page.amis.json +7 -7
- package/main/default/pages/object_detail.page.amis.json +1 -1
- package/main/default/pages/space_users_list.page.amis.json +5 -2
- package/main/default/routes/amis_button_design.router.js +2 -12
- package/main/default/routes/amis_listview_design.router.js +2 -11
- package/main/default/routes/object_fields_design.ejs +2 -1
- package/main/default/routes/object_fields_design.router.js +1 -14
- package/main/default/services/spaces.service.js +1 -1
- package/main/default/services/users.service.js +5 -2
- package/main/default/tabs/admin_bull_dashboard.tab.yml +2 -1
- package/main/default/tabs/admin_object_functions.tab.yml +21 -0
- package/main/default/tabs/admin_swagger.tab.yml +22 -0
- package/main/default/translations/en.translation.yml +2 -2
- package/main/default/triggers/space_users.trigger.js +3 -3
- package/package.json +3 -4
- package/public/platform.css +5 -0
- package/main/default/objectTranslations/forms.en/forms.en.objectTranslation.yml +0 -191
- package/main/default/objectTranslations/forms.zh-CN/forms.zh-CN.objectTranslation.yml +0 -194
- package/main/default/objectTranslations/instances.en/instances.en.objectTranslation.yml +0 -211
- package/main/default/objectTranslations/instances.zh-CN/instances.zh-CN.objectTranslation.yml +0 -208
- package/main/default/objects/object_functions/fields/is_rest.field.yml +0 -5
- package/main/default/objects/spaces/buttons/upgrade.button.js +0 -12
- package/main/default/objects/spaces/buttons/upgrade.button.yml +0 -4
|
@@ -14,7 +14,7 @@ var standardCustomizeSaveRequestAdaptor = `
|
|
|
14
14
|
delete newDoc.responseStatus;
|
|
15
15
|
}
|
|
16
16
|
else if(objectName === "permission_set"){
|
|
17
|
-
objectFields = ['name', 'label', 'type', 'license', 'lockout_interval', 'max_login_attempts', 'password_history', 'default_standard_buttons'];
|
|
17
|
+
objectFields = ['name', 'label', 'type', 'license', 'lockout_interval', 'max_login_attempts', 'password_history', 'default_standard_buttons', 'assigned_apps'];
|
|
18
18
|
_.each(objectFields, function(v, k){
|
|
19
19
|
if(_.has(doc, v)){
|
|
20
20
|
newDoc[v] = doc[v];
|
|
@@ -110,219 +110,219 @@ module.exports = {
|
|
|
110
110
|
return Steedos.StandardObjects.Base.Actions.standard_delete_many.todo.apply(this, arguments)
|
|
111
111
|
}
|
|
112
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
113
|
+
standard_approve: {
|
|
114
|
+
label: "Initiate Approval",
|
|
115
|
+
visible: function (object_name, record_id, record_permissions) {
|
|
116
|
+
return Steedos.StandardObjects.Base.Actions.standard_approve.visible.apply(this, arguments)
|
|
117
|
+
},
|
|
118
|
+
on: "record_only",
|
|
119
|
+
type: "amis_button",
|
|
120
|
+
amis_schema: {
|
|
121
|
+
"type": "service",
|
|
122
|
+
"body": [
|
|
123
|
+
{
|
|
124
|
+
"type": "button",
|
|
125
|
+
"label": "发起审批",
|
|
126
|
+
"id": "u:6887f3ab860a",
|
|
127
|
+
"editorState": "default",
|
|
128
|
+
"onEvent": {
|
|
129
|
+
"click": {
|
|
130
|
+
"weight": 0,
|
|
131
|
+
"actions": [
|
|
132
|
+
{
|
|
133
|
+
"actionType": "steedos_actions_standard_approve",
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"regions": [
|
|
141
|
+
"body"
|
|
142
|
+
],
|
|
143
|
+
"data": {
|
|
144
|
+
"context": {},
|
|
145
|
+
"dataComponentId": "",
|
|
146
|
+
"record_id": "",
|
|
147
|
+
"record": {},
|
|
148
|
+
"permissions": {}
|
|
149
|
+
},
|
|
150
|
+
"bodyClassName": "p-0",
|
|
151
|
+
"id": "u:5dd49d3a508c"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
standard_create_instance: {
|
|
155
|
+
label: "Create Approval",
|
|
156
|
+
sort: -1,
|
|
157
|
+
on: "list",
|
|
158
|
+
type: "amis_button",
|
|
159
|
+
visible: function(object_name, record_id, record_permissions, data){
|
|
160
|
+
if (data._isRelated) return false;
|
|
161
|
+
return false;
|
|
162
|
+
// return lodash.filter(Steedos.object_workflows, (item)=>{return item.object_name == object_name && (!item.sync_direction || item.sync_direction == 'both' || item.sync_direction == 'ins_to_obj') && true !== item.forbid_initiate_instance}).length > 0
|
|
163
|
+
},
|
|
164
|
+
amis_schema: {
|
|
165
|
+
"type": "service",
|
|
166
|
+
"body": [
|
|
167
|
+
{
|
|
168
|
+
"type": "button",
|
|
169
|
+
"label": "申请",
|
|
170
|
+
"id": "u:standard_create_instance",
|
|
171
|
+
"editorState": "default",
|
|
172
|
+
"onEvent": {
|
|
173
|
+
"click": {
|
|
174
|
+
"weight": 0,
|
|
175
|
+
"actions": [
|
|
176
|
+
{
|
|
177
|
+
"actionType": "custom",
|
|
178
|
+
"script": "// 编写判断,当前可发起的流程是单个还是多个. 并返回数据用于控制下个事件是直接新建申请单草稿还是弹出流程让选择\n\nconst flows = lodash.filter(Steedos.object_workflows, (item) => { return item.object_name == event.data.object_name && (!item.sync_direction || item.sync_direction == 'both' || item.sync_direction == 'ins_to_obj') && true !== item.forbid_initiate_instance })\n\nevent.setData({ ...event.data, ...{ flows: flows, flowCount: flows.length } })\n\n"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"actionType": "ajax",
|
|
182
|
+
"outputVar": "responseResult",
|
|
183
|
+
"args": {
|
|
184
|
+
"options": {},
|
|
185
|
+
"api": {
|
|
186
|
+
"url": "${context.rootUrl}/api/workflow/v2/draft",
|
|
187
|
+
"method": "post",
|
|
188
|
+
"requestAdaptor":"api.data = {\n \'instance\': {\n \'flow\': api.body.flows[0].flow_id,\n \'applicant\': api.body.context.userId,\n \'space\': api.body.context.tenantId\n \n}}\n\nreturn api;",
|
|
189
|
+
"adaptor":"\nif (payload.error) { \n return {\n status: 2,\n msg: payload.error\n }\n}\nconst instance = payload.instance;\nSteedos.openWindow(Steedos.absoluteUrl(\'/app/\' + context.app_id + \'/instances/view/\' + instance._id + \'?display=\' + (Steedos.Page.getDisplay('instances') || '') + \'&side_object=instances&side_listview_id=draft\'))\nreturn payload;",
|
|
190
|
+
"messages": {},
|
|
191
|
+
"headers": {
|
|
192
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
193
|
+
},
|
|
194
|
+
"data": {
|
|
195
|
+
"&": "$$",
|
|
196
|
+
"context": "${context}",
|
|
197
|
+
"objectName": "${objectName}",
|
|
198
|
+
"recordId": "${recordId}"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"expression": "${event.data.flowCount == 1}"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"actionType": "dialog",
|
|
206
|
+
"expression": "${event.data.flowCount > 1}",
|
|
207
|
+
"dialog": {
|
|
208
|
+
"type": "dialog",
|
|
209
|
+
"title": "选择流程发起审批",
|
|
210
|
+
"body": [
|
|
211
|
+
{
|
|
212
|
+
"type": "form",
|
|
213
|
+
"id": "u:f78efaa51a4f",
|
|
214
|
+
"body": [
|
|
215
|
+
{
|
|
216
|
+
"type": "input-tree",
|
|
217
|
+
"name": "flowId",
|
|
218
|
+
"label": false,
|
|
219
|
+
"clearable": true,
|
|
220
|
+
"id": "u:025b991fd40b",
|
|
221
|
+
"multiple": false,
|
|
222
|
+
"treeContainerClassName": "no-border m-none p-none",
|
|
223
|
+
"source": {
|
|
224
|
+
"method": "get",
|
|
225
|
+
"url": "${context.rootUrl}/api/workflow/v2/get_object_workflows",
|
|
226
|
+
"requestAdaptor": "api.data = {};return api;",
|
|
227
|
+
"adaptor":"return { data: _.filter(payload, (item) => { return item.object_name == api.body.objectName && item.can_add && (!item.sync_direction || item.sync_direction == 'both' || item.sync_direction == 'ins_to_obj') && true !== item.forbid_initiate_instance })};",
|
|
228
|
+
"messages": {},
|
|
229
|
+
"dataType": "json",
|
|
230
|
+
"headers": {
|
|
231
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
232
|
+
},
|
|
233
|
+
"data": {
|
|
234
|
+
"objectName": "${objectName}",
|
|
235
|
+
"spaceId": "${context.tenantId}"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"value": "",
|
|
239
|
+
"labelField": "flow_name",
|
|
240
|
+
"valueField": "flow_id",
|
|
241
|
+
"onEvent": {
|
|
242
|
+
"change": {
|
|
243
|
+
"weight": 0,
|
|
244
|
+
"actions": [
|
|
245
|
+
{
|
|
246
|
+
"actionType": "ajax",
|
|
247
|
+
"outputVar": "responseResult",
|
|
248
|
+
"args": {
|
|
249
|
+
"options": {},
|
|
250
|
+
"api": {
|
|
251
|
+
"url": "${context.rootUrl}/api/workflow/v2/draft",
|
|
252
|
+
"method": "post",
|
|
253
|
+
"requestAdaptor":"api.data = {\n \'instance\': {\n \'flow\': api.body.flowId,\n \'applicant\': api.body.context.userId,\n \'space\': api.body.context.tenantId\n \n}}\n\nreturn api;",
|
|
254
|
+
"adaptor":"\nif (payload.error) { \n return {\n status: 2,\n msg: payload.error\n }\n}\nconst instance = payload.instance;\nSteedos.openWindow(Steedos.absoluteUrl(\'/app/\' + FlowRouter.current().params.app_id + \'/instances/view/\' + instance._id + \'?display=\' + (Steedos.Page.getDisplay('instances') || '') + \'&side_object=instances&side_listview_id=draft\'))\nreturn payload;",
|
|
255
|
+
"messages": {},
|
|
256
|
+
"headers": {
|
|
257
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
258
|
+
},
|
|
259
|
+
"data": {
|
|
260
|
+
"&": "$$",
|
|
261
|
+
"context": "${context}",
|
|
262
|
+
"objectName": "${objectName}",
|
|
263
|
+
"recordId": "${recordId}"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
"expression": "${event.data.value}"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"actionType": "closeDialog"
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
"wrapWithPanel": false
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
"showCloseButton": true,
|
|
281
|
+
"showErrorMsg": true,
|
|
282
|
+
"showLoading": true,
|
|
283
|
+
"className": "",
|
|
284
|
+
"id": "u:ba79188bbf7e",
|
|
285
|
+
"closeOnEsc": true,
|
|
286
|
+
"actions": [],
|
|
287
|
+
"size": "md",
|
|
288
|
+
"data": {
|
|
289
|
+
"&": "$$"
|
|
290
|
+
},
|
|
291
|
+
"dataMap": {},
|
|
292
|
+
"withDefaultData": true,
|
|
293
|
+
"dataMapSwitch": true,
|
|
294
|
+
"bodyClassName": "overflow-hidden"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
"regions": [
|
|
303
|
+
"body"
|
|
304
|
+
],
|
|
305
|
+
"data": {
|
|
306
|
+
"context": {},
|
|
307
|
+
"dataComponentId": "",
|
|
308
|
+
"record_id": "",
|
|
309
|
+
"record": {},
|
|
310
|
+
"permissions": {}
|
|
311
|
+
},
|
|
312
|
+
"bodyClassName": "p-0",
|
|
313
|
+
"id": "u:6ac1032391f4"
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
standard_view_instance: {
|
|
317
|
+
label: "View Instance",
|
|
318
|
+
visible: function (object_name, record_id, record_permissions) {
|
|
319
|
+
return Steedos.StandardObjects.Base.Actions.standard_view_instance.visible.apply(this, arguments)
|
|
320
|
+
},
|
|
321
|
+
on: "record_only",
|
|
322
|
+
todo: function () {
|
|
323
|
+
return Steedos.StandardObjects.Base.Actions.standard_view_instance.todo.apply(this, arguments)
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
326
|
standard_submit_for_approval: {
|
|
327
327
|
visible: function (object_name, record_id, record_permissions, data) {
|
|
328
328
|
if (data && data.uiSchema && data.uiSchema.enable_process){
|
|
@@ -443,7 +443,14 @@ module.exports = {
|
|
|
443
443
|
},
|
|
444
444
|
standard_print: {
|
|
445
445
|
label: "Print",
|
|
446
|
-
visible:
|
|
446
|
+
visible: function (object_name, record_id, record_permissions, data) {
|
|
447
|
+
var uiSchema = data.uiSchema;
|
|
448
|
+
// 记录详细页面中如果有相关子记录,用RecordService组件显示子记录的话,子记录中打印按钮取的uiSchema是父记录的uiSchema,造成子记录详细界面也显示了打印按钮,这里判断下对象名称不一致时重新取uiSchema变量
|
|
449
|
+
if (!uiSchema || uiSchema.name !== object_name){
|
|
450
|
+
uiSchema = window.getUISchemaSync(object_name);
|
|
451
|
+
}
|
|
452
|
+
return uiSchema && uiSchema.enable_print;
|
|
453
|
+
},
|
|
447
454
|
on: "record_only",
|
|
448
455
|
type: 'amis_button',
|
|
449
456
|
amis_schema: {
|
|
@@ -456,6 +463,7 @@ module.exports = {
|
|
|
456
463
|
"type": "dropdown-button",
|
|
457
464
|
"label": "打印",
|
|
458
465
|
"buttons": "${buttonOptions}",
|
|
466
|
+
"className": "steedos-DropDown--show-label",
|
|
459
467
|
"id": "u:8cd2cefcaf9b",
|
|
460
468
|
"disabled": false,
|
|
461
469
|
"hidden": false
|
|
@@ -470,13 +478,13 @@ module.exports = {
|
|
|
470
478
|
"failed": "打印功能需要企业许可证"
|
|
471
479
|
},
|
|
472
480
|
"requestAdaptor": "",
|
|
473
|
-
"adaptor": "const buttonOptions = [];\nfor (const row of payload.data.rows) {\n buttonOptions.push({\n \"type\": \"button\",\n \"label\": row.label,\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"url\",\n \"args\": {\n \"url\": \"${context.rootUrl}/api/page/render\",\n \"blank\": true,\n \"params\": {\n \"schemaApi\": \"${context.rootUrl}/service/api
|
|
481
|
+
"adaptor": "const buttonOptions = [];\nfor (const row of payload.data.rows) {\n buttonOptions.push({\n \"type\": \"button\",\n \"label\": row.label,\n \"visibleOn\": row.visible_on || \"${true}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"url\",\n \"args\": {\n \"url\": \"${context.rootUrl}/api/page/render\",\n \"blank\": true,\n \"params\": {\n \"schemaApi\": \"${context.rootUrl}/service/api/print-template/getPrintSchema/\" + row._id + \"?title=\" + row.label + \"__${NAME_FIELD_VALUE}\",\n \"data\": JSON.stringify({\n \"filters\": [\"_id\", \"=\", \"${recordId}\"]\n })\n }\n }\n }\n ]\n }\n }\n })\n}\n\npayload.data = {\n buttonOptions: buttonOptions\n}\nreturn payload",
|
|
474
482
|
"headers": {
|
|
475
483
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
476
484
|
},
|
|
477
485
|
"data": {
|
|
478
486
|
"&": "$$",
|
|
479
|
-
"query": "{ rows: object_print(filters: [[\"object_name\", \"=\", \"${objectName}\"]]) { _id name label object_name } }"
|
|
487
|
+
"query": "{ rows: object_print(filters: [[\"object_name\", \"=\", \"${objectName}\"]]) { _id name label object_name visible_on } }"
|
|
480
488
|
}
|
|
481
489
|
},
|
|
482
490
|
"initFetch": true,
|
|
@@ -219,6 +219,9 @@ const updateRecord = async function(userId, object_name, new_doc, previous_doc,
|
|
|
219
219
|
for(var i = 0; i < keys.length; i++ ){
|
|
220
220
|
const k = keys[i];
|
|
221
221
|
const v = modifier[k];
|
|
222
|
+
if(k == "modified"){
|
|
223
|
+
continue
|
|
224
|
+
}
|
|
222
225
|
var auditRecordsObject, db_new_value, db_previous_value, doc, field, new_value, previous_value;
|
|
223
226
|
field = fields != null ? fields[k] : void 0;
|
|
224
227
|
previous_value = previous_doc[k];
|