mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 只有input-table才会豁免actions.args.condition
This commit is contained in:
parent
be01d6b3e3
commit
035d287650
@ -285,17 +285,26 @@ export const runAction = async (
|
||||
delete action.args?.options;
|
||||
delete action.args?.messages;
|
||||
}
|
||||
|
||||
const cmptFlag = key.componentId || key.componentName;
|
||||
let targetComponent = cmptFlag
|
||||
? event.context.scoped?.[
|
||||
action.componentId ? 'getComponentById' : 'getComponentByName'
|
||||
](cmptFlag)
|
||||
: renderer;
|
||||
// 动作配置
|
||||
const args = dataMapping(action.args, mergeData, key =>
|
||||
[
|
||||
const args = dataMapping(action.args, mergeData, (key: string) => {
|
||||
const ignoreKey = [
|
||||
'adaptor',
|
||||
'responseAdaptor',
|
||||
'requestAdaptor',
|
||||
'responseData',
|
||||
'condition'
|
||||
].includes(key)
|
||||
);
|
||||
'responseData'
|
||||
];
|
||||
if (targetComponent?.props?.type === 'input-table') {
|
||||
return [...ignoreKey, 'condition'].includes(key);
|
||||
} else {
|
||||
return ignoreKey.includes(key);
|
||||
}
|
||||
});
|
||||
const afterMappingData = dataMapping(action.data, mergeData);
|
||||
|
||||
// 动作数据
|
||||
@ -325,6 +334,7 @@ export const runAction = async (
|
||||
{
|
||||
...action,
|
||||
args,
|
||||
component: targetComponent,
|
||||
data: action.actionType === 'reload' ? actionData : data, // 如果是刷新动作,则只传action.data
|
||||
...key
|
||||
},
|
||||
|
@ -51,11 +51,7 @@ export class CmptAction implements RendererAction {
|
||||
}
|
||||
|
||||
// 如果key没指定,则默认是当前组件
|
||||
let component = key
|
||||
? event.context.scoped?.[
|
||||
action.componentId ? 'getComponentById' : 'getComponentByName'
|
||||
](key)
|
||||
: renderer;
|
||||
let component = action.component;
|
||||
|
||||
// 如果key指定来,但是没找到组件,则报错
|
||||
if (key && !component) {
|
||||
|
Loading…
Reference in New Issue
Block a user