fix(amis-editor): MatrixCheckboxes多选属性配置错误问题 (#7551)

This commit is contained in:
RUNZE LU 2023-07-24 11:15:06 +08:00 committed by GitHub
parent d6703cd982
commit fab9383c9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,16 +1,15 @@
import {defaultValue, getSchemaTpl} from 'amis-editor-core';
import {registerEditorPlugin} from 'amis-editor-core';
import { import {
registerEditorPlugin,
BasePlugin, BasePlugin,
BasicSubRenderInfo,
RendererEventContext,
SubRendererInfo,
BaseEventContext, BaseEventContext,
tipedLabel RendererPluginAction,
RendererPluginEvent,
tipedLabel,
defaultValue,
getSchemaTpl
} from 'amis-editor-core'; } from 'amis-editor-core';
import {ValidatorTag} from '../../validator'; import {ValidatorTag} from '../../validator';
import {getEventControlConfig} from '../../renderer/event-control/helper'; import {getEventControlConfig} from '../../renderer/event-control/helper';
import {RendererPluginAction, RendererPluginEvent} from 'amis-editor-core';
export class MatrixControlPlugin extends BasePlugin { export class MatrixControlPlugin extends BasePlugin {
static id = 'MatrixControlPlugin'; static id = 'MatrixControlPlugin';
@ -127,8 +126,9 @@ export class MatrixControlPlugin extends BasePlugin {
required: true required: true
}), }),
getSchemaTpl('label'), getSchemaTpl('label'),
getSchemaTpl('multiple', { getSchemaTpl('switch', {
value: true name: 'multiple',
label: '可多选'
}), }),
{ {
label: tipedLabel('模式', '行级、列级或者单个单元单选'), label: tipedLabel('模式', '行级、列级或者单个单元单选'),
@ -140,7 +140,7 @@ export class MatrixControlPlugin extends BasePlugin {
left: 2, left: 2,
justify: true justify: true
}, },
visibleOn: '!this.multiple', visibleOn: '!data.multiple',
options: [ options: [
{ {
label: '行级', label: '行级',
@ -157,37 +157,15 @@ export class MatrixControlPlugin extends BasePlugin {
], ],
pipeIn: defaultValue('column') pipeIn: defaultValue('column')
}, },
getSchemaTpl('autoFillApi'), getSchemaTpl('switch', {
{
label: tipedLabel('列全选', '列级全选功能'),
name: 'yCheckAll', name: 'yCheckAll',
type: 'select', label: tipedLabel('列全选', '列级全选功能')
options: [ }),
{ getSchemaTpl('switch', {
label: '是',
value: true
},
{
label: '否',
value: false
}
]
},
{
label: tipedLabel('行全选', '行级全选功能'),
name: 'xCheckAll', name: 'xCheckAll',
type: 'select', label: tipedLabel('行全选', '行级全选功能')
options: [ }),
{ getSchemaTpl('autoFillApi')
label: '是',
value: true
},
{
label: '否',
value: false
}
]
}
] ]
}, },
{ {