mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 20:09:08 +08:00
amis-saas-7740 完善 schemaBuilder 逻辑
Change-Id: Ifce2b1b1d459eef82b35b5424c2c906d80c4f8c8
This commit is contained in:
parent
b717311254
commit
7df504f084
@ -182,14 +182,18 @@
|
||||
border-radius: 4px;
|
||||
transform: scale(1);
|
||||
transform-origin: center top;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
> *:first-child {
|
||||
// min-width: 100%;
|
||||
position: relative;
|
||||
min-height: calc(100vh - 131px); // 确保能撑开画布区
|
||||
// min-height: calc(100vh - 131px); // 确保能撑开画布区
|
||||
flex: 1;
|
||||
height: auto;
|
||||
background: white;
|
||||
box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.2);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,11 @@ export class ContainerWrapper extends React.Component<ContainerWrapperProps> {
|
||||
const {render, $$editor, $$node} = this.props;
|
||||
|
||||
const child = render(region, node, props);
|
||||
|
||||
if ($$node?.memberImmutable(region)) {
|
||||
return child;
|
||||
}
|
||||
|
||||
const config = find(
|
||||
$$editor.regions,
|
||||
item => item.key === region && !item.matchRegion && !item.renderMethod
|
||||
|
@ -516,6 +516,18 @@ function insertRegion(
|
||||
info: RendererInfo,
|
||||
manager: EditorManager
|
||||
): JSX.Element {
|
||||
// 如果没有开启这些区域的内容修改功能,则跳过插入逻辑
|
||||
if (info.memberImmutable === true) {
|
||||
return dom;
|
||||
} else if (
|
||||
Array.isArray(info.memberImmutable) &&
|
||||
regions.every(reg =>
|
||||
(info.memberImmutable as Array<string>).includes(reg.key)
|
||||
)
|
||||
) {
|
||||
return dom;
|
||||
}
|
||||
|
||||
const rootRegion = find(regions, r => !r.matchRegion);
|
||||
|
||||
if (rootRegion) {
|
||||
|
@ -1250,7 +1250,7 @@ export class EditorManager {
|
||||
...commonContext,
|
||||
sourceId: node.id,
|
||||
direction: 'down',
|
||||
beforeId: node.nextSibling?.id,
|
||||
beforeId: node.nextSibling?.nextSibling?.id,
|
||||
region: regionNode.region
|
||||
};
|
||||
|
||||
|
@ -659,7 +659,7 @@ export interface PluginEventListener {
|
||||
* 移动节点的时候触发,包括上移,下移
|
||||
*/
|
||||
beforeMove?: (event: PluginEvent<MoveEventContext>) => false | void;
|
||||
aftterMove?: (event: PluginEvent<MoveEventContext>) => void;
|
||||
afterMove?: (event: PluginEvent<MoveEventContext>) => void;
|
||||
|
||||
/**
|
||||
* 删除的时候触发
|
||||
|
Loading…
Reference in New Issue
Block a user