@steedos/service-core-objects 3.0.0-beta.59 → 3.0.0-beta.60
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/_base/base.object.yml +4 -0
- package/main/default/objects/announcements.object.yml +68 -0
- package/package.json +3 -3
- package/main/default/objectTranslations/flow_positions.en/flow_positions.en.objectTranslation.yml +0 -19
- package/main/default/objectTranslations/flow_positions.zh-CN/flow_positions.zh-CN.objectTranslation.yml +0 -19
- package/main/default/objectTranslations/flow_roles.en/flow_roles.en.objectTranslation.yml +0 -11
- package/main/default/objectTranslations/flow_roles.zh-CN/flow_roles.zh-CN.objectTranslation.yml +0 -14
- package/main/default/objectTranslations/flows.en/flows.en.objectTranslation.yml +0 -317
- package/main/default/objectTranslations/flows.zh-CN/flows.zh-CN.objectTranslation.yml +0 -314
- package/main/default/objects/flows/flows.object.yml +0 -1089
- package/main/default/tabs/admin_process_delegation_rules.tab.yml +0 -24
|
@@ -1,1089 +0,0 @@
|
|
|
1
|
-
name: flows
|
|
2
|
-
icon: environment_hub
|
|
3
|
-
label: Workflow
|
|
4
|
-
hidden: true
|
|
5
|
-
enable_files: true
|
|
6
|
-
enable_dataloader: false
|
|
7
|
-
version: 2
|
|
8
|
-
fields:
|
|
9
|
-
name:
|
|
10
|
-
type: text
|
|
11
|
-
label: Name
|
|
12
|
-
required: false
|
|
13
|
-
searchable: true
|
|
14
|
-
# readonly: true
|
|
15
|
-
name: name
|
|
16
|
-
filterable: true
|
|
17
|
-
api_name:
|
|
18
|
-
type: text
|
|
19
|
-
label: Api Name
|
|
20
|
-
required: false
|
|
21
|
-
inlineHelpText: "配置了Api Name 的流程才能同步为元数据"
|
|
22
|
-
searchable: true
|
|
23
|
-
name: api_name
|
|
24
|
-
filterable: true
|
|
25
|
-
form:
|
|
26
|
-
label: Form
|
|
27
|
-
type: lookup
|
|
28
|
-
reference_to: forms
|
|
29
|
-
readonly: true
|
|
30
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
31
|
-
name: form
|
|
32
|
-
category:
|
|
33
|
-
label: Category
|
|
34
|
-
type: lookup
|
|
35
|
-
reference_to: categories
|
|
36
|
-
name: category
|
|
37
|
-
filterable: true
|
|
38
|
-
required: true
|
|
39
|
-
state:
|
|
40
|
-
label: State
|
|
41
|
-
type: select
|
|
42
|
-
options:
|
|
43
|
-
- label: Enabled
|
|
44
|
-
value: enabled
|
|
45
|
-
- label: Disabled
|
|
46
|
-
value: disabled
|
|
47
|
-
readonly: true
|
|
48
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
49
|
-
name: state
|
|
50
|
-
filterable: true
|
|
51
|
-
is_valid:
|
|
52
|
-
label: Valid
|
|
53
|
-
type: boolean
|
|
54
|
-
readonly: true
|
|
55
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
56
|
-
name: is_valid
|
|
57
|
-
current_no:
|
|
58
|
-
label: Current Number
|
|
59
|
-
type: number
|
|
60
|
-
readonly: true
|
|
61
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
62
|
-
name: current_no
|
|
63
|
-
description:
|
|
64
|
-
label: Description
|
|
65
|
-
type: textarea
|
|
66
|
-
is_wide: true
|
|
67
|
-
name: description
|
|
68
|
-
enable_amisform:
|
|
69
|
-
label: 启用amis表单
|
|
70
|
-
type: boolean
|
|
71
|
-
is_wide: false
|
|
72
|
-
name: description
|
|
73
|
-
visible_on: "{{false}}"
|
|
74
|
-
help_text:
|
|
75
|
-
label: Help
|
|
76
|
-
type: textarea
|
|
77
|
-
is_wide: true
|
|
78
|
-
name: help_text
|
|
79
|
-
company_id:
|
|
80
|
-
label: Main Division
|
|
81
|
-
required: false
|
|
82
|
-
omit: false
|
|
83
|
-
hidden: false
|
|
84
|
-
visible_on: "{{true}}"
|
|
85
|
-
created_by:
|
|
86
|
-
label: Created by
|
|
87
|
-
sort_no: 9999
|
|
88
|
-
modified_by:
|
|
89
|
-
label: Modified by
|
|
90
|
-
sort_no: 9999
|
|
91
|
-
current:
|
|
92
|
-
label: Current
|
|
93
|
-
type: object
|
|
94
|
-
is_wide: true
|
|
95
|
-
blackbox: true
|
|
96
|
-
visible_on: "{{global.mode ==='read' ? true : false}}"
|
|
97
|
-
readonly: true
|
|
98
|
-
name: current
|
|
99
|
-
current.modified:
|
|
100
|
-
label: Modification Time of Current
|
|
101
|
-
type: datetime
|
|
102
|
-
readonly: true
|
|
103
|
-
visible_on: "{{global.mode ==='read' ? true : false}}"
|
|
104
|
-
hidden: true
|
|
105
|
-
name: current.modified
|
|
106
|
-
current.modified_by:
|
|
107
|
-
label: Modified Currently by
|
|
108
|
-
type: lookup
|
|
109
|
-
reference_to: users
|
|
110
|
-
readonly: true
|
|
111
|
-
visible_on: "{{global.mode ==='read' ? true : false}}"
|
|
112
|
-
hidden: true
|
|
113
|
-
name: current.modified_by
|
|
114
|
-
filterable: true
|
|
115
|
-
current.created:
|
|
116
|
-
label: Creation Time of Current
|
|
117
|
-
type: datetime
|
|
118
|
-
readonly: true
|
|
119
|
-
visible_on: "{{global.mode ==='read' ? true : false}}"
|
|
120
|
-
hidden: true
|
|
121
|
-
name: current.created
|
|
122
|
-
current.created_by:
|
|
123
|
-
label: Created Currently by
|
|
124
|
-
type: lookup
|
|
125
|
-
reference_to: users
|
|
126
|
-
readonly: true
|
|
127
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
128
|
-
hidden: true
|
|
129
|
-
name: current.created_by
|
|
130
|
-
filterable: true
|
|
131
|
-
current.steps:
|
|
132
|
-
label: Current Steps
|
|
133
|
-
type: table
|
|
134
|
-
readonly: true
|
|
135
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
136
|
-
is_wide: true
|
|
137
|
-
name: current.steps
|
|
138
|
-
current.steps.$._id:
|
|
139
|
-
type: text
|
|
140
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
141
|
-
readonly: true
|
|
142
|
-
hidden: true
|
|
143
|
-
name: current.steps.$._id
|
|
144
|
-
current.steps.$.name:
|
|
145
|
-
label: Name
|
|
146
|
-
readonly: true
|
|
147
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
148
|
-
type: text
|
|
149
|
-
name: current.steps.$.name
|
|
150
|
-
current.steps.$.disableCC:
|
|
151
|
-
label: Disable CC
|
|
152
|
-
type: boolean
|
|
153
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
154
|
-
readonly: true
|
|
155
|
-
name: current.steps.$.disableCC
|
|
156
|
-
current.steps.$.allowDistribute:
|
|
157
|
-
label: Can Distribute Instance
|
|
158
|
-
type: boolean
|
|
159
|
-
readonly: true
|
|
160
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
161
|
-
name: current.steps.$.allowDistribute
|
|
162
|
-
current.steps.$.can_edit_main_attach:
|
|
163
|
-
label: Can Edit Main Attach
|
|
164
|
-
type: boolean
|
|
165
|
-
readonly: true
|
|
166
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
167
|
-
name: current.steps.$.can_edit_main_attach
|
|
168
|
-
current.steps.$.can_edit_normal_attach:
|
|
169
|
-
label: Can Edit Normal Attach
|
|
170
|
-
type: boolean
|
|
171
|
-
readonly: true
|
|
172
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
173
|
-
name: current.steps.$.can_edit_normal_attach
|
|
174
|
-
current.steps.$.distribute_optional_flows:
|
|
175
|
-
label: Workflows of Distribution
|
|
176
|
-
type: lookup
|
|
177
|
-
reference_to: flows
|
|
178
|
-
multiple: true
|
|
179
|
-
readonly: true
|
|
180
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
181
|
-
hidden: true
|
|
182
|
-
name: current.steps.$.distribute_optional_flows
|
|
183
|
-
filterable: true
|
|
184
|
-
current.steps.$.cc_must_finished:
|
|
185
|
-
label: Must Wait for CC finished
|
|
186
|
-
type: boolean
|
|
187
|
-
readonly: true
|
|
188
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
189
|
-
name: current.steps.$.cc_must_finished
|
|
190
|
-
current.steps.$.cc_alert:
|
|
191
|
-
label: Pop up CC Alert
|
|
192
|
-
type: boolean
|
|
193
|
-
readonly: true
|
|
194
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
195
|
-
name: current.steps.$.cc_alert
|
|
196
|
-
current.steps.$.allowBatch:
|
|
197
|
-
label: Batch Processing
|
|
198
|
-
type: boolean
|
|
199
|
-
readonly: true
|
|
200
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
201
|
-
name: current.steps.$.allowBatch
|
|
202
|
-
current.steps.$.oneClickApproval:
|
|
203
|
-
label: One Click Approval
|
|
204
|
-
type: boolean
|
|
205
|
-
readonly: true
|
|
206
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
207
|
-
name: current.steps.$.oneClickApproval
|
|
208
|
-
current.steps.$.oneClickRejection:
|
|
209
|
-
label: One Click Rejection
|
|
210
|
-
type: boolean
|
|
211
|
-
readonly: true
|
|
212
|
-
visible_on: "{{global.mode !='read' ? false : true}}"
|
|
213
|
-
name: current.steps.$.oneClickRejection
|
|
214
|
-
perms:
|
|
215
|
-
label: Permissions
|
|
216
|
-
type: object
|
|
217
|
-
is_wide: true
|
|
218
|
-
blackbox: true
|
|
219
|
-
name: perms
|
|
220
|
-
group: Permissions
|
|
221
|
-
perms.users_can_add:
|
|
222
|
-
label: Users that Can Initiate New Request
|
|
223
|
-
type: lookup
|
|
224
|
-
reference_to: users
|
|
225
|
-
multiple: true
|
|
226
|
-
is_wide: true
|
|
227
|
-
name: perms.users_can_add
|
|
228
|
-
filterable: true
|
|
229
|
-
group: Permissions
|
|
230
|
-
perms.orgs_can_add:
|
|
231
|
-
label: 'Departments that Can Initiate New Request'
|
|
232
|
-
type: lookup
|
|
233
|
-
reference_to: organizations
|
|
234
|
-
multiple: true
|
|
235
|
-
is_wide: true
|
|
236
|
-
name: perms.orgs_can_add
|
|
237
|
-
filterable: true
|
|
238
|
-
group: Permissions
|
|
239
|
-
perms.users_can_monitor:
|
|
240
|
-
label: Users that Can Read All the Reqests
|
|
241
|
-
type: lookup
|
|
242
|
-
reference_to: users
|
|
243
|
-
multiple: true
|
|
244
|
-
is_wide: true
|
|
245
|
-
name: perms.users_can_monitor
|
|
246
|
-
filterable: true
|
|
247
|
-
group: Permissions
|
|
248
|
-
perms.orgs_can_monitor:
|
|
249
|
-
label: Departments that Can Read All the Reqests
|
|
250
|
-
type: lookup
|
|
251
|
-
reference_to: organizations
|
|
252
|
-
multiple: true
|
|
253
|
-
is_wide: true
|
|
254
|
-
name: perms.orgs_can_monitor
|
|
255
|
-
filterable: true
|
|
256
|
-
group: Permissions
|
|
257
|
-
perms.users_can_admin:
|
|
258
|
-
label: Users that Can Read , Relocat, Reassign or Delete All the Reqests
|
|
259
|
-
type: lookup
|
|
260
|
-
reference_to: users
|
|
261
|
-
multiple: true
|
|
262
|
-
is_wide: true
|
|
263
|
-
name: perms.users_can_admin
|
|
264
|
-
filterable: true
|
|
265
|
-
group: Permissions
|
|
266
|
-
perms.orgs_can_admin:
|
|
267
|
-
label: Departments that Can Read , Relocat, Reassign or Delete All the Reqests
|
|
268
|
-
type: lookup
|
|
269
|
-
reference_to: organizations
|
|
270
|
-
multiple: true
|
|
271
|
-
is_wide: true
|
|
272
|
-
name: perms.orgs_can_admin
|
|
273
|
-
filterable: true
|
|
274
|
-
group: Permissions
|
|
275
|
-
app:
|
|
276
|
-
label: App
|
|
277
|
-
type: text
|
|
278
|
-
omit: true
|
|
279
|
-
hidden: true
|
|
280
|
-
name: app
|
|
281
|
-
historys:
|
|
282
|
-
label: History Workflows
|
|
283
|
-
type: grid
|
|
284
|
-
blackbox: true
|
|
285
|
-
omit: true
|
|
286
|
-
hidden: true
|
|
287
|
-
name: historys
|
|
288
|
-
object_name:
|
|
289
|
-
type: lookup
|
|
290
|
-
label: Object
|
|
291
|
-
reference_to: objects
|
|
292
|
-
reference_to_field: name
|
|
293
|
-
required: false
|
|
294
|
-
filters: ['enable_workflow', '=', true]
|
|
295
|
-
group: FlowBindObject
|
|
296
|
-
instance_fields:
|
|
297
|
-
type: grid
|
|
298
|
-
is_wide: true
|
|
299
|
-
required: false
|
|
300
|
-
depend_on:
|
|
301
|
-
- object_name
|
|
302
|
-
group: FlowBindObject
|
|
303
|
-
visible_on: "{{ (formData.object_name && global.mode ==='read') ? true : false}}"
|
|
304
|
-
readonly: true
|
|
305
|
-
instance_fields.$:
|
|
306
|
-
label: Field
|
|
307
|
-
blackbox: true
|
|
308
|
-
type: object
|
|
309
|
-
instance_fields.$.name:
|
|
310
|
-
label: Field
|
|
311
|
-
type: lookup
|
|
312
|
-
multiple: false
|
|
313
|
-
is_wide: false
|
|
314
|
-
required: false
|
|
315
|
-
reference_to: object_fields
|
|
316
|
-
reference_to_field: name
|
|
317
|
-
depend_on:
|
|
318
|
-
- object_name
|
|
319
|
-
filtersFunction: !<tag:yaml.org,2002:js/function> |-
|
|
320
|
-
function (filters, values) {
|
|
321
|
-
const objectName = _.isObject(values.object_name) ? values.object_name.name : values.object_name;
|
|
322
|
-
if(objectName){
|
|
323
|
-
if(values._grid_row_id){
|
|
324
|
-
var selected = _.find(values.instance_fields, function(item){return item._id==values._grid_row_id});
|
|
325
|
-
var selectedAll = _.pluck(values.instance_fields, 'name');
|
|
326
|
-
if(selected){
|
|
327
|
-
selectedAll = _.difference(selectedAll, [selected.name]);
|
|
328
|
-
}
|
|
329
|
-
if(selectedAll && selectedAll.length > 0){
|
|
330
|
-
return [['object', '=', objectName], ['name', '!=', selectedAll]]
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
return ['object', '=', objectName]
|
|
334
|
-
}else{
|
|
335
|
-
return ['_id', '=', 'no']
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
instance_fields.$.required:
|
|
339
|
-
label: Required
|
|
340
|
-
type: boolean
|
|
341
|
-
instance_table_fields:
|
|
342
|
-
type: grid
|
|
343
|
-
blackbox: true
|
|
344
|
-
is_wide: true
|
|
345
|
-
depend_on:
|
|
346
|
-
- object_name
|
|
347
|
-
group: FlowBindObject
|
|
348
|
-
visible_on: "{{(formData.object_name && global.mode ==='read') ? true : false}}"
|
|
349
|
-
readonly: true
|
|
350
|
-
instance_table_fields.$.detail_field_fullname:
|
|
351
|
-
type: lookup
|
|
352
|
-
optionsFunction: !!js/function |
|
|
353
|
-
function(values) {
|
|
354
|
-
if (!(values != null ? values.object_name : void 0)) {
|
|
355
|
-
return [];
|
|
356
|
-
}
|
|
357
|
-
const objectName = _.isObject(values.object_name) ? values.object_name.name : values.object_name;
|
|
358
|
-
|
|
359
|
-
const options = [];
|
|
360
|
-
const { detailsInfo } = Steedos.authRequest('/am/forms/getDetailsInfo', {
|
|
361
|
-
type: 'post',
|
|
362
|
-
async: false,
|
|
363
|
-
data: JSON.stringify({
|
|
364
|
-
objectName
|
|
365
|
-
})
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
_.each(detailsInfo, function(related){
|
|
369
|
-
let foo = related.split('.');
|
|
370
|
-
let rObjectName = foo[0];
|
|
371
|
-
let rFieldName = foo[1];
|
|
372
|
-
let rObjectLable = Creator.getObject(rObjectName).label;
|
|
373
|
-
let rObjectFieldLable = (_.find(Creator.getObject(rObjectName).fields, function(field){return field.name === rFieldName}) || {}).label;
|
|
374
|
-
options.push({label: `${rObjectLable}.${rObjectFieldLable}`, value: related})
|
|
375
|
-
})
|
|
376
|
-
return options;
|
|
377
|
-
}
|
|
378
|
-
instance_table_fields.$.label:
|
|
379
|
-
label: Label
|
|
380
|
-
type: text
|
|
381
|
-
inlineHelpText: default is the object name
|
|
382
|
-
instance_table_fields.$.field_names:
|
|
383
|
-
type: lookup
|
|
384
|
-
create: false
|
|
385
|
-
multiple: true
|
|
386
|
-
reference_to: object_fields
|
|
387
|
-
reference_to_field: name
|
|
388
|
-
depend_on:
|
|
389
|
-
- object_name
|
|
390
|
-
- instance_table_fields
|
|
391
|
-
filtersFunction: !<tag:yaml.org,2002:js/function> |-
|
|
392
|
-
function (filters, values) {
|
|
393
|
-
let relatedFieldFullname = null;
|
|
394
|
-
const rowValue = _.find(values.instance_table_fields, function(item){
|
|
395
|
-
return item._id === values._grid_row_id
|
|
396
|
-
})
|
|
397
|
-
if(rowValue){
|
|
398
|
-
relatedFieldFullname = rowValue.detail_field_fullname
|
|
399
|
-
}
|
|
400
|
-
if(relatedFieldFullname){
|
|
401
|
-
const objectName = relatedFieldFullname.substring(0, relatedFieldFullname.indexOf("."))
|
|
402
|
-
return ['object', '=', objectName]
|
|
403
|
-
}else{
|
|
404
|
-
return ['_id', '=', 'no']
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
instance_template:
|
|
408
|
-
label: Instance Template
|
|
409
|
-
type: code
|
|
410
|
-
language: handlebars
|
|
411
|
-
is_wide: true
|
|
412
|
-
group: Template
|
|
413
|
-
name: instance_template
|
|
414
|
-
visible_on: "this.enable_amisform ? false : true"
|
|
415
|
-
print_template:
|
|
416
|
-
label: Print Template
|
|
417
|
-
type: code
|
|
418
|
-
language: handlebars
|
|
419
|
-
is_wide: true
|
|
420
|
-
group: Template
|
|
421
|
-
name: print_template
|
|
422
|
-
visible_on: "this.enable_amisform ? false : true"
|
|
423
|
-
field_map:
|
|
424
|
-
label: Mapping
|
|
425
|
-
type: code
|
|
426
|
-
language: json
|
|
427
|
-
is_wide: true
|
|
428
|
-
group: Synchronization
|
|
429
|
-
name: field_map
|
|
430
|
-
events:
|
|
431
|
-
label: Events
|
|
432
|
-
type: code
|
|
433
|
-
language: javascript
|
|
434
|
-
is_wide: true
|
|
435
|
-
group: Develop
|
|
436
|
-
name: events
|
|
437
|
-
visible_on: "this.enable_amisform ? false : true"
|
|
438
|
-
distribute_optional_users:
|
|
439
|
-
type: object
|
|
440
|
-
label: Users to be Distributed
|
|
441
|
-
reference_to: users
|
|
442
|
-
multiple: true
|
|
443
|
-
is_wide: true
|
|
444
|
-
group: Distribution
|
|
445
|
-
blackbox: true
|
|
446
|
-
omit: true
|
|
447
|
-
hidden: true
|
|
448
|
-
name: distribute_optional_users
|
|
449
|
-
filterable: true
|
|
450
|
-
distribute_to_self:
|
|
451
|
-
label: Distribute to myself
|
|
452
|
-
type: boolean
|
|
453
|
-
group: Distribution
|
|
454
|
-
omit: true
|
|
455
|
-
hidden: true
|
|
456
|
-
name: distribute_to_self
|
|
457
|
-
distribute_end_notification:
|
|
458
|
-
label: Distribute to myself
|
|
459
|
-
type: boolean
|
|
460
|
-
group: Distribution
|
|
461
|
-
omit: true
|
|
462
|
-
hidden: true
|
|
463
|
-
name: distribute_to_self
|
|
464
|
-
upload_after_being_distributed:
|
|
465
|
-
label: Allow upload after being distributed
|
|
466
|
-
type: boolean
|
|
467
|
-
group: Distribution
|
|
468
|
-
omit: true
|
|
469
|
-
hidden: true
|
|
470
|
-
enable_distribute_instance_to_attachment:
|
|
471
|
-
type: boolean
|
|
472
|
-
label: 分发时允许将原表单存储为附件
|
|
473
|
-
group: Distribution
|
|
474
|
-
enable_distribute_instance_related:
|
|
475
|
-
type: boolean
|
|
476
|
-
label: 分发时允许自动创建关联文件
|
|
477
|
-
group: Distribution
|
|
478
|
-
name_formula:
|
|
479
|
-
label: Formula of Title
|
|
480
|
-
type: text
|
|
481
|
-
group: Others
|
|
482
|
-
name: name_formula
|
|
483
|
-
omit: true
|
|
484
|
-
hidden: true
|
|
485
|
-
code_formula:
|
|
486
|
-
label: Formula of Code
|
|
487
|
-
type: text
|
|
488
|
-
group: Others
|
|
489
|
-
name: code_formula
|
|
490
|
-
omit: true
|
|
491
|
-
hidden: true
|
|
492
|
-
auto_remind:
|
|
493
|
-
label: Auto Remind
|
|
494
|
-
type: boolean
|
|
495
|
-
group: Others
|
|
496
|
-
name: auto_remind
|
|
497
|
-
sort_no:
|
|
498
|
-
type: number
|
|
499
|
-
label: Sort Number
|
|
500
|
-
group: Others
|
|
501
|
-
sortable: true
|
|
502
|
-
name: sort_no
|
|
503
|
-
timeout_auto_submit:
|
|
504
|
-
label: Auto Commit if Time Out
|
|
505
|
-
type: boolean
|
|
506
|
-
group: Others
|
|
507
|
-
name: timeout_auto_submit
|
|
508
|
-
allow_select_step:
|
|
509
|
-
label: Applicant can Select Steps and Handlers
|
|
510
|
-
inlineHelpText: Allow the applicant to specify the flow steps and step handlers when submitting the application form. You need to modify the properties on the step through the Workflow Designer.
|
|
511
|
-
type: boolean
|
|
512
|
-
group: Others
|
|
513
|
-
forbid_initiate_instance:
|
|
514
|
-
label: 审批王端禁止发起流程
|
|
515
|
-
type: boolean
|
|
516
|
-
group: Others
|
|
517
|
-
list_views:
|
|
518
|
-
all:
|
|
519
|
-
label: All Workflows
|
|
520
|
-
filter_scope: space
|
|
521
|
-
columns:
|
|
522
|
-
- name
|
|
523
|
-
- state
|
|
524
|
-
- category
|
|
525
|
-
- sort_no
|
|
526
|
-
- modified
|
|
527
|
-
extra_columns:
|
|
528
|
-
- form
|
|
529
|
-
- object_name
|
|
530
|
-
- enable_amisform
|
|
531
|
-
filter_fields:
|
|
532
|
-
- state
|
|
533
|
-
- category
|
|
534
|
-
- company_id
|
|
535
|
-
sort:
|
|
536
|
-
- - modified
|
|
537
|
-
- desc
|
|
538
|
-
customize:
|
|
539
|
-
label: 自定义
|
|
540
|
-
filters:
|
|
541
|
-
- ["is_system","<>",true]
|
|
542
|
-
filter_scope: space
|
|
543
|
-
columns:
|
|
544
|
-
- name
|
|
545
|
-
- state
|
|
546
|
-
- category
|
|
547
|
-
- sort_no
|
|
548
|
-
- modified
|
|
549
|
-
sort:
|
|
550
|
-
- - modified
|
|
551
|
-
- desc
|
|
552
|
-
actions:
|
|
553
|
-
standard_new:
|
|
554
|
-
label: New
|
|
555
|
-
visible: !<tag:yaml.org,2002:js/function> |-
|
|
556
|
-
function () {
|
|
557
|
-
var permissions;
|
|
558
|
-
permissions = Creator.getPermissions();
|
|
559
|
-
|
|
560
|
-
if (permissions) {
|
|
561
|
-
return permissions["allowCreate"];
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
'on': list
|
|
565
|
-
amis_schema: |-
|
|
566
|
-
{
|
|
567
|
-
"type": "service",
|
|
568
|
-
"body": [
|
|
569
|
-
{
|
|
570
|
-
"type": "button",
|
|
571
|
-
"label": "${'flows.standard_new.new' | t}",
|
|
572
|
-
"id": "u:new_flow",
|
|
573
|
-
"onEvent": {
|
|
574
|
-
"click": {
|
|
575
|
-
"actions": [
|
|
576
|
-
{
|
|
577
|
-
"actionType": "dialog",
|
|
578
|
-
"dialog": {
|
|
579
|
-
"type": "dialog",
|
|
580
|
-
"data": {
|
|
581
|
-
"&": "$$",
|
|
582
|
-
"spaceId": "${context.tenantId}"
|
|
583
|
-
},
|
|
584
|
-
"title": "${'flows.standard_new.new_flow' | t}",
|
|
585
|
-
"body": [
|
|
586
|
-
{
|
|
587
|
-
"type": "form",
|
|
588
|
-
"id": "u:81f0d8165f54",
|
|
589
|
-
"title": "表单",
|
|
590
|
-
"body": [
|
|
591
|
-
{
|
|
592
|
-
"type": "uuid",
|
|
593
|
-
"name": "id",
|
|
594
|
-
"length": 32
|
|
595
|
-
},
|
|
596
|
-
{
|
|
597
|
-
"type": "select",
|
|
598
|
-
"name": "category",
|
|
599
|
-
"label": "${'flows.standard_new.category' | t}",
|
|
600
|
-
"required": true,
|
|
601
|
-
"joinValues": false,
|
|
602
|
-
"extractValue": true,
|
|
603
|
-
"autoComplete": {
|
|
604
|
-
"method": "post",
|
|
605
|
-
"url": "${context.rootUrl}/graphql",
|
|
606
|
-
"data": {
|
|
607
|
-
"orderBy": "${orderBy}",
|
|
608
|
-
"orderDir": "${orderDir}",
|
|
609
|
-
"pageNo": "${page}",
|
|
610
|
-
"pageSize": "${perPage}",
|
|
611
|
-
"query": "{options:categories(filters: {__filters}, top: {__top}){_id label:name value:_id},count:categories__count(filters:{__filters})}",
|
|
612
|
-
"$term": "$term",
|
|
613
|
-
"$value": "$category._id",
|
|
614
|
-
"$": "$$",
|
|
615
|
-
"rfield": "${object_name}"
|
|
616
|
-
},
|
|
617
|
-
"headers": {
|
|
618
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
619
|
-
},
|
|
620
|
-
"requestAdaptor": "\n var filters = '[]';\n var top = 10;\n if(api.data.$term){\n filters = '[\"name\", \"contains\", \"'+ api.data.$term +'\"]';\n }else if(api.data.$value){\n filters = '[\"_id\", \"=\", \"'+ api.data.$value +'\"]';\n }\n api.data.query = api.data.query.replace(/{__filters}/g, filters).replace('{__top}', top);\n return api;\n "
|
|
621
|
-
},
|
|
622
|
-
"labelClassName": "text-left",
|
|
623
|
-
"clearValueOnHidden": true,
|
|
624
|
-
"fieldName": "category",
|
|
625
|
-
"id": "u:ebbbc41d58b8"
|
|
626
|
-
},
|
|
627
|
-
{
|
|
628
|
-
"type": "input-text",
|
|
629
|
-
"label": "${'flows.standard_new.flow_name' | t}",
|
|
630
|
-
"name": "name",
|
|
631
|
-
"id": "u:4af5bdaa813a",
|
|
632
|
-
"required": true,
|
|
633
|
-
"labelClassName": "text-left"
|
|
634
|
-
},
|
|
635
|
-
{
|
|
636
|
-
"type": "steedos-field",
|
|
637
|
-
"className": "mb-3",
|
|
638
|
-
"config": {
|
|
639
|
-
"name": "company_id",
|
|
640
|
-
"type": "lookup",
|
|
641
|
-
"reference_to": "company",
|
|
642
|
-
"label": "${'flows.standard_new.division' | t}"
|
|
643
|
-
}
|
|
644
|
-
},
|
|
645
|
-
{
|
|
646
|
-
"label": "${'flows.standard_new.binding_objects' | t}",
|
|
647
|
-
"type": "select",
|
|
648
|
-
"name": "object_name2",
|
|
649
|
-
"clearable": true,
|
|
650
|
-
"id": "u:4e769995f638",
|
|
651
|
-
"required": false,
|
|
652
|
-
"joinValues": false,
|
|
653
|
-
"extractValue": true,
|
|
654
|
-
"labelField": "label",
|
|
655
|
-
"valueField": "value",
|
|
656
|
-
"className": "",
|
|
657
|
-
"labelClassName": "text-left",
|
|
658
|
-
"en-US": {
|
|
659
|
-
"label": "Object"
|
|
660
|
-
},
|
|
661
|
-
"checkAll": false,
|
|
662
|
-
"searchable": true,
|
|
663
|
-
"source": {
|
|
664
|
-
"method": "post",
|
|
665
|
-
"url": "${context.rootUrl}/graphql",
|
|
666
|
-
"data": {
|
|
667
|
-
"orderBy": "${orderBy}",
|
|
668
|
-
"orderDir": "${orderDir}",
|
|
669
|
-
"pageNo": "${page}",
|
|
670
|
-
"pageSize": "${perPage}",
|
|
671
|
-
"query": "{options:objects(filters: {__filters}, top: {__top}, sort: \"{__sort}\"){_id label:label value:name},count:objects__count(filters:{__filters}),defaultValueOptions:objects(filters:{__options_filters}){_id label:label value:name}}",
|
|
672
|
-
"$term": "$term",
|
|
673
|
-
"rfield": "${object_name}"
|
|
674
|
-
},
|
|
675
|
-
"headers": {
|
|
676
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
677
|
-
},
|
|
678
|
-
"adaptor": "\n const data = payload.data;\n var defaultValueOptions = data.defaultValueOptions;\n // 字段值下拉选项合并到options中\n data.options = _.unionWith(defaultValueOptions, data.options, function(a,b){\n return a[\"value\"]=== b[\"value\"];\n });\n delete data.defaultValueOptions;\n payload.data.options = data.options;\n return payload;\n ",
|
|
679
|
-
"requestAdaptor": "\n var filters = [];\n var top = 1000;\n if(api.data.$term){\n filters = [[\"label\", \"contains\", api.data.$term]];\n }\n // else if(api.data.$value){\n // filters = [[\"_id\", \"=\", api.data.$value]];\n // }\n\n var fieldFilters = [\"enable_workflow\",\"=\",true];\n if(fieldFilters && fieldFilters.length){\n filters.push(fieldFilters);\n }\n\n const filtersFunction = undefined;\n\n if(filtersFunction){\n const _filters = filtersFunction(filters, api.data.$);\n if(_filters && _filters.length > 0){\n filters.push(_filters);\n }\n }\n var sort = \"\";\n api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters)).replace('{__top}', top).replace('{__sort}', sort.trim());\n\n var defaultValue = api.data.$value;\n var optionsFiltersOp = \"=\";\n var optionsFilters = [[\"name\", optionsFiltersOp, []]];\n if (defaultValue && !api.data.$term) { \n // 字段值单独请求,没值的时候在请求中返回空\n optionsFilters = [[\"name\", optionsFiltersOp, defaultValue]];\n }\n api.data.query = api.data.query.replace(/{__options_filters}/g, JSON.stringify(optionsFilters));\n return api;\n "
|
|
680
|
-
},
|
|
681
|
-
"multiple": false
|
|
682
|
-
},{"type": "checkbox","option": "","name": "enable_amisform","id": "u:f581950a606a","label": "${'flows.standard_new.enable_amis_forms' | t}"}
|
|
683
|
-
],
|
|
684
|
-
"api": {
|
|
685
|
-
"method": "post",
|
|
686
|
-
"url": "${context.rootUrl}/am/forms?sync_token=",
|
|
687
|
-
"data": {
|
|
688
|
-
"&": "$$",
|
|
689
|
-
"space": "${spaceId}"
|
|
690
|
-
},
|
|
691
|
-
"requestAdaptor": "const {id, name, space, enable_amisform} = api.body;var form = {\n id,\n name,\n space,\n enable_amisform,\n is_valid: true,\n app: 'workflow',\n current: {\n id\n }\n\n};\nvar body = api.body;\nif (body.category) {\n form.category = body.category\n}\n\nlet companyId = body.company_id\nif (companyId) {\n form.company_id = companyId\n}\n\nif (body.object_name2) {\n form.object_name = body.object_name2\n}\n\napi.data = {\n Forms: [form]\n};\n\nconsole.log(`api`, api)\nreturn api;"
|
|
692
|
-
},
|
|
693
|
-
"onEvent": {
|
|
694
|
-
"submitSucc": {
|
|
695
|
-
"weight": 0,
|
|
696
|
-
"actions": [
|
|
697
|
-
{
|
|
698
|
-
"actionType": "broadcast",
|
|
699
|
-
"args": {
|
|
700
|
-
"eventName": "@data.changed.flows",
|
|
701
|
-
"recordId": "newFlow"
|
|
702
|
-
},
|
|
703
|
-
"data": {
|
|
704
|
-
"objectName": "flows"
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
]
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
],
|
|
712
|
-
"id": "u:85b77731ab26"
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
],
|
|
716
|
-
"weight": 0
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
],
|
|
721
|
-
"regions": [
|
|
722
|
-
"body"
|
|
723
|
-
],
|
|
724
|
-
"data": {
|
|
725
|
-
"context": {
|
|
726
|
-
"rootUrl": "http://127.0.0.1:5300"
|
|
727
|
-
},
|
|
728
|
-
"app_id": "",
|
|
729
|
-
"tab_id": "",
|
|
730
|
-
"object_name": "",
|
|
731
|
-
"dataComponentId": "",
|
|
732
|
-
"record_id": "",
|
|
733
|
-
"record": {},
|
|
734
|
-
"permissions": {}
|
|
735
|
-
},
|
|
736
|
-
"bodyClassName": "p-0",
|
|
737
|
-
"id": "u:35a8389e43b3"
|
|
738
|
-
}
|
|
739
|
-
is_enable: true
|
|
740
|
-
type: amis_button
|
|
741
|
-
design:
|
|
742
|
-
label: Designer
|
|
743
|
-
visible: !<tag:yaml.org,2002:js/function> |-
|
|
744
|
-
function () {
|
|
745
|
-
return true;
|
|
746
|
-
}
|
|
747
|
-
'on': list
|
|
748
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
749
|
-
function (object_name, record_id, fields) {
|
|
750
|
-
return WorkflowCore.openFlowDesign(Steedos.locale().toLocaleLowerCase(), Steedos.spaceId(), null, Creator.getUserCompanyId());
|
|
751
|
-
}
|
|
752
|
-
standard_edit:
|
|
753
|
-
visible: true
|
|
754
|
-
'on': record
|
|
755
|
-
standard_delete:
|
|
756
|
-
visible: false
|
|
757
|
-
'on': record_more
|
|
758
|
-
standard_delete_many:
|
|
759
|
-
visible: false
|
|
760
|
-
'on': list
|
|
761
|
-
designFlow:
|
|
762
|
-
label: Flow Designer
|
|
763
|
-
visible: !<tag:yaml.org,2002:js/function> |-
|
|
764
|
-
function (object_name, record_id, record_permissions) {
|
|
765
|
-
return true;
|
|
766
|
-
}
|
|
767
|
-
'on': record
|
|
768
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
769
|
-
function (object_name, record_id, fields) {
|
|
770
|
-
return WorkflowCore.openFlowDesign(Steedos.locale().toLocaleLowerCase(), Steedos.spaceId(), record_id, Creator.getUserCompanyId());
|
|
771
|
-
}
|
|
772
|
-
designForm:
|
|
773
|
-
label: Form Designer
|
|
774
|
-
visible: !<tag:yaml.org,2002:js/function> |-
|
|
775
|
-
function (object_name, record_id, record_permissions, data) {
|
|
776
|
-
var record = data && data.record;
|
|
777
|
-
if(record.object_name || record.enable_amisform){
|
|
778
|
-
return false;
|
|
779
|
-
};
|
|
780
|
-
return true;
|
|
781
|
-
}
|
|
782
|
-
'on': record
|
|
783
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
784
|
-
function (object_name, record_id, fields) {
|
|
785
|
-
return WorkflowCore.openFormDesign(Steedos.locale(), Steedos.spaceId(), this.record.record.form, Creator.getUserCompanyId());
|
|
786
|
-
}
|
|
787
|
-
enableFlow:
|
|
788
|
-
label: Enable Flow
|
|
789
|
-
visible: !<tag:yaml.org,2002:js/function> |-
|
|
790
|
-
function (object_name, record_id, record_permissions, data) {
|
|
791
|
-
var record = data && data.record;
|
|
792
|
-
if (record && record.state == 'disabled') {
|
|
793
|
-
return true;
|
|
794
|
-
}
|
|
795
|
-
return false;
|
|
796
|
-
}
|
|
797
|
-
'on': record
|
|
798
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
799
|
-
function (object_name, record_id, fields) {
|
|
800
|
-
window.$("body").addClass("loading");
|
|
801
|
-
var record = Creator.getObjectRecord(object_name, record_id, 'space,form,state');
|
|
802
|
-
var userSession = Steedos.User.get();
|
|
803
|
-
var authorization = "Bearer " + userSession.spaceId + "," + userSession.authToken;
|
|
804
|
-
var formId = _.isObject(record.form) ? record.form._id : record.form;
|
|
805
|
-
window.$.ajax({
|
|
806
|
-
type: "POST",
|
|
807
|
-
url: Steedos.absoluteUrl("/am/flows/state?methodOverride=PUT"),
|
|
808
|
-
data: JSON.stringify({ 'Flows': [{id: record._id, space: _.isObject(record.space) ? record.space._id : record.space, state: 'enabled', form: formId }] }),
|
|
809
|
-
dataType: "json",
|
|
810
|
-
contentType: 'application/json',
|
|
811
|
-
beforeSend: function (XHR) {
|
|
812
|
-
XHR.setRequestHeader('Content-Type', 'application/json');
|
|
813
|
-
XHR.setRequestHeader('Authorization', authorization);
|
|
814
|
-
},
|
|
815
|
-
success: function (data) {
|
|
816
|
-
window.$("body").removeClass("loading");
|
|
817
|
-
toastr.success("操作已成功!");
|
|
818
|
-
SteedosUI.reloadRecord(object_name, record_id);
|
|
819
|
-
FlowRouter.reload();
|
|
820
|
-
},
|
|
821
|
-
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
822
|
-
window.$("body").removeClass("loading");
|
|
823
|
-
toastr.error(XMLHttpRequest.responseJSON);
|
|
824
|
-
}
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
|
-
disableFlow:
|
|
828
|
-
label: Disable Flow
|
|
829
|
-
visible: !<tag:yaml.org,2002:js/function> |-
|
|
830
|
-
function (object_name, record_id, record_permissions, data) {
|
|
831
|
-
var record = data && data.record;
|
|
832
|
-
if (record && record.state == 'enabled') {
|
|
833
|
-
return true;
|
|
834
|
-
}
|
|
835
|
-
return false;
|
|
836
|
-
}
|
|
837
|
-
'on': record
|
|
838
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
839
|
-
function (object_name, record_id, fields) {
|
|
840
|
-
window.$("body").addClass("loading");
|
|
841
|
-
var record = Creator.getObjectRecord(object_name, record_id, 'space,form,state');
|
|
842
|
-
var userSession = Steedos.User.get();
|
|
843
|
-
var authorization = "Bearer " + userSession.spaceId + "," + userSession.authToken;
|
|
844
|
-
var formId = _.isObject(record.form) ? record.form._id : record.form;
|
|
845
|
-
window.$.ajax({
|
|
846
|
-
type: "POST",
|
|
847
|
-
url: Steedos.absoluteUrl("/am/flows/state?methodOverride=PUT"),
|
|
848
|
-
data: JSON.stringify({ 'Flows': [{id: record._id, space: _.isObject(record.space) ? record.space._id : record.space, state: 'disabled', form: formId }] }),
|
|
849
|
-
dataType: "json",
|
|
850
|
-
contentType: 'application/json',
|
|
851
|
-
beforeSend: function (XHR) {
|
|
852
|
-
XHR.setRequestHeader('Content-Type', 'application/json');
|
|
853
|
-
XHR.setRequestHeader('Authorization', authorization);
|
|
854
|
-
},
|
|
855
|
-
success: function (data) {
|
|
856
|
-
window.$("body").removeClass("loading");
|
|
857
|
-
toastr.success("操作已成功!");
|
|
858
|
-
SteedosUI.reloadRecord(object_name, record_id);
|
|
859
|
-
FlowRouter.reload();
|
|
860
|
-
},
|
|
861
|
-
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
862
|
-
window.$("body").removeClass("loading");
|
|
863
|
-
toastr.error(XMLHttpRequest.responseJSON);
|
|
864
|
-
}
|
|
865
|
-
});
|
|
866
|
-
}
|
|
867
|
-
export_default_template:
|
|
868
|
-
label: Export Default Template
|
|
869
|
-
'on': record_more
|
|
870
|
-
visible: !<tag:yaml.org,2002:js/function> |-
|
|
871
|
-
function () {
|
|
872
|
-
return true;
|
|
873
|
-
}
|
|
874
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
875
|
-
function (object_name, record_id, fields) {
|
|
876
|
-
var url = Steedos.absoluteUrl("/api/workflow/export/talbe_template?flow=" + record_id);
|
|
877
|
-
return window.open(url, '_blank');
|
|
878
|
-
}
|
|
879
|
-
exportFlow:
|
|
880
|
-
label: Export Workflow
|
|
881
|
-
visible: true
|
|
882
|
-
'on': record_more
|
|
883
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
884
|
-
function (object_name, record_id, fields) {
|
|
885
|
-
var flow, form_id, ref2, ref3, ref4;
|
|
886
|
-
console.log("exportFlow", object_name, record_id, fields);
|
|
887
|
-
|
|
888
|
-
if (_.isString((ref2 = this.record) != null ? ref2.form : void 0)) {
|
|
889
|
-
form_id = this.record.form;
|
|
890
|
-
} else if ((ref3 = this.record) != null ? (ref4 = ref3.form) != null ? ref4._id : void 0 : void 0) {
|
|
891
|
-
form_id = this.record.form._id;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
if (form_id) {
|
|
895
|
-
return window.open(Steedos.absoluteUrl("/api/workflow/export/form?form=" + form_id), '_blank');
|
|
896
|
-
} else {
|
|
897
|
-
flow = Creator.getCollection(object_name).findOne(record_id);
|
|
898
|
-
if (flow) {
|
|
899
|
-
return window.open(Steedos.absoluteUrl("/api/workflow/export/form?form=" + flow.form), '_blank');
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
# importFlow:
|
|
904
|
-
# label: Import Workflow
|
|
905
|
-
# visible: true
|
|
906
|
-
# 'on': list
|
|
907
|
-
# todo: !<tag:yaml.org,2002:js/function> |-
|
|
908
|
-
# function () {
|
|
909
|
-
# return Modal.show("admin_import_flow_modal", {
|
|
910
|
-
# onSuccess: function (flows) {
|
|
911
|
-
# if (flows.length > 0) {
|
|
912
|
-
# return FlowRouter.go("/app/admin/flows/view/" + flows[0]);
|
|
913
|
-
# }
|
|
914
|
-
# }
|
|
915
|
-
# });
|
|
916
|
-
# }
|
|
917
|
-
# exportFlows:
|
|
918
|
-
# label: Export Workflows
|
|
919
|
-
# visible: true
|
|
920
|
-
# 'on': list
|
|
921
|
-
# todo: !<tag:yaml.org,2002:js/function> |-
|
|
922
|
-
# function () {
|
|
923
|
-
# let selectedRows = SteedosUI.getTableSelectedRows(`listview_flows_${Session.get("list_view_id")}`);
|
|
924
|
-
# let ids = _.pluck(selectedRows, '_id');
|
|
925
|
-
# if(ids && ids.length > 0){
|
|
926
|
-
# window.open(Steedos.absoluteUrl("/api/workflow/export/form?flows=" + ids.join(',')), '_blank');
|
|
927
|
-
# }else{
|
|
928
|
-
# toastr.warning("请选择要导出的流程");
|
|
929
|
-
# }
|
|
930
|
-
# }
|
|
931
|
-
upgradeFlow:
|
|
932
|
-
label: Upgrade Workflow
|
|
933
|
-
visible: true
|
|
934
|
-
'on': record_more
|
|
935
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
936
|
-
function (object_name, record_id, fields) {
|
|
937
|
-
return Modal.show("admin_import_flow_modal", {
|
|
938
|
-
flowId: record_id,
|
|
939
|
-
onSuccess: function () {
|
|
940
|
-
toastr.success("流程升级成功")
|
|
941
|
-
}
|
|
942
|
-
});
|
|
943
|
-
}
|
|
944
|
-
copyFlow:
|
|
945
|
-
label: Copy Workflow
|
|
946
|
-
visible: true
|
|
947
|
-
'on': record_more
|
|
948
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
949
|
-
function (object_name, record_id, fields) {
|
|
950
|
-
return Modal.show("copy_flow_modal", {
|
|
951
|
-
record_id: record_id,
|
|
952
|
-
onSuccess: function (flows) {
|
|
953
|
-
if (flows.length > 0) {
|
|
954
|
-
return FlowRouter.go("/app/admin/flows/view/" + flows[0]);
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
distributeAdmin:
|
|
960
|
-
label: Set Distribution Options
|
|
961
|
-
visible: true
|
|
962
|
-
'on': record_more
|
|
963
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
964
|
-
function (object_name, record_id, fields, props) {
|
|
965
|
-
var queryResult = Steedos.authRequest("/graphql", {
|
|
966
|
-
type: 'POST',
|
|
967
|
-
async: false,
|
|
968
|
-
data: JSON.stringify({
|
|
969
|
-
query: `{record:${object_name}__findOne(id: "${record_id}"){_id, name, distribute_optional_users, current, distribute_to_self, distribute_end_notification, upload_after_being_distributed}}`
|
|
970
|
-
}),
|
|
971
|
-
contentType: 'application/json',
|
|
972
|
-
error: function () { }
|
|
973
|
-
});
|
|
974
|
-
var recordDoc = queryResult && queryResult.data && queryResult.data.record;
|
|
975
|
-
return Modal.show("distribute_edit_flow_modal", {
|
|
976
|
-
flow: recordDoc
|
|
977
|
-
});
|
|
978
|
-
}
|
|
979
|
-
removeFlow:
|
|
980
|
-
label: Delete
|
|
981
|
-
visible: true
|
|
982
|
-
'on': record
|
|
983
|
-
todo: !<tag:yaml.org,2002:js/function> |-
|
|
984
|
-
function (object_name, record_id, fields) {
|
|
985
|
-
var record = Creator.getObjectRecord(object_name, record_id, 'name,form');
|
|
986
|
-
var formId = _.isObject(record.form) ? record.form._id : record.form;
|
|
987
|
-
var flowName = record.name;
|
|
988
|
-
swal({
|
|
989
|
-
title: '为了确保安全,请输入您要删除的流程名(同时会删除相关的申请单)',
|
|
990
|
-
inputPlaceholder: '流程名',
|
|
991
|
-
type: "input",
|
|
992
|
-
confirmButtonText: t('OK'),
|
|
993
|
-
cancelButtonText: t('Cancel'),
|
|
994
|
-
showCancelButton: true,
|
|
995
|
-
closeOnConfirm: false
|
|
996
|
-
}, function (inputText) {
|
|
997
|
-
if (inputText == false) {
|
|
998
|
-
return false;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
if (inputText != flowName) {
|
|
1002
|
-
swal.showInputError('您输入的名称不正确');
|
|
1003
|
-
return false;
|
|
1004
|
-
}
|
|
1005
|
-
window.$("body").addClass("loading");
|
|
1006
|
-
var userSession = Steedos.User.get();
|
|
1007
|
-
var authorization = "Bearer " + userSession.spaceId + "," + userSession.authToken;
|
|
1008
|
-
window.$.ajax({
|
|
1009
|
-
type: "POST",
|
|
1010
|
-
url: Steedos.absoluteUrl("/am/forms?methodOverride=DELETE"),
|
|
1011
|
-
data: JSON.stringify({ 'Forms': [{ 'id': formId }] }),
|
|
1012
|
-
dataType: "json",
|
|
1013
|
-
contentType: 'application/json',
|
|
1014
|
-
beforeSend: function (XHR) {
|
|
1015
|
-
XHR.setRequestHeader('Content-Type', 'application/json');
|
|
1016
|
-
XHR.setRequestHeader('Authorization', authorization);
|
|
1017
|
-
},
|
|
1018
|
-
success: function (data) {
|
|
1019
|
-
window.$("body").removeClass("loading");
|
|
1020
|
-
toastr.success("操作已成功!");
|
|
1021
|
-
var gridObjectNameClass = object_name.replace(/\./g,"-");
|
|
1022
|
-
var gridContainer = window.$(`.gridContainer.${gridObjectNameClass}`);
|
|
1023
|
-
var dxDataGridInstance, isOpenerRemove;
|
|
1024
|
-
if (!(gridContainer != null ? gridContainer.length : void 0)) {
|
|
1025
|
-
if (window.opener) {
|
|
1026
|
-
isOpenerRemove = true;
|
|
1027
|
-
gridContainer = window.opener.$(`.gridContainer.${gridObjectNameClass}`);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
if (gridContainer != null ? gridContainer.length : void 0) {
|
|
1031
|
-
dxDataGridInstance = gridContainer.dxDataGrid().dxDataGrid('instance');
|
|
1032
|
-
}
|
|
1033
|
-
if (dxDataGridInstance) {
|
|
1034
|
-
Template.creator_grid.refresh(dxDataGridInstance);
|
|
1035
|
-
}
|
|
1036
|
-
if (isOpenerRemove || !dxDataGridInstance) {
|
|
1037
|
-
if (isOpenerRemove) {
|
|
1038
|
-
window.close();
|
|
1039
|
-
} else if (record_id === Session.get("record_id") && !Steedos.isMobile() && list_view_id !== 'calendar' && object_name !== "cms_posts") {
|
|
1040
|
-
var appid = Session.get("app_id");
|
|
1041
|
-
var list_view_id = Session.get("list_view_id");
|
|
1042
|
-
if (!list_view_id) {
|
|
1043
|
-
list_view_id = "all";
|
|
1044
|
-
}
|
|
1045
|
-
FlowRouter.go(`/app/${appid}/${object_name}/grid/${list_view_id}`);
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
window.refreshGrid();
|
|
1049
|
-
},
|
|
1050
|
-
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
|
1051
|
-
window.$("body").removeClass("loading");
|
|
1052
|
-
toastr.error(XMLHttpRequest.responseJSON);
|
|
1053
|
-
}
|
|
1054
|
-
});
|
|
1055
|
-
sweetAlert.close();
|
|
1056
|
-
})
|
|
1057
|
-
}
|
|
1058
|
-
relatedList:
|
|
1059
|
-
- cms_files
|
|
1060
|
-
- object_workflows
|
|
1061
|
-
permission_set:
|
|
1062
|
-
user:
|
|
1063
|
-
allowCreate: false
|
|
1064
|
-
allowDelete: false
|
|
1065
|
-
allowEdit: false
|
|
1066
|
-
allowRead: true
|
|
1067
|
-
modifyAllRecords: false
|
|
1068
|
-
viewAllRecords: true
|
|
1069
|
-
admin:
|
|
1070
|
-
allowCreate: true
|
|
1071
|
-
allowDelete: false
|
|
1072
|
-
allowEdit: true
|
|
1073
|
-
allowRead: true
|
|
1074
|
-
modifyAllRecords: true
|
|
1075
|
-
viewAllRecords: true
|
|
1076
|
-
workflow_admin:
|
|
1077
|
-
allowCreate: true
|
|
1078
|
-
allowDelete: false
|
|
1079
|
-
allowEdit: true
|
|
1080
|
-
allowRead: true
|
|
1081
|
-
modifyAllRecords: false
|
|
1082
|
-
viewAllRecords: false
|
|
1083
|
-
modifyCompanyRecords: true
|
|
1084
|
-
viewCompanyRecords: true
|
|
1085
|
-
disabled_list_views: []
|
|
1086
|
-
disabled_actions: []
|
|
1087
|
-
unreadable_fields: []
|
|
1088
|
-
uneditable_fields: []
|
|
1089
|
-
unrelated_objects: []
|