mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-24 10:38:15 +00:00
fix: 多tab panel切换异常问题
This commit is contained in:
parent
614159d7b2
commit
ed5b10cbf1
@ -172,8 +172,8 @@ export class Skeleton {
|
|||||||
const isInFloatAreaPreferenceExists = this.editor?.getPreference()?.contains(panelNameKey, 'skeleton');
|
const isInFloatAreaPreferenceExists = this.editor?.getPreference()?.contains(panelNameKey, 'skeleton');
|
||||||
if (isInFloatAreaPreferenceExists) {
|
if (isInFloatAreaPreferenceExists) {
|
||||||
const isInFloatAreaFromPreference = this.editor?.getPreference()?.get(panelNameKey, 'skeleton');
|
const isInFloatAreaFromPreference = this.editor?.getPreference()?.get(panelNameKey, 'skeleton');
|
||||||
const currentIsInFloatArea = panel?.isInFloatArea();
|
const isCurrentInFloatArea = panel?.isChildOfFloatArea();
|
||||||
if (isInFloatAreaFromPreference !== currentIsInFloatArea) {
|
if (isInFloatAreaFromPreference !== isCurrentInFloatArea) {
|
||||||
this.toggleFloatStatus(panel);
|
this.toggleFloatStatus(panel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -154,25 +154,37 @@ export default class Panel implements IWidget {
|
|||||||
getContent() {
|
getContent() {
|
||||||
return this.content;
|
return this.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check is current panel is in float area or not
|
* check is current panel is in float area or not
|
||||||
*
|
*
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
* @memberof Panel
|
* @memberof Panel
|
||||||
*/
|
*/
|
||||||
isInFloatArea(): boolean {
|
isChildOfFloatArea(): boolean {
|
||||||
return this.parent?.name === 'leftFloatArea';
|
return this.parent?.name === 'leftFloatArea';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check is current panel is in fixed area or not
|
||||||
|
*
|
||||||
|
* @returns {boolean}
|
||||||
|
* @memberof Panel
|
||||||
|
*/
|
||||||
|
isChildOfFixedArea(): boolean {
|
||||||
|
return this.parent?.name === 'leftFixedArea';
|
||||||
|
}
|
||||||
|
|
||||||
setActive(flag: boolean) {
|
setActive(flag: boolean) {
|
||||||
if (flag === this._actived) {
|
if (flag === this._actived) {
|
||||||
// TODO: 如果移动到另外一个 container,会有问题
|
// TODO: 如果移动到另外一个 container,会有问题
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flag) {
|
if (flag) {
|
||||||
if (this.isInFloatArea()) {
|
// 对于 Area 的直接 Child,要专门处理 Float & Fixed 分组切换, 其他情况不需要
|
||||||
|
if (this.isChildOfFloatArea()) {
|
||||||
this.skeleton.leftFixedArea.container.unactiveAll();
|
this.skeleton.leftFixedArea.container.unactiveAll();
|
||||||
} else {
|
} else if (this.isChildOfFixedArea()) {
|
||||||
this.skeleton.leftFloatArea.container.unactiveAll();
|
this.skeleton.leftFloatArea.container.unactiveAll();
|
||||||
}
|
}
|
||||||
this._actived = true;
|
this._actived = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user