mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
feat: 弹框增加按钮管理配置 (#11269)
This commit is contained in:
parent
e3ad9b9271
commit
fa38e61b27
@ -298,6 +298,8 @@ export class DialogPlugin extends BasePlugin {
|
|||||||
name: 'title'
|
name: 'title'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getSchemaTpl('button-manager'),
|
||||||
|
|
||||||
getSchemaTpl('switch', {
|
getSchemaTpl('switch', {
|
||||||
label: '展示关闭按钮',
|
label: '展示关闭按钮',
|
||||||
name: 'showCloseButton',
|
name: 'showCloseButton',
|
||||||
|
@ -171,6 +171,7 @@ export class DrawerPlugin extends BasePlugin {
|
|||||||
label: '显示蒙层',
|
label: '显示蒙层',
|
||||||
pipeIn: defaultValue(true)
|
pipeIn: defaultValue(true)
|
||||||
}),
|
}),
|
||||||
|
getSchemaTpl('button-manager'),
|
||||||
getSchemaTpl('switch', {
|
getSchemaTpl('switch', {
|
||||||
name: 'showCloseButton',
|
name: 'showCloseButton',
|
||||||
label: '展示关闭按钮',
|
label: '展示关闭按钮',
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
tipedLabel,
|
tipedLabel,
|
||||||
EditorManager
|
EditorManager
|
||||||
} from 'amis-editor-core';
|
} from 'amis-editor-core';
|
||||||
import type {SchemaObject} from 'amis';
|
import {render, type SchemaObject} from 'amis';
|
||||||
import flatten from 'lodash/flatten';
|
import flatten from 'lodash/flatten';
|
||||||
import {InputComponentName} from '../component/InputComponentName';
|
import {InputComponentName} from '../component/InputComponentName';
|
||||||
import {FormulaDateType} from '../renderer/FormulaControl';
|
import {FormulaDateType} from '../renderer/FormulaControl';
|
||||||
@ -1851,3 +1851,39 @@ setSchemaTpl('inputForbid', {
|
|||||||
name: 'inputForbid',
|
name: 'inputForbid',
|
||||||
inputClassName: 'is-inline'
|
inputClassName: 'is-inline'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setSchemaTpl('button-manager', () => {
|
||||||
|
return getSchemaTpl('combo-container', {
|
||||||
|
type: 'combo',
|
||||||
|
label: '按钮管理',
|
||||||
|
name: 'actions',
|
||||||
|
mode: 'normal',
|
||||||
|
multiple: true,
|
||||||
|
addable: true,
|
||||||
|
draggable: true,
|
||||||
|
editable: false,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
component: (props: any) => {
|
||||||
|
return render({
|
||||||
|
...props.data,
|
||||||
|
onEvent: {},
|
||||||
|
actionType: '',
|
||||||
|
onClick: (e: any, props: any) => {
|
||||||
|
const editorStore = (window as any).editorStore;
|
||||||
|
const subEditorStore = editorStore.getSubEditorRef()?.store;
|
||||||
|
(subEditorStore || editorStore).setActiveIdByComponentId(
|
||||||
|
props.id
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
addButtonText: '新增按钮',
|
||||||
|
scaffold: {
|
||||||
|
type: 'button',
|
||||||
|
label: '按钮'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@ -707,9 +707,7 @@ export class Action extends React.Component<ActionProps, ActionState> {
|
|||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
type,
|
type,
|
||||||
icon,
|
|
||||||
iconClassName,
|
iconClassName,
|
||||||
rightIcon,
|
|
||||||
rightIconClassName,
|
rightIconClassName,
|
||||||
loadingClassName,
|
loadingClassName,
|
||||||
primary,
|
primary,
|
||||||
@ -791,6 +789,8 @@ export class Action extends React.Component<ActionProps, ActionState> {
|
|||||||
}) as string;
|
}) as string;
|
||||||
disabled = true;
|
disabled = true;
|
||||||
}
|
}
|
||||||
|
const icon = filter(this.props.icon, data);
|
||||||
|
const rightIcon = filter(this.props.rightIcon, data);
|
||||||
|
|
||||||
const iconElement = (
|
const iconElement = (
|
||||||
<Icon
|
<Icon
|
||||||
|
Loading…
Reference in New Issue
Block a user