Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] editor 配置面板中的开关打开更多配置的组件配置整理 #11344

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions packages/amis-editor/src/component/BaseControl.ts
Original file line number Diff line number Diff line change
@@ -402,23 +402,11 @@ export function remarkTpl(config: {
: config.label,
bulk: false,
name: config.name,
pipeIn: (value: any) => !!value,
pipeOut: (value: any) => {
// 更新内容
if (isObject(value)) {
return value;
}
// 关到开
if (value) {
return {
icon: 'fa fa-question-circle',
trigger: ['hover'],
className: 'Remark--warning',
placement: 'top'
};
}
// 开到关
return undefined;
defaultData: {
icon: 'fa fa-question-circle',
trigger: ['hover'],
className: 'Remark--warning',
placement: 'top'
},
form: {
size: 'md',
7 changes: 4 additions & 3 deletions packages/amis-editor/src/plugin/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -301,19 +301,20 @@ export class CarouselPlugin extends BasePlugin {
}),
{
type: 'ae-switch-more',
bulk: true,
mode: 'normal',
name: 'multiple',
bulk: false,
label: '多图展示',
formType: 'extend',
form: {
body: [
{
name: 'multiple.count',
name: 'count',
label: '数量',
type: 'input-number',
min: 2,
step: 1
step: 1,
value: 5
}
]
}
6 changes: 5 additions & 1 deletion packages/amis-editor/src/plugin/CollapseGroup.tsx
Original file line number Diff line number Diff line change
@@ -166,11 +166,15 @@ export class CollapseGroupPlugin extends BasePlugin {
getSchemaTpl('icon', {
name: 'expandIcon',
label: '图标',
value: {
type: 'icon',
vendor: ''
},
pipeIn: (value: any) => value?.icon,
pipeOut: (value: any) => ({
type: 'icon',
vendor: '',
icon: value
icon: value ? value : undefined
})
})
]
18 changes: 0 additions & 18 deletions packages/amis-editor/src/plugin/Form/InputRating.tsx
Original file line number Diff line number Diff line change
@@ -253,9 +253,7 @@ export class RateControlPlugin extends BasePlugin {
{
type: 'ae-switch-more',
label: '自定义',
bulk: true,
mode: 'normal',
value: false,
formType: 'extend',
form: {
body: [
@@ -265,22 +263,6 @@ export class RateControlPlugin extends BasePlugin {
name: 'char'
}
]
},
pipeIn: (value: string) => {
if (typeof value === 'string' && value.length) {
return {
character: value
};
}
return undefined;
},
pipeOut: (value: any) => {
if (!isObject(value)) {
return undefined;
}
return typeof value.character === 'string'
? value.character
: undefined;
}
},

2 changes: 2 additions & 0 deletions packages/amis-editor/src/plugin/Form/InputTable.tsx
Original file line number Diff line number Diff line change
@@ -1187,6 +1187,8 @@ export class TableControlPlugin extends BasePlugin {
'确认模式',
'开启时,新增、编辑需要点击表格右侧的“保存”按钮才能变更组件数据。未开启时,新增、编辑、删除操作直接改变组件数据。'
),
isChecked: (v: any) => v !== false,
falseValue: false,
mode: 'normal',
formType: 'extend',
hiddenOnDefault: true,
7 changes: 5 additions & 2 deletions packages/amis-editor/src/plugin/Form/InputTree.tsx
Original file line number Diff line number Diff line change
@@ -629,6 +629,10 @@ export class TreeControlPlugin extends BasePlugin {
bulk: false,
name: 'itemActions',
formType: 'extend',
defaultData: {
type: 'container',
body: [{type: 'button', label: '按钮'}]
},
form: {
body: [
{
@@ -755,8 +759,7 @@ export class TreeControlPlugin extends BasePlugin {
label: '设置层级',
name: 'unfoldedLevel',
value: 1,
min: 0,
hiddenOn: 'this.initiallyOpen'
min: 0
}
]
}
2 changes: 0 additions & 2 deletions packages/amis-editor/src/plugin/Form/ListSelect.tsx
Original file line number Diff line number Diff line change
@@ -179,8 +179,6 @@ export class ListControlPlugin extends BasePlugin {
type: 'ae-switch-more',
mode: 'normal',
label: '自定义显示模板',
bulk: false,
name: 'itemSchema',
formType: 'extend',
form: {
body: [
12 changes: 7 additions & 5 deletions packages/amis-editor/src/plugin/Form/Picker.tsx
Original file line number Diff line number Diff line change
@@ -369,28 +369,30 @@ export class PickerControlPlugin extends BasePlugin {
type: 'ae-switch-more',
mode: 'normal',
formType: 'extend',
name: 'overflowConfigSwitch',
pipeIn: (value: any) => !!value,
name: 'overflowConfig',
bulk: false,
isChecked: (v: any) => !!v,
label: tipedLabel(
'标签收纳',
'当值数量超出一定数量时,可进行收纳显示'
),
extendData: ['embed'],
form: {
body: [
{
type: 'input-number',
name: 'overflowConfig.maxTagCount',
name: 'maxTagCount',
label: '最大标签数',
defaultValue: -1
},
getOverflowTagPopoverTpl({
namePre: 'overflowConfig.overflowTagPopover',
namePre: 'overflowTagPopover',
title: '选择器收纳器',
key: 'select',
className: 'm-b-sm'
}),
getOverflowTagPopoverTpl({
namePre: 'overflowConfig.overflowTagPopoverInCRUD',
namePre: 'overflowTagPopoverInCRUD',
title: 'CRUD收纳器',
key: 'crud',
className: 'm-b-sm',
Loading
Loading