mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +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?.options;
|
||||||
delete action.args?.messages;
|
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',
|
'adaptor',
|
||||||
'responseAdaptor',
|
'responseAdaptor',
|
||||||
'requestAdaptor',
|
'requestAdaptor',
|
||||||
'responseData',
|
'responseData'
|
||||||
'condition'
|
];
|
||||||
].includes(key)
|
if (targetComponent?.props?.type === 'input-table') {
|
||||||
);
|
return [...ignoreKey, 'condition'].includes(key);
|
||||||
|
} else {
|
||||||
|
return ignoreKey.includes(key);
|
||||||
|
}
|
||||||
|
});
|
||||||
const afterMappingData = dataMapping(action.data, mergeData);
|
const afterMappingData = dataMapping(action.data, mergeData);
|
||||||
|
|
||||||
// 动作数据
|
// 动作数据
|
||||||
@ -325,6 +334,7 @@ export const runAction = async (
|
|||||||
{
|
{
|
||||||
...action,
|
...action,
|
||||||
args,
|
args,
|
||||||
|
component: targetComponent,
|
||||||
data: action.actionType === 'reload' ? actionData : data, // 如果是刷新动作,则只传action.data
|
data: action.actionType === 'reload' ? actionData : data, // 如果是刷新动作,则只传action.data
|
||||||
...key
|
...key
|
||||||
},
|
},
|
||||||
|
@ -51,11 +51,7 @@ export class CmptAction implements RendererAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 如果key没指定,则默认是当前组件
|
// 如果key没指定,则默认是当前组件
|
||||||
let component = key
|
let component = action.component;
|
||||||
? event.context.scoped?.[
|
|
||||||
action.componentId ? 'getComponentById' : 'getComponentByName'
|
|
||||||
](key)
|
|
||||||
: renderer;
|
|
||||||
|
|
||||||
// 如果key指定来,但是没找到组件,则报错
|
// 如果key指定来,但是没找到组件,则报错
|
||||||
if (key && !component) {
|
if (key && !component) {
|
||||||
|
Loading…
Reference in New Issue
Block a user