amis-saas-7740 完善 schemaBuilder 逻辑

Change-Id: Ifce2b1b1d459eef82b35b5424c2c906d80c4f8c8
This commit is contained in:
2betop 2022-12-27 17:03:04 +08:00
parent b717311254
commit 7df504f084
5 changed files with 24 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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

View File

@ -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) {

View File

@ -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
};

View File

@ -659,7 +659,7 @@ export interface PluginEventListener {
*
*/
beforeMove?: (event: PluginEvent<MoveEventContext>) => false | void;
aftterMove?: (event: PluginEvent<MoveEventContext>) => void;
afterMove?: (event: PluginEvent<MoveEventContext>) => void;
/**
*