fix:事件动作组件选择问题

Change-Id: I51852bd7c5c935ec0ed61eb554428d99ac986b2e
This commit is contained in:
hsm-lv 2022-08-05 21:31:20 +08:00
parent a3de043b1f
commit 6e6d5e15b7
2 changed files with 7 additions and 5 deletions

View File

@ -656,7 +656,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
</div>
);
},
supportComponents: [],
supportComponents: 'byComponent',
schema: renderCmptSelect('选择组件', true)
},
{
@ -681,7 +681,7 @@ const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
</div>
);
},
supportComponents: [],
supportComponents: 'byComponent',
schema: [
...renderCmptActionSelect('选择组件', true),
getArgsWrapper({

View File

@ -992,12 +992,14 @@ export const getEventControlConfig = (
isSupport =
action.supportComponents === '*' ||
action.supportComponents === node.type;
// 内置逻辑
if (action.supportComponents === 'byComponent') {
isSupport = hasActionType(actionType, actions);
}
} else if (Array.isArray(action.supportComponents)) {
isSupport = action.supportComponents.includes(node.type);
}
if (['reload', 'setValue'].includes(actionType)) {
isSupport = hasActionType(actionType, actions);
}
if (actionType === 'component' && !actions?.length) {
node.disabled = true;
}