mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 20:39:07 +08:00
chore: crud & servie 独立scoped, 弹框委托子节点处理调整
This commit is contained in:
parent
56c00cb308
commit
c9f1caa03e
@ -2118,7 +2118,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
|
||||
@Renderer({
|
||||
type: 'crud',
|
||||
storeType: CRUDStore.name
|
||||
storeType: CRUDStore.name,
|
||||
isolateScope: true
|
||||
})
|
||||
export class CRUDRenderer extends CRUD {
|
||||
static contextType = ScopedContext;
|
||||
|
@ -652,19 +652,16 @@ export class DialogRenderer extends Dialog {
|
||||
components.push(...page.context.getComponents());
|
||||
}
|
||||
|
||||
const form = findLast(
|
||||
components,
|
||||
component => component.props.type === 'form'
|
||||
);
|
||||
for (let i = components.length - 1; i >= 0; i--) {
|
||||
const component = components[i];
|
||||
|
||||
if (form) {
|
||||
targets.push(form);
|
||||
} else {
|
||||
const crud = findLast(
|
||||
components,
|
||||
component => component.props.type === 'crud'
|
||||
);
|
||||
crud && targets.push(crud);
|
||||
if (component.props.type === 'form') {
|
||||
targets.push(component);
|
||||
break;
|
||||
} else if (component.props.type === 'crud') {
|
||||
targets.push(component);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -704,19 +704,16 @@ export class DrawerRenderer extends Drawer {
|
||||
components.push(...page.context.getComponents());
|
||||
}
|
||||
|
||||
const form = findLast(
|
||||
components,
|
||||
component => component.props.type === 'form'
|
||||
);
|
||||
for (let i = components.length - 1; i >= 0; i--) {
|
||||
const component = components[i];
|
||||
|
||||
if (form) {
|
||||
targets.push(form);
|
||||
} else {
|
||||
const crud = findLast(
|
||||
components,
|
||||
component => component.props.type === 'crud'
|
||||
);
|
||||
crud && targets.push(crud);
|
||||
if (component.props.type === 'form') {
|
||||
targets.push(component);
|
||||
break;
|
||||
} else if (component.props.type === 'crud') {
|
||||
targets.push(component);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -432,7 +432,8 @@ export default class Service extends React.Component<ServiceProps> {
|
||||
|
||||
@Renderer({
|
||||
type: 'service',
|
||||
storeType: ServiceStore.name
|
||||
storeType: ServiceStore.name,
|
||||
isolateScope: true
|
||||
})
|
||||
export class ServiceRenderer extends Service {
|
||||
static contextType = ScopedContext;
|
||||
|
Loading…
Reference in New Issue
Block a user