mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
refactor: 修改 actived typo
This commit is contained in:
parent
88f5677682
commit
a10641daff
@ -146,8 +146,7 @@ export default class DragResizeEngine {
|
||||
private getMasterSensors(): ISimulatorHost[] {
|
||||
return this.designer.project.documents
|
||||
.map(doc => {
|
||||
// TODO: not use actived,
|
||||
if (doc.actived && doc.simulator?.sensorAvailable) {
|
||||
if (doc.active && doc.simulator?.sensorAvailable) {
|
||||
return doc.simulator;
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -1053,7 +1053,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
scrollToNode(node: Node, detail?: any /* , tryTimes = 0 */) {
|
||||
this.tryScrollAgain = null;
|
||||
if (this.sensing) {
|
||||
// actived sensor
|
||||
// active sensor
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -308,8 +308,8 @@ export class Designer {
|
||||
getSuitableInsertion(
|
||||
insertNode?: Node | NodeSchema | NodeSchema[],
|
||||
): { target: ParentalNode; index?: number } | null {
|
||||
const activedDoc = this.project.currentDocument;
|
||||
if (!activedDoc) {
|
||||
const activeDoc = this.project.currentDocument;
|
||||
if (!activeDoc) {
|
||||
return null;
|
||||
}
|
||||
if (
|
||||
@ -318,11 +318,11 @@ export class Designer {
|
||||
this.getComponentMeta(insertNode[0].componentName).isModal
|
||||
) {
|
||||
return {
|
||||
target: activedDoc.rootNode as ParentalNode,
|
||||
target: activeDoc.rootNode as ParentalNode,
|
||||
};
|
||||
}
|
||||
const focusNode = activedDoc.focusNode!;
|
||||
const nodes = activedDoc.selection.getNodes();
|
||||
const focusNode = activeDoc.focusNode!;
|
||||
const nodes = activeDoc.selection.getNodes();
|
||||
const refNode = nodes.find(item => focusNode.contains(item));
|
||||
let target;
|
||||
let index: number | undefined;
|
||||
|
||||
@ -195,7 +195,7 @@ export class Dragon {
|
||||
private sensors: ISensor[] = [];
|
||||
|
||||
/**
|
||||
* current actived sensor, 可用于感应区高亮
|
||||
* current active sensor, 可用于感应区高亮
|
||||
*/
|
||||
@obx.ref private _activeSensor: ISensor | undefined;
|
||||
|
||||
@ -619,8 +619,7 @@ export class Dragon {
|
||||
new Set(
|
||||
this.designer.project.documents
|
||||
.map((doc) => {
|
||||
// TODO: not use actived,
|
||||
if (doc.actived && doc.simulator?.sensorAvailable) {
|
||||
if (doc.active && doc.simulator?.sensorAvailable) {
|
||||
return doc.simulator;
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -446,10 +446,17 @@ export class DocumentModel {
|
||||
/**
|
||||
* 与 suspensed 相反,是否为激活状态,这个函数可能用的更多一点
|
||||
*/
|
||||
get actived(): boolean {
|
||||
get active(): boolean {
|
||||
return !this._suspensed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 兼容
|
||||
*/
|
||||
get actived(): boolean {
|
||||
return this.active;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否打开
|
||||
*/
|
||||
@ -476,7 +483,7 @@ export class DocumentModel {
|
||||
this.setSuspense(true);
|
||||
}
|
||||
|
||||
active() {
|
||||
activate() {
|
||||
this.setSuspense(false);
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ export class Project {
|
||||
}
|
||||
|
||||
@computed get currentDocument() {
|
||||
return this.documents.find((doc) => doc.actived);
|
||||
return this.documents.find((doc) => doc.active);
|
||||
}
|
||||
|
||||
@obx private _config: any = {};
|
||||
@ -67,7 +67,7 @@ export class Project {
|
||||
*/
|
||||
setSchema(schema?: ProjectSchema) {
|
||||
// FIXME: 这里的行为和 getSchema 并不对等,感觉不太对
|
||||
const doc = this.documents.find((doc) => doc.actived);
|
||||
const doc = this.documents.find((doc) => doc.active);
|
||||
doc && doc.import(schema?.componentsTree[0]);
|
||||
}
|
||||
|
||||
@ -231,13 +231,13 @@ export class Project {
|
||||
return doc.open();
|
||||
}
|
||||
|
||||
checkExclusive(actived: DocumentModel) {
|
||||
checkExclusive(activeDoc: DocumentModel) {
|
||||
this.documents.forEach((doc) => {
|
||||
if (doc !== actived) {
|
||||
if (doc !== activeDoc) {
|
||||
doc.suspense();
|
||||
}
|
||||
});
|
||||
this.emitter.emit('current-document.change', actived);
|
||||
this.emitter.emit('current-document.change', activeDoc);
|
||||
}
|
||||
|
||||
closeOthers(opened: DocumentModel) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user