mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 20:18:03 +08:00
amis-saas-4886 支持强提示
Change-Id: I614538c8b868c8ccda83d9761f00879132b9f87c
This commit is contained in:
parent
ca30fbfadb
commit
ca999d1678
@ -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: '提交成功',
|
||||
|
@ -432,6 +432,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,
|
||||
|
@ -16,6 +16,7 @@ import {
|
||||
findSubActionNode,
|
||||
getActionType,
|
||||
getEventDesc,
|
||||
getEventStrongDesc,
|
||||
getEventLabel,
|
||||
getPropOfAcion,
|
||||
SELECT_PROPS_CONTAINER
|
||||
@ -627,6 +628,7 @@ export class EventControl extends React.Component<
|
||||
const enventSnapshot = cloneDeep(onEvent);
|
||||
const {showOldEntry} = this.props;
|
||||
const eventKeys = Object.keys(enventSnapshot);
|
||||
console.log(this.props);
|
||||
return (
|
||||
<div className="ae-event-control">
|
||||
<header
|
||||
@ -671,7 +673,7 @@ export class EventControl extends React.Component<
|
||||
'no-bd-btm': !(
|
||||
enventSnapshot[eventKey].actions?.length &&
|
||||
eventPanelActive[eventKey]
|
||||
)
|
||||
) && !getEventStrongDesc(events, eventKey)
|
||||
})}
|
||||
>
|
||||
<TooltipWrapper
|
||||
@ -681,7 +683,7 @@ export class EventControl extends React.Component<
|
||||
tooltip={{
|
||||
children: () => (
|
||||
<div>
|
||||
{getEventDesc(events, eventKey) || eventKey}
|
||||
{getEventDesc(events, eventKey) || getEventStrongDesc(events, eventKey) || eventKey}
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
@ -714,6 +716,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