From fab9383c9cdf1e925b6cbb6e5792f63f25d42033 Mon Sep 17 00:00:00 2001 From: RUNZE LU <36724300+lurunze1226@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:15:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(amis-editor):=20MatrixCheckboxes=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E5=B1=9E=E6=80=A7=E9=85=8D=E7=BD=AE=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#7551)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugin/Form/MatrixCheckboxes.tsx | 56 ++++++------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/packages/amis-editor/src/plugin/Form/MatrixCheckboxes.tsx b/packages/amis-editor/src/plugin/Form/MatrixCheckboxes.tsx index fd495ddde..1896cf4ae 100644 --- a/packages/amis-editor/src/plugin/Form/MatrixCheckboxes.tsx +++ b/packages/amis-editor/src/plugin/Form/MatrixCheckboxes.tsx @@ -1,16 +1,15 @@ -import {defaultValue, getSchemaTpl} from 'amis-editor-core'; -import {registerEditorPlugin} from 'amis-editor-core'; import { + registerEditorPlugin, BasePlugin, - BasicSubRenderInfo, - RendererEventContext, - SubRendererInfo, BaseEventContext, - tipedLabel + RendererPluginAction, + RendererPluginEvent, + tipedLabel, + defaultValue, + getSchemaTpl } from 'amis-editor-core'; import {ValidatorTag} from '../../validator'; import {getEventControlConfig} from '../../renderer/event-control/helper'; -import {RendererPluginAction, RendererPluginEvent} from 'amis-editor-core'; export class MatrixControlPlugin extends BasePlugin { static id = 'MatrixControlPlugin'; @@ -127,8 +126,9 @@ export class MatrixControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('multiple', { - value: true + getSchemaTpl('switch', { + name: 'multiple', + label: '可多选' }), { label: tipedLabel('模式', '行级、列级或者单个单元单选'), @@ -140,7 +140,7 @@ export class MatrixControlPlugin extends BasePlugin { left: 2, justify: true }, - visibleOn: '!this.multiple', + visibleOn: '!data.multiple', options: [ { label: '行级', @@ -157,37 +157,15 @@ export class MatrixControlPlugin extends BasePlugin { ], pipeIn: defaultValue('column') }, - getSchemaTpl('autoFillApi'), - { - label: tipedLabel('列全选', '列级全选功能'), + getSchemaTpl('switch', { name: 'yCheckAll', - type: 'select', - options: [ - { - label: '是', - value: true - }, - { - label: '否', - value: false - } - ] - }, - { - label: tipedLabel('行全选', '行级全选功能'), + label: tipedLabel('列全选', '列级全选功能') + }), + getSchemaTpl('switch', { name: 'xCheckAll', - type: 'select', - options: [ - { - label: '是', - value: true - }, - { - label: '否', - value: false - } - ] - } + label: tipedLabel('行全选', '行级全选功能') + }), + getSchemaTpl('autoFillApi') ] }, {