@steedos/standard-object-database 2.5.0-beta.7 → 2.5.0-beta.9
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.
|
@@ -381,48 +381,23 @@ fields:
|
|
|
381
381
|
summary_field:
|
|
382
382
|
type: lookup
|
|
383
383
|
label: Field to Aggregate
|
|
384
|
+
reference_to: object_fields
|
|
385
|
+
reference_to_field: name
|
|
384
386
|
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.
|
|
385
387
|
depend_on:
|
|
386
388
|
- summary_object
|
|
387
389
|
- summary_type
|
|
388
390
|
defaultIcon: service_contract
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
if(
|
|
399
|
-
return [];
|
|
400
|
-
}
|
|
401
|
-
if(values.summary_type === "sum" || values.summary_type === "avg"){
|
|
402
|
-
/*sum/avg类型可以汇总数值、金额、百分比字段*/
|
|
403
|
-
options = options.filter(function(option){
|
|
404
|
-
var optionFieldType = fields[option.value] && fields[option.value].type;
|
|
405
|
-
if(["formula", "summary"].indexOf(optionFieldType) > -1){
|
|
406
|
-
/*要聚合的字段为公式或汇总字段时,按其字段数据类型判断是否支持聚合*/
|
|
407
|
-
optionFieldType = fields[option.value].data_type;
|
|
408
|
-
}
|
|
409
|
-
return ["number", "currency", "percent"].indexOf(optionFieldType) > -1
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
else{
|
|
413
|
-
/*min、max类型可以汇总数值、金额、百分比、日期、日期时间字段*/
|
|
414
|
-
options = options.filter(function(option){
|
|
415
|
-
var optionFieldType = fields[option.value] && fields[option.value].type;
|
|
416
|
-
if(["formula", "summary"].indexOf(optionFieldType) > -1){
|
|
417
|
-
/*要聚合的字段为公式或汇总字段时,按其字段数据类型判断是否支持聚合*/
|
|
418
|
-
optionFieldType = fields[option.value].data_type;
|
|
419
|
-
}
|
|
420
|
-
return ["number", "currency", "percent", "date", "datetime"].indexOf(optionFieldType) > -1
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
return options;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
391
|
+
amis:
|
|
392
|
+
"autoComplete":
|
|
393
|
+
"method": "get"
|
|
394
|
+
"url": "${context.rootUrl}/service/api/@${summary_object}/uiSchema?summary_object=${summary_object}&summary_type=${summary_type}&term=${term}"
|
|
395
|
+
"data":
|
|
396
|
+
"summary_type": "${summary_type}"
|
|
397
|
+
"headers":
|
|
398
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
399
|
+
"sendOn": "!!this.summary_object && !!this.summary_type"
|
|
400
|
+
"adaptor": "const summary_type = api.body.summary_type;\nconst term = api.query.term;\nlet fields = payload.fields;\nlet options = [];\nif (fields) {\n if (summary_type && summary_type !== \"count\") {\n if (summary_type === \"sum\" || summary_type === \"avg\") {\n /*sum/avg类型可以汇总数值、金额、百分比字段*/\n _.forEach(fields, (value, key) => {\n let fieldType = value.type;\n if ([\"formula\", \"summary\"].indexOf(fieldType) > -1) {\n /*要聚合的字段为公式或汇总字段时,按其字段数据类型判断是否支持聚合*/\n fieldType = value.data_type;\n }\n if ([\"number\", \"currency\", \"percent\"].indexOf(fieldType) > -1) {\n options.push({ label: value.label, value: value.name });\n }\n })\n }\n else {\n /*min、max类型可以汇总数值、金额、百分比、日期、日期时间字段*/\n _.forEach(fields, (value, key) => {\n let fieldType = value.type;\n if ([\"formula\", \"summary\"].indexOf(fieldType) > -1) {\n /*要聚合的字段为公式或汇总字段时,按其字段数据类型判断是否支持聚合*/\n fieldType = value.data_type;\n }\n if ([\"number\", \"currency\", \"percent\", \"date\", \"datetime\"].indexOf(fieldType) > -1) {\n options.push({ label: value.label, value: value.name });\n }\n })\n }\n }\n if (term) {\n options = _.filter(options, (item) => {\n return item.label.toLowerCase().indexOf(term.toLowerCase()) > -1;\n })\n }\n}\npayload = {\n data: { options: options },\n msg: \"\",\n status: 0\n}\nreturn payload;"
|
|
426
401
|
visible_on: "{{formData.type === 'summary' && formData.summary_type !== 'count' ? true: false}}"
|
|
427
402
|
required: "{{formData.type === 'summary' && formData.summary_type !== 'count' ? true: false}}"
|
|
428
403
|
sort_no: 320
|
|
@@ -68,6 +68,21 @@
|
|
|
68
68
|
],
|
|
69
69
|
"id": "u:d75b105f6d02"
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
"title": "对象页面",
|
|
73
|
+
"body": [
|
|
74
|
+
{
|
|
75
|
+
"type": "steedos-object-related-listview",
|
|
76
|
+
"objectApiName": "objects",
|
|
77
|
+
"relatedObjectApiName": "pages",
|
|
78
|
+
"relatedKey": "object_name",
|
|
79
|
+
"perPage": 20,
|
|
80
|
+
"id": "u:e1a8b77a140c2",
|
|
81
|
+
"recordId": "${recordId}"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"id": "u:d75b105f6d042"
|
|
85
|
+
},
|
|
71
86
|
{
|
|
72
87
|
"title": "页面布局",
|
|
73
88
|
"body": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-object-database",
|
|
3
|
-
"version": "2.5.0-beta.
|
|
3
|
+
"version": "2.5.0-beta.9",
|
|
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": "
|
|
18
|
+
"gitHead": "a2623b433dd42632dc54d23c51b718bd4d1a2fdc"
|
|
19
19
|
}
|