@steedos/standard-object-database 2.2.55-beta.16

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.
Files changed (90) hide show
  1. package/main/default/applications/.gitkeep +0 -0
  2. package/main/default/client/datasources.client.js +7 -0
  3. package/main/default/client/object_fields.client.js +212 -0
  4. package/main/default/client/object_layouts.client.js +86 -0
  5. package/main/default/objectTranslations/_object_reload_logs.en/_object_reload_logs.en.objectTranslation.yml +16 -0
  6. package/main/default/objectTranslations/_object_reload_logs.zh-CN/_object_reload_logs.zh-CN.objectTranslation.yml +16 -0
  7. package/main/default/objectTranslations/datasources.en/datasources.en.objectTranslation.yml +121 -0
  8. package/main/default/objectTranslations/datasources.zh-CN/datasources.zh-CN.objectTranslation.yml +105 -0
  9. package/main/default/objectTranslations/object_actions.en/object_actions.en.objectTranslation.yml +55 -0
  10. package/main/default/objectTranslations/object_actions.zh-CN/object_actions.zh-CN.objectTranslation.yml +50 -0
  11. package/main/default/objectTranslations/object_fields.en/object_fields.en.objectTranslation.yml +335 -0
  12. package/main/default/objectTranslations/object_fields.zh-CN/object_fields.zh-CN.objectTranslation.yml +312 -0
  13. package/main/default/objectTranslations/object_layouts.en/object_layouts.en.objectTranslation.yml +72 -0
  14. package/main/default/objectTranslations/object_layouts.zh-CN/object_layouts.zh-CN.objectTranslation.yml +116 -0
  15. package/main/default/objectTranslations/object_listviews.en/object_listviews.en.objectTranslation.yml +153 -0
  16. package/main/default/objectTranslations/object_listviews.zh-CN/object_listviews.zh-CN.objectTranslation.yml +146 -0
  17. package/main/default/objectTranslations/object_related_list.en/object_related_list.en.objectTranslation.yml +82 -0
  18. package/main/default/objectTranslations/object_related_list.zh-CN/object_related_list.zh-CN.objectTranslation.yml +82 -0
  19. package/main/default/objectTranslations/object_triggers.en/object_triggers.en.objectTranslation.yml +30 -0
  20. package/main/default/objectTranslations/object_triggers.zh-CN/object_triggers.zh-CN.objectTranslation.yml +29 -0
  21. package/main/default/objectTranslations/object_validation_rules.en/object_validation_rules.en.objectTranslation.yml +40 -0
  22. package/main/default/objectTranslations/object_validation_rules.zh-CN/object_validation_rules.zh-CN.objectTranslation.yml +38 -0
  23. package/main/default/objectTranslations/objects.en/objects.en.objectTranslation.yml +219 -0
  24. package/main/default/objectTranslations/objects.zh-CN/objects.zh-CN.objectTranslation.yml +218 -0
  25. package/main/default/objects/0.datasources.observe.object.js +83 -0
  26. package/main/default/objects/0.objects_reload.object.js +26 -0
  27. package/main/default/objects/1.objects.observe.object.js +61 -0
  28. package/main/default/objects/10.tabs.observe.object.js +36 -0
  29. package/main/default/objects/11.restriction_rules.observe.object.js +37 -0
  30. package/main/default/objects/12.share_rules.observe.object.js +37 -0
  31. package/main/default/objects/13.permission_fields.observe.object.js +37 -0
  32. package/main/default/objects/14.object_fields.observe.object.js +44 -0
  33. package/main/default/objects/15.permission_objects.observe.object.js +44 -0
  34. package/main/default/objects/2.object_triggers.observe.object.js +35 -0
  35. package/main/default/objects/3.permission_objects.observe.object.js +29 -0
  36. package/main/default/objects/4.permission_set.observe.object.js +39 -0
  37. package/main/default/objects/5.holidays.observe.object.js +30 -0
  38. package/main/default/objects/6.business_hours.observe.object.js +33 -0
  39. package/main/default/objects/7.object_actions.observe.object.js +43 -0
  40. package/main/default/objects/7.object_layouts.observe.object.js +33 -0
  41. package/main/default/objects/9.apps.observe.object.js +33 -0
  42. package/main/default/objects/_object_reload_logs.object.yml +10 -0
  43. package/main/default/objects/datasources.action.js +51 -0
  44. package/main/default/objects/datasources.core.js +34 -0
  45. package/main/default/objects/datasources.object.js +168 -0
  46. package/main/default/objects/datasources.object.yml +113 -0
  47. package/main/default/objects/object_actions.object.js +152 -0
  48. package/main/default/objects/object_actions.object.yml +142 -0
  49. package/main/default/objects/object_fields.action.js +128 -0
  50. package/main/default/objects/object_fields.function.js +104 -0
  51. package/main/default/objects/object_fields.object.js +501 -0
  52. package/main/default/objects/object_fields.object.yml +690 -0
  53. package/main/default/objects/object_layouts.action.js +31 -0
  54. package/main/default/objects/object_layouts.layouts.action.js +19 -0
  55. package/main/default/objects/object_layouts.object.yml +356 -0
  56. package/main/default/objects/object_listviews.action.js +93 -0
  57. package/main/default/objects/object_listviews.object.js +100 -0
  58. package/main/default/objects/object_listviews.object.yml +309 -0
  59. package/main/default/objects/object_manager.app.todo.yml +11 -0
  60. package/main/default/objects/object_related_list.object.js +110 -0
  61. package/main/default/objects/object_related_list.object.yml +208 -0
  62. package/main/default/objects/object_triggers.core.js +58 -0
  63. package/main/default/objects/object_triggers.object.js +65 -0
  64. package/main/default/objects/object_triggers.object.yml +124 -0
  65. package/main/default/objects/object_validation_rules.action.js +33 -0
  66. package/main/default/objects/object_validation_rules.object.yml +100 -0
  67. package/main/default/objects/objects.action.js +157 -0
  68. package/main/default/objects/objects.core.js +398 -0
  69. package/main/default/objects/objects.erd.data.function.js +85 -0
  70. package/main/default/objects/objects.lib.js +42 -0
  71. package/main/default/objects/objects.object.js +543 -0
  72. package/main/default/objects/objects.object.yml +512 -0
  73. package/main/default/objects/objects.tree.js +58 -0
  74. package/main/default/objects/permission_objects.core.js +75 -0
  75. package/main/default/permissionsets/.gitkeep +0 -0
  76. package/main/default/profiles/.gitkeep +0 -0
  77. package/main/default/tabs/.gitkeep +0 -0
  78. package/main/default/triggers/datasources.trigger.js +93 -0
  79. package/main/default/triggers/object_actions.trigger.js +98 -0
  80. package/main/default/triggers/object_fields.trigger.js +376 -0
  81. package/main/default/triggers/object_layouts.trigger.js +153 -0
  82. package/main/default/triggers/object_listviews.trigger.js +139 -0
  83. package/main/default/triggers/object_triggers.trigger.js +50 -0
  84. package/main/default/triggers/object_validation_rules.trigger.js +80 -0
  85. package/main/default/triggers/objects.trigger.js +136 -0
  86. package/package.json +16 -0
  87. package/package.service.js +75 -0
  88. package/public/.md +3 -0
  89. package/src/.md +3 -0
  90. package/webapp/.md +1 -0
