mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
Merge branch 'fix/lihao-bugs' into 'release/0.9.6'
Fix/lihao bugs See merge request !939843
This commit is contained in:
commit
3fc1ff8be6
@ -208,13 +208,13 @@ export class ComponentMeta {
|
||||
return result as any;
|
||||
}
|
||||
|
||||
isRootComponent() {
|
||||
return this.componentName === 'Page' || this.componentName === 'Block' || this.componentName === 'Component';
|
||||
isRootComponent(includeBlock: boolean = true) {
|
||||
return this.componentName === 'Page' || this.componentName === 'Component' || (includeBlock && this.componentName === 'Block');
|
||||
}
|
||||
|
||||
@computed get availableActions() {
|
||||
let { disableBehaviors, actions } = this._transformedMetadata?.configure.component || {};
|
||||
const disabled = ensureAList(disableBehaviors) || (this.isRootComponent() ? ['copy', 'remove'] : null);
|
||||
const disabled = ensureAList(disableBehaviors) || (this.isRootComponent(false) ? ['copy', 'remove'] : null);
|
||||
actions = builtinComponentActions.concat(this.designer.getGlobalComponentActions() || [], actions || []);
|
||||
|
||||
if (disabled) {
|
||||
|
||||
@ -105,8 +105,6 @@ export class DocumentModel {
|
||||
|
||||
if (!schema) {
|
||||
this._blank = true;
|
||||
} else {
|
||||
this.id = project.getSchema()?.id || this.id;
|
||||
}
|
||||
|
||||
this.rootNode = this.createNode<RootNode>(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { designer } from './editor';
|
||||
import { RootSchema } from '@ali/lowcode-types';
|
||||
import { DocumentModel } from '@ali/lowcode-designer';
|
||||
import { designer } from './editor';
|
||||
import NodeCacheVisitor from './rootNodeVisitor';
|
||||
|
||||
const { project } = designer;
|
||||
@ -86,7 +86,12 @@ const pages = Object.assign(project, {
|
||||
page.active();
|
||||
},
|
||||
getCurrentPage() {
|
||||
return project.currentDocument;
|
||||
if (!project.currentDocument) {
|
||||
return null;
|
||||
}
|
||||
const currentPage = { ...project.currentDocument, id: project.getSchema().id };
|
||||
Object.setPrototypeOf(currentPage, Object.getPrototypeOf(project.currentDocument || {}));
|
||||
return currentPage;
|
||||
},
|
||||
onPagesChange() {
|
||||
// noop
|
||||
@ -101,7 +106,7 @@ const pages = Object.assign(project, {
|
||||
|
||||
Object.defineProperty(pages, 'currentPage', {
|
||||
get() {
|
||||
return project.currentDocument;
|
||||
return pages.getCurrentPage();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user