@steedos/standard-object-database 2.5.19-beta.5 → 2.5.19

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.
@@ -454,6 +454,34 @@ var triggers = {
454
454
  if(!allowChangeObject()){
455
455
  throw new Meteor.Error(500, "华炎云服务不包含自定义业务对象的功能,请部署私有云版本");
456
456
  }
457
+
458
+ const staticRequiredFields = ['object','label','_name','type'];
459
+ // const staticRequiredFieldLabel = ['所属对象','显示名称','字段名','字段类型'];
460
+ for(let i = 0; i<staticRequiredFields.length; i++){
461
+ const fieldName = staticRequiredFields[i];
462
+ const fieldValue = doc[fieldName];
463
+ if(!fieldValue){
464
+ throw new Meteor.Error(fieldName, "必填字段");
465
+ }
466
+ }
467
+ // options子字段、precision、scale、summary_field不参与以下简单动态必填字段组。
468
+ const dynamicsRequired = [
469
+ ['language',['code']],['reference_to',['lookup', 'master_detail']],['formula',['autonumber', 'formula']],
470
+ ['data_type',['formula']],['rows',['textarea']],['options',['select']],
471
+ ['formula_blank_value',['formula']],['summary_object',['summary']],['summary_type',['summary']],
472
+ ['deleted_lookup_record_behavior',['lookup']]
473
+ ];
474
+
475
+ for(let i = 0; i<dynamicsRequired.length; i++){
476
+ if( dynamicsRequired[i][1].indexOf(doc.type) > -1 ){
477
+ const fieldName = dynamicsRequired[i][0];
478
+ const fieldValue = doc[fieldName];
479
+ if(!fieldValue){
480
+ throw new Meteor.Error(fieldName, "动态必填字段");
481
+ }
482
+ }
483
+ }
484
+
457
485
  checkName(doc._name);
458
486
  if(['name','owner','parent','children'].indexOf(doc._name)>-1){
459
487
  doc.name = doc._name;
@@ -236,7 +236,7 @@ fields:
236
236
  reference_to: objects
237
237
  reference_to_field: name
238
238
  visible_on: "{{['lookup', 'master_detail'].indexOf(formData.type) > -1 ? true: false}}"
239
- required: "{{['master_detail'].indexOf(formData.type) > -1 ? true: false}}"
239
+ required: "{{['lookup','master_detail'].indexOf(formData.type) > -1 ? true: false}}"
240
240
  sort_no: 180
241
241
  amis:
242
242
  menuTpl: "<div>${label}(${value})</div>"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-object-database",
3
- "version": "2.5.19-beta.5",
3
+ "version": "2.5.19",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -15,5 +15,5 @@
15
15
  },
16
16
  "repository": {},
17
17
  "license": "MIT",
18
- "gitHead": "32cd0c5ebc7aaadcf12488585e62f7f3851ce2d4"
18
+ "gitHead": "f45f110239267697485b421285e61ca020e4779b"
19
19
  }