mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-15 17:31:18 +08:00
合并分支 feat-optimize-5
Change-Id: I03fc2b58363e62d01fa651b285a2a453d2d40d67
This commit is contained in:
commit
66a86352c0
@ -309,6 +309,22 @@ export class FormPlugin extends BasePlugin {
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// eventName: 'submit',
|
||||
// eventLabel: '表单提交',
|
||||
// strongDesc: '配置该事件后将不会触发表单提交时默认的校验、提交到api或者target等行为,所有行为需要自己配置',
|
||||
// dataSchema: [
|
||||
// {
|
||||
// type: 'object',
|
||||
// properties: {
|
||||
// 'event.data': {
|
||||
// type: 'object',
|
||||
// title: '当前表单数据'
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
eventName: 'submitSucc',
|
||||
eventLabel: '提交成功',
|
||||
|
@ -209,10 +209,26 @@ export class ImageControlPlugin extends BasePlugin {
|
||||
|
||||
getSchemaTpl('switch', {
|
||||
name: 'fixedSize',
|
||||
label: '固定尺寸',
|
||||
label: tipedLabel('固定尺寸', '开启后需同时设置CSS类'),
|
||||
value: false
|
||||
}),
|
||||
|
||||
{
|
||||
type: 'container',
|
||||
className: 'ae-ExtendMore mb-3',
|
||||
visibleOn: 'data.fixedSize',
|
||||
body: [
|
||||
{
|
||||
type: 'input-text',
|
||||
name: 'fixedSizeClassName',
|
||||
label: tipedLabel(
|
||||
'CSS类名',
|
||||
'开启固定尺寸时,根据此值控制展示尺寸'
|
||||
)
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
getSchemaTpl('switch', {
|
||||
name: 'hideUploadButton',
|
||||
label: '隐藏上传按钮',
|
||||
@ -225,38 +241,38 @@ export class ImageControlPlugin extends BasePlugin {
|
||||
value: false
|
||||
}),
|
||||
|
||||
getSchemaTpl('switch', {
|
||||
name: 'compress',
|
||||
value: true,
|
||||
label: tipedLabel(
|
||||
'开启压缩',
|
||||
'由 hiphoto 实现,自定义接口将无效'
|
||||
)
|
||||
}),
|
||||
{
|
||||
type: 'container',
|
||||
className: 'ae-ExtendMore mb-3',
|
||||
visibleOn: 'data.compress',
|
||||
name: 'compressOptions',
|
||||
body: [
|
||||
{
|
||||
type: 'input-number',
|
||||
label: '最大宽度',
|
||||
name: 'maxWidth'
|
||||
},
|
||||
// getSchemaTpl('switch', {
|
||||
// name: 'compress',
|
||||
// value: true,
|
||||
// label: tipedLabel(
|
||||
// '开启压缩',
|
||||
// '由 hiphoto 实现,自定义接口将无效'
|
||||
// )
|
||||
// }),
|
||||
// {
|
||||
// type: 'container',
|
||||
// className: 'ae-ExtendMore mb-3',
|
||||
// visibleOn: 'data.compress',
|
||||
// name: 'compressOptions',
|
||||
// body: [
|
||||
// {
|
||||
// type: 'input-number',
|
||||
// label: '最大宽度',
|
||||
// name: 'compressOptions.maxWidth'
|
||||
// },
|
||||
|
||||
{
|
||||
type: 'input-number',
|
||||
label: '最大高度',
|
||||
name: 'maxHeight'
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// type: 'input-number',
|
||||
// label: '最大高度',
|
||||
// name: 'compressOptions.maxHeight'
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
|
||||
getSchemaTpl('switch', {
|
||||
name: 'showCompressOptions',
|
||||
label: '是否显示压缩选项'
|
||||
}),
|
||||
// getSchemaTpl('switch', {
|
||||
// name: 'showCompressOptions',
|
||||
// label: '显示压缩选项'
|
||||
// }),
|
||||
|
||||
getSchemaTpl('switch', {
|
||||
name: 'crop',
|
||||
@ -325,13 +341,19 @@ export class ImageControlPlugin extends BasePlugin {
|
||||
{
|
||||
type: 'input-number',
|
||||
name: 'limit.width',
|
||||
label: '宽度'
|
||||
label: tipedLabel(
|
||||
'宽度',
|
||||
'校验优先级比最大宽度和最大宽度高'
|
||||
)
|
||||
},
|
||||
|
||||
{
|
||||
type: 'input-number',
|
||||
name: 'limit.height',
|
||||
label: '高度'
|
||||
label: tipedLabel(
|
||||
'高度',
|
||||
'校验优先级比最大高度和最大高度高'
|
||||
)
|
||||
},
|
||||
|
||||
{
|
||||
@ -366,7 +388,7 @@ export class ImageControlPlugin extends BasePlugin {
|
||||
|
||||
{
|
||||
type: 'input-text',
|
||||
name: 'limit.限制最小高度',
|
||||
name: 'limit.aspectRatioLabel',
|
||||
label: tipedLabel(
|
||||
'宽高比描述',
|
||||
'当宽高比没有满足条件时,此描述将作为提示信息显示'
|
||||
|
@ -180,7 +180,6 @@ export class TransferPlugin extends BasePlugin {
|
||||
}),
|
||||
getSchemaTpl('labelRemark'),
|
||||
getSchemaTpl('remark'),
|
||||
getSchemaTpl('placeholder'),
|
||||
getSchemaTpl('description'),
|
||||
getSchemaTpl('switch', {
|
||||
label: '统计数据',
|
||||
@ -290,7 +289,10 @@ export class TransferPlugin extends BasePlugin {
|
||||
options: [
|
||||
{label: '列表形式', value: false},
|
||||
{label: '跟随左侧', value: true}
|
||||
]
|
||||
],
|
||||
onChange: (value: any, origin: any, item: any, form: any) => {
|
||||
form.setValueByName('sortable', !value ? true : undefined);
|
||||
}
|
||||
},
|
||||
getSchemaTpl('switch', {
|
||||
label: tipedLabel(
|
||||
|
@ -389,11 +389,6 @@ export class TreeSelectControlPlugin extends BasePlugin {
|
||||
{
|
||||
title: '高级',
|
||||
body: [
|
||||
getSchemaTpl('valueFormula', {
|
||||
name: 'highlightTxt',
|
||||
label: '高亮节点字符',
|
||||
type: 'input-text'
|
||||
}),
|
||||
{
|
||||
type: 'ae-Switch-More',
|
||||
mode: 'normal',
|
||||
|
@ -103,7 +103,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
|
||||
actionLabel: '打开页面',
|
||||
actionType: 'link',
|
||||
description: '打开指定页面',
|
||||
innerArgs: ['link', 'params'],
|
||||
innerArgs: ['link', 'params', 'pageName', '__pageInputSchema'],
|
||||
descDetail: (info: any) => {
|
||||
return (
|
||||
<div>
|
||||
|
@ -437,6 +437,9 @@ export const getEventLabel = (events: RendererPluginEvent[], name: string) =>
|
||||
export const getEventDesc = (events: RendererPluginEvent[], name: string) =>
|
||||
events.find(item => item.eventName === name)?.description;
|
||||
|
||||
export const getEventStrongDesc = (events: RendererPluginEvent[], name: string) =>
|
||||
events.find(item => item.eventName === name)?.strongDesc;
|
||||
|
||||
// 判断插件动作中是否存在指定动作
|
||||
export const hasActionType = (
|
||||
actionType: string,
|
||||
|
@ -11,6 +11,7 @@ import {
|
||||
findSubActionNode,
|
||||
getActionType,
|
||||
getEventDesc,
|
||||
getEventStrongDesc,
|
||||
getEventLabel,
|
||||
getPropOfAcion,
|
||||
SELECT_PROPS_CONTAINER
|
||||
@ -689,7 +690,7 @@ export class EventControl extends React.Component<
|
||||
'no-bd-btm': !(
|
||||
enventSnapshot[eventKey].actions?.length &&
|
||||
eventPanelActive[eventKey]
|
||||
)
|
||||
) && !getEventStrongDesc(events, eventKey)
|
||||
})}
|
||||
>
|
||||
<TooltipWrapper
|
||||
@ -699,7 +700,7 @@ export class EventControl extends React.Component<
|
||||
tooltip={{
|
||||
children: () => (
|
||||
<div>
|
||||
{getEventDesc(events, eventKey) || eventKey}
|
||||
{getEventDesc(events, eventKey) || getEventStrongDesc(events, eventKey) || eventKey}
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
@ -732,6 +733,18 @@ export class EventControl extends React.Component<
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
getEventStrongDesc(events, eventKey)
|
||||
? amisRender({
|
||||
type: "alert",
|
||||
body: '温馨提示:' + getEventStrongDesc(events, eventKey),
|
||||
level: "info",
|
||||
showCloseButton: true,
|
||||
showIcon: true,
|
||||
className: "event-item-desc"
|
||||
})
|
||||
: null
|
||||
}
|
||||
{enventSnapshot[eventKey].actions.length &&
|
||||
eventPanelActive[eventKey] ? (
|
||||
<ul className="item-content">
|
||||
|
Loading…
Reference in New Issue
Block a user