mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +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');
|
||||
if (isInFloatAreaPreferenceExists) {
|
||||
const isInFloatAreaFromPreference = this.editor?.getPreference()?.get(panelNameKey, 'skeleton');
|
||||
const currentIsInFloatArea = panel?.isInFloatArea();
|
||||
if (isInFloatAreaFromPreference !== currentIsInFloatArea) {
|
||||
const isCurrentInFloatArea = panel?.isChildOfFloatArea();
|
||||
if (isInFloatAreaFromPreference !== isCurrentInFloatArea) {
|
||||
this.toggleFloatStatus(panel);
|
||||
}
|
||||
}
|
||||
|
||||
@ -154,25 +154,37 @@ export default class Panel implements IWidget {
|
||||
getContent() {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
/**
|
||||
* check is current panel is in float area or not
|
||||
*
|
||||
* @returns {boolean}
|
||||
* @memberof Panel
|
||||
*/
|
||||
isInFloatArea(): boolean {
|
||||
isChildOfFloatArea(): boolean {
|
||||
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) {
|
||||
if (flag === this._actived) {
|
||||
// TODO: 如果移动到另外一个 container,会有问题
|
||||
return;
|
||||
}
|
||||
if (flag) {
|
||||
if (this.isInFloatArea()) {
|
||||
// 对于 Area 的直接 Child,要专门处理 Float & Fixed 分组切换, 其他情况不需要
|
||||
if (this.isChildOfFloatArea()) {
|
||||
this.skeleton.leftFixedArea.container.unactiveAll();
|
||||
} else {
|
||||
} else if (this.isChildOfFixedArea()) {
|
||||
this.skeleton.leftFloatArea.container.unactiveAll();
|
||||
}
|
||||
this._actived = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user