@@ -0,0 +1,690 @@
1
+ name: object_fields
2
+ icon: textbox
3
+ enable_api: true
4
+ enable_inline_edit: false
5
+ enable_enhanced_lookup: true
6
+ hidden: true
7
+ label: Object Fields
8
+ version: 2.0
9
+ fields:
10
+ object:
11
+ type: master_detail
12
+ label: Object
13
+ reference_to: objects
14
+ reference_to_field: name
15
+ required: true
16
+ write_requires_master_read: true
17
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
18
+ function () {
19
+ var _options;
20
+
21
+ _options = [];
22
+
23
+ _.forEach(Creator.objectsByName, function (o, k) {
24
+ if(!['base','core','space_users_invite','_object_reload_logs'].includes(k)){
25
+ return _options.push({
26
+ label: o.label,
27
+ value: k,
28
+ icon: o.icon
29
+ });
30
+ }
31
+ });
32
+
33
+ return _options;
34
+ }
35
+ sort_no: 110
36
+ label:
37
+ type: text
38
+ required: true
39
+ label: Label
40
+ is_name: true
41
+ sort_no: 120
42
+ _name:
43
+ type: text
44
+ label: Field Name
45
+ searchable: true
46
+ index: true
47
+ required: true
48
+ visible_on: "{{global.mode !='read' ? true : false}}"
49
+ sort_no: 130
50
+ name:
51
+ type: text
52
+ label: API Name
53
+ searchable: true
54
+ index: true
55
+ inlineHelpText: Can only contain lowercase letters and numbers, must start with a letter, cannot end with an underscore character or contain two consecutive underscore characters
56
+ # regEx: !<tag:yaml.org,2002:js/regexp> '/^[a-zA-Z_]\w*(\.\$\.\w+)?[a-zA-Z0-9]*$/'
57
+ readonly: true
58
+ visible_on: "{{global.mode !='read' ? false : true}}"
59
+ sort_no: 140
60
+ type:
61
+ type: select
62
+ label: Type
63
+ required: true
64
+ options:
65
+ - label: Text
66
+ value: text
67
+ - label: Textarea
68
+ value: textarea
69
+ - label: Html
70
+ value: html
71
+ - label: Code
72
+ value: code
73
+ - label: Select
74
+ value: select
75
+ - label: Boolean
76
+ value: boolean
77
+ - label: Toggle
78
+ value: toggle
79
+ - label: Date
80
+ value: date
81
+ - label: Datetime
82
+ value: datetime
83
+ - label: Time
84
+ value: time
85
+ - label: Number
86
+ value: number
87
+ - label: Currency
88
+ value: currency
89
+ - label: Percent
90
+ value: percent
91
+ - label: Password
92
+ value: password
93
+ - label: Lookup
94
+ value: lookup
95
+ - label: Master Detail
96
+ value: master_detail
97
+ - label: Autonumber
98
+ value: autonumber
99
+ - label: Url
100
+ value: url
101
+ - label: Email
102
+ value: email
103
+ - label: Image
104
+ value: image
105
+ - label: File
106
+ value: file
107
+ - label: Formula
108
+ value: formula
109
+ - label: Roll-Up Summary
110
+ value: summary
111
+ sort_no: 150
112
+ defaultValue:
113
+ type: text
114
+ label: Default Value
115
+ sort_no: 160
116
+ group:
117
+ type: text
118
+ label: Group
119
+ sort_no: 170
120
+ reference_to:
121
+ type: lookup
122
+ label: Reference to
123
+ reference_to: objects
124
+ reference_to_field: name
125
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
126
+ function () {
127
+ return Steedos.getObjectsOptions();
128
+ }
129
+ visible_on: "{{['lookup', 'master_detail'].indexOf(formData.type) > -1 ? true: false}}"
130
+ required: "{{['master_detail'].indexOf(formData.type) > -1 ? true: false}}"
131
+ sort_no: 180
132
+ # reference_to_field:
133
+ # type: lookup
134
+ # label: Reference to field
135
+ # reference_to: object_fields
136
+ # reference_to_field: name
137
+ # visible_on: "{{['lookup', 'master_detail'].indexOf(formData.type) > -1 ? true: false}}"
138
+ # depend_on:
139
+ # - reference_to
140
+ # filtersFunction: !<tag:yaml.org,2002:js/function> |-
141
+ # function (filters, values) {
142
+ # if(values && values.reference_to){
143
+ # return ['object', '=', values.reference_to]
144
+ # }else{
145
+ # return ['_id', '=', 'no']
146
+ # }
147
+ # }
148
+ # sort_no: 182
149
+ multiple:
150
+ type: boolean
151
+ label: Multiple
152
+ inlineHelpText: Single choice and multiple choice switch to each other. Please resubmit the existing records or modify the saving format of this field in the database.
153
+ visible_on: "{{['select', 'lookup', 'image','file'].indexOf(formData.type) > -1 ? true: false}}"
154
+ sort_no: 190
155
+ write_requires_master_read:
156
+ label: Write requires master read
157
+ type: boolean
158
+ inlineHelpText: Sets the minimum sharing access level required on the master record to create, edit, or delete child records. This field applies only to master-detail or junction object custom field types. true—Allows users with “Read” access to the master record permission to create, edit, or delete child records. This setting makes sharing less restrictive. false—Allows users with “Read/Write” access to the master record permission to create, edit, or delete child records. This setting is more restrictive than true, and is the default value.
159
+ visible_on: "{{formData.type === 'master_detail' ? true: false}}"
160
+ sort_no: 200
161
+ formula:
162
+ label: Formula
163
+ type: textarea
164
+ inlineHelpText: This field must be filled when the field type is 'Autonumber' or 'Formula'
165
+ is_wide: true
166
+ visible_on: "{{['autonumber', 'formula'].indexOf(formData.type) > -1 ? true: false}}"
167
+ required: "{{['autonumber', 'formula'].indexOf(formData.type) > -1 ? true: false}}"
168
+ sort_no: 210
169
+ data_type:
170
+ type: select
171
+ label: Data Type
172
+ inlineHelpText: This field must be filled when the field type is 'Formula'
173
+ depend_on:
174
+ - type
175
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
176
+ function (values) {
177
+ return Steedos.getFieldDataTypes(values);
178
+ }
179
+ # summary字段类型的data_type可以自动计算得到,所以不用在零代码界面设置
180
+ visible_on: "{{['formula','select'].indexOf(formData.type) > -1 ? true: false}}"
181
+ required: "{{['formula'].indexOf(formData.type) > -1 ? true: false}}"
182
+ sort_no: 220
183
+ filtersFunction:
184
+ label: filters Function
185
+ type: textarea
186
+ is_wide: true
187
+ visible_on: "{{['lookup', 'master_detail'].indexOf(formData.type) > -1 ? true: false}}"
188
+ sort_no: 230
189
+ optionsFunction:
190
+ label: options Function
191
+ type: textarea
192
+ is_wide: true
193
+ visible_on: "{{['lookup', 'master_detail'].indexOf(formData.type) > -1 ? true: false}}"
194
+ sort_no: 240
195
+ precision:
196
+ type: currency
197
+ label: Precision
198
+ scale: 0
199
+ # defaultValue: 18
200
+ visible_on: "{{
201
+ (function(){
202
+ if(['number', 'currency', 'percent', 'summary'].indexOf(formData.type) > -1){
203
+ return true;
204
+ }
205
+ else{
206
+ if(['formula'].indexOf(formData.type) > -1 && ['number', 'currency', 'percent'].indexOf(formData.data_type) > -1){
207
+ return true;
208
+ }
209
+ else{
210
+ return false;
211
+ }
212
+ }
213
+ })()
214
+ }}"
215
+ required: "{{
216
+ (function(){
217
+ if(['number', 'currency', 'percent', 'summary'].indexOf(formData.type) > -1){
218
+ return true;
219
+ }
220
+ else{
221
+ if(['formula'].indexOf(formData.type) > -1 && ['number', 'currency', 'percent'].indexOf(formData.data_type) > -1){
222
+ return true;
223
+ }
224
+ else{
225
+ return false;
226
+ }
227
+ }
228
+ })()
229
+ }}"
230
+ sort_no: 250
231
+ scale:
232
+ type: currency
233
+ label: Scale
234
+ scale: 0
235
+ # defaultValue: 2
236
+ min: 0
237
+ inlineHelpText: If the field type is a Percent, this indicates the number of decimal places the field will display, for example, two decimal places will display as 10.20%.
238
+ visible_on: "{{
239
+ (function(){
240
+ if(['number', 'currency', 'percent', 'summary'].indexOf(formData.type) > -1){
241
+ return true;
242
+ }
243
+ else{
244
+ if(['formula'].indexOf(formData.type) > -1 && ['number', 'currency', 'percent'].indexOf(formData.data_type) > -1){
245
+ return true;
246
+ }
247
+ else{
248
+ return false;
249
+ }
250
+ }
251
+ })()
252
+ }}"
253
+ required: "{{
254
+ (function(){
255
+ if(['number', 'currency', 'percent', 'summary'].indexOf(formData.type) > -1){
256
+ return true;
257
+ }
258
+ else{
259
+ if(['formula'].indexOf(formData.type) > -1 && ['number', 'currency', 'percent'].indexOf(formData.data_type) > -1){
260
+ return true;
261
+ }
262
+ else{
263
+ return false;
264
+ }
265
+ }
266
+ })()
267
+ }}"
268
+ sort_no: 260
269
+ rows:
270
+ type: currency
271
+ label: Rows
272
+ scale: 0
273
+ visible_on: "{{formData.type === 'textarea' ? true: false}}"
274
+ required: "{{formData.type === 'textarea' ? true: false}}"
275
+ # defaultValue: "{{formData.type === 'textarea' ? 3 : 0}}"
276
+ # allowedValues:
277
+ # type: text
278
+ # multiple: true
279
+ # label: Allowed Values
280
+ # group: Advanced
281
+ sort_no: 270
282
+ options:
283
+ type: grid
284
+ label: Options
285
+ is_wide: true
286
+ inlineHelpText: The label and value of each option cannot be empty. Set the background color to FFFFFF in hexadecimal format.
287
+ visible_on: "{{formData.type === 'select' ? true: false}}"
288
+ required: "{{formData.type === 'select' ? true: false}}"
289
+ sort_no: 280
290
+ options.$:
291
+ label: Options
292
+ blackbox: true
293
+ type: object
294
+ options.$.label:
295
+ label: Label
296
+ type: text
297
+ required: true
298
+ options.$.value:
299
+ label: Value
300
+ type: text
301
+ required: true
302
+ options.$.color:
303
+ label: Color
304
+ type: text
305
+ required: false
306
+ options.$.description:
307
+ label: Description
308
+ type: text
309
+ required: false
310
+ formula_blank_value:
311
+ type: select
312
+ label: Blank Field Handling
313
+ inlineHelpText: If your formula references any number or currency fields, specify what happens to the formula output when their values are blank.
314
+ options:
315
+ - label: Treat blank fields as zeroes
316
+ value: zeroes
317
+ - label: Treat blank fields as blanks
318
+ value: blanks
319
+ # defaultValue: zeroes
320
+ visible_on: "{{['formula'].indexOf(formData.type) > -1 ? true: false}}"
321
+ required: "{{['formula'].indexOf(formData.type) > -1 ? true: false}}"
322
+ sort_no: 290
323
+ summary_object:
324
+ type: lookup
325
+ label: Object to Summarize
326
+ inlineHelpText: This field must be filled in when the field type is 'Roll-Up Summary'.
327
+ depend_on:
328
+ - object
329
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
330
+ function (values) {
331
+ if(!values.object){
332
+ return [];
333
+ }
334
+ /*在lookup控件编辑的时候values.object为字符串,在记录详细界面为对象*/
335
+ var objectName = typeof values.object === "string" ? values.object : values.object.name;
336
+ var object = Creator.getObject(objectName);
337
+ if(!object){
338
+ return [];
339
+ }
340
+ var relatedObjects = object.related_objects;
341
+ var _options = [];
342
+ _.forEach(relatedObjects, function (item, index) {
343
+ var relatedObject = Creator.Objects[item.object_name];
344
+ var relatedField = relatedObject && relatedObject.fields[item.foreign_key];
345
+ /*只需要支持master_detail类型的相关对象,也不支持multiple(本身就不允许配置master_detail为multiple)*/
346
+ if(relatedField && relatedField.type === "master_detail" && !relatedField.multiple){
347
+ _options.push({
348
+ label: relatedObject.label,
349
+ value: relatedObject.name,
350
+ icon: relatedObject.icon
351
+ });
352
+ }
353
+ });
354
+ return _options;
355
+ }
356
+ visible_on: "{{formData.type === 'summary' ? true: false}}"
357
+ required: "{{formData.type === 'summary' ? true: false}}"
358
+ sort_no: 300
359
+ summary_type:
360
+ type: select
361
+ label: Roll-Up Type
362
+ inlineHelpText: This field must be filled in when the field type is 'Roll-Up Summary'.
363
+ options:
364
+ - label: COUNT
365
+ value: count
366
+ - label: SUM
367
+ value: sum
368
+ - label: MIN
369
+ value: min
370
+ - label: MAX
371
+ value: max
372
+ - label: AVG
373
+ value: avg
374
+ visible_on: "{{formData.type === 'summary' ? true: false}}"
375
+ required: "{{formData.type === 'summary' ? true: false}}"
376
+ sort_no: 310
377
+ summary_field:
378
+ type: lookup
379
+ label: Field to Aggregate
380
+ inlineHelpText: If the field type is a 'Roll-Up Summary' and the 'Roll-Up Type' is not COUNT, this field must be filled in, Only fields that aggregate number, currency, date, and datetime types are supported.
381
+ depend_on:
382
+ - summary_object
383
+ - summary_type
384
+ defaultIcon: service_contract
385
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
386
+ function (values) {
387
+ if(!values.summary_object){
388
+ return [];
389
+ }
390
+ if(values.summary_type && values.summary_type !== "count"){
391
+ var options = Creator.getObjectLookupFieldOptions(values.summary_object, false, true);
392
+ var object = Creator.getObject(values.summary_object);
393
+ var fields = object ? object.fields : null;
394
+ if(!fields){
395
+ return [];
396
+ }
397
+ if(values.summary_type === "sum" || values.summary_type === "avg"){
398
+ /*sum/avg类型可以汇总数值、金额、百分比字段*/
399
+ options = options.filter(function(option){
400
+ var optionFieldType = fields[option.value] && fields[option.value].type;
401
+ if(["formula", "summary"].indexOf(optionFieldType) > -1){
402
+ /*要聚合的字段为公式或汇总字段时,按其字段数据类型判断是否支持聚合*/
403
+ optionFieldType = fields[option.value].data_type;
404
+ }
405
+ return ["number", "currency", "percent"].indexOf(optionFieldType) > -1
406
+ });
407
+ }
408
+ else{
409
+ /*min、max类型可以汇总数值、金额、百分比、日期、日期时间字段*/
410
+ options = options.filter(function(option){
411
+ var optionFieldType = fields[option.value] && fields[option.value].type;
412
+ if(["formula", "summary"].indexOf(optionFieldType) > -1){
413
+ /*要聚合的字段为公式或汇总字段时,按其字段数据类型判断是否支持聚合*/
414
+ optionFieldType = fields[option.value].data_type;
415
+ }
416
+ return ["number", "currency", "percent", "date", "datetime"].indexOf(optionFieldType) > -1
417
+ });
418
+ }
419
+ return options;
420
+ }
421
+ }
422
+ visible_on: "{{formData.type === 'summary' && formData.summary_type !== 'count' ? true: false}}"
423
+ required: "{{formData.type === 'summary' && formData.summary_type !== 'count' ? true: false}}"
424
+ sort_no: 320
425
+ summary_filters:
426
+ label: Filter Criteria
427
+ type: 'grid'
428
+ inlineHelpText: Only records meeting certain criteria should be included in the calculation, all records should be included in the calculation while the criteria is empty.
429
+ is_wide: true
430
+ depend_on:
431
+ - summary_object
432
+ visible_on: "{{formData.type === 'summary' ? true: false}}"
433
+ sort_no: 330
434
+ summary_filters.$:
435
+ label: Filter Criteria
436
+ blackbox: true
437
+ type: object
438
+ summary_filters.$.field:
439
+ label: Field
440
+ type: lookup
441
+ showIcon: false
442
+ optionsFunction: !!js/function |
443
+ function(values){
444
+ if(values.summary_object){
445
+ return Creator.getObjectFilterFieldOptions(values.summary_object)
446
+ }
447
+ return []
448
+ }
449
+ summary_filters.$.operation:
450
+ label: Operator
451
+ type: lookup
452
+ showIcon: false
453
+ optionsFunction: !!js/function |
454
+ function(values){
455
+ if(values.summary_object){
456
+ if(!this.template){
457
+ let options = Steedos.ObjectFieldManager.getSummaryFiltersOperation();
458
+ return options;
459
+ }
460
+ const filter = _.find(values.summary_filters, function (item) {
461
+ return item._id === values._grid_row_id
462
+ })
463
+ if(filter){
464
+ var field = filter.field;
465
+ if(field){
466
+ var object_fields = Creator.getObject(values.summary_object).fields
467
+ var filter_field_type;
468
+ if(object_fields[field]){
469
+ if(Creator.getFieldDataType){
470
+ filter_field_type = Creator.getFieldDataType(object_fields, field);
471
+ }
472
+ else{
473
+ filter_field_type = object_fields[field].type;
474
+ }
475
+ return Steedos.ObjectFieldManager.getSummaryFiltersOperation(filter_field_type);
476
+ }
477
+ }
478
+ }
479
+ }
480
+ return [];
481
+ }
482
+ summary_filters.$.value:
483
+ label: Value
484
+ type: text
485
+ column_name:
486
+ type: text
487
+ label: Database column name
488
+ inlineHelpText: Only supports relational databases.
489
+ searchable: true
490
+ index: true
491
+ group: External data source
492
+ # visible_on: "{{true}}"
493
+ sort_no: 340
494
+ primary:
495
+ type: boolean
496
+ label: Primary Key
497
+ group: External data source
498
+ # visible_on: "{{true}}"
499
+ sort_no: 350
500
+ generated:
501
+ type: boolean
502
+ label: Generated
503
+ group: External data source
504
+ # visible_on: "{{formData.database_name || formData.datasource ? true: false}}"
505
+ sort_no: 360
506
+ sort_no:
507
+ label: Sort Number
508
+ type: number
509
+ defaultValue: 100
510
+ scale: 0
511
+ sortable: true
512
+ group: Advanced
513
+ sort_no: 370
514
+ is_name:
515
+ type: boolean
516
+ label: Is Name
517
+ group: Advanced
518
+ sort_no: 380
519
+ required:
520
+ type: boolean
521
+ label: Required
522
+ group: Advanced
523
+ visible_on: "{{['autonumber','summary','formula'].indexOf(formData.type) > -1 ? false: true}}"
524
+ sort_no: 390
525
+ is_wide:
526
+ type: boolean
527
+ label: Is Wide
528
+ group: Advanced
529
+ # readonly:
530
+ # type: boolean
531
+ # label: Readonly
532
+ # group: Advanced
533
+ # hidden:
534
+ # type: boolean
535
+ # label: Hidden
536
+ # group: Advanced
537
+ # omit:
538
+ # type: boolean
539
+ # label: Omit
540
+ # group: Advanced
541
+ sort_no: 400
542
+ index:
543
+ type: boolean
544
+ label: Is Index Field
545
+ group: Advanced
546
+ sort_no: 410
547
+ sortable:
548
+ type: boolean
549
+ label: Sortable
550
+ group: Advanced
551
+ # searchable:
552
+ # type: boolean
553
+ # label: Searchable
554
+ # group: Advanced
555
+ sort_no: 420
556
+ filterable:
557
+ type: boolean
558
+ label: Filterable
559
+ group: Advanced
560
+ sort_no: 430
561
+ show_as_qr:
562
+ type: boolean
563
+ label: Show_as_qr
564
+ group: Advanced
565
+ visible_on: "{{formData.type === 'url' ? true: false}}"
566
+ sort_no: 440
567
+ visible_on:
568
+ type: textarea
569
+ label: Visible On
570
+ is_wide: true
571
+ group: Advanced
572
+ sort_no: 450
573
+ inlineHelpText:
574
+ label: Prompt text
575
+ type: textarea
576
+ is_wide: true
577
+ group: Advanced
578
+ sort_no: 460
579
+ description:
580
+ label: Description
581
+ type: textarea
582
+ is_wide: true
583
+ group: Advanced
584
+ sort_no: 470
585
+ paging:
586
+ enabled: false
587
+ list_views:
588
+ all:
589
+ columns:
590
+ - label
591
+ - name
592
+ - column_name
593
+ - type
594
+ - object
595
+ - sort_no
596
+ - modified
597
+ sort:
598
+ - field_name: sort_no
599
+ order: asc
600
+ label: All
601
+ filter_scope: space
602
+ actions:
603
+ recomputeFormulaValues:
604
+ label: Recompute Formula Values
605
+ on: record_only
606
+ recomputeSummaryValues:
607
+ label: Batch Recompute Summary Values
608
+ on: record_only
609
+ permission_set:
610
+ user:
611
+ allowCreate: false
612
+ allowDelete: false
613
+ allowEdit: false
614
+ allowRead: false
615
+ modifyAllRecords: false
616
+ viewAllRecords: false
617
+ admin:
618
+ allowCreate: true
619
+ allowDelete: true
620
+ allowEdit: true
621
+ allowRead: true
622
+ modifyAllRecords: true
623
+ viewAllRecords: true
624
+ relatedList:
625
+ - permission_fields
626
+ form:
627
+ initialValues: !!js/function |
628
+ function(){
629
+ var object = Creator.odata.get('objects', Session.get("record_id"), "fields_serial_number");
630
+ if(object){
631
+ let fields_serial_number = object.fields_serial_number
632
+ if(!fields_serial_number || fields_serial_number < 100){
633
+ fields_serial_number = 100 + 10
634
+ }
635
+ return {sort_no: fields_serial_number}
636
+ }
637
+ return {}
638
+ }
639
+ # beforeEdit: !!js/function |
640
+ # function(){
641
+ # return Steedos.ObjectFieldManager.changeSchema(this.doc, this.schema, 'edit');
642
+ # }
643
+ # afterEdit: !!js/function |
644
+ # function(){
645
+ # return Steedos.ObjectFieldManager.changeSchema(this.doc, this.schema, 'edit');
646
+ # }
647
+ # beforeView: !!js/function |
648
+ # function(){
649
+ # Steedos.ObjectFieldManager.changeSchema(this.doc, this.schema, 'view');
650
+ # }
651
+ afterInsert: !!js/function |
652
+ function(){
653
+ Creator.objectLayoutMananger.appendField(this.doc);
654
+ }
655
+ onValuesChange: !!js/function |
656
+ function(args){
657
+ /*以下代码是为解决issue:优化:使用新版form新建字段后,每种字段类型都多了3个属性formula_blank_value、precision、scale #1920*/
658
+ const fieldType = args.values.type,
659
+ changedFieldType = args.changedValues.type,
660
+ numberTypes = ['number', 'currency', 'percent'];
661
+
662
+ if(changedFieldType === 'textarea'){
663
+ args.form.setFieldsValue({rows: 3});
664
+ }
665
+ else if(fieldType !== 'textarea' && args.values.rows !== undefined){
666
+ args.form.setFieldsValue({rows: undefined});
667
+ }
668
+
669
+ if(changedFieldType === 'formula'){
670
+ args.form.setFieldsValue({formula_blank_value: 'zeroes'});
671
+ }
672
+ else if(fieldType !== 'formula' && args.values.formula_blank_value !== undefined){
673
+ args.form.setFieldsValue({formula_blank_value: undefined});
674
+ }
675
+
676
+ if(numberTypes.indexOf(changedFieldType) > -1 || 'summary' === changedFieldType){
677
+ args.form.setFieldsValue({precision: 18, scale: 2});
678
+ }
679
+ if(['formula'].indexOf(fieldType) > -1 && numberTypes.indexOf(args.changedValues.data_type) > -1){
680
+ args.form.setFieldsValue({precision: 18, scale: 2});
681
+ }
682
+ if(numberTypes.indexOf(fieldType) < 0 && 'summary' !== fieldType && numberTypes.indexOf(args.values.data_type) < 0 ){
683
+ if(args.values.precision !== undefined){
684
+ args.form.setFieldsValue({precision: undefined});
685
+ }
686
+ if(args.values.scale !== undefined){
687
+ args.form.setFieldsValue({scale: undefined});
688
+ }
689
+ }
690
+ }