fix: 修改汇总区块兼容视图没有字段的情况 (#923)

Reviewed-on: daoyoucloud/tachybase#923
Co-authored-by: wjh <wwwjh0710@163.com>
Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
wjh 2024-05-08 17:50:26 +08:00 committed by sealday
parent 3e58c54aa8
commit ffc9236728
2 changed files with 14 additions and 3 deletions

View File

@ -126,6 +126,13 @@ const createGroupBlockSchema = (options) => {
},
},
};
if (!sumItem.length) {
delete schema['x-decorator-props']['resource_deprecated'];
}
if (collection.template === 'view' && !sumItem.length) {
delete schema['x-decorator-props']['action'];
delete schema['x-decorator-props']['groupField'];
}
return schema;
};

View File

@ -104,7 +104,7 @@ const modalSchema = (t, params, valueOption, decimal) => {
placeholder: '{{t("type")}}',
},
enum: fieldType,
require: true,
required: true,
},
field: {
type: 'string',
@ -114,11 +114,13 @@ const modalSchema = (t, params, valueOption, decimal) => {
placeholder: '{{t("field")}}',
},
'x-visbile': false,
required: false,
enum: valueOption,
'x-reactions': {
dependencies: ['.type'],
fulfill: {
schema: {
required: "{{$deps[0]==='field'}}",
'x-visible': "{{$deps[0]==='field'}}",
},
},
@ -132,11 +134,13 @@ const modalSchema = (t, params, valueOption, decimal) => {
placeholder: '{{t("reqUrl")}}',
addonBefore: <PullRequestOutlined />,
},
required: false,
'x-visible': false,
'x-reactions': {
dependencies: ['.type'],
fulfill: {
schema: {
required: "{{$deps[0]==='custom'}}",
'x-visible': "{{$deps[0]==='custom'}}",
},
},
@ -150,7 +154,7 @@ const modalSchema = (t, params, valueOption, decimal) => {
placeholder: '{{t("format")}}',
},
enum: transformers.option,
require: true,
required: true,
},
digits: {
type: 'string',
@ -178,7 +182,7 @@ const modalSchema = (t, params, valueOption, decimal) => {
placeholder: '{{t("style")}}',
},
enum: styleOption,
require: true,
required: true,
},
remove: {
type: 'void',