@steedos/service-core-objects 3.0.0-beta.105 → 3.0.0-beta.107
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/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/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/objects/_base/base.client.js +113 -114
- package/main/default/objects/_base/base.object.js +217 -215
- 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/space_users/fields/password_expired.field.yml +1 -1
- package/main/default/pages/apps_form.page.amis.json +1 -0
- package/package.json +3 -3
- package/public/platform.css +5 -0
- 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
|
@@ -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,9 @@ 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
|
+
return data.uiSchema && data.uiSchema.enable_print;
|
|
448
|
+
},
|
|
447
449
|
on: "record_only",
|
|
448
450
|
type: 'amis_button',
|
|
449
451
|
amis_schema: {
|
|
@@ -470,7 +472,7 @@ module.exports = {
|
|
|
470
472
|
"failed": "打印功能需要企业许可证"
|
|
471
473
|
},
|
|
472
474
|
"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
|
|
475
|
+
"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/print-template/getPrintSchema/\" + row._id,\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
476
|
"headers": {
|
|
475
477
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
476
478
|
},
|
|
@@ -2,6 +2,15 @@ name: description
|
|
|
2
2
|
hidden: false
|
|
3
3
|
is_wide: true
|
|
4
4
|
label: Description
|
|
5
|
-
sort_no:
|
|
5
|
+
sort_no: 380
|
|
6
6
|
type: textarea
|
|
7
|
-
inlineHelpText: 在字段下方增加解释说明
|
|
7
|
+
inlineHelpText: 在字段下方增加解释说明
|
|
8
|
+
amis:
|
|
9
|
+
type: input-rich-text
|
|
10
|
+
name: rich
|
|
11
|
+
options:
|
|
12
|
+
menubar: false
|
|
13
|
+
height: 200
|
|
14
|
+
plugins:
|
|
15
|
+
- lists
|
|
16
|
+
toolbar: undo redo | formatselect | bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat
|
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.107",
|
|
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.107",
|
|
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": "1af567ed119c938f6214ea192e610f07aa8612af"
|
|
21
21
|
}
|