Merge pull request #7163 from hsm-lv/fix-action

fix:表单视图中动作配置面板报错问题
This commit is contained in:
hsm-lv 2023-06-14 14:42:13 +08:00 committed by GitHub
commit c86ecb4030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,15 +167,11 @@ export class EventControl extends React.Component<
prevProps: EventControlProps,
prevState: EventControlState
) {
const {value, onChange} = this.props;
const {value} = this.props;
if (value !== prevProps.value) {
this.setState({onEvent: value});
}
if (prevState.onEvent !== this.state.onEvent) {
onChange && onChange(this.state.onEvent);
}
}
generateEmptyDefault(events: RendererPluginEvent[]) {
@ -822,7 +818,7 @@ export class EventControl extends React.Component<
'event-item-header': true,
'no-bd-btm':
!(
eventSnapshot[eventKey].actions?.length &&
eventSnapshot[eventKey]?.actions?.length &&
eventPanelActive[eventKey]
) && !getEventStrongDesc(events, eventKey)
})}
@ -890,10 +886,10 @@ export class EventControl extends React.Component<
className: 'event-item-desc'
})
: null}
{eventSnapshot[eventKey].actions.length &&
{eventSnapshot[eventKey]?.actions?.length &&
eventPanelActive[eventKey] ? (
<ul className="item-content">
{eventSnapshot[eventKey].actions.map(
{eventSnapshot[eventKey]?.actions?.map(
(action, actionIndex) => {
return (
<li