diff --git a/packages/amis-editor/src/plugin/Form/Checkboxes.tsx b/packages/amis-editor/src/plugin/Form/Checkboxes.tsx index a30b2b98c..9febd351f 100644 --- a/packages/amis-editor/src/plugin/Form/Checkboxes.tsx +++ b/packages/amis-editor/src/plugin/Form/Checkboxes.tsx @@ -141,6 +141,7 @@ export class CheckboxesControlPlugin extends BasePlugin { if (!value) { // 可全选关闭时,默认全选也需联动关闭 form.setValueByName('defaultCheckAll', false); + form.setValueByName('checkAllText', undefined); } } }), @@ -153,7 +154,12 @@ export class CheckboxesControlPlugin extends BasePlugin { label: '默认全选', name: 'defaultCheckAll', value: false - }) + }), + { + type: 'input-text', + label: '全选文本', + name: 'checkAllText' + } ] } ], diff --git a/packages/amis/src/renderers/Form/Checkboxes.tsx b/packages/amis/src/renderers/Form/Checkboxes.tsx index 8fb6e258b..6080bf9fb 100644 --- a/packages/amis/src/renderers/Form/Checkboxes.tsx +++ b/packages/amis/src/renderers/Form/Checkboxes.tsx @@ -30,6 +30,10 @@ export interface CheckboxesControlSchema extends FormOptionsSchema { */ defaultCheckAll?: boolean; + /** + * 全选/不选文案 + */ + checkAllText?: string; /** * 每行显示多少个 */ @@ -337,6 +341,7 @@ export default class CheckboxesControl extends React.Component< onToggle, onToggleAll, checkAll, + checkAllText, classnames: cx, itemClassName, labelClassName, @@ -369,7 +374,7 @@ export default class CheckboxesControl extends React.Component< inline={inline} labelClassName={labelClassName} > - {__('Checkboxes.selectAll')} + {checkAllText ?? __('Checkboxes.selectAll')} ); }